From 1c9ba2cdd48d9c55a17816a9ac9cd6b080b91eaa Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Mon, 3 Feb 2020 10:24:27 -0800 Subject: [PATCH] chore: remove more libs for repo split (#10313) * docs: link to split repos * remove kokoro configs * chore: remove split repos --- .kokoro/continuous/automl.cfg | 7 - .kokoro/continuous/cloudbuild.cfg | 7 - .kokoro/continuous/container.cfg | 7 - .kokoro/continuous/containeranalysis.cfg | 7 - .kokoro/continuous/datacatalog.cfg | 7 - .kokoro/continuous/datalabeling.cfg | 7 - .kokoro/continuous/dlp.cfg | 7 - .kokoro/continuous/dns.cfg | 7 - .kokoro/continuous/documentai.cfg | 7 - .kokoro/continuous/texttospeech.cfg | 7 - .kokoro/continuous/translate.cfg | 7 - .kokoro/continuous/webrisk.cfg | 7 - .kokoro/continuous/websecurityscanner.cfg | 7 - .kokoro/docs/automl.cfg | 7 - .kokoro/docs/cloudbuild.cfg | 7 - .kokoro/docs/container.cfg | 7 - .kokoro/docs/containeranalysis.cfg | 7 - .kokoro/docs/datacatalog.cfg | 7 - .kokoro/docs/datalabeling.cfg | 7 - .kokoro/docs/dlp.cfg | 7 - .kokoro/docs/dns.cfg | 7 - .kokoro/docs/documentai.cfg | 7 - .kokoro/docs/texttospeech.cfg | 7 - .kokoro/docs/translate.cfg | 7 - .kokoro/docs/webrisk.cfg | 7 - .kokoro/docs/websecurityscanner.cfg | 7 - .kokoro/presubmit/automl.cfg | 7 - .kokoro/presubmit/cloudbuild.cfg | 7 - .kokoro/presubmit/container.cfg | 7 - .kokoro/presubmit/containeranalysis.cfg | 7 - .kokoro/presubmit/datacatalog.cfg | 7 - .kokoro/presubmit/datalabeling.cfg | 7 - .kokoro/presubmit/dlp.cfg | 7 - .kokoro/presubmit/dns.cfg | 7 - .kokoro/presubmit/documentai.cfg | 7 - .kokoro/presubmit/texttospeech.cfg | 7 - .kokoro/presubmit/translate.cfg | 7 - .kokoro/presubmit/webrisk.cfg | 7 - .kokoro/presubmit/websecurityscanner.cfg | 7 - .kokoro/release/automl.cfg | 7 - .kokoro/release/cloudbuild.cfg | 7 - .kokoro/release/container.cfg | 7 - .kokoro/release/containeranalysis.cfg | 7 - .kokoro/release/datacatalog.cfg | 7 - .kokoro/release/datalabeling.cfg | 7 - .kokoro/release/dlp.cfg | 7 - .kokoro/release/dns.cfg | 7 - .kokoro/release/documentai.cfg | 7 - .kokoro/release/texttospeech.cfg | 7 - .kokoro/release/translate.cfg | 7 - .kokoro/release/webrisk.cfg | 7 - .kokoro/release/websecurityscanner.cfg | 7 - README.rst | 28 +- automl/.coveragerc | 19 - automl/.flake8 | 14 - automl/.repo-metadata.json | 13 - automl/CHANGELOG.md | 208 - automl/LICENSE | 201 - automl/MANIFEST.in | 5 - automl/README.rst | 131 - automl/docs/README.rst | 1 - automl/docs/_static/custom.css | 4 - automl/docs/_templates/layout.html | 50 - automl/docs/changelog.md | 1 - automl/docs/conf.py | 363 - automl/docs/gapic/v1/api.rst | 6 - automl/docs/gapic/v1/types.rst | 5 - automl/docs/gapic/v1beta1/api.rst | 6 - automl/docs/gapic/v1beta1/tables.rst | 5 - automl/docs/gapic/v1beta1/types.rst | 5 - automl/docs/index.rst | 37 - automl/google/__init__.py | 22 - automl/google/cloud/__init__.py | 22 - automl/google/cloud/automl.py | 26 - automl/google/cloud/automl_v1/__init__.py | 47 - .../google/cloud/automl_v1/gapic/__init__.py | 0 .../cloud/automl_v1/gapic/auto_ml_client.py | 1898 -- .../automl_v1/gapic/auto_ml_client_config.py | 113 - automl/google/cloud/automl_v1/gapic/enums.py | 109 - .../gapic/prediction_service_client.py | 463 - .../gapic/prediction_service_client_config.py | 33 - .../automl_v1/gapic/transports/__init__.py | 0 .../transports/auto_ml_grpc_transport.py | 376 - .../prediction_service_grpc_transport.py | 168 - .../google/cloud/automl_v1/proto/__init__.py | 0 .../automl_v1/proto/annotation_payload.proto | 68 - .../automl_v1/proto/annotation_payload_pb2.py | 315 - .../proto/annotation_payload_pb2_grpc.py | 2 - .../automl_v1/proto/annotation_spec.proto | 46 - .../automl_v1/proto/annotation_spec_pb2.py | 142 - .../proto/annotation_spec_pb2_grpc.py | 2 - .../automl_v1/proto/classification.proto | 172 - .../automl_v1/proto/classification_pb2.py | 826 - .../proto/classification_pb2_grpc.py | 2 - .../cloud/automl_v1/proto/data_items.proto | 200 - .../cloud/automl_v1/proto/data_items_pb2.py | 864 - .../automl_v1/proto/data_items_pb2_grpc.py | 2 - .../cloud/automl_v1/proto/dataset.proto | 92 - .../cloud/automl_v1/proto/dataset_pb2.py | 518 - .../cloud/automl_v1/proto/dataset_pb2_grpc.py | 2 - .../cloud/automl_v1/proto/detection.proto | 88 - .../cloud/automl_v1/proto/detection_pb2.py | 472 - .../automl_v1/proto/detection_pb2_grpc.py | 2 - .../cloud/automl_v1/proto/geometry.proto | 48 - .../cloud/automl_v1/proto/geometry_pb2.py | 175 - .../automl_v1/proto/geometry_pb2_grpc.py | 2 - .../google/cloud/automl_v1/proto/image.proto | 194 - .../google/cloud/automl_v1/proto/image_pb2.py | 715 - .../cloud/automl_v1/proto/image_pb2_grpc.py | 2 - automl/google/cloud/automl_v1/proto/io.proto | 885 - automl/google/cloud/automl_v1/proto/io_pb2.py | 1610 -- .../cloud/automl_v1/proto/io_pb2_grpc.py | 2 - .../google/cloud/automl_v1/proto/model.proto | 113 - .../automl_v1/proto/model_evaluation.proto | 88 - .../automl_v1/proto/model_evaluation_pb2.py | 387 - .../proto/model_evaluation_pb2_grpc.py | 2 - .../google/cloud/automl_v1/proto/model_pb2.py | 576 - .../cloud/automl_v1/proto/model_pb2_grpc.py | 2 - .../cloud/automl_v1/proto/operations.proto | 168 - .../cloud/automl_v1/proto/operations_pb2.py | 1122 - .../automl_v1/proto/operations_pb2_grpc.py | 2 - .../automl_v1/proto/prediction_service.proto | 207 - .../automl_v1/proto/prediction_service_pb2.py | 843 - .../proto/prediction_service_pb2_grpc.py | 100 - .../cloud/automl_v1/proto/service.proto | 507 - .../cloud/automl_v1/proto/service_pb2.py | 2084 -- .../cloud/automl_v1/proto/service_pb2_grpc.py | 416 - .../google/cloud/automl_v1/proto/text.proto | 60 - .../automl_v1/proto/text_extraction.proto | 70 - .../automl_v1/proto/text_extraction_pb2.py | 351 - .../proto/text_extraction_pb2_grpc.py | 2 - .../google/cloud/automl_v1/proto/text_pb2.py | 352 - .../cloud/automl_v1/proto/text_pb2_grpc.py | 2 - .../cloud/automl_v1/proto/text_segment.proto | 43 - .../cloud/automl_v1/proto/text_segment_pb2.py | 142 - .../automl_v1/proto/text_segment_pb2_grpc.py | 2 - .../automl_v1/proto/text_sentiment.proto | 79 - .../automl_v1/proto/text_sentiment_pb2.py | 331 - .../proto/text_sentiment_pb2_grpc.py | 2 - .../cloud/automl_v1/proto/translation.proto | 71 - .../cloud/automl_v1/proto/translation_pb2.py | 374 - .../automl_v1/proto/translation_pb2_grpc.py | 2 - automl/google/cloud/automl_v1/types.py | 92 - .../google/cloud/automl_v1beta1/__init__.py | 64 - .../cloud/automl_v1beta1/gapic/__init__.py | 0 .../automl_v1beta1/gapic/auto_ml_client.py | 2464 --- .../gapic/auto_ml_client_config.py | 143 - .../cloud/automl_v1beta1/gapic/enums.py | 158 - .../gapic/prediction_service_client.py | 517 - .../gapic/prediction_service_client_config.py | 33 - .../gapic/transports/__init__.py | 0 .../transports/auto_ml_grpc_transport.py | 474 - .../prediction_service_grpc_transport.py | 175 - .../cloud/automl_v1beta1/proto/__init__.py | 0 .../proto/annotation_payload.proto | 78 - .../proto/annotation_payload_pb2.py | 413 - .../proto/annotation_payload_pb2_grpc.py | 2 - .../proto/annotation_spec.proto | 45 - .../proto/annotation_spec_pb2.py | 142 - .../proto/annotation_spec_pb2_grpc.py | 2 - .../automl_v1beta1/proto/classification.proto | 222 - .../proto/classification_pb2.py | 993 - .../proto/classification_pb2_grpc.py | 2 - .../automl_v1beta1/proto/column_spec.proto | 73 - .../automl_v1beta1/proto/column_spec_pb2.py | 314 - .../proto/column_spec_pb2_grpc.py | 2 - .../automl_v1beta1/proto/data_items.proto | 231 - .../automl_v1beta1/proto/data_items_pb2.py | 1010 - .../proto/data_items_pb2_grpc.py | 2 - .../automl_v1beta1/proto/data_stats.proto | 167 - .../automl_v1beta1/proto/data_stats_pb2.py | 1330 -- .../proto/data_stats_pb2_grpc.py | 2 - .../automl_v1beta1/proto/data_types.proto | 106 - .../automl_v1beta1/proto/data_types_pb2.py | 408 - .../proto/data_types_pb2_grpc.py | 2 - .../cloud/automl_v1beta1/proto/dataset.proto | 91 - .../cloud/automl_v1beta1/proto/dataset_pb2.py | 521 - .../automl_v1beta1/proto/dataset_pb2_grpc.py | 2 - .../automl_v1beta1/proto/detection.proto | 136 - .../automl_v1beta1/proto/detection_pb2.py | 747 - .../proto/detection_pb2_grpc.py | 2 - .../cloud/automl_v1beta1/proto/geometry.proto | 47 - .../automl_v1beta1/proto/geometry_pb2.py | 175 - .../automl_v1beta1/proto/geometry_pb2_grpc.py | 2 - .../cloud/automl_v1beta1/proto/image.proto | 180 - .../cloud/automl_v1beta1/proto/image_pb2.py | 701 - .../automl_v1beta1/proto/image_pb2_grpc.py | 2 - .../cloud/automl_v1beta1/proto/io.proto | 1133 - .../cloud/automl_v1beta1/proto/io_pb2.py | 1921 -- .../cloud/automl_v1beta1/proto/io_pb2_grpc.py | 2 - .../cloud/automl_v1beta1/proto/model.proto | 103 - .../proto/model_evaluation.proto | 111 - .../proto/model_evaluation_pb2.py | 469 - .../proto/model_evaluation_pb2_grpc.py | 2 - .../cloud/automl_v1beta1/proto/model_pb2.py | 555 - .../automl_v1beta1/proto/model_pb2_grpc.py | 2 - .../automl_v1beta1/proto/operations.proto | 178 - .../automl_v1beta1/proto/operations_pb2.py | 1283 -- .../proto/operations_pb2_grpc.py | 2 - .../proto/prediction_service.proto | 255 - .../proto/prediction_service_pb2.py | 880 - .../proto/prediction_service_pb2_grpc.py | 106 - .../cloud/automl_v1beta1/proto/ranges.proto | 36 - .../cloud/automl_v1beta1/proto/ranges_pb2.py | 116 - .../automl_v1beta1/proto/ranges_pb2_grpc.py | 2 - .../automl_v1beta1/proto/regression.proto | 45 - .../automl_v1beta1/proto/regression_pb2.py | 179 - .../proto/regression_pb2_grpc.py | 2 - .../cloud/automl_v1beta1/proto/service.proto | 632 - .../cloud/automl_v1beta1/proto/service_pb2.py | 2973 --- .../automl_v1beta1/proto/service_pb2_grpc.py | 545 - .../automl_v1beta1/proto/table_spec.proto | 73 - .../automl_v1beta1/proto/table_spec_pb2.py | 244 - .../proto/table_spec_pb2_grpc.py | 2 - .../cloud/automl_v1beta1/proto/tables.proto | 283 - .../cloud/automl_v1beta1/proto/tables_pb2.py | 932 - .../automl_v1beta1/proto/tables_pb2_grpc.py | 2 - .../cloud/automl_v1beta1/proto/temporal.proto | 38 - .../automl_v1beta1/proto/temporal_pb2.py | 129 - .../automl_v1beta1/proto/temporal_pb2_grpc.py | 2 - .../cloud/automl_v1beta1/proto/text.proto | 59 - .../proto/text_extraction.proto | 69 - .../proto/text_extraction_pb2.py | 351 - .../proto/text_extraction_pb2_grpc.py | 2 - .../cloud/automl_v1beta1/proto/text_pb2.py | 352 - .../automl_v1beta1/proto/text_pb2_grpc.py | 2 - .../automl_v1beta1/proto/text_segment.proto | 42 - .../automl_v1beta1/proto/text_segment_pb2.py | 142 - .../proto/text_segment_pb2_grpc.py | 2 - .../automl_v1beta1/proto/text_sentiment.proto | 81 - .../proto/text_sentiment_pb2.py | 353 - .../proto/text_sentiment_pb2_grpc.py | 2 - .../automl_v1beta1/proto/translation.proto | 69 - .../automl_v1beta1/proto/translation_pb2.py | 370 - .../proto/translation_pb2_grpc.py | 2 - .../cloud/automl_v1beta1/proto/video.proto | 49 - .../cloud/automl_v1beta1/proto/video_pb2.py | 193 - .../automl_v1beta1/proto/video_pb2_grpc.py | 2 - .../cloud/automl_v1beta1/tables/__init__.py | 0 .../cloud/automl_v1beta1/tables/gcs_client.py | 146 - .../automl_v1beta1/tables/tables_client.py | 2870 --- automl/google/cloud/automl_v1beta1/types.py | 114 - automl/noxfile.py | 160 - automl/setup.cfg | 3 - automl/setup.py | 78 - automl/synth.metadata | 655 - automl/synth.py | 143 - .../v1beta1/test_system_tables_client_v1.py | 295 - .../unit/gapic/v1/test_auto_ml_client_v1.py | 991 - .../v1/test_prediction_service_client_v1.py | 165 - .../v1beta1/test_auto_ml_client_v1beta1.py | 1255 -- .../gapic/v1beta1/test_gcs_client_v1beta1.py | 173 - .../test_prediction_service_client_v1beta1.py | 165 - .../v1beta1/test_tables_client_v1beta1.py | 1467 -- cloudbuild/.coveragerc | 19 - cloudbuild/.flake8 | 14 - cloudbuild/.repo-metadata.json | 13 - cloudbuild/CHANGELOG.md | 14 - cloudbuild/LICENSE | 201 - cloudbuild/MANIFEST.in | 5 - cloudbuild/README.rst | 75 - cloudbuild/docs/README.rst | 1 - cloudbuild/docs/_static/custom.css | 4 - cloudbuild/docs/_templates/layout.html | 50 - cloudbuild/docs/changelog.md | 1 - cloudbuild/docs/conf.py | 357 - cloudbuild/docs/gapic/v1/api.rst | 6 - cloudbuild/docs/gapic/v1/types.rst | 5 - cloudbuild/docs/index.rst | 22 - cloudbuild/google/__init__.py | 24 - cloudbuild/google/cloud/__init__.py | 24 - cloudbuild/google/cloud/devtools/__init__.py | 24 - .../google/cloud/devtools/cloudbuild.py | 25 - .../cloud/devtools/cloudbuild_v1/__init__.py | 41 - .../devtools/cloudbuild_v1/gapic/__init__.py | 0 .../cloudbuild_v1/gapic/cloud_build_client.py | 1334 -- .../gapic/cloud_build_client_config.py | 103 - .../devtools/cloudbuild_v1/gapic/enums.py | 185 - .../gapic/transports/__init__.py | 0 .../transports/cloud_build_grpc_transport.py | 372 - .../devtools/cloudbuild_v1/proto/__init__.py | 0 .../cloudbuild_v1/proto/cloudbuild.proto | 1304 -- .../cloudbuild_v1/proto/cloudbuild_pb2.py | 6361 ------ .../proto/cloudbuild_pb2_grpc.py | 378 - .../cloud/devtools/cloudbuild_v1/types.py | 56 - cloudbuild/noxfile.py | 160 - cloudbuild/setup.cfg | 3 - cloudbuild/setup.py | 81 - cloudbuild/synth.metadata | 153 - cloudbuild/synth.py | 74 - .../gapic/v1/test_cloud_build_client_v1.py | 754 - container/.coveragerc | 19 - container/.flake8 | 14 - container/.repo-metadata.json | 13 - container/CHANGELOG.md | 117 - container/LICENSE | 201 - container/MANIFEST.in | 5 - container/README.rst | 101 - container/docs/README.rst | 1 - container/docs/_static/custom.css | 4 - container/docs/_templates/layout.html | 50 - container/docs/changelog.md | 1 - container/docs/conf.py | 356 - container/docs/gapic/v1/api.rst | 6 - container/docs/gapic/v1/types.rst | 5 - container/docs/index.rst | 19 - container/google/__init__.py | 8 - container/google/cloud/__init__.py | 8 - container/google/cloud/container.py | 25 - .../google/cloud/container_v1/__init__.py | 30 - .../cloud/container_v1/gapic/__init__.py | 0 .../gapic/cluster_manager_client.py | 3338 --- .../gapic/cluster_manager_client_config.py | 178 - .../google/cloud/container_v1/gapic/enums.py | 260 - .../container_v1/gapic/transports/__init__.py | 0 .../cluster_manager_grpc_transport.py | 534 - .../cloud/container_v1/proto/__init__.py | 0 .../container_v1/proto/cluster_service.proto | 3041 --- .../container_v1/proto/cluster_service_pb2.py | 12775 ----------- .../proto/cluster_service_pb2_grpc.py | 584 - container/google/cloud/container_v1/types.py | 45 - .../cloud/container_v1beta1/__init__.py | 30 - .../cloud/container_v1beta1/gapic/__init__.py | 0 .../gapic/cluster_manager_client.py | 3405 --- .../gapic/cluster_manager_client_config.py | 183 - .../cloud/container_v1beta1/gapic/enums.py | 294 - .../gapic/transports/__init__.py | 0 .../cluster_manager_grpc_transport.py | 548 - .../cloud/container_v1beta1/proto/__init__.py | 0 .../proto/cluster_service.proto | 2740 --- .../proto/cluster_service_pb2.py | 12672 ----------- .../proto/cluster_service_pb2_grpc.py | 602 - .../google/cloud/container_v1beta1/types.py | 44 - container/noxfile.py | 160 - container/setup.cfg | 3 - container/setup.py | 89 - container/synth.metadata | 49 - container/synth.py | 67 - .../v1/test_system_cluster_manager_v1.py | 29 - .../v1/test_cluster_manager_client_v1.py | 2035 -- .../test_cluster_manager_client_v1beta1.py | 2085 -- containeranalysis/.coveragerc | 19 - containeranalysis/.flake8 | 14 - containeranalysis/.repo-metadata.json | 13 - containeranalysis/CHANGELOG.md | 56 - containeranalysis/LICENSE | 201 - containeranalysis/MANIFEST.in | 5 - containeranalysis/README.rst | 76 - containeranalysis/docs/README.rst | 1 - containeranalysis/docs/_static/custom.css | 4 - containeranalysis/docs/_templates/layout.html | 50 - containeranalysis/docs/changelog.md | 1 - containeranalysis/docs/conf.py | 363 - containeranalysis/docs/gapic/v1/api.rst | 6 - containeranalysis/docs/gapic/v1/types.rst | 5 - containeranalysis/docs/index.rst | 20 - containeranalysis/google/__init__.py | 24 - containeranalysis/google/cloud/__init__.py | 24 - .../proto/containeranalysis.proto | 100 - .../google/cloud/devtools/__init__.py | 24 - .../cloud/devtools/containeranalysis.py | 24 - .../devtools/containeranalysis_v1/__init__.py | 39 - .../containeranalysis_v1/gapic/__init__.py | 0 .../gapic/container_analysis_client.py | 495 - .../gapic/container_analysis_client_config.py | 38 - .../gapic/transports/__init__.py | 0 .../container_analysis_grpc_transport.py | 172 - .../containeranalysis_v1/proto/__init__.py | 0 .../proto/containeranalysis.proto | 108 - .../proto/containeranalysis_pb2.py | 100 - .../proto/containeranalysis_pb2_grpc.py | 126 - .../devtools/containeranalysis_v1/types.py | 46 - containeranalysis/noxfile.py | 160 - containeranalysis/setup.cfg | 3 - containeranalysis/setup.py | 81 - containeranalysis/synth.metadata | 153 - containeranalysis/synth.py | 92 - .../v1/test_container_analysis_client_v1.py | 187 - datacatalog/.coveragerc | 19 - datacatalog/.flake8 | 14 - datacatalog/.repo-metadata.json | 13 - datacatalog/CHANGELOG.md | 101 - datacatalog/LICENSE | 201 - datacatalog/MANIFEST.in | 5 - datacatalog/README.rst | 79 - datacatalog/docs/README.rst | 1 - datacatalog/docs/_static/custom.css | 4 - datacatalog/docs/_templates/layout.html | 50 - datacatalog/docs/changelog.md | 1 - datacatalog/docs/conf.py | 356 - datacatalog/docs/gapic/v1beta1/api.rst | 6 - datacatalog/docs/gapic/v1beta1/types.rst | 5 - datacatalog/docs/index.rst | 22 - datacatalog/google/__init__.py | 24 - datacatalog/google/cloud/__init__.py | 24 - datacatalog/google/cloud/datacatalog.py | 33 - .../cloud/datacatalog_v1beta1/__init__.py | 53 - .../datacatalog_v1beta1/gapic/__init__.py | 0 .../gapic/data_catalog_client.py | 2385 -- .../gapic/data_catalog_client_config.py | 143 - .../cloud/datacatalog_v1beta1/gapic/enums.py | 106 - .../gapic/policy_tag_manager_client.py | 1154 - .../gapic/policy_tag_manager_client_config.py | 88 - ...policy_tag_manager_serialization_client.py | 372 - ...tag_manager_serialization_client_config.py | 33 - .../gapic/transports/__init__.py | 0 .../transports/data_catalog_grpc_transport.py | 535 - .../policy_tag_manager_grpc_transport.py | 282 - ...ag_manager_serialization_grpc_transport.py | 145 - .../datacatalog_v1beta1/proto/__init__.py | 0 .../proto/datacatalog.proto | 1012 - .../proto/datacatalog_pb2.py | 3141 --- .../proto/datacatalog_pb2_grpc.py | 559 - .../proto/gcs_fileset_spec.proto | 59 - .../proto/gcs_fileset_spec_pb2.py | 246 - .../proto/gcs_fileset_spec_pb2_grpc.py | 2 - .../proto/policytagmanager_pb2.py | 1521 -- .../proto/policytagmanager_pb2_grpc.py | 261 - .../policytagmanagerserialization_pb2.py | 713 - .../policytagmanagerserialization_pb2_grpc.py | 76 - .../datacatalog_v1beta1/proto/schema.proto | 54 - .../datacatalog_v1beta1/proto/schema_pb2.py | 250 - .../proto/schema_pb2_grpc.py | 2 - .../datacatalog_v1beta1/proto/search.proto | 69 - .../datacatalog_v1beta1/proto/search_pb2.py | 211 - .../proto/search_pb2_grpc.py | 2 - .../proto/table_spec.proto | 101 - .../proto/table_spec_pb2.py | 434 - .../proto/table_spec_pb2_grpc.py | 2 - .../datacatalog_v1beta1/proto/tags.proto | 206 - .../datacatalog_v1beta1/proto/tags_pb2.py | 1116 - .../proto/tags_pb2_grpc.py | 2 - .../proto/timestamps.proto | 40 - .../proto/timestamps_pb2.py | 153 - .../proto/timestamps_pb2_grpc.py | 2 - .../google/cloud/datacatalog_v1beta1/types.py | 76 - datacatalog/noxfile.py | 179 - datacatalog/samples/__init__.py | 0 datacatalog/samples/quickstart/__init__.py | 0 .../create_fileset_entry_quickstart.py | 115 - datacatalog/samples/tests/__init__.py | 0 datacatalog/samples/tests/conftest.py | 94 - .../samples/tests/quickstart/__init__.py | 0 .../test_create_fileset_entry_quickstart.py | 40 - .../samples/tests/test_create_entry_group.py | 29 - .../tests/test_create_fileset_entry.py | 30 - datacatalog/samples/v1beta1/__init__.py | 0 .../samples/v1beta1/create_entry_group.py | 54 - .../samples/v1beta1/create_fileset_entry.py | 86 - .../samples/v1beta1/datacatalog_get_entry.py | 77 - .../v1beta1/datacatalog_lookup_entry.py | 69 - .../datacatalog_lookup_entry_sql_resource.py | 68 - .../samples/v1beta1/datacatalog_search.py | 90 - datacatalog/setup.cfg | 3 - datacatalog/setup.py | 79 - datacatalog/synth.metadata | 288 - datacatalog/synth.py | 67 - .../test_data_catalog_client_v1beta1.py | 1105 - .../test_policy_tag_manager_client_v1beta1.py | 515 - ...ag_manager_serialization_client_v1beta1.py | 127 - datalabeling/.coveragerc | 19 - datalabeling/.flake8 | 14 - datalabeling/.gitignore | 1 - datalabeling/.repo-metadata.json | 13 - datalabeling/CHANGELOG.md | 77 - datalabeling/LICENSE | 201 - datalabeling/MANIFEST.in | 5 - datalabeling/README.rst | 89 - datalabeling/docs/README.rst | 1 - datalabeling/docs/_static/custom.css | 4 - datalabeling/docs/_templates/layout.html | 50 - datalabeling/docs/changelog.md | 1 - datalabeling/docs/conf.py | 356 - datalabeling/docs/gapic/v1beta1/api.rst | 6 - datalabeling/docs/gapic/v1beta1/types.rst | 5 - datalabeling/docs/index.rst | 19 - datalabeling/google/__init__.py | 24 - datalabeling/google/cloud/__init__.py | 24 - datalabeling/google/cloud/datalabeling.py | 25 - .../cloud/datalabeling_v1beta1/__init__.py | 29 - .../datalabeling_v1beta1/gapic/__init__.py | 0 .../gapic/data_labeling_service_client.py | 3376 --- .../data_labeling_service_client_config.py | 193 - .../cloud/datalabeling_v1beta1/gapic/enums.py | 228 - .../gapic/transports/__init__.py | 0 .../data_labeling_service_grpc_transport.py | 580 - .../datalabeling_v1beta1/proto/__init__.py | 0 .../proto/annotation.proto | 344 - .../proto/annotation_pb2.py | 2497 --- .../proto/annotation_pb2_grpc.py | 2 - .../proto/annotation_spec_set.proto | 69 - .../proto/annotation_spec_set_pb2.py | 280 - .../proto/annotation_spec_set_pb2_grpc.py | 2 - .../proto/data_labeling_service.proto | 1232 -- .../proto/data_labeling_service_pb2.py | 5027 ----- .../proto/data_labeling_service_pb2_grpc.py | 649 - .../proto/data_payloads.proto | 75 - .../proto/data_payloads_pb2.py | 442 - .../proto/data_payloads_pb2_grpc.py | 2 - .../datalabeling_v1beta1/proto/dataset.proto | 345 - .../datalabeling_v1beta1/proto/dataset_pb2.py | 2207 -- .../proto/dataset_pb2_grpc.py | 2 - .../proto/evaluation.proto | 205 - .../proto/evaluation_job.proto | 272 - .../proto/evaluation_job_pb2.py | 995 - .../proto/evaluation_job_pb2_grpc.py | 2 - .../proto/evaluation_pb2.py | 1251 -- .../proto/evaluation_pb2_grpc.py | 2 - .../proto/human_annotation_config.proto | 209 - .../proto/human_annotation_config_pb2.py | 1286 -- .../proto/human_annotation_config_pb2_grpc.py | 2 - .../proto/instruction.proto | 85 - .../proto/instruction_pb2.py | 411 - .../proto/instruction_pb2_grpc.py | 2 - .../proto/operations.proto | 231 - .../proto/operations_pb2.py | 1880 -- .../proto/operations_pb2_grpc.py | 2 - .../cloud/datalabeling_v1beta1/types.py | 80 - datalabeling/noxfile.py | 160 - datalabeling/protos/annotation.proto | 294 - datalabeling/protos/annotation_spec_set.proto | 56 - .../protos/data_labeling_service.proto | 727 - datalabeling/protos/dataset.proto | 306 - .../protos/human_annotation_config.proto | 208 - datalabeling/protos/instruction.proto | 78 - datalabeling/protos/operations.proto | 206 - datalabeling/setup.cfg | 3 - datalabeling/setup.py | 74 - datalabeling/synth.metadata | 255 - datalabeling/synth.py | 80 - ...st_data_labeling_service_client_v1beta1.py | 1712 -- dlp/.coveragerc | 19 - dlp/.flake8 | 14 - dlp/.repo-metadata.json | 13 - dlp/CHANGELOG.md | 199 - dlp/LICENSE | 201 - dlp/MANIFEST.in | 5 - dlp/README.rst | 111 - dlp/docs/README.rst | 1 - dlp/docs/_static/custom.css | 4 - dlp/docs/_templates/layout.html | 50 - dlp/docs/changelog.md | 1 - dlp/docs/conf.py | 357 - dlp/docs/gapic/v2/api.rst | 6 - dlp/docs/gapic/v2/types.rst | 5 - dlp/docs/index.rst | 20 - dlp/google/__init__.py | 24 - dlp/google/cloud/__init__.py | 24 - dlp/google/cloud/dlp.py | 25 - dlp/google/cloud/dlp_v2/__init__.py | 41 - dlp/google/cloud/dlp_v2/gapic/__init__.py | 0 .../cloud/dlp_v2/gapic/dlp_service_client.py | 3095 --- .../dlp_v2/gapic/dlp_service_client_config.py | 173 - dlp/google/cloud/dlp_v2/gapic/enums.py | 456 - .../cloud/dlp_v2/gapic/transports/__init__.py | 0 .../transports/dlp_service_grpc_transport.py | 574 - dlp/google/cloud/dlp_v2/proto/__init__.py | 0 dlp/google/cloud/dlp_v2/proto/dlp.proto | 3775 ---- dlp/google/cloud/dlp_v2/proto/dlp_pb2.py | 18420 ---------------- dlp/google/cloud/dlp_v2/proto/dlp_pb2_grpc.py | 656 - dlp/google/cloud/dlp_v2/proto/storage.proto | 648 - dlp/google/cloud/dlp_v2/proto/storage_pb2.py | 3327 --- .../cloud/dlp_v2/proto/storage_pb2_grpc.py | 2 - dlp/google/cloud/dlp_v2/types.py | 61 - dlp/noxfile.py | 160 - dlp/setup.cfg | 3 - dlp/setup.py | 75 - dlp/synth.metadata | 165 - dlp/synth.py | 258 - .../gapic/v2/test_system_dlp_service_v2.py | 41 - .../v2/test_system_dlp_service_v2_vpcsc.py | 499 - .../gapic/v2/test_dlp_service_client_v2.py | 1273 -- dns/.coveragerc | 16 - dns/.flake8 | 13 - dns/.repo-metadata.json | 12 - dns/CHANGELOG.md | 130 - dns/LICENSE | 202 - dns/MANIFEST.in | 4 - dns/README.rst | 87 - dns/docs/README.rst | 1 - dns/docs/_static/custom.css | 4 - dns/docs/_templates/layout.html | 49 - dns/docs/changelog.md | 1 - dns/docs/changes.rst | 6 - dns/docs/client.rst | 6 - dns/docs/conf.py | 353 - dns/docs/index.rst | 201 - dns/docs/resource-record-set.rst | 6 - dns/docs/usage.html | 8 - dns/docs/zone.rst | 6 - dns/google/__init__.py | 22 - dns/google/cloud/__init__.py | 22 - dns/google/cloud/dns/__init__.py | 48 - dns/google/cloud/dns/_http.py | 44 - dns/google/cloud/dns/changes.py | 278 - dns/google/cloud/dns/client.py | 169 - dns/google/cloud/dns/resource_record_set.py | 66 - dns/google/cloud/dns/zone.py | 428 - dns/noxfile.py | 134 - dns/pylint.config.py | 25 - dns/setup.cfg | 2 - dns/setup.py | 89 - dns/tests/__init__.py | 0 dns/tests/unit/__init__.py | 13 - dns/tests/unit/test__http.py | 82 - dns/tests/unit/test_changes.py | 373 - dns/tests/unit/test_client.py | 336 - dns/tests/unit/test_resource_record_set.py | 107 - dns/tests/unit/test_zone.py | 707 - documentai/.coveragerc | 19 - documentai/.flake8 | 14 - documentai/.repo-metadata.json | 13 - documentai/CHANGELOG.md | 1 - documentai/LICENSE | 201 - documentai/MANIFEST.in | 5 - documentai/README.rst | 77 - documentai/docs/README.rst | 1 - documentai/docs/_static/custom.css | 4 - documentai/docs/_templates/layout.html | 50 - documentai/docs/changelog.md | 1 - documentai/docs/conf.py | 363 - documentai/docs/gapic/v1beta1/api.rst | 6 - documentai/docs/gapic/v1beta1/types.rst | 5 - documentai/docs/index.rst | 19 - documentai/google/__init__.py | 24 - documentai/google/cloud/__init__.py | 24 - documentai/google/cloud/documentai.py | 25 - .../cloud/documentai_v1beta1/__init__.py | 45 - .../documentai_v1beta1/gapic/__init__.py | 0 .../document_understanding_service_client.py | 291 - ...ent_understanding_service_client_config.py | 28 - .../cloud/documentai_v1beta1/gapic/enums.py | 84 - .../gapic/transports/__init__.py | 0 ...nt_understanding_service_grpc_transport.py | 131 - .../documentai_v1beta1/proto/__init__.py | 0 .../documentai_v1beta1/proto/document.proto | 446 - .../documentai_v1beta1/proto/document_pb2.py | 2698 --- .../proto/document_pb2_grpc.py | 2 - .../proto/document_understanding.proto | 299 - .../proto/document_understanding_pb2.py | 1559 -- .../proto/document_understanding_pb2_grpc.py | 57 - .../documentai_v1beta1/proto/geometry.proto | 55 - .../documentai_v1beta1/proto/geometry_pb2.py | 270 - .../proto/geometry_pb2_grpc.py | 2 - .../google/cloud/documentai_v1beta1/types.py | 58 - documentai/noxfile.py | 160 - documentai/setup.cfg | 3 - documentai/setup.py | 73 - documentai/synth.metadata | 168 - documentai/synth.py | 53 - ...nt_understanding_service_client_v1beta1.py | 118 - texttospeech/.coveragerc | 19 - texttospeech/.flake8 | 14 - texttospeech/.repo-metadata.json | 13 - texttospeech/CHANGELOG.md | 109 - texttospeech/LICENSE | 201 - texttospeech/MANIFEST.in | 5 - texttospeech/README.rst | 90 - texttospeech/docs/README.rst | 1 - texttospeech/docs/_static/custom.css | 4 - texttospeech/docs/_templates/layout.html | 50 - texttospeech/docs/api.rst | 30 - texttospeech/docs/changelog.md | 1 - texttospeech/docs/conf.py | 356 - texttospeech/docs/gapic/v1/api.rst | 6 - texttospeech/docs/gapic/v1/types.rst | 5 - texttospeech/docs/gapic/v1beta1/api.rst | 6 - texttospeech/docs/gapic/v1beta1/types.rst | 5 - texttospeech/docs/index.rst | 22 - texttospeech/google/__init__.py | 22 - texttospeech/google/cloud/__init__.py | 22 - texttospeech/google/cloud/texttospeech.py | 25 - .../google/cloud/texttospeech_v1/__init__.py | 41 - .../cloud/texttospeech_v1/gapic/__init__.py | 0 .../cloud/texttospeech_v1/gapic/enums.py | 63 - .../gapic/text_to_speech_client.py | 323 - .../gapic/text_to_speech_client_config.py | 33 - .../gapic/transports/__init__.py | 0 .../text_to_speech_grpc_transport.py | 135 - .../cloud/texttospeech_v1/proto/__init__.py | 0 .../texttospeech_v1/proto/cloud_tts.proto | 253 - .../texttospeech_v1/proto/cloud_tts_pb2.py | 993 - .../proto/cloud_tts_pb2_grpc.py | 67 - .../google/cloud/texttospeech_v1/types.py | 43 - .../cloud/texttospeech_v1beta1/__init__.py | 41 - .../texttospeech_v1beta1/gapic/__init__.py | 0 .../cloud/texttospeech_v1beta1/gapic/enums.py | 63 - .../gapic/text_to_speech_client.py | 325 - .../gapic/text_to_speech_client_config.py | 33 - .../gapic/transports/__init__.py | 0 .../text_to_speech_grpc_transport.py | 135 - .../texttospeech_v1beta1/proto/__init__.py | 0 .../proto/cloud_tts.proto | 253 - .../proto/cloud_tts_pb2.py | 993 - .../proto/cloud_tts_pb2_grpc.py | 67 - .../cloud/texttospeech_v1beta1/types.py | 43 - texttospeech/noxfile.py | 160 - texttospeech/setup.cfg | 3 - texttospeech/setup.py | 99 - texttospeech/synth.metadata | 214 - texttospeech/synth.py | 46 - .../tests/system/v1/test_system_tts_v1.py | 38 - .../system/v1beta1/test_system_tts_v1beta1.py | 40 - .../gapic/v1/test_text_to_speech_client_v1.py | 136 - .../test_text_to_speech_client_v1beta1.py | 136 - translate/.coveragerc | 19 - translate/.flake8 | 14 - translate/.repo-metadata.json | 13 - translate/CHANGELOG.md | 179 - translate/LICENSE | 201 - translate/MANIFEST.in | 5 - translate/README.rst | 84 - translate/docs/README.rst | 1 - translate/docs/_static/custom.css | 4 - translate/docs/_templates/layout.html | 50 - translate/docs/changelog.md | 1 - translate/docs/client.rst | 7 - translate/docs/conf.py | 357 - translate/docs/gapic/v3/api.rst | 6 - translate/docs/gapic/v3/types.rst | 5 - translate/docs/gapic/v3beta1/api.rst | 6 - translate/docs/gapic/v3beta1/types.rst | 5 - translate/docs/index.rst | 32 - translate/docs/usage.rst | 110 - translate/docs/v2.rst | 8 - translate/docs/v3.rst | 8 - translate/docs/v3beta1.rst | 8 - translate/google/__init__.py | 24 - translate/google/cloud/__init__.py | 24 - translate/google/cloud/translate.py | 24 - .../google/cloud/translate_v2/__init__.py | 25 - translate/google/cloud/translate_v2/_http.py | 44 - translate/google/cloud/translate_v2/client.py | 281 - .../google/cloud/translate_v3/__init__.py | 39 - .../cloud/translate_v3/gapic/__init__.py | 0 .../google/cloud/translate_v3/gapic/enums.py | 91 - .../gapic/translation_service_client.py | 1099 - .../translation_service_client_config.py | 63 - .../translate_v3/gapic/transports/__init__.py | 0 .../translation_service_grpc_transport.py | 234 - .../cloud/translate_v3/proto/__init__.py | 0 .../proto/translation_service.proto | 926 - .../proto/translation_service_pb2.py | 3902 ---- .../proto/translation_service_pb2_grpc.py | 186 - translate/google/cloud/translate_v3/types.py | 47 - .../cloud/translate_v3beta1/__init__.py | 39 - .../cloud/translate_v3beta1/gapic/__init__.py | 0 .../gapic/translation_service_client.py | 1096 - .../translation_service_client_config.py | 63 - .../gapic/transports/__init__.py | 0 .../translation_service_grpc_transport.py | 234 - .../cloud/translate_v3beta1/proto/__init__.py | 0 .../proto/translation_service.proto | 902 - .../proto/translation_service_pb2.py | 3894 ---- .../proto/translation_service_pb2_grpc.py | 186 - .../google/cloud/translate_v3beta1/types.py | 47 - translate/noxfile.py | 160 - translate/pylint.config.py | 25 - translate/setup.cfg | 3 - translate/setup.py | 89 - translate/synth.metadata | 244 - translate/synth.py | 85 - translate/tests/__init__.py | 0 translate/tests/system.py | 75 - translate/tests/system/test_vpcsc.py | 168 - .../v3/test_translation_service_client_v3.py | 470 - ...test_translation_service_client_v3beta1.py | 470 - translate/tests/unit/v2/test__http.py | 94 - translate/tests/unit/v2/test_client.py | 387 - webrisk/.coveragerc | 19 - webrisk/.flake8 | 14 - webrisk/.repo-metadata.json | 13 - webrisk/CHANGELOG.md | 41 - webrisk/LICENSE | 201 - webrisk/MANIFEST.in | 5 - webrisk/README.rst | 81 - webrisk/docs/README.rst | 1 - webrisk/docs/_static/custom.css | 4 - webrisk/docs/_templates/layout.html | 50 - webrisk/docs/changelog.md | 1 - webrisk/docs/conf.py | 363 - webrisk/docs/gapic/v1beta1/api.rst | 6 - webrisk/docs/gapic/v1beta1/types.rst | 5 - webrisk/docs/index.rst | 10 - webrisk/google/__init__.py | 24 - webrisk/google/cloud/__init__.py | 24 - webrisk/google/cloud/webrisk.py | 25 - .../google/cloud/webrisk_v1beta1/__init__.py | 43 - .../cloud/webrisk_v1beta1/gapic/__init__.py | 0 .../cloud/webrisk_v1beta1/gapic/enums.py | 70 - .../gapic/transports/__init__.py | 0 ...eb_risk_service_v1_beta1_grpc_transport.py | 153 - .../gapic/web_risk_service_v1_beta1_client.py | 389 - ...web_risk_service_v1_beta1_client_config.py | 38 - .../cloud/webrisk_v1beta1/proto/__init__.py | 0 .../cloud/webrisk_v1beta1/proto/webrisk.proto | 302 - .../webrisk_v1beta1/proto/webrisk_pb2.py | 1599 -- .../webrisk_v1beta1/proto/webrisk_pb2_grpc.py | 89 - webrisk/google/cloud/webrisk_v1beta1/types.py | 44 - webrisk/noxfile.py | 160 - webrisk/setup.cfg | 3 - webrisk/setup.py | 86 - webrisk/synth.metadata | 150 - webrisk/synth.py | 49 - ...eb_risk_service_v1_beta1_client_v1beta1.py | 184 - websecurityscanner/.coveragerc | 19 - websecurityscanner/.flake8 | 14 - websecurityscanner/.repo-metadata.json | 13 - websecurityscanner/CHANGELOG.md | 94 - websecurityscanner/LICENSE | 201 - websecurityscanner/MANIFEST.in | 5 - websecurityscanner/README.rst | 86 - websecurityscanner/docs/README.rst | 1 - websecurityscanner/docs/_static/custom.css | 4 - .../docs/_templates/layout.html | 50 - websecurityscanner/docs/changelog.md | 1 - websecurityscanner/docs/conf.py | 356 - websecurityscanner/docs/gapic/v1alpha/api.rst | 6 - .../docs/gapic/v1alpha/types.rst | 5 - websecurityscanner/docs/gapic/v1beta/api.rst | 6 - .../docs/gapic/v1beta/types.rst | 5 - websecurityscanner/docs/index.rst | 32 - websecurityscanner/google/__init__.py | 22 - websecurityscanner/google/cloud/__init__.py | 22 - .../google/cloud/websecurityscanner.py | 25 - .../websecurityscanner_v1alpha/__init__.py | 41 - .../gapic/__init__.py | 0 .../websecurityscanner_v1alpha/gapic/enums.py | 146 - .../gapic/transports/__init__.py | 0 .../web_security_scanner_grpc_transport.py | 283 - .../gapic/web_security_scanner_client.py | 1320 -- .../web_security_scanner_client_config.py | 88 - .../proto/__init__.py | 0 .../proto/crawled_url.proto | 38 - .../proto/crawled_url_pb2.py | 137 - .../proto/crawled_url_pb2_grpc.py | 2 - .../proto/finding.proto | 152 - .../proto/finding_addon.proto | 78 - .../proto/finding_addon_pb2.py | 506 - .../proto/finding_addon_pb2_grpc.py | 2 - .../proto/finding_pb2.py | 505 - .../proto/finding_pb2_grpc.py | 2 - .../proto/finding_type_stats.proto | 35 - .../proto/finding_type_stats_pb2.py | 126 - .../proto/finding_type_stats_pb2_grpc.py | 2 - .../proto/scan_config.proto | 157 - .../proto/scan_config_pb2.py | 743 - .../proto/scan_config_pb2_grpc.py | 2 - .../proto/scan_run.proto | 104 - .../proto/scan_run_pb2.py | 348 - .../proto/scan_run_pb2_grpc.py | 2 - .../proto/web_security_scanner.proto | 410 - .../proto/web_security_scanner_pb2.py | 1711 -- .../proto/web_security_scanner_pb2_grpc.py | 269 - .../cloud/websecurityscanner_v1alpha/types.py | 60 - .../websecurityscanner_v1beta/__init__.py | 41 - .../gapic/__init__.py | 0 .../websecurityscanner_v1beta/gapic/enums.py | 289 - .../gapic/transports/__init__.py | 0 .../web_security_scanner_grpc_transport.py | 283 - .../gapic/web_security_scanner_client.py | 1320 -- .../web_security_scanner_client_config.py | 88 - .../proto/__init__.py | 0 .../proto/crawled_url.proto | 39 - .../proto/crawled_url_pb2.py | 136 - .../proto/crawled_url_pb2_grpc.py | 2 - .../proto/finding.proto | 96 - .../proto/finding_addon.proto | 88 - .../proto/finding_addon_pb2.py | 584 - .../proto/finding_addon_pb2_grpc.py | 2 - .../proto/finding_pb2.py | 453 - .../proto/finding_pb2_grpc.py | 2 - .../proto/finding_type_stats.proto | 34 - .../proto/finding_type_stats_pb2.py | 113 - .../proto/finding_type_stats_pb2_grpc.py | 2 - .../proto/scan_config.proto | 191 - .../proto/scan_config_error.proto | 188 - .../proto/scan_config_error_pb2.py | 422 - .../proto/scan_config_error_pb2_grpc.py | 2 - .../proto/scan_config_pb2.py | 848 - .../proto/scan_config_pb2_grpc.py | 2 - .../proto/scan_run.proto | 115 - .../proto/scan_run_error_trace.proto | 74 - .../proto/scan_run_error_trace_pb2.py | 212 - .../proto/scan_run_error_trace_pb2_grpc.py | 2 - .../proto/scan_run_pb2.py | 409 - .../proto/scan_run_pb2_grpc.py | 2 - .../proto/scan_run_warning_trace.proto | 57 - .../proto/scan_run_warning_trace_pb2.py | 142 - .../proto/scan_run_warning_trace_pb2_grpc.py | 2 - .../proto/web_security_scanner.proto | 411 - .../proto/web_security_scanner_pb2.py | 1711 -- .../proto/web_security_scanner_pb2_grpc.py | 268 - .../cloud/websecurityscanner_v1beta/types.py | 66 - websecurityscanner/noxfile.py | 160 - websecurityscanner/setup.cfg | 3 - websecurityscanner/setup.py | 87 - websecurityscanner/synth.metadata | 340 - websecurityscanner/synth.py | 52 - ...est_web_security_scanner_client_v1alpha.py | 677 - ...test_web_security_scanner_client_v1beta.py | 679 - 901 files changed, 19 insertions(+), 260221 deletions(-) delete mode 100644 .kokoro/continuous/automl.cfg delete mode 100644 .kokoro/continuous/cloudbuild.cfg delete mode 100644 .kokoro/continuous/container.cfg delete mode 100644 .kokoro/continuous/containeranalysis.cfg delete mode 100644 .kokoro/continuous/datacatalog.cfg delete mode 100644 .kokoro/continuous/datalabeling.cfg delete mode 100644 .kokoro/continuous/dlp.cfg delete mode 100644 .kokoro/continuous/dns.cfg delete mode 100644 .kokoro/continuous/documentai.cfg delete mode 100644 .kokoro/continuous/texttospeech.cfg delete mode 100644 .kokoro/continuous/translate.cfg delete mode 100644 .kokoro/continuous/webrisk.cfg delete mode 100644 .kokoro/continuous/websecurityscanner.cfg delete mode 100644 .kokoro/docs/automl.cfg delete mode 100644 .kokoro/docs/cloudbuild.cfg delete mode 100644 .kokoro/docs/container.cfg delete mode 100644 .kokoro/docs/containeranalysis.cfg delete mode 100644 .kokoro/docs/datacatalog.cfg delete mode 100644 .kokoro/docs/datalabeling.cfg delete mode 100644 .kokoro/docs/dlp.cfg delete mode 100644 .kokoro/docs/dns.cfg delete mode 100644 .kokoro/docs/documentai.cfg delete mode 100644 .kokoro/docs/texttospeech.cfg delete mode 100644 .kokoro/docs/translate.cfg delete mode 100644 .kokoro/docs/webrisk.cfg delete mode 100644 .kokoro/docs/websecurityscanner.cfg delete mode 100644 .kokoro/presubmit/automl.cfg delete mode 100644 .kokoro/presubmit/cloudbuild.cfg delete mode 100644 .kokoro/presubmit/container.cfg delete mode 100644 .kokoro/presubmit/containeranalysis.cfg delete mode 100644 .kokoro/presubmit/datacatalog.cfg delete mode 100644 .kokoro/presubmit/datalabeling.cfg delete mode 100644 .kokoro/presubmit/dlp.cfg delete mode 100644 .kokoro/presubmit/dns.cfg delete mode 100644 .kokoro/presubmit/documentai.cfg delete mode 100644 .kokoro/presubmit/texttospeech.cfg delete mode 100644 .kokoro/presubmit/translate.cfg delete mode 100644 .kokoro/presubmit/webrisk.cfg delete mode 100644 .kokoro/presubmit/websecurityscanner.cfg delete mode 100644 .kokoro/release/automl.cfg delete mode 100644 .kokoro/release/cloudbuild.cfg delete mode 100644 .kokoro/release/container.cfg delete mode 100644 .kokoro/release/containeranalysis.cfg delete mode 100644 .kokoro/release/datacatalog.cfg delete mode 100644 .kokoro/release/datalabeling.cfg delete mode 100644 .kokoro/release/dlp.cfg delete mode 100644 .kokoro/release/dns.cfg delete mode 100644 .kokoro/release/documentai.cfg delete mode 100644 .kokoro/release/texttospeech.cfg delete mode 100644 .kokoro/release/translate.cfg delete mode 100644 .kokoro/release/webrisk.cfg delete mode 100644 .kokoro/release/websecurityscanner.cfg delete mode 100644 automl/.coveragerc delete mode 100644 automl/.flake8 delete mode 100644 automl/.repo-metadata.json delete mode 100644 automl/CHANGELOG.md delete mode 100644 automl/LICENSE delete mode 100644 automl/MANIFEST.in delete mode 100644 automl/README.rst delete mode 120000 automl/docs/README.rst delete mode 100644 automl/docs/_static/custom.css delete mode 100644 automl/docs/_templates/layout.html delete mode 120000 automl/docs/changelog.md delete mode 100644 automl/docs/conf.py delete mode 100644 automl/docs/gapic/v1/api.rst delete mode 100644 automl/docs/gapic/v1/types.rst delete mode 100644 automl/docs/gapic/v1beta1/api.rst delete mode 100644 automl/docs/gapic/v1beta1/tables.rst delete mode 100644 automl/docs/gapic/v1beta1/types.rst delete mode 100644 automl/docs/index.rst delete mode 100644 automl/google/__init__.py delete mode 100644 automl/google/cloud/__init__.py delete mode 100644 automl/google/cloud/automl.py delete mode 100644 automl/google/cloud/automl_v1/__init__.py delete mode 100644 automl/google/cloud/automl_v1/gapic/__init__.py delete mode 100644 automl/google/cloud/automl_v1/gapic/auto_ml_client.py delete mode 100644 automl/google/cloud/automl_v1/gapic/auto_ml_client_config.py delete mode 100644 automl/google/cloud/automl_v1/gapic/enums.py delete mode 100644 automl/google/cloud/automl_v1/gapic/prediction_service_client.py delete mode 100644 automl/google/cloud/automl_v1/gapic/prediction_service_client_config.py delete mode 100644 automl/google/cloud/automl_v1/gapic/transports/__init__.py delete mode 100644 automl/google/cloud/automl_v1/gapic/transports/auto_ml_grpc_transport.py delete mode 100644 automl/google/cloud/automl_v1/gapic/transports/prediction_service_grpc_transport.py delete mode 100644 automl/google/cloud/automl_v1/proto/__init__.py delete mode 100644 automl/google/cloud/automl_v1/proto/annotation_payload.proto delete mode 100644 automl/google/cloud/automl_v1/proto/annotation_payload_pb2.py delete mode 100644 automl/google/cloud/automl_v1/proto/annotation_payload_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1/proto/annotation_spec.proto delete mode 100644 automl/google/cloud/automl_v1/proto/annotation_spec_pb2.py delete mode 100644 automl/google/cloud/automl_v1/proto/annotation_spec_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1/proto/classification.proto delete mode 100644 automl/google/cloud/automl_v1/proto/classification_pb2.py delete mode 100644 automl/google/cloud/automl_v1/proto/classification_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1/proto/data_items.proto delete mode 100644 automl/google/cloud/automl_v1/proto/data_items_pb2.py delete mode 100644 automl/google/cloud/automl_v1/proto/data_items_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1/proto/dataset.proto delete mode 100644 automl/google/cloud/automl_v1/proto/dataset_pb2.py delete mode 100644 automl/google/cloud/automl_v1/proto/dataset_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1/proto/detection.proto delete mode 100644 automl/google/cloud/automl_v1/proto/detection_pb2.py delete mode 100644 automl/google/cloud/automl_v1/proto/detection_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1/proto/geometry.proto delete mode 100644 automl/google/cloud/automl_v1/proto/geometry_pb2.py delete mode 100644 automl/google/cloud/automl_v1/proto/geometry_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1/proto/image.proto delete mode 100644 automl/google/cloud/automl_v1/proto/image_pb2.py delete mode 100644 automl/google/cloud/automl_v1/proto/image_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1/proto/io.proto delete mode 100644 automl/google/cloud/automl_v1/proto/io_pb2.py delete mode 100644 automl/google/cloud/automl_v1/proto/io_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1/proto/model.proto delete mode 100644 automl/google/cloud/automl_v1/proto/model_evaluation.proto delete mode 100644 automl/google/cloud/automl_v1/proto/model_evaluation_pb2.py delete mode 100644 automl/google/cloud/automl_v1/proto/model_evaluation_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1/proto/model_pb2.py delete mode 100644 automl/google/cloud/automl_v1/proto/model_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1/proto/operations.proto delete mode 100644 automl/google/cloud/automl_v1/proto/operations_pb2.py delete mode 100644 automl/google/cloud/automl_v1/proto/operations_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1/proto/prediction_service.proto delete mode 100644 automl/google/cloud/automl_v1/proto/prediction_service_pb2.py delete mode 100644 automl/google/cloud/automl_v1/proto/prediction_service_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1/proto/service.proto delete mode 100644 automl/google/cloud/automl_v1/proto/service_pb2.py delete mode 100644 automl/google/cloud/automl_v1/proto/service_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1/proto/text.proto delete mode 100644 automl/google/cloud/automl_v1/proto/text_extraction.proto delete mode 100644 automl/google/cloud/automl_v1/proto/text_extraction_pb2.py delete mode 100644 automl/google/cloud/automl_v1/proto/text_extraction_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1/proto/text_pb2.py delete mode 100644 automl/google/cloud/automl_v1/proto/text_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1/proto/text_segment.proto delete mode 100644 automl/google/cloud/automl_v1/proto/text_segment_pb2.py delete mode 100644 automl/google/cloud/automl_v1/proto/text_segment_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1/proto/text_sentiment.proto delete mode 100644 automl/google/cloud/automl_v1/proto/text_sentiment_pb2.py delete mode 100644 automl/google/cloud/automl_v1/proto/text_sentiment_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1/proto/translation.proto delete mode 100644 automl/google/cloud/automl_v1/proto/translation_pb2.py delete mode 100644 automl/google/cloud/automl_v1/proto/translation_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1/types.py delete mode 100644 automl/google/cloud/automl_v1beta1/__init__.py delete mode 100644 automl/google/cloud/automl_v1beta1/gapic/__init__.py delete mode 100644 automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py delete mode 100644 automl/google/cloud/automl_v1beta1/gapic/auto_ml_client_config.py delete mode 100644 automl/google/cloud/automl_v1beta1/gapic/enums.py delete mode 100644 automl/google/cloud/automl_v1beta1/gapic/prediction_service_client.py delete mode 100644 automl/google/cloud/automl_v1beta1/gapic/prediction_service_client_config.py delete mode 100644 automl/google/cloud/automl_v1beta1/gapic/transports/__init__.py delete mode 100644 automl/google/cloud/automl_v1beta1/gapic/transports/auto_ml_grpc_transport.py delete mode 100644 automl/google/cloud/automl_v1beta1/gapic/transports/prediction_service_grpc_transport.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/__init__.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/annotation_payload.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/annotation_payload_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/annotation_payload_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/annotation_spec.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/annotation_spec_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/annotation_spec_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/classification.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/classification_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/classification_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/column_spec.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/column_spec_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/column_spec_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/data_items.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/data_items_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/data_items_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/data_stats.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/data_stats_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/data_stats_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/data_types.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/data_types_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/data_types_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/dataset.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/dataset_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/dataset_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/detection.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/detection_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/detection_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/geometry.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/geometry_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/geometry_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/image.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/image_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/image_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/io.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/io_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/io_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/model.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/model_evaluation.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/model_evaluation_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/model_evaluation_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/model_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/model_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/operations.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/operations_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/operations_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/prediction_service.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/prediction_service_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/prediction_service_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/ranges.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/ranges_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/ranges_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/regression.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/regression_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/regression_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/service.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/service_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/service_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/table_spec.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/table_spec_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/table_spec_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/tables.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/tables_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/tables_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/temporal.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/temporal_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/temporal_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/text.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/text_extraction.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/text_extraction_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/text_extraction_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/text_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/text_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/text_segment.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/text_segment_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/text_segment_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/text_sentiment.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/text_sentiment_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/text_sentiment_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/translation.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/translation_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/translation_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/video.proto delete mode 100644 automl/google/cloud/automl_v1beta1/proto/video_pb2.py delete mode 100644 automl/google/cloud/automl_v1beta1/proto/video_pb2_grpc.py delete mode 100644 automl/google/cloud/automl_v1beta1/tables/__init__.py delete mode 100644 automl/google/cloud/automl_v1beta1/tables/gcs_client.py delete mode 100644 automl/google/cloud/automl_v1beta1/tables/tables_client.py delete mode 100644 automl/google/cloud/automl_v1beta1/types.py delete mode 100644 automl/noxfile.py delete mode 100644 automl/setup.cfg delete mode 100644 automl/setup.py delete mode 100644 automl/synth.metadata delete mode 100644 automl/synth.py delete mode 100644 automl/tests/system/gapic/v1beta1/test_system_tables_client_v1.py delete mode 100644 automl/tests/unit/gapic/v1/test_auto_ml_client_v1.py delete mode 100644 automl/tests/unit/gapic/v1/test_prediction_service_client_v1.py delete mode 100644 automl/tests/unit/gapic/v1beta1/test_auto_ml_client_v1beta1.py delete mode 100644 automl/tests/unit/gapic/v1beta1/test_gcs_client_v1beta1.py delete mode 100644 automl/tests/unit/gapic/v1beta1/test_prediction_service_client_v1beta1.py delete mode 100644 automl/tests/unit/gapic/v1beta1/test_tables_client_v1beta1.py delete mode 100644 cloudbuild/.coveragerc delete mode 100644 cloudbuild/.flake8 delete mode 100644 cloudbuild/.repo-metadata.json delete mode 100644 cloudbuild/CHANGELOG.md delete mode 100644 cloudbuild/LICENSE delete mode 100644 cloudbuild/MANIFEST.in delete mode 100644 cloudbuild/README.rst delete mode 120000 cloudbuild/docs/README.rst delete mode 100644 cloudbuild/docs/_static/custom.css delete mode 100644 cloudbuild/docs/_templates/layout.html delete mode 120000 cloudbuild/docs/changelog.md delete mode 100644 cloudbuild/docs/conf.py delete mode 100644 cloudbuild/docs/gapic/v1/api.rst delete mode 100644 cloudbuild/docs/gapic/v1/types.rst delete mode 100644 cloudbuild/docs/index.rst delete mode 100644 cloudbuild/google/__init__.py delete mode 100644 cloudbuild/google/cloud/__init__.py delete mode 100644 cloudbuild/google/cloud/devtools/__init__.py delete mode 100644 cloudbuild/google/cloud/devtools/cloudbuild.py delete mode 100644 cloudbuild/google/cloud/devtools/cloudbuild_v1/__init__.py delete mode 100644 cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/__init__.py delete mode 100644 cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/cloud_build_client.py delete mode 100644 cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/cloud_build_client_config.py delete mode 100644 cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/enums.py delete mode 100644 cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/transports/__init__.py delete mode 100644 cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/transports/cloud_build_grpc_transport.py delete mode 100644 cloudbuild/google/cloud/devtools/cloudbuild_v1/proto/__init__.py delete mode 100644 cloudbuild/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild.proto delete mode 100644 cloudbuild/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild_pb2.py delete mode 100644 cloudbuild/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild_pb2_grpc.py delete mode 100644 cloudbuild/google/cloud/devtools/cloudbuild_v1/types.py delete mode 100644 cloudbuild/noxfile.py delete mode 100644 cloudbuild/setup.cfg delete mode 100644 cloudbuild/setup.py delete mode 100644 cloudbuild/synth.metadata delete mode 100644 cloudbuild/synth.py delete mode 100644 cloudbuild/tests/unit/gapic/v1/test_cloud_build_client_v1.py delete mode 100644 container/.coveragerc delete mode 100644 container/.flake8 delete mode 100644 container/.repo-metadata.json delete mode 100644 container/CHANGELOG.md delete mode 100644 container/LICENSE delete mode 100644 container/MANIFEST.in delete mode 100644 container/README.rst delete mode 120000 container/docs/README.rst delete mode 100644 container/docs/_static/custom.css delete mode 100644 container/docs/_templates/layout.html delete mode 120000 container/docs/changelog.md delete mode 100644 container/docs/conf.py delete mode 100644 container/docs/gapic/v1/api.rst delete mode 100644 container/docs/gapic/v1/types.rst delete mode 100644 container/docs/index.rst delete mode 100644 container/google/__init__.py delete mode 100644 container/google/cloud/__init__.py delete mode 100644 container/google/cloud/container.py delete mode 100644 container/google/cloud/container_v1/__init__.py delete mode 100644 container/google/cloud/container_v1/gapic/__init__.py delete mode 100644 container/google/cloud/container_v1/gapic/cluster_manager_client.py delete mode 100644 container/google/cloud/container_v1/gapic/cluster_manager_client_config.py delete mode 100644 container/google/cloud/container_v1/gapic/enums.py delete mode 100644 container/google/cloud/container_v1/gapic/transports/__init__.py delete mode 100644 container/google/cloud/container_v1/gapic/transports/cluster_manager_grpc_transport.py delete mode 100644 container/google/cloud/container_v1/proto/__init__.py delete mode 100644 container/google/cloud/container_v1/proto/cluster_service.proto delete mode 100644 container/google/cloud/container_v1/proto/cluster_service_pb2.py delete mode 100644 container/google/cloud/container_v1/proto/cluster_service_pb2_grpc.py delete mode 100644 container/google/cloud/container_v1/types.py delete mode 100644 container/google/cloud/container_v1beta1/__init__.py delete mode 100644 container/google/cloud/container_v1beta1/gapic/__init__.py delete mode 100644 container/google/cloud/container_v1beta1/gapic/cluster_manager_client.py delete mode 100644 container/google/cloud/container_v1beta1/gapic/cluster_manager_client_config.py delete mode 100644 container/google/cloud/container_v1beta1/gapic/enums.py delete mode 100644 container/google/cloud/container_v1beta1/gapic/transports/__init__.py delete mode 100644 container/google/cloud/container_v1beta1/gapic/transports/cluster_manager_grpc_transport.py delete mode 100644 container/google/cloud/container_v1beta1/proto/__init__.py delete mode 100644 container/google/cloud/container_v1beta1/proto/cluster_service.proto delete mode 100644 container/google/cloud/container_v1beta1/proto/cluster_service_pb2.py delete mode 100644 container/google/cloud/container_v1beta1/proto/cluster_service_pb2_grpc.py delete mode 100644 container/google/cloud/container_v1beta1/types.py delete mode 100644 container/noxfile.py delete mode 100644 container/setup.cfg delete mode 100644 container/setup.py delete mode 100644 container/synth.metadata delete mode 100644 container/synth.py delete mode 100644 container/tests/system/gapic/v1/test_system_cluster_manager_v1.py delete mode 100644 container/tests/unit/gapic/v1/test_cluster_manager_client_v1.py delete mode 100644 container/tests/unit/gapic/v1beta1/test_cluster_manager_client_v1beta1.py delete mode 100644 containeranalysis/.coveragerc delete mode 100644 containeranalysis/.flake8 delete mode 100644 containeranalysis/.repo-metadata.json delete mode 100644 containeranalysis/CHANGELOG.md delete mode 100644 containeranalysis/LICENSE delete mode 100644 containeranalysis/MANIFEST.in delete mode 100644 containeranalysis/README.rst delete mode 120000 containeranalysis/docs/README.rst delete mode 100644 containeranalysis/docs/_static/custom.css delete mode 100644 containeranalysis/docs/_templates/layout.html delete mode 120000 containeranalysis/docs/changelog.md delete mode 100644 containeranalysis/docs/conf.py delete mode 100644 containeranalysis/docs/gapic/v1/api.rst delete mode 100644 containeranalysis/docs/gapic/v1/types.rst delete mode 100644 containeranalysis/docs/index.rst delete mode 100644 containeranalysis/google/__init__.py delete mode 100644 containeranalysis/google/cloud/__init__.py delete mode 100644 containeranalysis/google/cloud/containeranalysis_v1/proto/containeranalysis.proto delete mode 100644 containeranalysis/google/cloud/devtools/__init__.py delete mode 100644 containeranalysis/google/cloud/devtools/containeranalysis.py delete mode 100644 containeranalysis/google/cloud/devtools/containeranalysis_v1/__init__.py delete mode 100644 containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/__init__.py delete mode 100644 containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/container_analysis_client.py delete mode 100644 containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/container_analysis_client_config.py delete mode 100644 containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/transports/__init__.py delete mode 100644 containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/transports/container_analysis_grpc_transport.py delete mode 100644 containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/__init__.py delete mode 100644 containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis.proto delete mode 100644 containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis_pb2.py delete mode 100644 containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis_pb2_grpc.py delete mode 100644 containeranalysis/google/cloud/devtools/containeranalysis_v1/types.py delete mode 100644 containeranalysis/noxfile.py delete mode 100644 containeranalysis/setup.cfg delete mode 100644 containeranalysis/setup.py delete mode 100644 containeranalysis/synth.metadata delete mode 100644 containeranalysis/synth.py delete mode 100644 containeranalysis/tests/unit/gapic/v1/test_container_analysis_client_v1.py delete mode 100644 datacatalog/.coveragerc delete mode 100644 datacatalog/.flake8 delete mode 100644 datacatalog/.repo-metadata.json delete mode 100644 datacatalog/CHANGELOG.md delete mode 100644 datacatalog/LICENSE delete mode 100644 datacatalog/MANIFEST.in delete mode 100644 datacatalog/README.rst delete mode 120000 datacatalog/docs/README.rst delete mode 100644 datacatalog/docs/_static/custom.css delete mode 100644 datacatalog/docs/_templates/layout.html delete mode 120000 datacatalog/docs/changelog.md delete mode 100644 datacatalog/docs/conf.py delete mode 100644 datacatalog/docs/gapic/v1beta1/api.rst delete mode 100644 datacatalog/docs/gapic/v1beta1/types.rst delete mode 100644 datacatalog/docs/index.rst delete mode 100644 datacatalog/google/__init__.py delete mode 100644 datacatalog/google/cloud/__init__.py delete mode 100644 datacatalog/google/cloud/datacatalog.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/__init__.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/gapic/__init__.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/gapic/data_catalog_client.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/gapic/data_catalog_client_config.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/gapic/enums.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_client.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_client_config.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_serialization_client.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_serialization_client_config.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/__init__.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/data_catalog_grpc_transport.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/policy_tag_manager_grpc_transport.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/policy_tag_manager_serialization_grpc_transport.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/__init__.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/datacatalog.proto delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/datacatalog_pb2.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/datacatalog_pb2_grpc.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec.proto delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec_pb2.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec_pb2_grpc.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/policytagmanager_pb2.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/policytagmanager_pb2_grpc.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/policytagmanagerserialization_pb2.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/policytagmanagerserialization_pb2_grpc.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/schema.proto delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/schema_pb2.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/schema_pb2_grpc.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/search.proto delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/search_pb2.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/search_pb2_grpc.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/table_spec.proto delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/table_spec_pb2.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/table_spec_pb2_grpc.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/tags.proto delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/tags_pb2.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/tags_pb2_grpc.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/timestamps.proto delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/timestamps_pb2.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/proto/timestamps_pb2_grpc.py delete mode 100644 datacatalog/google/cloud/datacatalog_v1beta1/types.py delete mode 100644 datacatalog/noxfile.py delete mode 100644 datacatalog/samples/__init__.py delete mode 100644 datacatalog/samples/quickstart/__init__.py delete mode 100644 datacatalog/samples/quickstart/create_fileset_entry_quickstart.py delete mode 100644 datacatalog/samples/tests/__init__.py delete mode 100644 datacatalog/samples/tests/conftest.py delete mode 100644 datacatalog/samples/tests/quickstart/__init__.py delete mode 100644 datacatalog/samples/tests/quickstart/test_create_fileset_entry_quickstart.py delete mode 100644 datacatalog/samples/tests/test_create_entry_group.py delete mode 100644 datacatalog/samples/tests/test_create_fileset_entry.py delete mode 100644 datacatalog/samples/v1beta1/__init__.py delete mode 100644 datacatalog/samples/v1beta1/create_entry_group.py delete mode 100644 datacatalog/samples/v1beta1/create_fileset_entry.py delete mode 100644 datacatalog/samples/v1beta1/datacatalog_get_entry.py delete mode 100644 datacatalog/samples/v1beta1/datacatalog_lookup_entry.py delete mode 100644 datacatalog/samples/v1beta1/datacatalog_lookup_entry_sql_resource.py delete mode 100644 datacatalog/samples/v1beta1/datacatalog_search.py delete mode 100644 datacatalog/setup.cfg delete mode 100644 datacatalog/setup.py delete mode 100644 datacatalog/synth.metadata delete mode 100644 datacatalog/synth.py delete mode 100644 datacatalog/tests/unit/gapic/v1beta1/test_data_catalog_client_v1beta1.py delete mode 100644 datacatalog/tests/unit/gapic/v1beta1/test_policy_tag_manager_client_v1beta1.py delete mode 100644 datacatalog/tests/unit/gapic/v1beta1/test_policy_tag_manager_serialization_client_v1beta1.py delete mode 100644 datalabeling/.coveragerc delete mode 100644 datalabeling/.flake8 delete mode 100644 datalabeling/.gitignore delete mode 100644 datalabeling/.repo-metadata.json delete mode 100644 datalabeling/CHANGELOG.md delete mode 100644 datalabeling/LICENSE delete mode 100644 datalabeling/MANIFEST.in delete mode 100644 datalabeling/README.rst delete mode 120000 datalabeling/docs/README.rst delete mode 100644 datalabeling/docs/_static/custom.css delete mode 100644 datalabeling/docs/_templates/layout.html delete mode 120000 datalabeling/docs/changelog.md delete mode 100644 datalabeling/docs/conf.py delete mode 100644 datalabeling/docs/gapic/v1beta1/api.rst delete mode 100644 datalabeling/docs/gapic/v1beta1/types.rst delete mode 100644 datalabeling/docs/index.rst delete mode 100644 datalabeling/google/__init__.py delete mode 100644 datalabeling/google/cloud/__init__.py delete mode 100644 datalabeling/google/cloud/datalabeling.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/__init__.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/gapic/__init__.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client_config.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/gapic/enums.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/gapic/transports/__init__.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/gapic/transports/data_labeling_service_grpc_transport.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/__init__.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation.proto delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_pb2.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_pb2_grpc.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set_pb2.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set_pb2_grpc.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service.proto delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service_pb2.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service_pb2_grpc.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/data_payloads.proto delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/data_payloads_pb2.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/data_payloads_pb2_grpc.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset.proto delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset_pb2.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset_pb2_grpc.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation.proto delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_job.proto delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_job_pb2.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_job_pb2_grpc.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_pb2.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_pb2_grpc.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config.proto delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config_pb2.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config_pb2_grpc.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction.proto delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction_pb2.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction_pb2_grpc.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/operations.proto delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/operations_pb2.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/proto/operations_pb2_grpc.py delete mode 100644 datalabeling/google/cloud/datalabeling_v1beta1/types.py delete mode 100644 datalabeling/noxfile.py delete mode 100644 datalabeling/protos/annotation.proto delete mode 100644 datalabeling/protos/annotation_spec_set.proto delete mode 100644 datalabeling/protos/data_labeling_service.proto delete mode 100644 datalabeling/protos/dataset.proto delete mode 100644 datalabeling/protos/human_annotation_config.proto delete mode 100644 datalabeling/protos/instruction.proto delete mode 100644 datalabeling/protos/operations.proto delete mode 100644 datalabeling/setup.cfg delete mode 100644 datalabeling/setup.py delete mode 100644 datalabeling/synth.metadata delete mode 100644 datalabeling/synth.py delete mode 100644 datalabeling/tests/unit/gapic/v1beta1/test_data_labeling_service_client_v1beta1.py delete mode 100644 dlp/.coveragerc delete mode 100644 dlp/.flake8 delete mode 100644 dlp/.repo-metadata.json delete mode 100644 dlp/CHANGELOG.md delete mode 100644 dlp/LICENSE delete mode 100644 dlp/MANIFEST.in delete mode 100644 dlp/README.rst delete mode 120000 dlp/docs/README.rst delete mode 100644 dlp/docs/_static/custom.css delete mode 100644 dlp/docs/_templates/layout.html delete mode 120000 dlp/docs/changelog.md delete mode 100644 dlp/docs/conf.py delete mode 100644 dlp/docs/gapic/v2/api.rst delete mode 100644 dlp/docs/gapic/v2/types.rst delete mode 100644 dlp/docs/index.rst delete mode 100644 dlp/google/__init__.py delete mode 100644 dlp/google/cloud/__init__.py delete mode 100644 dlp/google/cloud/dlp.py delete mode 100644 dlp/google/cloud/dlp_v2/__init__.py delete mode 100644 dlp/google/cloud/dlp_v2/gapic/__init__.py delete mode 100644 dlp/google/cloud/dlp_v2/gapic/dlp_service_client.py delete mode 100644 dlp/google/cloud/dlp_v2/gapic/dlp_service_client_config.py delete mode 100644 dlp/google/cloud/dlp_v2/gapic/enums.py delete mode 100644 dlp/google/cloud/dlp_v2/gapic/transports/__init__.py delete mode 100644 dlp/google/cloud/dlp_v2/gapic/transports/dlp_service_grpc_transport.py delete mode 100644 dlp/google/cloud/dlp_v2/proto/__init__.py delete mode 100644 dlp/google/cloud/dlp_v2/proto/dlp.proto delete mode 100644 dlp/google/cloud/dlp_v2/proto/dlp_pb2.py delete mode 100644 dlp/google/cloud/dlp_v2/proto/dlp_pb2_grpc.py delete mode 100644 dlp/google/cloud/dlp_v2/proto/storage.proto delete mode 100644 dlp/google/cloud/dlp_v2/proto/storage_pb2.py delete mode 100644 dlp/google/cloud/dlp_v2/proto/storage_pb2_grpc.py delete mode 100644 dlp/google/cloud/dlp_v2/types.py delete mode 100644 dlp/noxfile.py delete mode 100644 dlp/setup.cfg delete mode 100644 dlp/setup.py delete mode 100644 dlp/synth.metadata delete mode 100644 dlp/synth.py delete mode 100644 dlp/tests/system/gapic/v2/test_system_dlp_service_v2.py delete mode 100644 dlp/tests/system/gapic/v2/test_system_dlp_service_v2_vpcsc.py delete mode 100644 dlp/tests/unit/gapic/v2/test_dlp_service_client_v2.py delete mode 100644 dns/.coveragerc delete mode 100644 dns/.flake8 delete mode 100644 dns/.repo-metadata.json delete mode 100644 dns/CHANGELOG.md delete mode 100644 dns/LICENSE delete mode 100644 dns/MANIFEST.in delete mode 100644 dns/README.rst delete mode 120000 dns/docs/README.rst delete mode 100644 dns/docs/_static/custom.css delete mode 100644 dns/docs/_templates/layout.html delete mode 120000 dns/docs/changelog.md delete mode 100644 dns/docs/changes.rst delete mode 100644 dns/docs/client.rst delete mode 100644 dns/docs/conf.py delete mode 100644 dns/docs/index.rst delete mode 100644 dns/docs/resource-record-set.rst delete mode 100644 dns/docs/usage.html delete mode 100644 dns/docs/zone.rst delete mode 100644 dns/google/__init__.py delete mode 100644 dns/google/cloud/__init__.py delete mode 100644 dns/google/cloud/dns/__init__.py delete mode 100644 dns/google/cloud/dns/_http.py delete mode 100644 dns/google/cloud/dns/changes.py delete mode 100644 dns/google/cloud/dns/client.py delete mode 100644 dns/google/cloud/dns/resource_record_set.py delete mode 100644 dns/google/cloud/dns/zone.py delete mode 100644 dns/noxfile.py delete mode 100644 dns/pylint.config.py delete mode 100644 dns/setup.cfg delete mode 100644 dns/setup.py delete mode 100644 dns/tests/__init__.py delete mode 100644 dns/tests/unit/__init__.py delete mode 100644 dns/tests/unit/test__http.py delete mode 100644 dns/tests/unit/test_changes.py delete mode 100644 dns/tests/unit/test_client.py delete mode 100644 dns/tests/unit/test_resource_record_set.py delete mode 100644 dns/tests/unit/test_zone.py delete mode 100644 documentai/.coveragerc delete mode 100644 documentai/.flake8 delete mode 100644 documentai/.repo-metadata.json delete mode 100644 documentai/CHANGELOG.md delete mode 100644 documentai/LICENSE delete mode 100644 documentai/MANIFEST.in delete mode 100644 documentai/README.rst delete mode 120000 documentai/docs/README.rst delete mode 100644 documentai/docs/_static/custom.css delete mode 100644 documentai/docs/_templates/layout.html delete mode 120000 documentai/docs/changelog.md delete mode 100644 documentai/docs/conf.py delete mode 100644 documentai/docs/gapic/v1beta1/api.rst delete mode 100644 documentai/docs/gapic/v1beta1/types.rst delete mode 100644 documentai/docs/index.rst delete mode 100644 documentai/google/__init__.py delete mode 100644 documentai/google/cloud/__init__.py delete mode 100644 documentai/google/cloud/documentai.py delete mode 100644 documentai/google/cloud/documentai_v1beta1/__init__.py delete mode 100644 documentai/google/cloud/documentai_v1beta1/gapic/__init__.py delete mode 100644 documentai/google/cloud/documentai_v1beta1/gapic/document_understanding_service_client.py delete mode 100644 documentai/google/cloud/documentai_v1beta1/gapic/document_understanding_service_client_config.py delete mode 100644 documentai/google/cloud/documentai_v1beta1/gapic/enums.py delete mode 100644 documentai/google/cloud/documentai_v1beta1/gapic/transports/__init__.py delete mode 100644 documentai/google/cloud/documentai_v1beta1/gapic/transports/document_understanding_service_grpc_transport.py delete mode 100644 documentai/google/cloud/documentai_v1beta1/proto/__init__.py delete mode 100644 documentai/google/cloud/documentai_v1beta1/proto/document.proto delete mode 100644 documentai/google/cloud/documentai_v1beta1/proto/document_pb2.py delete mode 100644 documentai/google/cloud/documentai_v1beta1/proto/document_pb2_grpc.py delete mode 100644 documentai/google/cloud/documentai_v1beta1/proto/document_understanding.proto delete mode 100644 documentai/google/cloud/documentai_v1beta1/proto/document_understanding_pb2.py delete mode 100644 documentai/google/cloud/documentai_v1beta1/proto/document_understanding_pb2_grpc.py delete mode 100644 documentai/google/cloud/documentai_v1beta1/proto/geometry.proto delete mode 100644 documentai/google/cloud/documentai_v1beta1/proto/geometry_pb2.py delete mode 100644 documentai/google/cloud/documentai_v1beta1/proto/geometry_pb2_grpc.py delete mode 100644 documentai/google/cloud/documentai_v1beta1/types.py delete mode 100644 documentai/noxfile.py delete mode 100644 documentai/setup.cfg delete mode 100644 documentai/setup.py delete mode 100644 documentai/synth.metadata delete mode 100644 documentai/synth.py delete mode 100644 documentai/tests/unit/gapic/v1beta1/test_document_understanding_service_client_v1beta1.py delete mode 100644 texttospeech/.coveragerc delete mode 100644 texttospeech/.flake8 delete mode 100644 texttospeech/.repo-metadata.json delete mode 100644 texttospeech/CHANGELOG.md delete mode 100644 texttospeech/LICENSE delete mode 100644 texttospeech/MANIFEST.in delete mode 100644 texttospeech/README.rst delete mode 120000 texttospeech/docs/README.rst delete mode 100644 texttospeech/docs/_static/custom.css delete mode 100644 texttospeech/docs/_templates/layout.html delete mode 100644 texttospeech/docs/api.rst delete mode 120000 texttospeech/docs/changelog.md delete mode 100644 texttospeech/docs/conf.py delete mode 100644 texttospeech/docs/gapic/v1/api.rst delete mode 100644 texttospeech/docs/gapic/v1/types.rst delete mode 100644 texttospeech/docs/gapic/v1beta1/api.rst delete mode 100644 texttospeech/docs/gapic/v1beta1/types.rst delete mode 100644 texttospeech/docs/index.rst delete mode 100644 texttospeech/google/__init__.py delete mode 100644 texttospeech/google/cloud/__init__.py delete mode 100644 texttospeech/google/cloud/texttospeech.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1/__init__.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1/gapic/__init__.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1/gapic/enums.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1/gapic/text_to_speech_client.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1/gapic/text_to_speech_client_config.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1/gapic/transports/__init__.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1/gapic/transports/text_to_speech_grpc_transport.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1/proto/__init__.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts.proto delete mode 100644 texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts_pb2.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts_pb2_grpc.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1/types.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1beta1/__init__.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1beta1/gapic/__init__.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1beta1/gapic/enums.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client_config.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1beta1/gapic/transports/__init__.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1beta1/gapic/transports/text_to_speech_grpc_transport.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1beta1/proto/__init__.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts.proto delete mode 100644 texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2_grpc.py delete mode 100644 texttospeech/google/cloud/texttospeech_v1beta1/types.py delete mode 100644 texttospeech/noxfile.py delete mode 100644 texttospeech/setup.cfg delete mode 100644 texttospeech/setup.py delete mode 100644 texttospeech/synth.metadata delete mode 100644 texttospeech/synth.py delete mode 100644 texttospeech/tests/system/v1/test_system_tts_v1.py delete mode 100644 texttospeech/tests/system/v1beta1/test_system_tts_v1beta1.py delete mode 100644 texttospeech/tests/unit/gapic/v1/test_text_to_speech_client_v1.py delete mode 100644 texttospeech/tests/unit/gapic/v1beta1/test_text_to_speech_client_v1beta1.py delete mode 100644 translate/.coveragerc delete mode 100644 translate/.flake8 delete mode 100644 translate/.repo-metadata.json delete mode 100644 translate/CHANGELOG.md delete mode 100644 translate/LICENSE delete mode 100644 translate/MANIFEST.in delete mode 100644 translate/README.rst delete mode 120000 translate/docs/README.rst delete mode 100644 translate/docs/_static/custom.css delete mode 100644 translate/docs/_templates/layout.html delete mode 120000 translate/docs/changelog.md delete mode 100644 translate/docs/client.rst delete mode 100644 translate/docs/conf.py delete mode 100644 translate/docs/gapic/v3/api.rst delete mode 100644 translate/docs/gapic/v3/types.rst delete mode 100644 translate/docs/gapic/v3beta1/api.rst delete mode 100644 translate/docs/gapic/v3beta1/types.rst delete mode 100644 translate/docs/index.rst delete mode 100644 translate/docs/usage.rst delete mode 100644 translate/docs/v2.rst delete mode 100644 translate/docs/v3.rst delete mode 100644 translate/docs/v3beta1.rst delete mode 100644 translate/google/__init__.py delete mode 100644 translate/google/cloud/__init__.py delete mode 100644 translate/google/cloud/translate.py delete mode 100644 translate/google/cloud/translate_v2/__init__.py delete mode 100644 translate/google/cloud/translate_v2/_http.py delete mode 100644 translate/google/cloud/translate_v2/client.py delete mode 100644 translate/google/cloud/translate_v3/__init__.py delete mode 100644 translate/google/cloud/translate_v3/gapic/__init__.py delete mode 100644 translate/google/cloud/translate_v3/gapic/enums.py delete mode 100644 translate/google/cloud/translate_v3/gapic/translation_service_client.py delete mode 100644 translate/google/cloud/translate_v3/gapic/translation_service_client_config.py delete mode 100644 translate/google/cloud/translate_v3/gapic/transports/__init__.py delete mode 100644 translate/google/cloud/translate_v3/gapic/transports/translation_service_grpc_transport.py delete mode 100644 translate/google/cloud/translate_v3/proto/__init__.py delete mode 100644 translate/google/cloud/translate_v3/proto/translation_service.proto delete mode 100644 translate/google/cloud/translate_v3/proto/translation_service_pb2.py delete mode 100644 translate/google/cloud/translate_v3/proto/translation_service_pb2_grpc.py delete mode 100644 translate/google/cloud/translate_v3/types.py delete mode 100644 translate/google/cloud/translate_v3beta1/__init__.py delete mode 100644 translate/google/cloud/translate_v3beta1/gapic/__init__.py delete mode 100644 translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py delete mode 100644 translate/google/cloud/translate_v3beta1/gapic/translation_service_client_config.py delete mode 100644 translate/google/cloud/translate_v3beta1/gapic/transports/__init__.py delete mode 100644 translate/google/cloud/translate_v3beta1/gapic/transports/translation_service_grpc_transport.py delete mode 100644 translate/google/cloud/translate_v3beta1/proto/__init__.py delete mode 100644 translate/google/cloud/translate_v3beta1/proto/translation_service.proto delete mode 100644 translate/google/cloud/translate_v3beta1/proto/translation_service_pb2.py delete mode 100644 translate/google/cloud/translate_v3beta1/proto/translation_service_pb2_grpc.py delete mode 100644 translate/google/cloud/translate_v3beta1/types.py delete mode 100644 translate/noxfile.py delete mode 100644 translate/pylint.config.py delete mode 100644 translate/setup.cfg delete mode 100644 translate/setup.py delete mode 100644 translate/synth.metadata delete mode 100644 translate/synth.py delete mode 100644 translate/tests/__init__.py delete mode 100644 translate/tests/system.py delete mode 100644 translate/tests/system/test_vpcsc.py delete mode 100644 translate/tests/unit/gapic/v3/test_translation_service_client_v3.py delete mode 100644 translate/tests/unit/gapic/v3beta1/test_translation_service_client_v3beta1.py delete mode 100644 translate/tests/unit/v2/test__http.py delete mode 100644 translate/tests/unit/v2/test_client.py delete mode 100644 webrisk/.coveragerc delete mode 100644 webrisk/.flake8 delete mode 100644 webrisk/.repo-metadata.json delete mode 100644 webrisk/CHANGELOG.md delete mode 100644 webrisk/LICENSE delete mode 100644 webrisk/MANIFEST.in delete mode 100644 webrisk/README.rst delete mode 120000 webrisk/docs/README.rst delete mode 100644 webrisk/docs/_static/custom.css delete mode 100644 webrisk/docs/_templates/layout.html delete mode 120000 webrisk/docs/changelog.md delete mode 100644 webrisk/docs/conf.py delete mode 100644 webrisk/docs/gapic/v1beta1/api.rst delete mode 100644 webrisk/docs/gapic/v1beta1/types.rst delete mode 100644 webrisk/docs/index.rst delete mode 100644 webrisk/google/__init__.py delete mode 100644 webrisk/google/cloud/__init__.py delete mode 100644 webrisk/google/cloud/webrisk.py delete mode 100644 webrisk/google/cloud/webrisk_v1beta1/__init__.py delete mode 100644 webrisk/google/cloud/webrisk_v1beta1/gapic/__init__.py delete mode 100644 webrisk/google/cloud/webrisk_v1beta1/gapic/enums.py delete mode 100644 webrisk/google/cloud/webrisk_v1beta1/gapic/transports/__init__.py delete mode 100644 webrisk/google/cloud/webrisk_v1beta1/gapic/transports/web_risk_service_v1_beta1_grpc_transport.py delete mode 100644 webrisk/google/cloud/webrisk_v1beta1/gapic/web_risk_service_v1_beta1_client.py delete mode 100644 webrisk/google/cloud/webrisk_v1beta1/gapic/web_risk_service_v1_beta1_client_config.py delete mode 100644 webrisk/google/cloud/webrisk_v1beta1/proto/__init__.py delete mode 100644 webrisk/google/cloud/webrisk_v1beta1/proto/webrisk.proto delete mode 100644 webrisk/google/cloud/webrisk_v1beta1/proto/webrisk_pb2.py delete mode 100644 webrisk/google/cloud/webrisk_v1beta1/proto/webrisk_pb2_grpc.py delete mode 100644 webrisk/google/cloud/webrisk_v1beta1/types.py delete mode 100644 webrisk/noxfile.py delete mode 100644 webrisk/setup.cfg delete mode 100644 webrisk/setup.py delete mode 100644 webrisk/synth.metadata delete mode 100644 webrisk/synth.py delete mode 100644 webrisk/tests/unit/gapic/v1beta1/test_web_risk_service_v1_beta1_client_v1beta1.py delete mode 100644 websecurityscanner/.coveragerc delete mode 100644 websecurityscanner/.flake8 delete mode 100644 websecurityscanner/.repo-metadata.json delete mode 100644 websecurityscanner/CHANGELOG.md delete mode 100644 websecurityscanner/LICENSE delete mode 100644 websecurityscanner/MANIFEST.in delete mode 100644 websecurityscanner/README.rst delete mode 120000 websecurityscanner/docs/README.rst delete mode 100644 websecurityscanner/docs/_static/custom.css delete mode 100644 websecurityscanner/docs/_templates/layout.html delete mode 120000 websecurityscanner/docs/changelog.md delete mode 100644 websecurityscanner/docs/conf.py delete mode 100644 websecurityscanner/docs/gapic/v1alpha/api.rst delete mode 100644 websecurityscanner/docs/gapic/v1alpha/types.rst delete mode 100644 websecurityscanner/docs/gapic/v1beta/api.rst delete mode 100644 websecurityscanner/docs/gapic/v1beta/types.rst delete mode 100644 websecurityscanner/docs/index.rst delete mode 100644 websecurityscanner/google/__init__.py delete mode 100644 websecurityscanner/google/cloud/__init__.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/__init__.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/__init__.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/enums.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/transports/__init__.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/transports/web_security_scanner_grpc_transport.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client_config.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/__init__.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/crawled_url.proto delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/crawled_url_pb2.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/crawled_url_pb2_grpc.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding.proto delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_addon.proto delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_addon_pb2.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_addon_pb2_grpc.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_pb2.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_pb2_grpc.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_type_stats.proto delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_type_stats_pb2.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_type_stats_pb2_grpc.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/scan_config.proto delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/scan_config_pb2.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/scan_config_pb2_grpc.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/scan_run.proto delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/scan_run_pb2.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/scan_run_pb2_grpc.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/web_security_scanner.proto delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/web_security_scanner_pb2.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/web_security_scanner_pb2_grpc.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1alpha/types.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/__init__.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/__init__.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/enums.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/transports/__init__.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/transports/web_security_scanner_grpc_transport.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/web_security_scanner_client.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/web_security_scanner_client_config.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/__init__.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/crawled_url.proto delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/crawled_url_pb2.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/crawled_url_pb2_grpc.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding.proto delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_addon.proto delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_addon_pb2.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_addon_pb2_grpc.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_pb2.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_pb2_grpc.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_type_stats.proto delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_type_stats_pb2.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_type_stats_pb2_grpc.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config.proto delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_error.proto delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_error_pb2.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_error_pb2_grpc.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_pb2.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_pb2_grpc.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run.proto delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_error_trace.proto delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_error_trace_pb2.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_error_trace_pb2_grpc.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_pb2.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_pb2_grpc.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_warning_trace.proto delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_warning_trace_pb2.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_warning_trace_pb2_grpc.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/web_security_scanner.proto delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/web_security_scanner_pb2.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/web_security_scanner_pb2_grpc.py delete mode 100644 websecurityscanner/google/cloud/websecurityscanner_v1beta/types.py delete mode 100644 websecurityscanner/noxfile.py delete mode 100644 websecurityscanner/setup.cfg delete mode 100644 websecurityscanner/setup.py delete mode 100644 websecurityscanner/synth.metadata delete mode 100644 websecurityscanner/synth.py delete mode 100644 websecurityscanner/tests/unit/gapic/v1alpha/test_web_security_scanner_client_v1alpha.py delete mode 100644 websecurityscanner/tests/unit/gapic/v1beta/test_web_security_scanner_client_v1beta.py diff --git a/.kokoro/continuous/automl.cfg b/.kokoro/continuous/automl.cfg deleted file mode 100644 index 5081664abb56..000000000000 --- a/.kokoro/continuous/automl.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "automl" -} diff --git a/.kokoro/continuous/cloudbuild.cfg b/.kokoro/continuous/cloudbuild.cfg deleted file mode 100644 index 695ad3787290..000000000000 --- a/.kokoro/continuous/cloudbuild.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "cloudbuild" -} diff --git a/.kokoro/continuous/container.cfg b/.kokoro/continuous/container.cfg deleted file mode 100644 index 8d06b5285bf2..000000000000 --- a/.kokoro/continuous/container.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "container" -} diff --git a/.kokoro/continuous/containeranalysis.cfg b/.kokoro/continuous/containeranalysis.cfg deleted file mode 100644 index ae80ed8d8bc6..000000000000 --- a/.kokoro/continuous/containeranalysis.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "containeranalysis" -} diff --git a/.kokoro/continuous/datacatalog.cfg b/.kokoro/continuous/datacatalog.cfg deleted file mode 100644 index fc0371e5eb11..000000000000 --- a/.kokoro/continuous/datacatalog.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "datacatalog" -} diff --git a/.kokoro/continuous/datalabeling.cfg b/.kokoro/continuous/datalabeling.cfg deleted file mode 100644 index a1c53b81884b..000000000000 --- a/.kokoro/continuous/datalabeling.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "datalabeling" -} diff --git a/.kokoro/continuous/dlp.cfg b/.kokoro/continuous/dlp.cfg deleted file mode 100644 index 931126d3e719..000000000000 --- a/.kokoro/continuous/dlp.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "dlp" -} diff --git a/.kokoro/continuous/dns.cfg b/.kokoro/continuous/dns.cfg deleted file mode 100644 index 845e3e148060..000000000000 --- a/.kokoro/continuous/dns.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "dns" -} diff --git a/.kokoro/continuous/documentai.cfg b/.kokoro/continuous/documentai.cfg deleted file mode 100644 index c374e377c2cf..000000000000 --- a/.kokoro/continuous/documentai.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "documentai" -} diff --git a/.kokoro/continuous/texttospeech.cfg b/.kokoro/continuous/texttospeech.cfg deleted file mode 100644 index 9e7d6d7f7980..000000000000 --- a/.kokoro/continuous/texttospeech.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "texttospeech" -} diff --git a/.kokoro/continuous/translate.cfg b/.kokoro/continuous/translate.cfg deleted file mode 100644 index 807c96195b41..000000000000 --- a/.kokoro/continuous/translate.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "translate" -} diff --git a/.kokoro/continuous/webrisk.cfg b/.kokoro/continuous/webrisk.cfg deleted file mode 100644 index 36b06f0b0b55..000000000000 --- a/.kokoro/continuous/webrisk.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "webrisk" -} diff --git a/.kokoro/continuous/websecurityscanner.cfg b/.kokoro/continuous/websecurityscanner.cfg deleted file mode 100644 index 221d1fc23d6b..000000000000 --- a/.kokoro/continuous/websecurityscanner.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "websecurityscanner" -} diff --git a/.kokoro/docs/automl.cfg b/.kokoro/docs/automl.cfg deleted file mode 100644 index 093775c51065..000000000000 --- a/.kokoro/docs/automl.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "automl" -} \ No newline at end of file diff --git a/.kokoro/docs/cloudbuild.cfg b/.kokoro/docs/cloudbuild.cfg deleted file mode 100644 index 695ad3787290..000000000000 --- a/.kokoro/docs/cloudbuild.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "cloudbuild" -} diff --git a/.kokoro/docs/container.cfg b/.kokoro/docs/container.cfg deleted file mode 100644 index 8d06b5285bf2..000000000000 --- a/.kokoro/docs/container.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "container" -} diff --git a/.kokoro/docs/containeranalysis.cfg b/.kokoro/docs/containeranalysis.cfg deleted file mode 100644 index ae80ed8d8bc6..000000000000 --- a/.kokoro/docs/containeranalysis.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "containeranalysis" -} diff --git a/.kokoro/docs/datacatalog.cfg b/.kokoro/docs/datacatalog.cfg deleted file mode 100644 index fc0371e5eb11..000000000000 --- a/.kokoro/docs/datacatalog.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "datacatalog" -} diff --git a/.kokoro/docs/datalabeling.cfg b/.kokoro/docs/datalabeling.cfg deleted file mode 100644 index a1c53b81884b..000000000000 --- a/.kokoro/docs/datalabeling.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "datalabeling" -} diff --git a/.kokoro/docs/dlp.cfg b/.kokoro/docs/dlp.cfg deleted file mode 100644 index 931126d3e719..000000000000 --- a/.kokoro/docs/dlp.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "dlp" -} diff --git a/.kokoro/docs/dns.cfg b/.kokoro/docs/dns.cfg deleted file mode 100644 index 845e3e148060..000000000000 --- a/.kokoro/docs/dns.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "dns" -} diff --git a/.kokoro/docs/documentai.cfg b/.kokoro/docs/documentai.cfg deleted file mode 100644 index c374e377c2cf..000000000000 --- a/.kokoro/docs/documentai.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "documentai" -} diff --git a/.kokoro/docs/texttospeech.cfg b/.kokoro/docs/texttospeech.cfg deleted file mode 100644 index 9e7d6d7f7980..000000000000 --- a/.kokoro/docs/texttospeech.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "texttospeech" -} diff --git a/.kokoro/docs/translate.cfg b/.kokoro/docs/translate.cfg deleted file mode 100644 index 807c96195b41..000000000000 --- a/.kokoro/docs/translate.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "translate" -} diff --git a/.kokoro/docs/webrisk.cfg b/.kokoro/docs/webrisk.cfg deleted file mode 100644 index 36b06f0b0b55..000000000000 --- a/.kokoro/docs/webrisk.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "webrisk" -} diff --git a/.kokoro/docs/websecurityscanner.cfg b/.kokoro/docs/websecurityscanner.cfg deleted file mode 100644 index 221d1fc23d6b..000000000000 --- a/.kokoro/docs/websecurityscanner.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "websecurityscanner" -} diff --git a/.kokoro/presubmit/automl.cfg b/.kokoro/presubmit/automl.cfg deleted file mode 100644 index 5081664abb56..000000000000 --- a/.kokoro/presubmit/automl.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "automl" -} diff --git a/.kokoro/presubmit/cloudbuild.cfg b/.kokoro/presubmit/cloudbuild.cfg deleted file mode 100644 index 695ad3787290..000000000000 --- a/.kokoro/presubmit/cloudbuild.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "cloudbuild" -} diff --git a/.kokoro/presubmit/container.cfg b/.kokoro/presubmit/container.cfg deleted file mode 100644 index 8d06b5285bf2..000000000000 --- a/.kokoro/presubmit/container.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "container" -} diff --git a/.kokoro/presubmit/containeranalysis.cfg b/.kokoro/presubmit/containeranalysis.cfg deleted file mode 100644 index ae80ed8d8bc6..000000000000 --- a/.kokoro/presubmit/containeranalysis.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "containeranalysis" -} diff --git a/.kokoro/presubmit/datacatalog.cfg b/.kokoro/presubmit/datacatalog.cfg deleted file mode 100644 index fc0371e5eb11..000000000000 --- a/.kokoro/presubmit/datacatalog.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "datacatalog" -} diff --git a/.kokoro/presubmit/datalabeling.cfg b/.kokoro/presubmit/datalabeling.cfg deleted file mode 100644 index a1c53b81884b..000000000000 --- a/.kokoro/presubmit/datalabeling.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "datalabeling" -} diff --git a/.kokoro/presubmit/dlp.cfg b/.kokoro/presubmit/dlp.cfg deleted file mode 100644 index 931126d3e719..000000000000 --- a/.kokoro/presubmit/dlp.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "dlp" -} diff --git a/.kokoro/presubmit/dns.cfg b/.kokoro/presubmit/dns.cfg deleted file mode 100644 index 845e3e148060..000000000000 --- a/.kokoro/presubmit/dns.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "dns" -} diff --git a/.kokoro/presubmit/documentai.cfg b/.kokoro/presubmit/documentai.cfg deleted file mode 100644 index c374e377c2cf..000000000000 --- a/.kokoro/presubmit/documentai.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "documentai" -} diff --git a/.kokoro/presubmit/texttospeech.cfg b/.kokoro/presubmit/texttospeech.cfg deleted file mode 100644 index 9e7d6d7f7980..000000000000 --- a/.kokoro/presubmit/texttospeech.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "texttospeech" -} diff --git a/.kokoro/presubmit/translate.cfg b/.kokoro/presubmit/translate.cfg deleted file mode 100644 index 807c96195b41..000000000000 --- a/.kokoro/presubmit/translate.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "translate" -} diff --git a/.kokoro/presubmit/webrisk.cfg b/.kokoro/presubmit/webrisk.cfg deleted file mode 100644 index 36b06f0b0b55..000000000000 --- a/.kokoro/presubmit/webrisk.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "webrisk" -} diff --git a/.kokoro/presubmit/websecurityscanner.cfg b/.kokoro/presubmit/websecurityscanner.cfg deleted file mode 100644 index 221d1fc23d6b..000000000000 --- a/.kokoro/presubmit/websecurityscanner.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "websecurityscanner" -} diff --git a/.kokoro/release/automl.cfg b/.kokoro/release/automl.cfg deleted file mode 100644 index 5081664abb56..000000000000 --- a/.kokoro/release/automl.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "automl" -} diff --git a/.kokoro/release/cloudbuild.cfg b/.kokoro/release/cloudbuild.cfg deleted file mode 100644 index 695ad3787290..000000000000 --- a/.kokoro/release/cloudbuild.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "cloudbuild" -} diff --git a/.kokoro/release/container.cfg b/.kokoro/release/container.cfg deleted file mode 100644 index 8d06b5285bf2..000000000000 --- a/.kokoro/release/container.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "container" -} diff --git a/.kokoro/release/containeranalysis.cfg b/.kokoro/release/containeranalysis.cfg deleted file mode 100644 index ae80ed8d8bc6..000000000000 --- a/.kokoro/release/containeranalysis.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "containeranalysis" -} diff --git a/.kokoro/release/datacatalog.cfg b/.kokoro/release/datacatalog.cfg deleted file mode 100644 index fc0371e5eb11..000000000000 --- a/.kokoro/release/datacatalog.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "datacatalog" -} diff --git a/.kokoro/release/datalabeling.cfg b/.kokoro/release/datalabeling.cfg deleted file mode 100644 index a1c53b81884b..000000000000 --- a/.kokoro/release/datalabeling.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "datalabeling" -} diff --git a/.kokoro/release/dlp.cfg b/.kokoro/release/dlp.cfg deleted file mode 100644 index 931126d3e719..000000000000 --- a/.kokoro/release/dlp.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "dlp" -} diff --git a/.kokoro/release/dns.cfg b/.kokoro/release/dns.cfg deleted file mode 100644 index 845e3e148060..000000000000 --- a/.kokoro/release/dns.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "dns" -} diff --git a/.kokoro/release/documentai.cfg b/.kokoro/release/documentai.cfg deleted file mode 100644 index c374e377c2cf..000000000000 --- a/.kokoro/release/documentai.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "documentai" -} diff --git a/.kokoro/release/texttospeech.cfg b/.kokoro/release/texttospeech.cfg deleted file mode 100644 index 9e7d6d7f7980..000000000000 --- a/.kokoro/release/texttospeech.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "texttospeech" -} diff --git a/.kokoro/release/translate.cfg b/.kokoro/release/translate.cfg deleted file mode 100644 index 807c96195b41..000000000000 --- a/.kokoro/release/translate.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "translate" -} diff --git a/.kokoro/release/webrisk.cfg b/.kokoro/release/webrisk.cfg deleted file mode 100644 index 36b06f0b0b55..000000000000 --- a/.kokoro/release/webrisk.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "webrisk" -} diff --git a/.kokoro/release/websecurityscanner.cfg b/.kokoro/release/websecurityscanner.cfg deleted file mode 100644 index 221d1fc23d6b..000000000000 --- a/.kokoro/release/websecurityscanner.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Tell the trampoline which build file to use. -env_vars: { - key: "PACKAGE" - value: "websecurityscanner" -} diff --git a/README.rst b/README.rst index 49098ecf3728..063b8fc4ffa9 100644 --- a/README.rst +++ b/README.rst @@ -83,7 +83,7 @@ The following client libraries have **GA** support: .. _Tasks Documentation: https://googleapis.dev/python/cloudtasks/latest .. _Google Cloud Translation: https://pypi.org/project/google-cloud-translate/ -.. _Translation README: https://github.com/googleapis/google-cloud-python/tree/master/translate +.. _Translation README: https://github.com/googleapis/python-translate#python-client-for-google-cloud-translation .. _Translation Documentation: https://googleapis.dev/python/translation/latest .. _Google Cloud Scheduler: https://pypi.org/project/google-cloud-scheduler/ @@ -106,6 +106,7 @@ The following client libraries have **beta** support: - `Google Cloud Asset`_ (`Asset README`_, `Asset Documentation`_) - `Google Cloud Billing Budgets`_ (`Billing Budgets README`_, `Billing Budgets Documentation`_) - `Google Cloud Data Catalog`_ (`Data Catalog README`_, `Data Catalog Documentation`_) +- `Google Cloud Data Labeling`_ (`Data Labeling README`_, `Data Labeling Documentation`_) - `Google Cloud Firestore`_ (`Firestore README`_, `Firestore Documentation`_) - `Google Cloud Video Intelligence`_ (`Video Intelligence README`_, `Video Intelligence Documentation`_) - `Google Cloud Vision`_ (`Vision README`_, `Vision Documentation`_) @@ -119,9 +120,13 @@ The following client libraries have **beta** support: .. _Billing Budgets Documentation: https://googleapis.dev/python/billingbudgets/latest .. _Google Cloud Data Catalog: https://pypi.org/project/google-cloud-datacatalog/ -.. _Data Catalog README: https://github.com/googleapis/google-cloud-python/tree/master/datacatalog +.. _Data Catalog README: https://github.com/googleapis/python-datacatalog .. _Data Catalog Documentation: https://googleapis.dev/python/datacatalog/latest +.. _Google Cloud Data Labeling: https://pypi.org/project/google-cloud-datalabeling/ +.. _Data Labeling README: https://github.com/googleapis/python-datalabeling#python-client-for-data-labeling-api-beta +.. _Data Labeling Documentation: https://googleapis.dev/python/datalabeling/latest + .. _Google Cloud Firestore: https://pypi.org/project/google-cloud-firestore/ .. _Firestore README: https://github.com/googleapis/python-firestore .. _Firestore Documentation: https://googleapis.dev/python/firestore/latest @@ -164,9 +169,10 @@ The following client libraries have **alpha** support: - `Grafeas`_ (`Grafeas README`_, `Grafeas Documentation`_) - `Stackdriver Error Reporting`_ (`Error Reporting README`_, `Error Reporting Documentation`_) - `Stackdriver Monitoring`_ (`Monitoring README`_, `Monitoring Documentation`_) +- `Webrisk`_ (`Webrisk README`_, `Webrisk Documentation`_) .. _Google Cloud AutoML: https://pypi.org/project/google-cloud-automl/ -.. _AutoML README: https://github.com/googleapis/google-cloud-python/blob/master/automl +.. _AutoML README: https://github.com/googleapis/python-automl .. _AutoML Documentation: https://googleapis.dev/python/automl/latest .. _Google BigQuery Data Transfer: https://pypi.org/project/google-cloud-bigquery-datatransfer/ @@ -178,15 +184,15 @@ The following client libraries have **alpha** support: .. _HappyBase Documentation: https://google-cloud-python-happybase.readthedocs.io/en/latest/ .. _Google Cloud Build: https://pypi.org/project/google-cloud-build/ -.. _Cloud Build README: https://github.com/googleapis/google-cloud-python/cloudbuild +.. _Cloud Build README: https://github.com/googleapis/python-cloudbuild .. _Cloud Build Documentation: https://googleapis.dev/python/cloudbuild/latest .. _Google Cloud Container: https://pypi.org/project/google-cloud-container/ -.. _Container README: https://github.com/googleapis/google-cloud-python/tree/master/container +.. _Container README: https://github.com/googleapis/python-container .. _Container Documentation: https://googleapis.dev/python/container/latest .. _Google Cloud Container Analysis: https://pypi.org/project/google-cloud-containeranalysis/ -.. _Container Analysis README: https://github.com/googleapis/google-cloud-python/tree/master/containeranalysis +.. _Container Analysis README: https://github.com/googleapis/python-containeranalysis .. _Container Analysis Documentation: https://googleapis.dev/python/containeranalysis/latest .. _Google Cloud Dataproc: https://pypi.org/project/google-cloud-dataproc/ @@ -194,11 +200,11 @@ The following client libraries have **alpha** support: .. _Dataproc Documentation: https://googleapis.dev/python/dataproc/latest .. _Google Cloud DLP: https://pypi.org/project/google-cloud-dlp/ -.. _DLP README: https://github.com/googleapis/google-cloud-python/tree/master/dlp +.. _DLP README: https://github.com/googleapis/python-dlp#python-client-for-cloud-data-loss-prevention-dlp-api .. _DLP Documentation: https://googleapis.dev/python/dlp/latest .. _Google Cloud DNS: https://pypi.org/project/google-cloud-dns/ -.. _DNS README: https://github.com/googleapis/google-cloud-python/tree/master/dns +.. _DNS README: https://github.com/googleapis/python-dns#python-client-for-google-cloud-dns .. _DNS Documentation: https://googleapis.dev/python/dns/latest .. _Google Cloud IoT: https://pypi.org/project/google-cloud-iot/ @@ -226,7 +232,7 @@ The following client libraries have **alpha** support: .. _Security Scanner Documentation: https://googleapis.dev/python/websecurityscanner/latest .. _Google Cloud Text-to-Speech: https://pypi.org/project/google-cloud-texttospeech/ -.. _Text-to-Speech README: https://github.com/googleapis/google-cloud-python/tree/master/texttospeech +.. _Text-to-Speech README: https://github.com/googleapis/python-texttospeech#python-client-for-cloud-text-to-speech-api .. _Text-to-Speech Documentation: https://googleapis.dev/python/texttospeech/latest .. _Google Cloud Trace: https://pypi.org/project/google-cloud-trace/ @@ -245,6 +251,10 @@ The following client libraries have **alpha** support: .. _Monitoring README: https://github.com/googleapis/google-cloud-python/tree/master/monitoring .. _Monitoring Documentation: https://googleapis.dev/python/monitoring/latest +.. _Webrisk: https://pypi.org/project/google-cloud-webrisk +.. _Webrisk README: https://github.com/googleapis/python-webrisk#python-client-for-web-risk-api-alpha +.. _Webrisk Documentation: https://googleapis.dev/python/webrisk/latest + .. _versioning: https://github.com/googleapis/google-cloud-python/blob/master/CONTRIBUTING.rst#versioning If you need support for other Google APIs, check out the diff --git a/automl/.coveragerc b/automl/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/automl/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/automl/.flake8 b/automl/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/automl/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/automl/.repo-metadata.json b/automl/.repo-metadata.json deleted file mode 100644 index 6d94acb2d745..000000000000 --- a/automl/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "automl", - "name_pretty": "Cloud AutoML", - "product_documentation": "https://cloud.google.com/automl/docs/", - "client_documentation": "https://googleapis.dev/python/automl/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559744", - "release_level": "alpha", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-automl", - "api_id": "automl.googleapis.com", - "requires_billing": true -} \ No newline at end of file diff --git a/automl/CHANGELOG.md b/automl/CHANGELOG.md deleted file mode 100644 index 9a65baa3be5b..000000000000 --- a/automl/CHANGELOG.md +++ /dev/null @@ -1,208 +0,0 @@ -# Changelog - -[PyPI History][1] - -[1]: https://pypi.org/project/google-cloud-automl/#history - -## 0.9.0 - -11-18-2019 09:49 PST - -### Implementation Changes -- Change proto imports (via synth). ([#9817](https://github.com/googleapis/google-cloud-python/pull/9817)) -- Pass params passed to `tables_client` to underlying client. ([#9794](https://github.com/googleapis/google-cloud-python/pull/9794)) - -### New Features -- Add support for `feature_importance` to `TablesClient`. ([#9816](https://github.com/googleapis/google-cloud-python/pull/9816)) - -### Documentation -- Fix typo in code example for AutoML Tables. ([#9806](https://github.com/googleapis/google-cloud-python/pull/9806)) -- Update docs templates (via synth). ([#9797](https://github.com/googleapis/google-cloud-python/pull/9797)) - -## 0.8.0 - -11-13-2019 13:44 PST - -### Implementation Changes -- Fix uploading pandas dataframe to AutoML Tables. ([#9647](https://github.com/googleapis/google-cloud-python/pull/9647)) - -### New Features -- Add support for image classification, image object detection, text classification, text extraction. (via synth). ([#9628](https://github.com/googleapis/google-cloud-python/pull/9628)) -- Add `batch_predict`. (via synth). ([#9628](https://github.com/googleapis/google-cloud-python/pull/9628)) -- Add `deploy_model`, `undeploy_model`, `export_model`. (via synth). ([#9628](https://github.com/googleapis/google-cloud-python/pull/9628)) -- Add annotation specs (via synth). ([#9628](https://github.com/googleapis/google-cloud-python/pull/9628)) -- Expose `disable_early_stopping` option for `create_model`. ([#9779](https://github.com/googleapis/google-cloud-python/pull/9779)) - -### Documentation -- Add python 2 sunset banner to documentation. ([#9036](https://github.com/googleapis/google-cloud-python/pull/9036)) - -### Internal / Testing Changes -- Normalize VPCSC configuration in systests. ([#9607](https://github.com/googleapis/google-cloud-python/pull/9607)) -- Fix docstring formatting. ([#9793](https://github.com/googleapis/google-cloud-python/pull/9793)) - -## 0.7.1 - -10-29-2019 13:45 PDT - - -### Implementation Changes -- Pass credentials to underlying clients in TableClient ([#9491](https://github.com/googleapis/google-cloud-python/pull/9491)) - -## 0.7.0 - -10-04-2019 15:37 PDT - -### Implementation Changes -- Return operation future from `AutoMlClient.create_dataset` (via synth).([#9423](https://github.com/googleapis/google-cloud-python/pull/9423)) - - -### New Features -- Add support for V1 API (via synth). ([#9388](https://github.com/googleapis/google-cloud-python/pull/9388)) -- Add support for passing project to 'GcsClient'. ([#9299](https://github.com/googleapis/google-cloud-python/pull/9299)) - -## 0.6.0 - -09-30-2019 10:40 PDT - -### New Features -- Add 'image_classification_model_deployment_metadata' arg to 'AutoMlClient.deploy_model' (via synth). ([#9291](https://github.com/googleapis/google-cloud-python/pull/9291)) - -### Documentation -- Fix intersphinx reference to requests. ([#9294](https://github.com/googleapis/google-cloud-python/pull/9294)) - -### Internal / Testing Changes -- Preserve GcsClient, 'pandas' extras in testing (via synth). ([#9179](https://github.com/googleapis/google-cloud-python/pull/9179)) - -## 0.5.0 - -08-28-2019 14:07 PDT - -### Implementation Changes -- Catch exceptions in GcsClient when a same name bucket already exists in a different project ([#9139](https://github.com/googleapis/google-cloud-python/pull/9139)) -- Log when LROs are kicked off. ([#9058](https://github.com/googleapis/google-cloud-python/pull/9058)) -- Throw a ValueError when an ambiguous display_name is used ([#9089](https://github.com/googleapis/google-cloud-python/pull/9089)) -- Remove send/recv msg size limit (via synth). ([#8944](https://github.com/googleapis/google-cloud-python/pull/8944)) - -### New Features -- Enable users to pass in Pandas Dataframe when calling import_data() and batch_predict() from AutoML Tables client ([#9116](https://github.com/googleapis/google-cloud-python/pull/9116)) -- Add support for documents (via synth). ([#9039](https://github.com/googleapis/google-cloud-python/pull/9039)) -- Add a TablesClient for automl-tables specific behavior. ([#8720](https://github.com/googleapis/google-cloud-python/pull/8720)) -- Add 'ClassificationEvaluationMetrics.display_name'/'BatchPredictResult.metadata'/'TableSpec.valid_row_count' (via synth) ([#9004](https://github.com/googleapis/google-cloud-python/pull/9004)) - -### Documentation -- Remove compatability badges from READMEs. ([#9035](https://github.com/googleapis/google-cloud-python/pull/9035)) - -### Internal / Testing Changes -- Remove CI for gh-pages, use googleapis.dev for api_core refs. ([#9085](https://github.com/googleapis/google-cloud-python/pull/9085)) -- Skip relevant system tests if in VPCSC ([#9111](https://github.com/googleapis/google-cloud-python/pull/9111)) -- Fix synth replace to add TablesClient. ([#9033](https://github.com/googleapis/google-cloud-python/pull/9033)) -- Update intersphinx mapping for requests. ([#8805](https://github.com/googleapis/google-cloud-python/pull/8805)) - -## 0.4.0 - -07-22-2019 17:39 PDT - - -### New Features -- Add support for 'TablesModelMetadata.{optimization_objective_recall_value,optimization_objective_precision_value}' (via synth). ([#8643](https://github.com/googleapis/google-cloud-python/pull/8643)) -- Add 'client_options' support, update list method docstrings (via synth). ([#8533](https://github.com/googleapis/google-cloud-python/pull/8533)) - -### Dependencies -- Bump minimum version for google-api-core to 1.14.0. ([#8709](https://github.com/googleapis/google-cloud-python/pull/8709)) - -### Documentation -- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705)) -- Add compatibility check badges to READMEs. ([#8288](https://github.com/googleapis/google-cloud-python/pull/8288)) - -### Internal / Testing Changes -- Pin black version (via synth). ([#8573](https://github.com/googleapis/google-cloud-python/pull/8573)) -- Update Ruby package name (via synth). ([#8485](https://github.com/googleapis/google-cloud-python/pull/8485)) -- All: Add docs job to publish to googleapis.dev. ([#8464](https://github.com/googleapis/google-cloud-python/pull/8464)) - -## 0.3.0 - -06-20-2019 14:47 PDT - - -### New Features -- Add support for video object tracking (via synth). ([#8278](https://github.com/googleapis/google-cloud-python/pull/8278)) - -### Documentation -- Add proto files; add 'docs' session to 'nox'; update docstrings (via synth). ([#8029](https://github.com/googleapis/google-cloud-python/pull/8029)) - -### Internal / Testing Changes -- Suppress checking 'cov-fail-under' in nox default session (via synth). ([#8233](https://github.com/googleapis/google-cloud-python/pull/8233)) -- Fix coverage in 'types.py'. ([#8145](https://github.com/googleapis/google-cloud-python/pull/8145)) -- Blacken noxfile.py, setup.py (via synth). ([#8115](https://github.com/googleapis/google-cloud-python/pull/8115)) -- Add empty lines (via synth). ([#8048](https://github.com/googleapis/google-cloud-python/pull/8048)) -- Use alabaster theme everwhere. ([#8021](https://github.com/googleapis/google-cloud-python/pull/8021)) -- Include protos in synth. ([#8000](https://github.com/googleapis/google-cloud-python/pull/8000)) - -## 0.2.0 - -04-03-2019 09:16 PDT - - -### Implementation Changes -- Remove classifier for Python 3.4 for end-of-life. ([#7535](https://github.com/googleapis/google-cloud-python/pull/7535)) -- Sort generated classes (via synth). ([#7256](https://github.com/googleapis/google-cloud-python/pull/7256)) -- Protoc-generated serialization update. ([#7074](https://github.com/googleapis/google-cloud-python/pull/7074)) - -### New Features -- Video Classification, Text Extraction, Text Sentiment, Tables support. ([#7650](https://github.com/googleapis/google-cloud-python/pull/7650)) - -### Documentation -- Updated client library documentation URLs. ([#7307](https://github.com/googleapis/google-cloud-python/pull/7307)) -- AutoML: pick up stub docstring fix in GAPIC generator. ([#6964](https://github.com/googleapis/google-cloud-python/pull/6964)) - -### Internal / Testing Changes -- Update copyright headers - -## 0.1.2 - -12-17-2018 16:27 PST - - -### Implementation Changes -- Add protoc-generated descriptor changes from updated .proto files. ([#6899](https://github.com/googleapis/google-cloud-python/pull/6899)) -- Import `iam.policy` from `google.api_core.iam.policy`. ([#6741](https://github.com/googleapis/google-cloud-python/pull/6741)) -- Pick up fixes in GAPIC generator. ([#6490](https://github.com/googleapis/google-cloud-python/pull/6490)) -- Assorted synth fixups / cleanups ([#6400](https://github.com/googleapis/google-cloud-python/pull/6400)) -- Fix client_info bug, update docstrings. ([#6404](https://github.com/googleapis/google-cloud-python/pull/6404)) -- Re-generate library using automl/synth.py ([#5972](https://github.com/googleapis/google-cloud-python/pull/5972)) -- Re-generate library using automl/synth.py ([#5946](https://github.com/googleapis/google-cloud-python/pull/5946)) - -### Dependencies -- Add 'mock' to unit test dependencies for autogen libs. ([#6402](https://github.com/googleapis/google-cloud-python/pull/6402)) -- Bump minimum `api_core`' version for all GAPIC libs to 1.4.1. ([#6391](https://github.com/googleapis/google-cloud-python/pull/6391)) -- Avoid broken 'google-common-apis 1.5.4' release. ([#6355](https://github.com/googleapis/google-cloud-python/pull/6355)) - -### Documentation -- Document Python 2 deprecation ([#6910](https://github.com/googleapis/google-cloud-python/pull/6910)) -- Harmonize / DRY 'README.rst' / 'docs/index.rst'. ([#6005](https://github.com/googleapis/google-cloud-python/pull/6005)) -- Replace links to '/stable/' with '/latest/'. ([#5901](https://github.com/googleapis/google-cloud-python/pull/5901)) - -### Internal / Testing Changes -- Update noxfile. -- Blacken all gen'd libs ([#6792](https://github.com/googleapis/google-cloud-python/pull/6792)) -- Omit local deps ([#6701](https://github.com/googleapis/google-cloud-python/pull/6701)) -- Run black at end of synth.py ([#6698](https://github.com/googleapis/google-cloud-python/pull/6698)) -- Unblack automl gapic and protos. -- Run Black on Generated libraries ([#6666](https://github.com/googleapis/google-cloud-python/pull/6666)) -- Add templates for flake8, coveragerc, noxfile, and black. ([#6642](https://github.com/googleapis/google-cloud-python/pull/6642)) -- Add synth metadata. ([#6561](https://github.com/googleapis/google-cloud-python/pull/6561)) -- Normalize use of support level badges ([#6159](https://github.com/googleapis/google-cloud-python/pull/6159)) -- Add / fix badges for PyPI / versions. ([#6158](https://github.com/googleapis/google-cloud-python/pull/6158)) -- Use new Nox ([#6175](https://github.com/googleapis/google-cloud-python/pull/6175)) - -## 0.1.1 - -### Documentation -- Fix broken links (#5675) -- bad trove classifier (#5648) - -## 0.1.0 - -### New Features -- Initial Release of AutoML v1beta1 - diff --git a/automl/LICENSE b/automl/LICENSE deleted file mode 100644 index a8ee855de2aa..000000000000 --- a/automl/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/automl/MANIFEST.in b/automl/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/automl/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/automl/README.rst b/automl/README.rst deleted file mode 100644 index ecf4052479a1..000000000000 --- a/automl/README.rst +++ /dev/null @@ -1,131 +0,0 @@ -Python Client for Cloud AutoML API -================================== - -|alpha| |pypi| |versions| - -The `Cloud AutoML API`_ is a suite of machine learning products that enables -developers with limited machine learning expertise to train high-quality models -specific to their business needs, by leveraging Google’s state-of-the-art -transfer learning, and Neural Architecture Search technology. - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. |alpha| image:: https://img.shields.io/badge/support-alpha-orange.svg - :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#alpha-support -.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-automl.svg - :target: https://pypi.org/project/google-cloud-automl/ -.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-automl.svg - :target: https://pypi.org/project/google-cloud-automl/ -.. _Cloud AutoML API: https://cloud.google.com/automl -.. _Client Library Documentation: https://googleapis.dev/python/automl/latest -.. _Product Documentation: https://cloud.google.com/automl - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the Cloud AutoML API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Cloud AutoML API.: https://cloud.google.com/automl -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Supported Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.5 - -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7. Python 2.7 support will be removed on January 1, 2020. - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-automl - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-automl - -Example Usage -~~~~~~~~~~~~~ - -.. code-block:: python - - from google.cloud.automl_v1beta1 import PredictionServiceClient - - client = PredictionServiceClient() - model_path = client.model_path('my-project-123', 'us-central', 'model-name') - payload = {...} - params = {'foo': 1} - response = client.predict(model_path, payload, params=params) - -Next Steps -~~~~~~~~~~ - -- Read the `Client Library Documentation`_ for Cloud AutoML API - API to see other available methods on the client. -- Read the `Product documentation`_ to learn - more about the product and see How-to Guides. - -Making & Testing Local Changes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If you want to make changes to this library, here is how to set up your -development environment: - -1. Make sure you have `virtualenv`_ installed and activated as shown above. -2. Run the following one-time setup (it will be persisted in your virtualenv): - - .. code-block:: console - - pip install -r ../docs/requirements.txt - pip install -U nox mock pytest - -3. If you want to run all tests, you will need a billing-enabled - `GCP project`_, and a `service account`_ with access to the AutoML APIs. - Note: the first time the tests run in a new project it will take a _long_ - time, on the order of 2-3 hours. This is one-time setup that will be skipped - in future runs. - -.. _service account: https://cloud.google.com/iam/docs/creating-managing-service-accounts -.. _GCP project: https://cloud.google.com/resource-manager/docs/creating-managing-projects - -.. code-block:: console - - export PROJECT_ID= GOOGLE_APPLICATION_CREDENTIALS= - nox - diff --git a/automl/docs/README.rst b/automl/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/automl/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/automl/docs/_static/custom.css b/automl/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/automl/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/automl/docs/_templates/layout.html b/automl/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/automl/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/automl/docs/changelog.md b/automl/docs/changelog.md deleted file mode 120000 index 04c99a55caae..000000000000 --- a/automl/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../CHANGELOG.md \ No newline at end of file diff --git a/automl/docs/conf.py b/automl/docs/conf.py deleted file mode 100644 index dab151417fa9..000000000000 --- a/automl/docs/conf.py +++ /dev/null @@ -1,363 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-automl documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-automl" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-automl-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-automl.tex", - u"google-cloud-automl Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - master_doc, - "google-cloud-automl", - u"google-cloud-automl Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-automl", - u"google-cloud-automl Documentation", - author, - "google-cloud-automl", - "GAPIC library for the {metadata.shortName} v1 service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/master/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/automl/docs/gapic/v1/api.rst b/automl/docs/gapic/v1/api.rst deleted file mode 100644 index 757fc1a0f456..000000000000 --- a/automl/docs/gapic/v1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud AutoML API -=========================== - -.. automodule:: google.cloud.automl_v1 - :members: - :inherited-members: \ No newline at end of file diff --git a/automl/docs/gapic/v1/types.rst b/automl/docs/gapic/v1/types.rst deleted file mode 100644 index 5fd25134fc13..000000000000 --- a/automl/docs/gapic/v1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud AutoML API Client -================================= - -.. automodule:: google.cloud.automl_v1.types - :members: \ No newline at end of file diff --git a/automl/docs/gapic/v1beta1/api.rst b/automl/docs/gapic/v1beta1/api.rst deleted file mode 100644 index 268baa5b798c..000000000000 --- a/automl/docs/gapic/v1beta1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud AutoML API -=========================== - -.. automodule:: google.cloud.automl_v1beta1 - :members: - :inherited-members: \ No newline at end of file diff --git a/automl/docs/gapic/v1beta1/tables.rst b/automl/docs/gapic/v1beta1/tables.rst deleted file mode 100644 index 54ed6a203805..000000000000 --- a/automl/docs/gapic/v1beta1/tables.rst +++ /dev/null @@ -1,5 +0,0 @@ -A tables-specific client for AutoML -=================================== - -.. automodule:: google.cloud.automl_v1beta1.tables.tables_client - :members: diff --git a/automl/docs/gapic/v1beta1/types.rst b/automl/docs/gapic/v1beta1/types.rst deleted file mode 100644 index 27ce6644bcc5..000000000000 --- a/automl/docs/gapic/v1beta1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud AutoML API Client -================================= - -.. automodule:: google.cloud.automl_v1beta1.types - :members: \ No newline at end of file diff --git a/automl/docs/index.rst b/automl/docs/index.rst deleted file mode 100644 index 90c2bfd56246..000000000000 --- a/automl/docs/index.rst +++ /dev/null @@ -1,37 +0,0 @@ -.. include:: README.rst - -This package includes clients for multiple versions of the Cloud AutoML API. -By default, you will get ``v1``, the latest stable version. - -v1 API Reference ------------------------- -.. toctree:: - :maxdepth: 2 - - gapic/v1/api - gapic/v1/types - -Previous beta release v1beta1 is provided as well. - -An API and type reference is provided for ``v1beta1``: - -v1beta1 API Reference ----------------------- -.. toctree:: - :maxdepth: 2 - - gapic/v1beta1/api - gapic/v1beta1/types - gapic/v1beta1/tables - - - -Changelog ---------- - -For a list of all ``google-cloud-automl`` releases: - -.. toctree:: - :maxdepth: 2 - - changelog diff --git a/automl/google/__init__.py b/automl/google/__init__.py deleted file mode 100644 index dd3a9f485275..000000000000 --- a/automl/google/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/automl/google/cloud/__init__.py b/automl/google/cloud/__init__.py deleted file mode 100644 index dd3a9f485275..000000000000 --- a/automl/google/cloud/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/automl/google/cloud/automl.py b/automl/google/cloud/automl.py deleted file mode 100644 index c1dc4ee784b9..000000000000 --- a/automl/google/cloud/automl.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import - -from google.cloud.automl_v1 import AutoMlClient -from google.cloud.automl_v1 import PredictionServiceClient -from google.cloud.automl_v1 import enums -from google.cloud.automl_v1 import types - - -__all__ = ("enums", "types", "AutoMlClient", "PredictionServiceClient") diff --git a/automl/google/cloud/automl_v1/__init__.py b/automl/google/cloud/automl_v1/__init__.py deleted file mode 100644 index a663f191efd4..000000000000 --- a/automl/google/cloud/automl_v1/__init__.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.automl_v1 import types -from google.cloud.automl_v1.gapic import auto_ml_client -from google.cloud.automl_v1.gapic import enums -from google.cloud.automl_v1.gapic import prediction_service_client - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class AutoMlClient(auto_ml_client.AutoMlClient): - __doc__ = auto_ml_client.AutoMlClient.__doc__ - enums = enums - - -class PredictionServiceClient(prediction_service_client.PredictionServiceClient): - __doc__ = prediction_service_client.PredictionServiceClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "AutoMlClient", "PredictionServiceClient") diff --git a/automl/google/cloud/automl_v1/gapic/__init__.py b/automl/google/cloud/automl_v1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/automl/google/cloud/automl_v1/gapic/auto_ml_client.py b/automl/google/cloud/automl_v1/gapic/auto_ml_client.py deleted file mode 100644 index c1f6ed3ddf4d..000000000000 --- a/automl/google/cloud/automl_v1/gapic/auto_ml_client.py +++ /dev/null @@ -1,1898 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.cloud.automl.v1 AutoMl API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.operation -import google.api_core.operations_v1 -import google.api_core.page_iterator -import google.api_core.path_template -import google.api_core.protobuf_helpers -import grpc - -from google.cloud.automl_v1.gapic import auto_ml_client_config -from google.cloud.automl_v1.gapic import enums -from google.cloud.automl_v1.gapic.transports import auto_ml_grpc_transport -from google.cloud.automl_v1.proto import annotation_spec_pb2 -from google.cloud.automl_v1.proto import dataset_pb2 -from google.cloud.automl_v1.proto import image_pb2 -from google.cloud.automl_v1.proto import io_pb2 -from google.cloud.automl_v1.proto import model_evaluation_pb2 -from google.cloud.automl_v1.proto import model_pb2 -from google.cloud.automl_v1.proto import operations_pb2 as proto_operations_pb2 -from google.cloud.automl_v1.proto import service_pb2 -from google.cloud.automl_v1.proto import service_pb2_grpc -from google.longrunning import operations_pb2 as longrunning_operations_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-automl").version - - -class AutoMlClient(object): - """ - AutoML Server API. - - The resource names are assigned by the server. The server never reuses - names that it has created after the resources with those names are - deleted. - - An ID of a resource is the last element of the item's resource name. For - ``projects/{project_id}/locations/{location_id}/datasets/{dataset_id}``, - then the id for the item is ``{dataset_id}``. - - Currently the only supported ``location_id`` is "us-central1". - - On any input that is documented to expect a string parameter in - snake\_case or kebab-case, either of those cases is accepted. - """ - - SERVICE_ADDRESS = "automl.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.automl.v1.AutoMl" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - AutoMlClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def annotation_spec_path(cls, project, location, dataset, annotation_spec): - """Return a fully-qualified annotation_spec string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}", - project=project, - location=location, - dataset=dataset, - annotation_spec=annotation_spec, - ) - - @classmethod - def dataset_path(cls, project, location, dataset): - """Return a fully-qualified dataset string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/datasets/{dataset}", - project=project, - location=location, - dataset=dataset, - ) - - @classmethod - def location_path(cls, project, location): - """Return a fully-qualified location string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}", - project=project, - location=location, - ) - - @classmethod - def model_path(cls, project, location, model): - """Return a fully-qualified model string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/models/{model}", - project=project, - location=location, - model=model, - ) - - @classmethod - def model_evaluation_path(cls, project, location, model, model_evaluation): - """Return a fully-qualified model_evaluation string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}", - project=project, - location=location, - model=model, - model_evaluation=model_evaluation, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.AutoMlGrpcTransport, - Callable[[~.Credentials, type], ~.AutoMlGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = auto_ml_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=auto_ml_grpc_transport.AutoMlGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = auto_ml_grpc_transport.AutoMlGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def create_dataset( - self, - parent, - dataset, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a dataset. - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.AutoMlClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `dataset`: - >>> dataset = {} - >>> - >>> response = client.create_dataset(parent, dataset) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - parent (str): The resource name of the project to create the dataset for. - dataset (Union[dict, ~google.cloud.automl_v1.types.Dataset]): The dataset to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1.types.Dataset` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_dataset" not in self._inner_api_calls: - self._inner_api_calls[ - "create_dataset" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_dataset, - default_retry=self._method_configs["CreateDataset"].retry, - default_timeout=self._method_configs["CreateDataset"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.CreateDatasetRequest(parent=parent, dataset=dataset) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["create_dataset"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - dataset_pb2.Dataset, - metadata_type=proto_operations_pb2.OperationMetadata, - ) - - def update_dataset( - self, - dataset, - update_mask, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates a dataset. - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.AutoMlClient() - >>> - >>> # TODO: Initialize `dataset`: - >>> dataset = {} - >>> - >>> # TODO: Initialize `update_mask`: - >>> update_mask = {} - >>> - >>> response = client.update_dataset(dataset, update_mask) - - Args: - dataset (Union[dict, ~google.cloud.automl_v1.types.Dataset]): The dataset which replaces the resource on the server. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1.types.Dataset` - update_mask (Union[dict, ~google.cloud.automl_v1.types.FieldMask]): Required. The update mask applies to the resource. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1.types.Dataset` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_dataset" not in self._inner_api_calls: - self._inner_api_calls[ - "update_dataset" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_dataset, - default_retry=self._method_configs["UpdateDataset"].retry, - default_timeout=self._method_configs["UpdateDataset"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.UpdateDatasetRequest( - dataset=dataset, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("dataset.name", dataset.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_dataset"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_dataset( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a dataset. - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.AutoMlClient() - >>> - >>> name = client.dataset_path('[PROJECT]', '[LOCATION]', '[DATASET]') - >>> - >>> response = client.get_dataset(name) - - Args: - name (str): The resource name of the dataset to retrieve. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1.types.Dataset` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_dataset" not in self._inner_api_calls: - self._inner_api_calls[ - "get_dataset" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_dataset, - default_retry=self._method_configs["GetDataset"].retry, - default_timeout=self._method_configs["GetDataset"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.GetDatasetRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_dataset"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_datasets( - self, - parent, - filter_=None, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists datasets in a project. - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.AutoMlClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # Iterate over all results - >>> for element in client.list_datasets(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_datasets(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): The resource name of the project from which to list datasets. - filter_ (str): 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. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.automl_v1.types.Dataset` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_datasets" not in self._inner_api_calls: - self._inner_api_calls[ - "list_datasets" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_datasets, - default_retry=self._method_configs["ListDatasets"].retry, - default_timeout=self._method_configs["ListDatasets"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.ListDatasetsRequest( - parent=parent, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_datasets"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="datasets", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def delete_dataset( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a dataset and all of its contents. Returns empty response in the - ``response`` field when it completes, and ``delete_details`` in the - ``metadata`` field. - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.AutoMlClient() - >>> - >>> name = client.dataset_path('[PROJECT]', '[LOCATION]', '[DATASET]') - >>> - >>> response = client.delete_dataset(name) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): The resource name of the dataset to delete. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_dataset" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_dataset" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_dataset, - default_retry=self._method_configs["DeleteDataset"].retry, - default_timeout=self._method_configs["DeleteDataset"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.DeleteDatasetRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["delete_dataset"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - empty_pb2.Empty, - metadata_type=proto_operations_pb2.OperationMetadata, - ) - - def import_data( - self, - name, - input_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Imports data into a dataset. - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.AutoMlClient() - >>> - >>> name = client.dataset_path('[PROJECT]', '[LOCATION]', '[DATASET]') - >>> - >>> # TODO: Initialize `input_config`: - >>> input_config = {} - >>> - >>> response = client.import_data(name, input_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. Dataset name. Dataset must already exist. All imported - annotations and examples will be added. - input_config (Union[dict, ~google.cloud.automl_v1.types.InputConfig]): Required. The desired input location and its domain specific semantics, - if any. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1.types.InputConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "import_data" not in self._inner_api_calls: - self._inner_api_calls[ - "import_data" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.import_data, - default_retry=self._method_configs["ImportData"].retry, - default_timeout=self._method_configs["ImportData"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.ImportDataRequest(name=name, input_config=input_config) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["import_data"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - empty_pb2.Empty, - metadata_type=proto_operations_pb2.OperationMetadata, - ) - - def export_data( - self, - name, - output_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Exports dataset's data to the provided output location. Returns an empty - response in the ``response`` field when it completes. - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.AutoMlClient() - >>> - >>> name = client.dataset_path('[PROJECT]', '[LOCATION]', '[DATASET]') - >>> - >>> # TODO: Initialize `output_config`: - >>> output_config = {} - >>> - >>> response = client.export_data(name, output_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. The resource name of the dataset. - output_config (Union[dict, ~google.cloud.automl_v1.types.OutputConfig]): Required. The desired output location. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1.types.OutputConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "export_data" not in self._inner_api_calls: - self._inner_api_calls[ - "export_data" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.export_data, - default_retry=self._method_configs["ExportData"].retry, - default_timeout=self._method_configs["ExportData"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.ExportDataRequest(name=name, output_config=output_config) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["export_data"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - empty_pb2.Empty, - metadata_type=proto_operations_pb2.OperationMetadata, - ) - - def get_annotation_spec( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets an annotation spec. - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.AutoMlClient() - >>> - >>> name = client.annotation_spec_path('[PROJECT]', '[LOCATION]', '[DATASET]', '[ANNOTATION_SPEC]') - >>> - >>> response = client.get_annotation_spec(name) - - Args: - name (str): The resource name of the annotation spec to retrieve. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1.types.AnnotationSpec` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_annotation_spec" not in self._inner_api_calls: - self._inner_api_calls[ - "get_annotation_spec" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_annotation_spec, - default_retry=self._method_configs["GetAnnotationSpec"].retry, - default_timeout=self._method_configs["GetAnnotationSpec"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.GetAnnotationSpecRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_annotation_spec"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_model( - self, - parent, - model, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a model. Returns a Model in the ``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. - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.AutoMlClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `model`: - >>> model = {} - >>> - >>> response = client.create_model(parent, model) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - parent (str): Resource name of the parent project where the model is being created. - model (Union[dict, ~google.cloud.automl_v1.types.Model]): The model to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1.types.Model` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_model" not in self._inner_api_calls: - self._inner_api_calls[ - "create_model" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_model, - default_retry=self._method_configs["CreateModel"].retry, - default_timeout=self._method_configs["CreateModel"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.CreateModelRequest(parent=parent, model=model) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["create_model"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - model_pb2.Model, - metadata_type=proto_operations_pb2.OperationMetadata, - ) - - def get_model( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a model. - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.AutoMlClient() - >>> - >>> name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]') - >>> - >>> response = client.get_model(name) - - Args: - name (str): Resource name of the model. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1.types.Model` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_model" not in self._inner_api_calls: - self._inner_api_calls[ - "get_model" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_model, - default_retry=self._method_configs["GetModel"].retry, - default_timeout=self._method_configs["GetModel"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.GetModelRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_model"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_model( - self, - model, - update_mask, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates a model. - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.AutoMlClient() - >>> - >>> # TODO: Initialize `model`: - >>> model = {} - >>> - >>> # TODO: Initialize `update_mask`: - >>> update_mask = {} - >>> - >>> response = client.update_model(model, update_mask) - - Args: - model (Union[dict, ~google.cloud.automl_v1.types.Model]): The model which replaces the resource on the server. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1.types.Model` - update_mask (Union[dict, ~google.cloud.automl_v1.types.FieldMask]): Required. The update mask applies to the resource. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1.types.Model` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_model" not in self._inner_api_calls: - self._inner_api_calls[ - "update_model" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_model, - default_retry=self._method_configs["UpdateModel"].retry, - default_timeout=self._method_configs["UpdateModel"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.UpdateModelRequest(model=model, update_mask=update_mask) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("model.name", model.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_model"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_models( - self, - parent, - filter_=None, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists models. - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.AutoMlClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # Iterate over all results - >>> for element in client.list_models(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_models(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Resource name of the project, from which to list the models. - filter_ (str): An expression for filtering the results of the request. - - - ``model_metadata`` - for existence of the case (e.g. - image\_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. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.automl_v1.types.Model` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_models" not in self._inner_api_calls: - self._inner_api_calls[ - "list_models" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_models, - default_retry=self._method_configs["ListModels"].retry, - default_timeout=self._method_configs["ListModels"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.ListModelsRequest( - parent=parent, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_models"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="model", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def delete_model( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a model. Returns ``google.protobuf.Empty`` in the ``response`` - field when it completes, and ``delete_details`` in the ``metadata`` - field. - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.AutoMlClient() - >>> - >>> name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]') - >>> - >>> response = client.delete_model(name) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Resource name of the model being deleted. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_model" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_model" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_model, - default_retry=self._method_configs["DeleteModel"].retry, - default_timeout=self._method_configs["DeleteModel"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.DeleteModelRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["delete_model"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - empty_pb2.Empty, - metadata_type=proto_operations_pb2.OperationMetadata, - ) - - def deploy_model( - self, - name, - image_object_detection_model_deployment_metadata=None, - image_classification_model_deployment_metadata=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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``) will reset the deployment state without pausing the - model's availability. - - Only applicable for Text Classification, Image Object Detection; all - other domains manage deployment automatically. - - Returns an empty response in the ``response`` field when it completes. - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.AutoMlClient() - >>> - >>> name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]') - >>> - >>> response = client.deploy_model(name) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Resource name of the model to deploy. - image_object_detection_model_deployment_metadata (Union[dict, ~google.cloud.automl_v1.types.ImageObjectDetectionModelDeploymentMetadata]): Model deployment metadata specific to Image Object Detection. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1.types.ImageObjectDetectionModelDeploymentMetadata` - image_classification_model_deployment_metadata (Union[dict, ~google.cloud.automl_v1.types.ImageClassificationModelDeploymentMetadata]): Model deployment metadata specific to Image Classification. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1.types.ImageClassificationModelDeploymentMetadata` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "deploy_model" not in self._inner_api_calls: - self._inner_api_calls[ - "deploy_model" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.deploy_model, - default_retry=self._method_configs["DeployModel"].retry, - default_timeout=self._method_configs["DeployModel"].timeout, - client_info=self._client_info, - ) - - # Sanity check: We have some fields which are mutually exclusive; - # raise ValueError if more than one is sent. - google.api_core.protobuf_helpers.check_oneof( - image_object_detection_model_deployment_metadata=image_object_detection_model_deployment_metadata, - image_classification_model_deployment_metadata=image_classification_model_deployment_metadata, - ) - - request = service_pb2.DeployModelRequest( - name=name, - image_object_detection_model_deployment_metadata=image_object_detection_model_deployment_metadata, - image_classification_model_deployment_metadata=image_classification_model_deployment_metadata, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["deploy_model"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - empty_pb2.Empty, - metadata_type=proto_operations_pb2.OperationMetadata, - ) - - def undeploy_model( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Undeploys a model. If the model is not deployed this method has no - effect. - - Only applicable for Text Classification, Image Object Detection; all - other domains manage deployment automatically. - - Returns an empty response in the ``response`` field when it completes. - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.AutoMlClient() - >>> - >>> name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]') - >>> - >>> response = client.undeploy_model(name) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Resource name of the model to undeploy. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "undeploy_model" not in self._inner_api_calls: - self._inner_api_calls[ - "undeploy_model" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.undeploy_model, - default_retry=self._method_configs["UndeployModel"].retry, - default_timeout=self._method_configs["UndeployModel"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.UndeployModelRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["undeploy_model"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - empty_pb2.Empty, - metadata_type=proto_operations_pb2.OperationMetadata, - ) - - def export_model( - self, - name, - output_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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``. - - Returns an empty response in the ``response`` field when it completes. - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.AutoMlClient() - >>> - >>> name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]') - >>> - >>> # TODO: Initialize `output_config`: - >>> output_config = {} - >>> - >>> response = client.export_model(name, output_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. The resource name of the model to export. - output_config (Union[dict, ~google.cloud.automl_v1.types.ModelExportOutputConfig]): Required. The desired output location and configuration. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1.types.ModelExportOutputConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "export_model" not in self._inner_api_calls: - self._inner_api_calls[ - "export_model" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.export_model, - default_retry=self._method_configs["ExportModel"].retry, - default_timeout=self._method_configs["ExportModel"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.ExportModelRequest(name=name, output_config=output_config) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["export_model"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - empty_pb2.Empty, - metadata_type=proto_operations_pb2.OperationMetadata, - ) - - def get_model_evaluation( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a model evaluation. - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.AutoMlClient() - >>> - >>> name = client.model_evaluation_path('[PROJECT]', '[LOCATION]', '[MODEL]', '[MODEL_EVALUATION]') - >>> - >>> response = client.get_model_evaluation(name) - - Args: - name (str): Resource name for the model evaluation. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1.types.ModelEvaluation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_model_evaluation" not in self._inner_api_calls: - self._inner_api_calls[ - "get_model_evaluation" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_model_evaluation, - default_retry=self._method_configs["GetModelEvaluation"].retry, - default_timeout=self._method_configs["GetModelEvaluation"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.GetModelEvaluationRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_model_evaluation"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_model_evaluations( - self, - parent, - filter_, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists model evaluations. - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.AutoMlClient() - >>> - >>> parent = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]') - >>> - >>> # TODO: Initialize `filter_`: - >>> filter_ = '' - >>> - >>> # Iterate over all results - >>> for element in client.list_model_evaluations(parent, filter_): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_model_evaluations(parent, filter_).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): 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. - filter_ (str): 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. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.automl_v1.types.ModelEvaluation` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_model_evaluations" not in self._inner_api_calls: - self._inner_api_calls[ - "list_model_evaluations" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_model_evaluations, - default_retry=self._method_configs["ListModelEvaluations"].retry, - default_timeout=self._method_configs["ListModelEvaluations"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.ListModelEvaluationsRequest( - parent=parent, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_model_evaluations"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="model_evaluation", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator diff --git a/automl/google/cloud/automl_v1/gapic/auto_ml_client_config.py b/automl/google/cloud/automl_v1/gapic/auto_ml_client_config.py deleted file mode 100644 index e54353d4d983..000000000000 --- a/automl/google/cloud/automl_v1/gapic/auto_ml_client_config.py +++ /dev/null @@ -1,113 +0,0 @@ -config = { - "interfaces": { - "google.cloud.automl.v1.AutoMl": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "CreateDataset": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateDataset": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetDataset": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListDatasets": { - "timeout_millis": 50000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteDataset": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ImportData": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ExportData": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetAnnotationSpec": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateModel": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetModel": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateModel": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListModels": { - "timeout_millis": 50000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteModel": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeployModel": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UndeployModel": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ExportModel": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetModelEvaluation": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListModelEvaluations": { - "timeout_millis": 50000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/automl/google/cloud/automl_v1/gapic/enums.py b/automl/google/cloud/automl_v1/gapic/enums.py deleted file mode 100644 index 8e525587c98f..000000000000 --- a/automl/google/cloud/automl_v1/gapic/enums.py +++ /dev/null @@ -1,109 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class ClassificationType(enum.IntEnum): - """ - Type of the classification problem. - - Attributes: - CLASSIFICATION_TYPE_UNSPECIFIED (int): An un-set value of this enum. - MULTICLASS (int): At most one label is allowed per example. - MULTILABEL (int): Multiple labels are allowed for one example. - """ - - CLASSIFICATION_TYPE_UNSPECIFIED = 0 - MULTICLASS = 1 - MULTILABEL = 2 - - -class Document(object): - class Layout(object): - class TextSegmentType(enum.IntEnum): - """ - The type of TextSegment in the context of the original document. - - Attributes: - TEXT_SEGMENT_TYPE_UNSPECIFIED (int): Should not be used. - TOKEN (int): The text segment is a token. e.g. word. - PARAGRAPH (int): The text segment is a paragraph. - FORM_FIELD (int): The text segment is a form field. - FORM_FIELD_NAME (int): 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. - FORM_FIELD_CONTENTS (int): 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. - TABLE (int): The text segment is a whole table, including headers, and all rows. - TABLE_HEADER (int): 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. - TABLE_ROW (int): 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. - TABLE_CELL (int): 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. - """ - - TEXT_SEGMENT_TYPE_UNSPECIFIED = 0 - TOKEN = 1 - PARAGRAPH = 2 - FORM_FIELD = 3 - FORM_FIELD_NAME = 4 - FORM_FIELD_CONTENTS = 5 - TABLE = 6 - TABLE_HEADER = 7 - TABLE_ROW = 8 - TABLE_CELL = 9 - - -class DocumentDimensions(object): - class DocumentDimensionUnit(enum.IntEnum): - """ - Unit of the document dimension. - - Attributes: - DOCUMENT_DIMENSION_UNIT_UNSPECIFIED (int): Should not be used. - INCH (int): Document dimension is measured in inches. - CENTIMETER (int): Document dimension is measured in centimeters. - POINT (int): Document dimension is measured in points. 72 points = 1 inch. - """ - - DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0 - INCH = 1 - CENTIMETER = 2 - POINT = 3 - - -class Model(object): - class DeploymentState(enum.IntEnum): - """ - Deployment state of the model. - - Attributes: - DEPLOYMENT_STATE_UNSPECIFIED (int): Should not be used, an un-set enum has this value by default. - DEPLOYED (int): Model is deployed. - UNDEPLOYED (int): Model is not deployed. - """ - - DEPLOYMENT_STATE_UNSPECIFIED = 0 - DEPLOYED = 1 - UNDEPLOYED = 2 diff --git a/automl/google/cloud/automl_v1/gapic/prediction_service_client.py b/automl/google/cloud/automl_v1/gapic/prediction_service_client.py deleted file mode 100644 index d6df5e545610..000000000000 --- a/automl/google/cloud/automl_v1/gapic/prediction_service_client.py +++ /dev/null @@ -1,463 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.cloud.automl.v1 PredictionService API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.operation -import google.api_core.operations_v1 -import google.api_core.path_template -import grpc - -from google.cloud.automl_v1.gapic import enums -from google.cloud.automl_v1.gapic import prediction_service_client_config -from google.cloud.automl_v1.gapic.transports import prediction_service_grpc_transport -from google.cloud.automl_v1.proto import annotation_spec_pb2 -from google.cloud.automl_v1.proto import data_items_pb2 -from google.cloud.automl_v1.proto import dataset_pb2 -from google.cloud.automl_v1.proto import image_pb2 -from google.cloud.automl_v1.proto import io_pb2 -from google.cloud.automl_v1.proto import model_evaluation_pb2 -from google.cloud.automl_v1.proto import model_pb2 -from google.cloud.automl_v1.proto import operations_pb2 as proto_operations_pb2 -from google.cloud.automl_v1.proto import prediction_service_pb2 -from google.cloud.automl_v1.proto import prediction_service_pb2_grpc -from google.cloud.automl_v1.proto import service_pb2 -from google.cloud.automl_v1.proto import service_pb2_grpc -from google.longrunning import operations_pb2 as longrunning_operations_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-automl").version - - -class PredictionServiceClient(object): - """ - AutoML Prediction API. - - On any input that is documented to expect a string parameter in - snake\_case or kebab-case, either of those cases is accepted. - """ - - SERVICE_ADDRESS = "automl.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.automl.v1.PredictionService" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - PredictionServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def model_path(cls, project, location, model): - """Return a fully-qualified model string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/models/{model}", - project=project, - location=location, - model=model, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.PredictionServiceGrpcTransport, - Callable[[~.Credentials, type], ~.PredictionServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = prediction_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=prediction_service_grpc_transport.PredictionServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = prediction_service_grpc_transport.PredictionServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def predict( - self, - name, - payload, - params=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Perform an online prediction. The prediction result will be directly - returned in the response. Available for following ML problems, and their - expected request payloads: - - - Image Classification - Image in .JPEG, .GIF or .PNG format, - image\_bytes up to 30MB. - - Image Object Detection - Image in .JPEG, .GIF or .PNG format, - image\_bytes up to 30MB. - - Text Classification - TextSnippet, content up to 60,000 characters, - UTF-8 encoded. - - Text Extraction - TextSnippet, content up to 30,000 characters, UTF-8 - NFC encoded. - - Translation - TextSnippet, content up to 25,000 characters, UTF-8 - encoded. - - Text Sentiment - TextSnippet, content up 500 characters, UTF-8 - encoded. - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.PredictionServiceClient() - >>> - >>> name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]') - >>> - >>> # TODO: Initialize `payload`: - >>> payload = {} - >>> - >>> response = client.predict(name, payload) - - Args: - name (str): Name of the model requested to serve the prediction. - payload (Union[dict, ~google.cloud.automl_v1.types.ExamplePayload]): Required. Payload to perform a prediction on. The payload must match the - problem type that the model was trained to solve. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1.types.ExamplePayload` - params (dict[str -> str]): Additional domain-specific parameters, any string must be up to 25000 - characters long. - - - For Image 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. - - - For Image 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) No more than - this number of bounding boxes will be returned in the response. - Default is 100, the requested value may be limited by server. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1.types.PredictResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "predict" not in self._inner_api_calls: - self._inner_api_calls[ - "predict" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.predict, - default_retry=self._method_configs["Predict"].retry, - default_timeout=self._method_configs["Predict"].timeout, - client_info=self._client_info, - ) - - request = prediction_service_pb2.PredictRequest( - name=name, payload=payload, params=params - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["predict"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def batch_predict( - self, - name, - input_config, - output_config, - params=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Perform a batch prediction. Unlike the online ``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`` method. Once the operation is - done, ``BatchPredictResult`` is returned in the ``response`` field. - Available for following ML problems: - - - Image Classification - - Image Object Detection - - Text Extraction - - Example: - >>> from google.cloud import automl_v1 - >>> - >>> client = automl_v1.PredictionServiceClient() - >>> - >>> name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]') - >>> - >>> # TODO: Initialize `input_config`: - >>> input_config = {} - >>> - >>> # TODO: Initialize `output_config`: - >>> output_config = {} - >>> - >>> response = client.batch_predict(name, input_config, output_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Name of the model requested to serve the batch prediction. - input_config (Union[dict, ~google.cloud.automl_v1.types.BatchPredictInputConfig]): Required. The input configuration for batch prediction. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1.types.BatchPredictInputConfig` - output_config (Union[dict, ~google.cloud.automl_v1.types.BatchPredictOutputConfig]): Required. The Configuration specifying where output predictions should - be written. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1.types.BatchPredictOutputConfig` - params (dict[str -> str]): Additional domain-specific parameters for the predictions, any string - must be up to 25000 characters long. - - - For Text 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. - - - For Image 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. - - - For Image 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) No more than this number of - bounding boxes will be produced per image. Default is 100, the - requested value may be limited by server. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "batch_predict" not in self._inner_api_calls: - self._inner_api_calls[ - "batch_predict" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.batch_predict, - default_retry=self._method_configs["BatchPredict"].retry, - default_timeout=self._method_configs["BatchPredict"].timeout, - client_info=self._client_info, - ) - - request = prediction_service_pb2.BatchPredictRequest( - name=name, - input_config=input_config, - output_config=output_config, - params=params, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["batch_predict"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - prediction_service_pb2.BatchPredictResult, - metadata_type=proto_operations_pb2.OperationMetadata, - ) diff --git a/automl/google/cloud/automl_v1/gapic/prediction_service_client_config.py b/automl/google/cloud/automl_v1/gapic/prediction_service_client_config.py deleted file mode 100644 index bcfb22ff6cd5..000000000000 --- a/automl/google/cloud/automl_v1/gapic/prediction_service_client_config.py +++ /dev/null @@ -1,33 +0,0 @@ -config = { - "interfaces": { - "google.cloud.automl.v1.PredictionService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "Predict": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "BatchPredict": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/automl/google/cloud/automl_v1/gapic/transports/__init__.py b/automl/google/cloud/automl_v1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/automl/google/cloud/automl_v1/gapic/transports/auto_ml_grpc_transport.py b/automl/google/cloud/automl_v1/gapic/transports/auto_ml_grpc_transport.py deleted file mode 100644 index c5f6bfa71255..000000000000 --- a/automl/google/cloud/automl_v1/gapic/transports/auto_ml_grpc_transport.py +++ /dev/null @@ -1,376 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers -import google.api_core.operations_v1 - -from google.cloud.automl_v1.proto import service_pb2_grpc - - -class AutoMlGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.automl.v1 AutoMl API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="automl.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = {"auto_ml_stub": service_pb2_grpc.AutoMlStub(channel)} - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="automl.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def create_dataset(self): - """Return the gRPC stub for :meth:`AutoMlClient.create_dataset`. - - Creates a dataset. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].CreateDataset - - @property - def update_dataset(self): - """Return the gRPC stub for :meth:`AutoMlClient.update_dataset`. - - Updates a dataset. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].UpdateDataset - - @property - def get_dataset(self): - """Return the gRPC stub for :meth:`AutoMlClient.get_dataset`. - - Gets a dataset. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].GetDataset - - @property - def list_datasets(self): - """Return the gRPC stub for :meth:`AutoMlClient.list_datasets`. - - Lists datasets in a project. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].ListDatasets - - @property - def delete_dataset(self): - """Return the gRPC stub for :meth:`AutoMlClient.delete_dataset`. - - Deletes a dataset and all of its contents. Returns empty response in the - ``response`` field when it completes, and ``delete_details`` in the - ``metadata`` field. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].DeleteDataset - - @property - def import_data(self): - """Return the gRPC stub for :meth:`AutoMlClient.import_data`. - - Imports data into a dataset. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].ImportData - - @property - def export_data(self): - """Return the gRPC stub for :meth:`AutoMlClient.export_data`. - - Exports dataset's data to the provided output location. Returns an empty - response in the ``response`` field when it completes. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].ExportData - - @property - def get_annotation_spec(self): - """Return the gRPC stub for :meth:`AutoMlClient.get_annotation_spec`. - - Gets an annotation spec. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].GetAnnotationSpec - - @property - def create_model(self): - """Return the gRPC stub for :meth:`AutoMlClient.create_model`. - - Creates a model. Returns a Model in the ``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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].CreateModel - - @property - def get_model(self): - """Return the gRPC stub for :meth:`AutoMlClient.get_model`. - - Gets a model. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].GetModel - - @property - def update_model(self): - """Return the gRPC stub for :meth:`AutoMlClient.update_model`. - - Updates a model. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].UpdateModel - - @property - def list_models(self): - """Return the gRPC stub for :meth:`AutoMlClient.list_models`. - - Lists models. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].ListModels - - @property - def delete_model(self): - """Return the gRPC stub for :meth:`AutoMlClient.delete_model`. - - Deletes a model. Returns ``google.protobuf.Empty`` in the ``response`` - field when it completes, and ``delete_details`` in the ``metadata`` - field. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].DeleteModel - - @property - def deploy_model(self): - """Return the gRPC stub for :meth:`AutoMlClient.deploy_model`. - - 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``) will reset the deployment state without pausing the - model's availability. - - Only applicable for Text Classification, Image Object Detection; all - other domains manage deployment automatically. - - Returns an empty response in the ``response`` field when it completes. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].DeployModel - - @property - def undeploy_model(self): - """Return the gRPC stub for :meth:`AutoMlClient.undeploy_model`. - - Undeploys a model. If the model is not deployed this method has no - effect. - - Only applicable for Text Classification, Image Object Detection; all - other domains manage deployment automatically. - - Returns an empty response in the ``response`` field when it completes. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].UndeployModel - - @property - def export_model(self): - """Return the gRPC stub for :meth:`AutoMlClient.export_model`. - - 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``. - - Returns an empty response in the ``response`` field when it completes. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].ExportModel - - @property - def get_model_evaluation(self): - """Return the gRPC stub for :meth:`AutoMlClient.get_model_evaluation`. - - Gets a model evaluation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].GetModelEvaluation - - @property - def list_model_evaluations(self): - """Return the gRPC stub for :meth:`AutoMlClient.list_model_evaluations`. - - Lists model evaluations. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].ListModelEvaluations diff --git a/automl/google/cloud/automl_v1/gapic/transports/prediction_service_grpc_transport.py b/automl/google/cloud/automl_v1/gapic/transports/prediction_service_grpc_transport.py deleted file mode 100644 index 9d494540f373..000000000000 --- a/automl/google/cloud/automl_v1/gapic/transports/prediction_service_grpc_transport.py +++ /dev/null @@ -1,168 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers -import google.api_core.operations_v1 - -from google.cloud.automl_v1.proto import prediction_service_pb2_grpc - - -class PredictionServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.automl.v1 PredictionService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="automl.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "prediction_service_stub": prediction_service_pb2_grpc.PredictionServiceStub( - channel - ) - } - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="automl.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def predict(self): - """Return the gRPC stub for :meth:`PredictionServiceClient.predict`. - - Perform an online prediction. The prediction result will be directly - returned in the response. Available for following ML problems, and their - expected request payloads: - - - Image Classification - Image in .JPEG, .GIF or .PNG format, - image\_bytes up to 30MB. - - Image Object Detection - Image in .JPEG, .GIF or .PNG format, - image\_bytes up to 30MB. - - Text Classification - TextSnippet, content up to 60,000 characters, - UTF-8 encoded. - - Text Extraction - TextSnippet, content up to 30,000 characters, UTF-8 - NFC encoded. - - Translation - TextSnippet, content up to 25,000 characters, UTF-8 - encoded. - - Text Sentiment - TextSnippet, content up 500 characters, UTF-8 - encoded. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["prediction_service_stub"].Predict - - @property - def batch_predict(self): - """Return the gRPC stub for :meth:`PredictionServiceClient.batch_predict`. - - Perform a batch prediction. Unlike the online ``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`` method. Once the operation is - done, ``BatchPredictResult`` is returned in the ``response`` field. - Available for following ML problems: - - - Image Classification - - Image Object Detection - - Text Extraction - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["prediction_service_stub"].BatchPredict diff --git a/automl/google/cloud/automl_v1/proto/__init__.py b/automl/google/cloud/automl_v1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/automl/google/cloud/automl_v1/proto/annotation_payload.proto b/automl/google/cloud/automl_v1/proto/annotation_payload.proto deleted file mode 100644 index 980c0e368c56..000000000000 --- a/automl/google/cloud/automl_v1/proto/annotation_payload.proto +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1; - -import "google/cloud/automl/v1/classification.proto"; -import "google/cloud/automl/v1/detection.proto"; -import "google/cloud/automl/v1/text_extraction.proto"; -import "google/cloud/automl/v1/text_sentiment.proto"; -import "google/cloud/automl/v1/translation.proto"; -import "google/protobuf/any.proto"; -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AutoML.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1"; -option ruby_package = "Google::Cloud::AutoML::V1"; - -// Contains annotation information that is relevant to AutoML. -message AnnotationPayload { - // Output only . Additional information about the annotation - // specific to the AutoML domain. - oneof detail { - // Annotation details for translation. - TranslationAnnotation translation = 2; - - // Annotation details for content or image classification. - ClassificationAnnotation classification = 3; - - // Annotation details for image object detection. - ImageObjectDetectionAnnotation image_object_detection = 4; - - // Annotation details for text extraction. - TextExtractionAnnotation text_extraction = 6; - - // Annotation details for text sentiment. - TextSentimentAnnotation text_sentiment = 7; - } - - // 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. - string annotation_spec_id = 1; - - // 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. - string display_name = 5; -} diff --git a/automl/google/cloud/automl_v1/proto/annotation_payload_pb2.py b/automl/google/cloud/automl_v1/proto/annotation_payload_pb2.py deleted file mode 100644 index 7840971f1a7c..000000000000 --- a/automl/google/cloud/automl_v1/proto/annotation_payload_pb2.py +++ /dev/null @@ -1,315 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1/proto/annotation_payload.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.cloud.automl_v1.proto import ( - classification_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_classification__pb2, -) -from google.cloud.automl_v1.proto import ( - detection_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_detection__pb2, -) -from google.cloud.automl_v1.proto import ( - text_extraction_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_text__extraction__pb2, -) -from google.cloud.automl_v1.proto import ( - text_sentiment_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_text__sentiment__pb2, -) -from google.cloud.automl_v1.proto import ( - translation_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_translation__pb2, -) -from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1/proto/annotation_payload.proto", - package="google.cloud.automl.v1", - syntax="proto3", - serialized_options=_b( - "\n\032com.google.cloud.automl.v1P\001Z labels = 39; -} diff --git a/automl/google/cloud/automl_v1/proto/dataset_pb2.py b/automl/google/cloud/automl_v1/proto/dataset_pb2.py deleted file mode 100644 index ad20d7b1e556..000000000000 --- a/automl/google/cloud/automl_v1/proto/dataset_pb2.py +++ /dev/null @@ -1,518 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1/proto/dataset.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.automl_v1.proto import ( - image_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_image__pb2, -) -from google.cloud.automl_v1.proto import ( - text_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_text__pb2, -) -from google.cloud.automl_v1.proto import ( - translation_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_translation__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1/proto/dataset.proto", - package="google.cloud.automl.v1", - syntax="proto3", - serialized_options=_b( - "\n\032com.google.cloud.automl.v1P\001ZAutoML Vision -// -// -//
Classification
-// -// See [Preparing your training -// data](https://cloud.google.com/vision/automl/docs/prepare) for more -// information. -// -// CSV file(s) with each line in format: -// -// ML_USE,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. -// -// * `GCS_FILE_PATH` - The Google Cloud Storage location of an image of up to -// 30MB in size. Supported extensions: .JPEG, .GIF, .PNG, .WEBP, .BMP, -// .TIFF, .ICO. -// -// * `LABEL` - A label that identifies the object in the image. -// -// For the `MULTICLASS` classification type, at most one `LABEL` is allowed -// per image. If an image has not yet been labeled, then it should be -// mentioned just once with no `LABEL`. -// -// Some sample rows: -// -// TRAIN,gs://folder/image1.jpg,daisy -// TEST,gs://folder/image2.jpg,dandelion,tulip,rose -// UNASSIGNED,gs://folder/image3.jpg,daisy -// UNASSIGNED,gs://folder/image4.jpg -// -// -//
Object Detection
-// See [Preparing your training -// data](https://cloud.google.com/vision/automl/object-detection/docs/prepare) -// for more information. -// -// A CSV file(s) with each line in format: -// -// ML_USE,GCS_FILE_PATH,[LABEL],(BOUNDING_BOX | ,,,,,,,) -// -// * `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` - The Google Cloud Storage location of an image of up to -// 30MB in size. Supported extensions: .JPEG, .GIF, .PNG. Each image -// is assumed to be exhaustively labeled. -// -// * `LABEL` - A label that identifies the object in the image specified by the -// `BOUNDING_BOX`. -// -// * `BOUNDING BOX` - The vertices of an object in the example image. -// The minimum allowed `BOUNDING_BOX` edge length is 0.01, and no more than -// 500 `BOUNDING_BOX` instances per image are allowed (one `BOUNDING_BOX` -// per line). If an image has no looked for objects then it should be -// mentioned just once with no LABEL and the ",,,,,,," in place of the -// `BOUNDING_BOX`. -// -// **Four sample rows:** -// -// TRAIN,gs://folder/image1.png,car,0.1,0.1,,,0.3,0.3,, -// TRAIN,gs://folder/image1.png,bike,.7,.6,,,.8,.9,, -// UNASSIGNED,gs://folder/im2.png,car,0.1,0.1,0.2,0.1,0.2,0.3,0.1,0.3 -// TEST,gs://folder/im3.png,,,,,,,,, -//
-//
-// -// -//

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 PDF document. -// Multiple JSON documents can be separated using line breaks (\n). -// -// For example: -// -// { -// "document": { -// "input_config": { -// "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] -// } -// } -// } -// }\n -// { -// "document": { -// "input_config": { -// "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ] -// } -// } -// } -// } -// -// **In-line JSONL files with PDF layout information** -// -// **Note:** You can only annotate PDF files using the UI. The format described -// below applies to annotated PDF files exported using the UI or `exportData`. -// -// In-line .JSONL files for PDF documents contain, per line, a JSON document -// that wraps a `document` field that provides the textual content of the PDF -// 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, .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, .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 -//
-//
-// -// -// **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. -// -// `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. -// -// `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. -// -message InputConfig { - // The source of the input. - oneof 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]. - GcsSource gcs_source = 1; - } - - // Additional domain-specific parameters describing the semantic of the - // imported data, any string must be up to 25000 - // characters long. - map params = 2; -} - -// Input configuration for BatchPredict Action. -// -// The format of input depends on the ML problem of the model used for -// prediction. As input source the -// [gcs_source][google.cloud.automl.v1.InputConfig.gcs_source] -// is expected, unless specified otherwise. -// -// The formats are represented in EBNF with commas being literal and with -// non-terminal symbols defined near the end of this comment. The formats -// are: -// -//

AutoML Natural Language

-//
Classification
-// -// One or more CSV files where each line is a single column: -// -// GCS_FILE_PATH -// -// `GCS_FILE_PATH` is the Google Cloud Storage location of a text file. -// Supported file extensions: .TXT, .PDF -// Text files can be no larger than 10MB in size. -// -// Sample rows: -// -// gs://folder/text1.txt -// gs://folder/text2.pdf -// -//
Sentiment Analysis
-// One or more CSV files where each line is a single column: -// -// GCS_FILE_PATH -// -// `GCS_FILE_PATH` is the Google Cloud Storage location of a text file. -// Supported file extensions: .TXT, .PDF -// Text files can be no larger than 128kB in size. -// -// Sample rows: -// -// gs://folder/text1.txt -// gs://folder/text2.pdf -// -//
Entity Extraction
-// -// One or more JSONL (JSON Lines) files that either provide inline text or -// documents. You can only use one format, either inline text or documents, -// for a single call to [AutoMl.BatchPredict]. -// -// Each JSONL file contains a per line a proto that -// wraps a temporary user-assigned TextSnippet ID (string up to 2000 -// characters long) called "id", a TextSnippet proto (in -// JSON representation) and zero or more TextFeature protos. Any given -// text snippet content must have 30,000 characters or less, and also -// be UTF-8 NFC encoded (ASCII already is). The IDs provided should be -// unique. -// -// Each document JSONL file contains, per line, a proto that wraps a -// Document proto with `input_config` set. Only PDF documents are -// currently supported, and each PDF document cannot exceed 2MB in size. -// -// Each JSONL file must not exceed 100MB in size, and no more than 20 -// JSONL files may be passed. -// -// Sample inline JSONL file (Shown with artificial line -// breaks. Actual line breaks are denoted by "\n".): -// -// { -// "id": "my_first_id", -// "text_snippet": { "content": "dog car cat"}, -// "text_features": [ -// { -// "text_segment": {"start_offset": 4, "end_offset": 6}, -// "structural_type": PARAGRAPH, -// "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}, -// ] -// }, -// } -// ], -// }\n -// { -// "id": "2", -// "text_snippet": { -// "content": "Extended sample content", -// "mime_type": "text/plain" -// } -// } -// -// Sample document JSONL file (Shown with artificial line -// breaks. Actual line breaks are denoted by "\n".): -// -// { -// "document": { -// "input_config": { -// "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] -// } -// } -// } -// }\n -// { -// "document": { -// "input_config": { -// "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ] -// } -// } -// } -// } -//
-//
-// -// **Input field definitions:** -// -// `GCS_FILE_PATH` -// : The path to a file on Google Cloud Storage. For example, -// "gs://folder/video.avi". -// -// **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. -message BatchPredictInputConfig { - // The source of the input. - oneof source { - // Required. The Google Cloud Storage location for the input content. - GcsSource gcs_source = 1 [(google.api.field_behavior) = REQUIRED]; - } -} - -// Input configuration of a [Document][google.cloud.automl.v1.Document]. -message DocumentInputConfig { - // The Google Cloud Storage location of the document file. Only a single path - // should be given. - // - // Max supported size: 512MB. - // - // Supported extensions: .PDF. - GcsSource gcs_source = 1; -} - -// Output configuration for ExportData. -// -// As destination the -// [gcs_destination][google.cloud.automl.v1.OutputConfig.gcs_destination] -// must be set unless specified otherwise for a domain. If gcs_destination is -// set then in the given directory a new directory is created. Its name -// will be "export_data--", -// where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. -// Only ground truth annotations are exported (not approved annotations are -// not exported). -// -// The outputs correspond to how the data was imported, and may be used as -// input to import data. The output formats are represented as EBNF with literal -// commas and same non-terminal symbols definitions are these in import data's -// [InputConfig][google.cloud.automl.v1.InputConfig]: -// -// * For Image Classification: -// CSV file(s) `image_classification_1.csv`, -// `image_classification_2.csv`,...,`image_classification_N.csv`with -// each line in format: -// ML_USE,GCS_FILE_PATH,LABEL,LABEL,... -// where GCS_FILE_PATHs point at the original, source locations of the -// imported images. -// For MULTICLASS classification type, there can be at most one LABEL -// per example. -// -// * For Image Object Detection: -// CSV file(s) `image_object_detection_1.csv`, -// `image_object_detection_2.csv`,...,`image_object_detection_N.csv` -// with each line in format: -// ML_USE,GCS_FILE_PATH,[LABEL],(BOUNDING_BOX | ,,,,,,,) -// where GCS_FILE_PATHs point at the original, source locations of the -// imported images. -// -// * For Text Classification: -// In the created directory CSV file(s) `text_classification_1.csv`, -// `text_classification_2.csv`, ...,`text_classification_N.csv` will be -// created where N depends on the total number of examples exported. -// Each line in the CSV is of the format: -// ML_USE,GCS_FILE_PATH,LABEL,LABEL,... -// where GCS_FILE_PATHs point at the exported .txt files containing -// the text content of the imported example. For MULTICLASS -// classification type, there will be at most one LABEL per example. -// -// * For Text Sentiment: -// In the created directory CSV file(s) `text_sentiment_1.csv`, -// `text_sentiment_2.csv`, ...,`text_sentiment_N.csv` will be -// created where N depends on the total number of examples exported. -// Each line in the CSV is of the format: -// ML_USE,GCS_FILE_PATH,SENTIMENT -// where GCS_FILE_PATHs point at the exported .txt files containing -// the text content of the imported example. -// -// * For Text Extraction: -// CSV file `text_extraction.csv`, with each line in format: -// ML_USE,GCS_FILE_PATH -// GCS_FILE_PATH leads to a .JSONL (i.e. JSON Lines) file which -// contains, per line, a proto that wraps a TextSnippet proto (in json -// representation) followed by AnnotationPayload protos (called -// annotations). If initially documents had been imported, the JSONL -// will point at the original, source locations of the imported -// documents. -// -// * For Translation: -// CSV file `translation.csv`, with each line in format: -// ML_USE,GCS_FILE_PATH -// GCS_FILE_PATH leads to a .TSV file which describes examples that have -// given ML_USE, using the following row format per line: -// TEXT_SNIPPET (in source language) \t TEXT_SNIPPET (in target -// language) -message OutputConfig { - // The destination of the output. - oneof destination { - // Required. The Google Cloud Storage location where the output is to be - // written to. For Image Object Detection, Text Extraction 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. - GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; - } -} - -// Output configuration for BatchPredict Action. -// -// As destination the -// -// [gcs_destination][google.cloud.automl.v1.BatchPredictOutputConfig.gcs_destination] -// must be set unless specified otherwise for a domain. If gcs_destination is -// set then in the given directory a new directory is created. Its name -// will be -// "prediction--", -// 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 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 (or pdf) file 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 (or pdf) file -// will be listed only once with all its annotations, and its -// annotations will never be split across files. -// -// If prediction for any text (or pdf) file 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 text (or pdf) 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 (or pdf) file 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 (or pdf) file -// will be listed only once with all its annotations, and its -// annotations will never be split across files. -// -// If prediction for any text (or pdf) file 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 text (or pdf) 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`. -message BatchPredictOutputConfig { - // The destination of the output. - oneof destination { - // Required. The Google Cloud Storage location of the directory where the - // output is to be written to. - GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; - } -} - -// Output configuration for ModelExport Action. -message ModelExportOutputConfig { - // The destination of the output. - oneof 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. - GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // 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". - // - // * 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.x` - // * core_ml - Used for iOS mobile devices. - string model_format = 4; - - // 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. - map params = 2; -} - -// The Google Cloud Storage location for the input content. -message GcsSource { - // 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 - repeated string input_uris = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The Google Cloud Storage location where the output is to be written to. -message GcsDestination { - // 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. - string output_uri_prefix = 1 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/automl/google/cloud/automl_v1/proto/io_pb2.py b/automl/google/cloud/automl_v1/proto/io_pb2.py deleted file mode 100644 index b0a5f00082fe..000000000000 --- a/automl/google/cloud/automl_v1/proto/io_pb2.py +++ /dev/null @@ -1,1610 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1/proto/io.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1/proto/io.proto", - package="google.cloud.automl.v1", - syntax="proto3", - serialized_options=_b( - "\n\032com.google.cloud.automl.v1P\001Z`__ for more - information. - - CSV file(s) with each line in format: - - :: - - ML_USE,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. - - - ``GCS_FILE_PATH`` - The Google Cloud Storage location of an image of - up to 30MB in size. Supported extensions: .JPEG, .GIF, .PNG, .WEBP, - .BMP, .TIFF, .ICO. - - - ``LABEL`` - A label that identifies the object in the image. - - For the ``MULTICLASS`` classification type, at most one ``LABEL`` is - allowed per image. If an image has not yet been labeled, then it should - be mentioned just once with no ``LABEL``. - - Some sample rows: - - :: - - TRAIN,gs://folder/image1.jpg,daisy - TEST,gs://folder/image2.jpg,dandelion,tulip,rose - UNASSIGNED,gs://folder/image3.jpg,daisy - UNASSIGNED,gs://folder/image4.jpg - - - - - - See `Preparing your training - data `__ - for more information. - - A CSV file(s) with each line in format: - - :: - - ML_USE,GCS_FILE_PATH,[LABEL],(BOUNDING_BOX | ,,,,,,,) - - - ``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`` - The Google Cloud Storage location of an image of - up to 30MB in size. Supported extensions: .JPEG, .GIF, .PNG. Each - image is assumed to be exhaustively labeled. - - - ``LABEL`` - A label that identifies the object in the image specified - by the ``BOUNDING_BOX``. - - - ``BOUNDING BOX`` - The vertices of an object in the example image. - The minimum allowed ``BOUNDING_BOX`` edge length is 0.01, and no more - than 500 ``BOUNDING_BOX`` instances per image are allowed (one - ``BOUNDING_BOX`` per line). If an image has no looked for objects - then it should be mentioned just once with no LABEL and the ",,,,,,," - in place of the ``BOUNDING_BOX``. - - **Four sample rows:** - - :: - - TRAIN,gs://folder/image1.png,car,0.1,0.1,,,0.3,0.3,, - TRAIN,gs://folder/image1.png,bike,.7,.6,,,.8,.9,, - UNASSIGNED,gs://folder/im2.png,car,0.1,0.1,0.2,0.1,0.2,0.3,0.1,0.3 - TEST,gs://folder/im3.png,,,,,,,,, - - - - - - - - - - See `Preparing your training - data `__ 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 PDF document. - Multiple JSON documents can be separated using line breaks - (``\\n``). - - For example: - - :: - - { - "document": { - "input_config": { - "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] - } - } - } - }\\n - { - "document": { - "input_config": { - "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ] - } - } - } - } - - **In-line JSONL files with PDF layout information** - - **Note:** You can only annotate PDF files using the UI. The format - described below applies to annotated PDF files exported using the UI or - ``exportData``. - - In-line .JSONL files for PDF documents contain, per line, a JSON - document that wraps a ``document`` field that provides the textual - content of the PDF 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} - } - }, - ], - - - - - - See `Preparing your training - data `__ - 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, .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 - - - - - - See `Preparing your training - data `__ - 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, .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 - - - - - - **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. - ``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. - ``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. - - - Attributes: - source: - The source of the input. - 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]. - params: - Additional domain-specific parameters describing the semantic - of the imported data, any string must be up to 25000 - characters long. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.InputConfig) - ), -) -_sym_db.RegisterMessage(InputConfig) -_sym_db.RegisterMessage(InputConfig.ParamsEntry) - -BatchPredictInputConfig = _reflection.GeneratedProtocolMessageType( - "BatchPredictInputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHPREDICTINPUTCONFIG, - __module__="google.cloud.automl_v1.proto.io_pb2", - __doc__="""Input configuration for BatchPredict Action. - - The format of input depends on the ML problem of the model used for - prediction. As input source the - [gcs\_source][google.cloud.automl.v1.InputConfig.gcs\_source] is - expected, unless specified otherwise. - - The formats are represented in EBNF with commas being literal and with - non-terminal symbols defined near the end of this comment. The formats - are: - - - - - - One or more CSV files where each line is a single column: - - :: - - GCS_FILE_PATH - - ``GCS_FILE_PATH`` is the Google Cloud Storage location of a text file. - Supported file extensions: .TXT, .PDF Text files can be no larger than - 10MB in size. - - Sample rows: - - :: - - gs://folder/text1.txt - gs://folder/text2.pdf - - - - - - One or more CSV files where each line is a single column: - - :: - - GCS_FILE_PATH - - ``GCS_FILE_PATH`` is the Google Cloud Storage location of a text file. - Supported file extensions: .TXT, .PDF Text files can be no larger than - 128kB in size. - - Sample rows: - - :: - - gs://folder/text1.txt - gs://folder/text2.pdf - - - - - - One or more JSONL (JSON Lines) files that either provide inline text or - documents. You can only use one format, either inline text or documents, - for a single call to [AutoMl.BatchPredict]. - - Each JSONL file contains a per line a proto that wraps a temporary - user-assigned TextSnippet ID (string up to 2000 characters long) called - "id", a TextSnippet proto (in JSON representation) and zero or more - TextFeature protos. Any given text snippet content must have 30,000 - characters or less, and also be UTF-8 NFC encoded (ASCII already is). - The IDs provided should be unique. - - Each document JSONL file contains, per line, a proto that wraps a - Document proto with ``input_config`` set. Only PDF documents are - currently supported, and each PDF document cannot exceed 2MB in size. - - Each JSONL file must not exceed 100MB in size, and no more than 20 JSONL - files may be passed. - - Sample inline JSONL file (Shown with artificial line breaks. Actual line - breaks are denoted by "``\\n``".): - - :: - - { - "id": "my_first_id", - "text_snippet": { "content": "dog car cat"}, - "text_features": [ - { - "text_segment": {"start_offset": 4, "end_offset": 6}, - "structural_type": PARAGRAPH, - "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}, - ] - }, - } - ], - }\\n - { - "id": "2", - "text_snippet": { - "content": "Extended sample content", - "mime_type": "text/plain" - } - } - - Sample document JSONL file (Shown with artificial line breaks. Actual - line breaks are denoted by "``\\n``".): - - :: - - { - "document": { - "input_config": { - "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] - } - } - } - }\\n - { - "document": { - "input_config": { - "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ] - } - } - } - } - - - - - - **Input field definitions:** - - ``GCS_FILE_PATH`` - The path to a file on Google Cloud Storage. For example, - "gs://folder/video.avi". - - **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. - - - Attributes: - source: - The source of the input. - gcs_source: - Required. The Google Cloud Storage location for the input - content. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.BatchPredictInputConfig) - ), -) -_sym_db.RegisterMessage(BatchPredictInputConfig) - -DocumentInputConfig = _reflection.GeneratedProtocolMessageType( - "DocumentInputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENTINPUTCONFIG, - __module__="google.cloud.automl_v1.proto.io_pb2", - __doc__="""Input configuration of a - [Document][google.cloud.automl.v1.Document]. - - - Attributes: - 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. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.DocumentInputConfig) - ), -) -_sym_db.RegisterMessage(DocumentInputConfig) - -OutputConfig = _reflection.GeneratedProtocolMessageType( - "OutputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_OUTPUTCONFIG, - __module__="google.cloud.automl_v1.proto.io_pb2", - __doc__="""Output configuration for ExportData. - - As destination the - [gcs\_destination][google.cloud.automl.v1.OutputConfig.gcs\_destination] - must be set unless specified otherwise for a domain. If gcs\_destination - is set then in the given directory a new directory is created. Its name - will be "export\_data--", where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ - ISO-8601 format. Only ground truth annotations are exported (not - approved annotations are not exported). - - The outputs correspond to how the data was imported, and may be used as - input to import data. The output formats are represented as EBNF with - literal commas and same non-terminal symbols definitions are these in - import data's [InputConfig][google.cloud.automl.v1.InputConfig]: - - - For Image Classification: CSV file(s) ``image_classification_1.csv``, - ``image_classification_2.csv``,...,\ ``image_classification_N.csv``\ with - each line in format: ML\_USE,GCS\_FILE\_PATH,LABEL,LABEL,... where - GCS\_FILE\_PATHs point at the original, source locations of the - imported images. For MULTICLASS classification type, there can be at - most one LABEL per example. - - - For Image Object Detection: CSV file(s) - ``image_object_detection_1.csv``, - ``image_object_detection_2.csv``,...,\ ``image_object_detection_N.csv`` - with each line in format: - ML\_USE,GCS\_FILE\_PATH,[LABEL],(BOUNDING\_BOX \| ,,,,,,,) where - GCS\_FILE\_PATHs point at the original, source locations of the - imported images. - - - For Text Classification: In the created directory CSV file(s) - ``text_classification_1.csv``, ``text_classification_2.csv``, - ...,\ ``text_classification_N.csv`` will be created where N depends - on the total number of examples exported. Each line in the CSV is of - the format: ML\_USE,GCS\_FILE\_PATH,LABEL,LABEL,... where - GCS\_FILE\_PATHs point at the exported .txt files containing the text - content of the imported example. For MULTICLASS classification type, - there will be at most one LABEL per example. - - - For Text Sentiment: In the created directory CSV file(s) - ``text_sentiment_1.csv``, ``text_sentiment_2.csv``, - ...,\ ``text_sentiment_N.csv`` will be created where N depends on the - total number of examples exported. Each line in the CSV is of the - format: ML\_USE,GCS\_FILE\_PATH,SENTIMENT where GCS\_FILE\_PATHs - point at the exported .txt files containing the text content of the - imported example. - - - For Text Extraction: CSV file ``text_extraction.csv``, with each line - in format: ML\_USE,GCS\_FILE\_PATH GCS\_FILE\_PATH leads to a .JSONL - (i.e. JSON Lines) file which contains, per line, a proto that wraps a - TextSnippet proto (in json representation) followed by - AnnotationPayload protos (called annotations). If initially documents - had been imported, the JSONL will point at the original, source - locations of the imported documents. - - - For Translation: CSV file ``translation.csv``, with each line in - format: ML\_USE,GCS\_FILE\_PATH GCS\_FILE\_PATH leads to a .TSV file - which describes examples that have given ML\_USE, using the following - row format per line: TEXT\_SNIPPET (in source language) - \\tTEXT\_SNIPPET (in target language) - - - Attributes: - destination: - The destination of the output. - gcs_destination: - Required. The Google Cloud Storage location where the output - is to be written to. For Image Object Detection, Text - Extraction 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. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.OutputConfig) - ), -) -_sym_db.RegisterMessage(OutputConfig) - -BatchPredictOutputConfig = _reflection.GeneratedProtocolMessageType( - "BatchPredictOutputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHPREDICTOUTPUTCONFIG, - __module__="google.cloud.automl_v1.proto.io_pb2", - __doc__="""Output configuration for BatchPredict Action. - - As destination the - - [gcs\_destination][google.cloud.automl.v1.BatchPredictOutputConfig.gcs\_destination] - must be set unless specified otherwise for a domain. If gcs\_destination - is set then in the given directory a new directory is created. Its name - will be "prediction--", 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 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 (or pdf) file 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 (or pdf) file - will be listed only once with all its annotations, and its - annotations will never be split across files. - - If prediction for any text (or pdf) file 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 text (or pdf) file followed by exactly one - - ```google.rpc.Status`` `__ - 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 (or pdf) file 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 (or pdf) file - will be listed only once with all its annotations, and its - annotations will never be split across files. - - If prediction for any text (or pdf) file 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 text (or pdf) file followed by exactly one - - ```google.rpc.Status`` `__ - 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`` `__ - containing only ``code`` and ``message``. - - - Attributes: - destination: - The destination of the output. - gcs_destination: - Required. The Google Cloud Storage location of the directory - where the output is to be written to. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.BatchPredictOutputConfig) - ), -) -_sym_db.RegisterMessage(BatchPredictOutputConfig) - -ModelExportOutputConfig = _reflection.GeneratedProtocolMessageType( - "ModelExportOutputConfig", - (_message.Message,), - dict( - ParamsEntry=_reflection.GeneratedProtocolMessageType( - "ParamsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_MODELEXPORTOUTPUTCONFIG_PARAMSENTRY, - __module__="google.cloud.automl_v1.proto.io_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ModelExportOutputConfig.ParamsEntry) - ), - ), - DESCRIPTOR=_MODELEXPORTOUTPUTCONFIG, - __module__="google.cloud.automl_v1.proto.io_pb2", - __doc__="""Output configuration for ModelExport Action. - - - Attributes: - destination: - The destination of the output. - 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. - 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". - 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 `__ - devices. - tf\_saved\_model - A tensorflow model in - SavedModel format. - tf\_js - A `TensorFlow.js - `__ model that can be used - in the browser and in Node.js using JavaScript.x\` - core\_ml - - Used for iOS mobile devices. - 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. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ModelExportOutputConfig) - ), -) -_sym_db.RegisterMessage(ModelExportOutputConfig) -_sym_db.RegisterMessage(ModelExportOutputConfig.ParamsEntry) - -GcsSource = _reflection.GeneratedProtocolMessageType( - "GcsSource", - (_message.Message,), - dict( - DESCRIPTOR=_GCSSOURCE, - __module__="google.cloud.automl_v1.proto.io_pb2", - __doc__="""The Google Cloud Storage location for the input content. - - - Attributes: - 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 - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.GcsSource) - ), -) -_sym_db.RegisterMessage(GcsSource) - -GcsDestination = _reflection.GeneratedProtocolMessageType( - "GcsDestination", - (_message.Message,), - dict( - DESCRIPTOR=_GCSDESTINATION, - __module__="google.cloud.automl_v1.proto.io_pb2", - __doc__="""The Google Cloud Storage location where the output is to - be written to. - - - Attributes: - 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. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.GcsDestination) - ), -) -_sym_db.RegisterMessage(GcsDestination) - - -DESCRIPTOR._options = None -_INPUTCONFIG_PARAMSENTRY._options = None -_BATCHPREDICTINPUTCONFIG.fields_by_name["gcs_source"]._options = None -_OUTPUTCONFIG.fields_by_name["gcs_destination"]._options = None -_BATCHPREDICTOUTPUTCONFIG.fields_by_name["gcs_destination"]._options = None -_MODELEXPORTOUTPUTCONFIG_PARAMSENTRY._options = None -_MODELEXPORTOUTPUTCONFIG.fields_by_name["gcs_destination"]._options = None -_GCSSOURCE.fields_by_name["input_uris"]._options = None -_GCSDESTINATION.fields_by_name["output_uri_prefix"]._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1/proto/io_pb2_grpc.py b/automl/google/cloud/automl_v1/proto/io_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1/proto/io_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1/proto/model.proto b/automl/google/cloud/automl_v1/proto/model.proto deleted file mode 100644 index ee080684d591..000000000000 --- a/automl/google/cloud/automl_v1/proto/model.proto +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1; - -import "google/api/resource.proto"; -import "google/cloud/automl/v1/image.proto"; -import "google/cloud/automl/v1/text.proto"; -import "google/cloud/automl/v1/translation.proto"; -import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AutoML.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1"; -option ruby_package = "Google::Cloud::AutoML::V1"; - -// API proto representing a trained machine learning model. -message Model { - option (google.api.resource) = { - type: "automl.googleapis.com/Model" - pattern: "projects/{project_id}/locations/{location_id}/models/{model_id}" - }; - - // Deployment state of the model. - enum DeploymentState { - // Should not be used, an un-set enum has this value by default. - DEPLOYMENT_STATE_UNSPECIFIED = 0; - - // Model is deployed. - DEPLOYED = 1; - - // Model is not deployed. - UNDEPLOYED = 2; - } - - // Required. - // The model metadata that is specific to the problem type. - // Must match the metadata type of the dataset used to train the model. - oneof model_metadata { - // Metadata for translation models. - TranslationModelMetadata translation_model_metadata = 15; - - // Metadata for image classification models. - ImageClassificationModelMetadata image_classification_model_metadata = 13; - - // Metadata for text classification models. - TextClassificationModelMetadata text_classification_model_metadata = 14; - - // Metadata for image object detection models. - ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; - - // Metadata for text extraction models. - TextExtractionModelMetadata text_extraction_model_metadata = 19; - - // Metadata for text sentiment models. - TextSentimentModelMetadata text_sentiment_model_metadata = 22; - } - - // Output only. Resource name of the model. - // Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` - string name = 1; - - // 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. - string display_name = 2; - - // Required. The resource ID of the dataset used to create the model. The dataset must - // come from the same ancestor project and location. - string dataset_id = 3; - - // Output only. Timestamp when the model training finished and can be used for prediction. - google.protobuf.Timestamp create_time = 7; - - // Output only. Timestamp when this model was last updated. - google.protobuf.Timestamp update_time = 11; - - // Output only. Deployment state of the model. A model can only serve - // prediction requests after it gets deployed. - DeploymentState deployment_state = 8; - - // Used to perform a consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 10; - - // 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. - map labels = 34; -} diff --git a/automl/google/cloud/automl_v1/proto/model_evaluation.proto b/automl/google/cloud/automl_v1/proto/model_evaluation.proto deleted file mode 100644 index 8c768adc3bef..000000000000 --- a/automl/google/cloud/automl_v1/proto/model_evaluation.proto +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1; - -import "google/api/annotations.proto"; -import "google/api/resource.proto"; -import "google/cloud/automl/v1/classification.proto"; -import "google/cloud/automl/v1/detection.proto"; -import "google/cloud/automl/v1/text_extraction.proto"; -import "google/cloud/automl/v1/text_sentiment.proto"; -import "google/cloud/automl/v1/translation.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.AutoML.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1"; -option ruby_package = "Google::Cloud::AutoML::V1"; - -// Evaluation results of a model. -message ModelEvaluation { - // Output only. Problem type specific evaluation metrics. - oneof metrics { - // Model evaluation metrics for image, text classification. - ClassificationEvaluationMetrics classification_evaluation_metrics = 8; - - // Model evaluation metrics for translation. - TranslationEvaluationMetrics translation_evaluation_metrics = 9; - - // Model evaluation metrics for image object detection. - ImageObjectDetectionEvaluationMetrics - image_object_detection_evaluation_metrics = 12; - - // Evaluation metrics for text sentiment models. - TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; - - // Evaluation metrics for text extraction models. - TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; - } - - // Output only. Resource name of the model evaluation. - // Format: - // - // `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}` - string name = 1; - - // Output only. The ID of the annotation spec that the model evaluation - // applies to. The The ID is empty for the overall model evaluation. - string annotation_spec_id = 2; - - // 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. - string display_name = 15; - - // Output only. Timestamp when this model evaluation was created. - google.protobuf.Timestamp create_time = 5; - - // 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]. - int32 evaluated_example_count = 6; -} diff --git a/automl/google/cloud/automl_v1/proto/model_evaluation_pb2.py b/automl/google/cloud/automl_v1/proto/model_evaluation_pb2.py deleted file mode 100644 index 7ac909dfd9c8..000000000000 --- a/automl/google/cloud/automl_v1/proto/model_evaluation_pb2.py +++ /dev/null @@ -1,387 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1/proto/model_evaluation.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.automl_v1.proto import ( - classification_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_classification__pb2, -) -from google.cloud.automl_v1.proto import ( - detection_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_detection__pb2, -) -from google.cloud.automl_v1.proto import ( - text_extraction_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_text__extraction__pb2, -) -from google.cloud.automl_v1.proto import ( - text_sentiment_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_text__sentiment__pb2, -) -from google.cloud.automl_v1.proto import ( - translation_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_translation__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1/proto/model_evaluation.proto", - package="google.cloud.automl.v1", - syntax="proto3", - serialized_options=_b( - "\n\032com.google.cloud.automl.v1P\001Z params = 3; -} - -// Response message for -// [PredictionService.Predict][google.cloud.automl.v1.PredictionService.Predict]. -message PredictResponse { - // Prediction result. - // Translation and Text Sentiment will return precisely one payload. - repeated AnnotationPayload payload = 1; - - // The preprocessed example that AutoML actually makes prediction on. - // Empty if AutoML does not preprocess the input example. - // * For Text Extraction: - // If the input is a .pdf file, the OCR'ed text will be provided in - // [document_text][google.cloud.automl.v1.Document.document_text]. - // - // * For Text Classification: - // If the input is a .pdf file, the OCR'ed trucated text will be provided in - // [document_text][google.cloud.automl.v1.Document.document_text]. - // - // * For Text Sentiment: - // If the input is a .pdf file, the OCR'ed trucated text will be provided in - // [document_text][google.cloud.automl.v1.Document.document_text]. - ExamplePayload preprocessed_input = 3; - - // Additional domain-specific prediction response metadata. - // - // * For Image Object Detection: - // `max_bounding_box_count` - (int64) At most that many bounding boxes per - // image could have been returned. - // - // * For Text Sentiment: - // `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 will be also positive (though - // the least). - // The sentiment_score shouldn't be confused with "score" or "magnitude" - // from the previous Natural Language Sentiment Analysis API. - map metadata = 2; -} - -// Request message for -// [PredictionService.BatchPredict][google.cloud.automl.v1.PredictionService.BatchPredict]. -message BatchPredictRequest { - // Name of the model requested to serve the batch prediction. - string name = 1; - - // Required. The input configuration for batch prediction. - BatchPredictInputConfig input_config = 3; - - // Required. The Configuration specifying where output predictions should - // be written. - BatchPredictOutputConfig output_config = 4; - - // Additional domain-specific parameters for the predictions, any string must - // be up to 25000 characters long. - // - // * For Text 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. - // - // * For Image 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. - // - // * For Image 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) No more than this number of bounding - // boxes will be produced per image. Default is 100, the - // requested value may be limited by server. - map params = 5; -} - -// Result of the Batch Predict. This message is returned in -// [response][google.longrunning.Operation.response] of the operation returned -// by the -// [PredictionService.BatchPredict][google.cloud.automl.v1.PredictionService.BatchPredict]. -message BatchPredictResult { - // Additional domain-specific prediction response metadata. - // - // * For Image Object Detection: - // `max_bounding_box_count` - (int64) At most that many bounding boxes per - // image could have been returned. - map metadata = 1; -} diff --git a/automl/google/cloud/automl_v1/proto/prediction_service_pb2.py b/automl/google/cloud/automl_v1/proto/prediction_service_pb2.py deleted file mode 100644 index 7e41c82a70db..000000000000 --- a/automl/google/cloud/automl_v1/proto/prediction_service_pb2.py +++ /dev/null @@ -1,843 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1/proto/prediction_service.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.automl_v1.proto import ( - annotation_payload_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_annotation__payload__pb2, -) -from google.cloud.automl_v1.proto import ( - data_items_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_data__items__pb2, -) -from google.cloud.automl_v1.proto import ( - io_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_io__pb2, -) -from google.cloud.automl_v1.proto import ( - operations_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_operations__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1/proto/prediction_service.proto", - package="google.cloud.automl.v1", - syntax="proto3", - serialized_options=_b( - "\n\032com.google.cloud.automl.v1B\026PredictionServiceProtoP\001Z The dataset has - // translation_dataset_metadata. - string filter = 3; - - // Requested page size. Server may return fewer results than requested. - // If unspecified, server will pick a default size. - int32 page_size = 4; - - // 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. - string page_token = 6; -} - -// Response message for -// [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets]. -message ListDatasetsResponse { - // The datasets read. - repeated Dataset datasets = 1; - - // A token to retrieve next page of results. - // Pass to - // [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] - // to obtain that page. - string next_page_token = 2; -} - -// Request message for -// [AutoMl.UpdateDataset][google.cloud.automl.v1.AutoMl.UpdateDataset] -message UpdateDatasetRequest { - // The dataset which replaces the resource on the server. - Dataset dataset = 1; - - // Required. The update mask applies to the resource. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for -// [AutoMl.DeleteDataset][google.cloud.automl.v1.AutoMl.DeleteDataset]. -message DeleteDatasetRequest { - // The resource name of the dataset to delete. - string name = 1; -} - -// Request message for -// [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData]. -message ImportDataRequest { - // Required. Dataset name. Dataset must already exist. All imported - // annotations and examples will be added. - string name = 1; - - // Required. The desired input location and its domain specific semantics, - // if any. - InputConfig input_config = 3; -} - -// Request message for -// [AutoMl.ExportData][google.cloud.automl.v1.AutoMl.ExportData]. -message ExportDataRequest { - // Required. The resource name of the dataset. - string name = 1; - - // Required. The desired output location. - OutputConfig output_config = 3; -} - -// Request message for -// [AutoMl.GetAnnotationSpec][google.cloud.automl.v1.AutoMl.GetAnnotationSpec]. -message GetAnnotationSpecRequest { - // The resource name of the annotation spec to retrieve. - string name = 1; -} - -// Request message for -// [AutoMl.CreateModel][google.cloud.automl.v1.AutoMl.CreateModel]. -message CreateModelRequest { - // Resource name of the parent project where the model is being created. - string parent = 1; - - // The model to create. - Model model = 4; -} - -// Request message for -// [AutoMl.GetModel][google.cloud.automl.v1.AutoMl.GetModel]. -message GetModelRequest { - // Resource name of the model. - string name = 1; -} - -// Request message for -// [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels]. -message ListModelsRequest { - // Resource name of the project, from which to list the models. - string parent = 1; - - // An expression for filtering the results of the request. - // - // * `model_metadata` - for existence of the case (e.g. - // image_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. - string filter = 3; - - // Requested page size. - int32 page_size = 4; - - // 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. - string page_token = 6; -} - -// Response message for -// [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels]. -message ListModelsResponse { - // List of models in the requested page. - repeated Model model = 1; - - // A token to retrieve next page of results. - // Pass to - // [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] - // to obtain that page. - string next_page_token = 2; -} - -// Request message for -// [AutoMl.DeleteModel][google.cloud.automl.v1.AutoMl.DeleteModel]. -message DeleteModelRequest { - // Resource name of the model being deleted. - string name = 1; -} - -// Request message for -// [AutoMl.UpdateModel][google.cloud.automl.v1.AutoMl.UpdateModel] -message UpdateModelRequest { - // The model which replaces the resource on the server. - Model model = 1; - - // Required. The update mask applies to the resource. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for -// [AutoMl.DeployModel][google.cloud.automl.v1.AutoMl.DeployModel]. -message DeployModelRequest { - // The per-domain specific deployment parameters. - oneof model_deployment_metadata { - // Model deployment metadata specific to Image Object Detection. - ImageObjectDetectionModelDeploymentMetadata - image_object_detection_model_deployment_metadata = 2; - - // Model deployment metadata specific to Image Classification. - ImageClassificationModelDeploymentMetadata - image_classification_model_deployment_metadata = 4; - } - - // Resource name of the model to deploy. - string name = 1; -} - -// Request message for -// [AutoMl.UndeployModel][google.cloud.automl.v1.AutoMl.UndeployModel]. -message UndeployModelRequest { - // Resource name of the model to undeploy. - string name = 1; -} - -// Request message for -// [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]. Models need -// to be enabled for exporting, otherwise an error code will be returned. -message ExportModelRequest { - // Required. The resource name of the model to export. - string name = 1; - - // Required. The desired output location and configuration. - ModelExportOutputConfig output_config = 3; -} - -// Request message for -// [AutoMl.GetModelEvaluation][google.cloud.automl.v1.AutoMl.GetModelEvaluation]. -message GetModelEvaluationRequest { - // Resource name for the model evaluation. - string name = 1; -} - -// Request message for -// [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations]. -message ListModelEvaluationsRequest { - // 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. - string parent = 1; - - // 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. - string filter = 3; - - // Requested page size. - int32 page_size = 4; - - // 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. - string page_token = 6; -} - -// Response message for -// [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations]. -message ListModelEvaluationsResponse { - // List of model evaluations in the requested page. - repeated ModelEvaluation model_evaluation = 1; - - // 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. - string next_page_token = 2; -} diff --git a/automl/google/cloud/automl_v1/proto/service_pb2.py b/automl/google/cloud/automl_v1/proto/service_pb2.py deleted file mode 100644 index c41a58f90f1d..000000000000 --- a/automl/google/cloud/automl_v1/proto/service_pb2.py +++ /dev/null @@ -1,2084 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1/proto/service.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.automl_v1.proto import ( - annotation_payload_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_annotation__payload__pb2, -) -from google.cloud.automl_v1.proto import ( - annotation_spec_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_annotation__spec__pb2, -) -from google.cloud.automl_v1.proto import ( - dataset_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_dataset__pb2, -) -from google.cloud.automl_v1.proto import ( - image_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_image__pb2, -) -from google.cloud.automl_v1.proto import ( - io_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_io__pb2, -) -from google.cloud.automl_v1.proto import ( - model_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_model__pb2, -) -from google.cloud.automl_v1.proto import ( - model_evaluation_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_model__evaluation__pb2, -) -from google.cloud.automl_v1.proto import ( - operations_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_operations__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1/proto/service.proto", - package="google.cloud.automl.v1", - syntax="proto3", - serialized_options=_b( - "\n\032com.google.cloud.automl.v1B\013AutoMlProtoP\001Z/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}\x12\x93\x01\n\x0b\x43reateModel\x12*.google.cloud.automl.v1.CreateModelRequest\x1a\x1d.google.longrunning.Operation"9\x82\xd3\xe4\x93\x02\x33"*/v1/{parent=projects/*/locations/*}/models:\x05model\x12\x86\x01\n\x08GetModel\x12\'.google.cloud.automl.v1.GetModelRequest\x1a\x1d.google.cloud.automl.v1.Model"2\x82\xd3\xe4\x93\x02,\x12*/v1/{name=projects/*/locations/*/models/*}\x12\x97\x01\n\nListModels\x12).google.cloud.automl.v1.ListModelsRequest\x1a*.google.cloud.automl.v1.ListModelsResponse"2\x82\xd3\xe4\x93\x02,\x12*/v1/{parent=projects/*/locations/*}/models\x12\x8c\x01\n\x0b\x44\x65leteModel\x12*.google.cloud.automl.v1.DeleteModelRequest\x1a\x1d.google.longrunning.Operation"2\x82\xd3\xe4\x93\x02,**/v1/{name=projects/*/locations/*/models/*}\x12\x99\x01\n\x0bUpdateModel\x12*.google.cloud.automl.v1.UpdateModelRequest\x1a\x1d.google.cloud.automl.v1.Model"?\x82\xd3\xe4\x93\x02\x39\x32\x30/v1/{model.name=projects/*/locations/*/models/*}:\x05model\x12\x96\x01\n\x0b\x44\x65ployModel\x12*.google.cloud.automl.v1.DeployModelRequest\x1a\x1d.google.longrunning.Operation"<\x82\xd3\xe4\x93\x02\x36"1/v1/{name=projects/*/locations/*/models/*}:deploy:\x01*\x12\x9c\x01\n\rUndeployModel\x12,.google.cloud.automl.v1.UndeployModelRequest\x1a\x1d.google.longrunning.Operation">\x82\xd3\xe4\x93\x02\x38"3/v1/{name=projects/*/locations/*/models/*}:undeploy:\x01*\x12\x96\x01\n\x0b\x45xportModel\x12*.google.cloud.automl.v1.ExportModelRequest\x1a\x1d.google.longrunning.Operation"<\x82\xd3\xe4\x93\x02\x36"1/v1/{name=projects/*/locations/*/models/*}:export:\x01*\x12\xb7\x01\n\x12GetModelEvaluation\x12\x31.google.cloud.automl.v1.GetModelEvaluationRequest\x1a\'.google.cloud.automl.v1.ModelEvaluation"E\x82\xd3\xe4\x93\x02?\x12=/v1/{name=projects/*/locations/*/models/*/modelEvaluations/*}\x12\xc8\x01\n\x14ListModelEvaluations\x12\x33.google.cloud.automl.v1.ListModelEvaluationsRequest\x1a\x34.google.cloud.automl.v1.ListModelEvaluationsResponse"E\x82\xd3\xe4\x93\x02?\x12=/v1/{parent=projects/*/locations/*/models/*}/modelEvaluations\x1aI\xca\x41\x15\x61utoml.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb7\x01\n\x1a\x63om.google.cloud.automl.v1B\x0b\x41utoMlProtoP\x01Z The dataset has - translation\_dataset\_metadata. - page_size: - Requested page size. Server may return fewer results than - requested. If unspecified, server will pick a default size. - 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\_toke - n] of the previous [AutoMl.ListDatasets][google.cloud.automl.v - 1.AutoMl.ListDatasets] call. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ListDatasetsRequest) - ), -) -_sym_db.RegisterMessage(ListDatasetsRequest) - -ListDatasetsResponse = _reflection.GeneratedProtocolMessageType( - "ListDatasetsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTDATASETSRESPONSE, - __module__="google.cloud.automl_v1.proto.service_pb2", - __doc__="""Response message for - [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets]. - - - Attributes: - datasets: - The datasets read. - next_page_token: - A token to retrieve next page of results. Pass to [ListDataset - sRequest.page\_token][google.cloud.automl.v1.ListDatasetsReque - st.page\_token] to obtain that page. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ListDatasetsResponse) - ), -) -_sym_db.RegisterMessage(ListDatasetsResponse) - -UpdateDatasetRequest = _reflection.GeneratedProtocolMessageType( - "UpdateDatasetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEDATASETREQUEST, - __module__="google.cloud.automl_v1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.UpdateDataset][google.cloud.automl.v1.AutoMl.UpdateDataset] - - - Attributes: - dataset: - The dataset which replaces the resource on the server. - update_mask: - Required. The update mask applies to the resource. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.UpdateDatasetRequest) - ), -) -_sym_db.RegisterMessage(UpdateDatasetRequest) - -DeleteDatasetRequest = _reflection.GeneratedProtocolMessageType( - "DeleteDatasetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEDATASETREQUEST, - __module__="google.cloud.automl_v1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.DeleteDataset][google.cloud.automl.v1.AutoMl.DeleteDataset]. - - - Attributes: - name: - The resource name of the dataset to delete. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.DeleteDatasetRequest) - ), -) -_sym_db.RegisterMessage(DeleteDatasetRequest) - -ImportDataRequest = _reflection.GeneratedProtocolMessageType( - "ImportDataRequest", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTDATAREQUEST, - __module__="google.cloud.automl_v1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData]. - - - Attributes: - name: - Required. Dataset name. Dataset must already exist. All - imported annotations and examples will be added. - input_config: - Required. The desired input location and its domain specific - semantics, if any. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ImportDataRequest) - ), -) -_sym_db.RegisterMessage(ImportDataRequest) - -ExportDataRequest = _reflection.GeneratedProtocolMessageType( - "ExportDataRequest", - (_message.Message,), - dict( - DESCRIPTOR=_EXPORTDATAREQUEST, - __module__="google.cloud.automl_v1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.ExportData][google.cloud.automl.v1.AutoMl.ExportData]. - - - Attributes: - name: - Required. The resource name of the dataset. - output_config: - Required. The desired output location. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ExportDataRequest) - ), -) -_sym_db.RegisterMessage(ExportDataRequest) - -GetAnnotationSpecRequest = _reflection.GeneratedProtocolMessageType( - "GetAnnotationSpecRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETANNOTATIONSPECREQUEST, - __module__="google.cloud.automl_v1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.GetAnnotationSpec][google.cloud.automl.v1.AutoMl.GetAnnotationSpec]. - - - Attributes: - name: - The resource name of the annotation spec to retrieve. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.GetAnnotationSpecRequest) - ), -) -_sym_db.RegisterMessage(GetAnnotationSpecRequest) - -CreateModelRequest = _reflection.GeneratedProtocolMessageType( - "CreateModelRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEMODELREQUEST, - __module__="google.cloud.automl_v1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.CreateModel][google.cloud.automl.v1.AutoMl.CreateModel]. - - - Attributes: - parent: - Resource name of the parent project where the model is being - created. - model: - The model to create. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.CreateModelRequest) - ), -) -_sym_db.RegisterMessage(CreateModelRequest) - -GetModelRequest = _reflection.GeneratedProtocolMessageType( - "GetModelRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETMODELREQUEST, - __module__="google.cloud.automl_v1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.GetModel][google.cloud.automl.v1.AutoMl.GetModel]. - - - Attributes: - name: - Resource name of the model. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.GetModelRequest) - ), -) -_sym_db.RegisterMessage(GetModelRequest) - -ListModelsRequest = _reflection.GeneratedProtocolMessageType( - "ListModelsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTMODELSREQUEST, - __module__="google.cloud.automl_v1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels]. - - - Attributes: - parent: - Resource name of the project, from which to list the models. - filter: - An expression for filtering the results of the request. - - ``model_metadata`` - for existence of the case (e.g. - image\_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. - page_size: - Requested page size. - 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. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ListModelsRequest) - ), -) -_sym_db.RegisterMessage(ListModelsRequest) - -ListModelsResponse = _reflection.GeneratedProtocolMessageType( - "ListModelsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTMODELSRESPONSE, - __module__="google.cloud.automl_v1.proto.service_pb2", - __doc__="""Response message for - [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels]. - - - Attributes: - model: - List of models in the requested page. - next_page_token: - A token to retrieve next page of results. Pass to [ListModelsR - equest.page\_token][google.cloud.automl.v1.ListModelsRequest.p - age\_token] to obtain that page. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ListModelsResponse) - ), -) -_sym_db.RegisterMessage(ListModelsResponse) - -DeleteModelRequest = _reflection.GeneratedProtocolMessageType( - "DeleteModelRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEMODELREQUEST, - __module__="google.cloud.automl_v1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.DeleteModel][google.cloud.automl.v1.AutoMl.DeleteModel]. - - - Attributes: - name: - Resource name of the model being deleted. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.DeleteModelRequest) - ), -) -_sym_db.RegisterMessage(DeleteModelRequest) - -UpdateModelRequest = _reflection.GeneratedProtocolMessageType( - "UpdateModelRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEMODELREQUEST, - __module__="google.cloud.automl_v1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.UpdateModel][google.cloud.automl.v1.AutoMl.UpdateModel] - - - Attributes: - model: - The model which replaces the resource on the server. - update_mask: - Required. The update mask applies to the resource. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.UpdateModelRequest) - ), -) -_sym_db.RegisterMessage(UpdateModelRequest) - -DeployModelRequest = _reflection.GeneratedProtocolMessageType( - "DeployModelRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DEPLOYMODELREQUEST, - __module__="google.cloud.automl_v1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.DeployModel][google.cloud.automl.v1.AutoMl.DeployModel]. - - - Attributes: - model_deployment_metadata: - The per-domain specific deployment parameters. - image_object_detection_model_deployment_metadata: - Model deployment metadata specific to Image Object Detection. - image_classification_model_deployment_metadata: - Model deployment metadata specific to Image Classification. - name: - Resource name of the model to deploy. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.DeployModelRequest) - ), -) -_sym_db.RegisterMessage(DeployModelRequest) - -UndeployModelRequest = _reflection.GeneratedProtocolMessageType( - "UndeployModelRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UNDEPLOYMODELREQUEST, - __module__="google.cloud.automl_v1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.UndeployModel][google.cloud.automl.v1.AutoMl.UndeployModel]. - - - Attributes: - name: - Resource name of the model to undeploy. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.UndeployModelRequest) - ), -) -_sym_db.RegisterMessage(UndeployModelRequest) - -ExportModelRequest = _reflection.GeneratedProtocolMessageType( - "ExportModelRequest", - (_message.Message,), - dict( - DESCRIPTOR=_EXPORTMODELREQUEST, - __module__="google.cloud.automl_v1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]. Models - need to be enabled for exporting, otherwise an error code will be - returned. - - - Attributes: - name: - Required. The resource name of the model to export. - output_config: - Required. The desired output location and configuration. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ExportModelRequest) - ), -) -_sym_db.RegisterMessage(ExportModelRequest) - -GetModelEvaluationRequest = _reflection.GeneratedProtocolMessageType( - "GetModelEvaluationRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETMODELEVALUATIONREQUEST, - __module__="google.cloud.automl_v1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.GetModelEvaluation][google.cloud.automl.v1.AutoMl.GetModelEvaluation]. - - - Attributes: - name: - Resource name for the model evaluation. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.GetModelEvaluationRequest) - ), -) -_sym_db.RegisterMessage(GetModelEvaluationRequest) - -ListModelEvaluationsRequest = _reflection.GeneratedProtocolMessageType( - "ListModelEvaluationsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTMODELEVALUATIONSREQUEST, - __module__="google.cloud.automl_v1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations]. - - - Attributes: - parent: - 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. - filter: - 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. - page_size: - Requested page size. - page_token: - A token identifying a page of results for the server to - return. Typically obtained via [ListModelEvaluationsResponse.n - ext\_page\_token][google.cloud.automl.v1.ListModelEvaluationsR - esponse.next\_page\_token] of the previous [AutoMl.ListModelEv - aluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] - call. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ListModelEvaluationsRequest) - ), -) -_sym_db.RegisterMessage(ListModelEvaluationsRequest) - -ListModelEvaluationsResponse = _reflection.GeneratedProtocolMessageType( - "ListModelEvaluationsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTMODELEVALUATIONSRESPONSE, - __module__="google.cloud.automl_v1.proto.service_pb2", - __doc__="""Response message for - [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations]. - - - Attributes: - model_evaluation: - List of model evaluations in the requested page. - next_page_token: - A token to retrieve next page of results. Pass to the [ListMod - elEvaluationsRequest.page\_token][google.cloud.automl.v1.ListM - odelEvaluationsRequest.page\_token] field of a new [AutoMl.Lis - tModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEval - uations] request to obtain that page. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ListModelEvaluationsResponse) - ), -) -_sym_db.RegisterMessage(ListModelEvaluationsResponse) - - -DESCRIPTOR._options = None - -_AUTOML = _descriptor.ServiceDescriptor( - name="AutoMl", - full_name="google.cloud.automl.v1.AutoMl", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\025automl.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=2501, - serialized_end=5458, - methods=[ - _descriptor.MethodDescriptor( - name="CreateDataset", - full_name="google.cloud.automl.v1.AutoMl.CreateDataset", - index=0, - containing_service=None, - input_type=_CREATEDATASETREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\0027",/v1/{parent=projects/*/locations/*}/datasets:\007dataset' - ), - ), - _descriptor.MethodDescriptor( - name="GetDataset", - full_name="google.cloud.automl.v1.AutoMl.GetDataset", - index=1, - containing_service=None, - input_type=_GETDATASETREQUEST, - output_type=google_dot_cloud_dot_automl__v1_dot_proto_dot_dataset__pb2._DATASET, - serialized_options=_b( - "\202\323\344\223\002.\022,/v1/{name=projects/*/locations/*/datasets/*}" - ), - ), - _descriptor.MethodDescriptor( - name="ListDatasets", - full_name="google.cloud.automl.v1.AutoMl.ListDatasets", - index=2, - containing_service=None, - input_type=_LISTDATASETSREQUEST, - output_type=_LISTDATASETSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002.\022,/v1/{parent=projects/*/locations/*}/datasets" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateDataset", - full_name="google.cloud.automl.v1.AutoMl.UpdateDataset", - index=3, - containing_service=None, - input_type=_UPDATEDATASETREQUEST, - output_type=google_dot_cloud_dot_automl__v1_dot_proto_dot_dataset__pb2._DATASET, - serialized_options=_b( - "\202\323\344\223\002?24/v1/{dataset.name=projects/*/locations/*/datasets/*}:\007dataset" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteDataset", - full_name="google.cloud.automl.v1.AutoMl.DeleteDataset", - index=4, - containing_service=None, - input_type=_DELETEDATASETREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - "\202\323\344\223\002.*,/v1/{name=projects/*/locations/*/datasets/*}" - ), - ), - _descriptor.MethodDescriptor( - name="ImportData", - full_name="google.cloud.automl.v1.AutoMl.ImportData", - index=5, - containing_service=None, - input_type=_IMPORTDATAREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002<"7/v1/{name=projects/*/locations/*/datasets/*}:importData:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="ExportData", - full_name="google.cloud.automl.v1.AutoMl.ExportData", - index=6, - containing_service=None, - input_type=_EXPORTDATAREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002<"7/v1/{name=projects/*/locations/*/datasets/*}:exportData:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="GetAnnotationSpec", - full_name="google.cloud.automl.v1.AutoMl.GetAnnotationSpec", - index=7, - containing_service=None, - input_type=_GETANNOTATIONSPECREQUEST, - output_type=google_dot_cloud_dot_automl__v1_dot_proto_dot_annotation__spec__pb2._ANNOTATIONSPEC, - serialized_options=_b( - "\202\323\344\223\002@\022>/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}" - ), - ), - _descriptor.MethodDescriptor( - name="CreateModel", - full_name="google.cloud.automl.v1.AutoMl.CreateModel", - index=8, - containing_service=None, - input_type=_CREATEMODELREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\0023"*/v1/{parent=projects/*/locations/*}/models:\005model' - ), - ), - _descriptor.MethodDescriptor( - name="GetModel", - full_name="google.cloud.automl.v1.AutoMl.GetModel", - index=9, - containing_service=None, - input_type=_GETMODELREQUEST, - output_type=google_dot_cloud_dot_automl__v1_dot_proto_dot_model__pb2._MODEL, - serialized_options=_b( - "\202\323\344\223\002,\022*/v1/{name=projects/*/locations/*/models/*}" - ), - ), - _descriptor.MethodDescriptor( - name="ListModels", - full_name="google.cloud.automl.v1.AutoMl.ListModels", - index=10, - containing_service=None, - input_type=_LISTMODELSREQUEST, - output_type=_LISTMODELSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002,\022*/v1/{parent=projects/*/locations/*}/models" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteModel", - full_name="google.cloud.automl.v1.AutoMl.DeleteModel", - index=11, - containing_service=None, - input_type=_DELETEMODELREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - "\202\323\344\223\002,**/v1/{name=projects/*/locations/*/models/*}" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateModel", - full_name="google.cloud.automl.v1.AutoMl.UpdateModel", - index=12, - containing_service=None, - input_type=_UPDATEMODELREQUEST, - output_type=google_dot_cloud_dot_automl__v1_dot_proto_dot_model__pb2._MODEL, - serialized_options=_b( - "\202\323\344\223\002920/v1/{model.name=projects/*/locations/*/models/*}:\005model" - ), - ), - _descriptor.MethodDescriptor( - name="DeployModel", - full_name="google.cloud.automl.v1.AutoMl.DeployModel", - index=13, - containing_service=None, - input_type=_DEPLOYMODELREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\0026"1/v1/{name=projects/*/locations/*/models/*}:deploy:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="UndeployModel", - full_name="google.cloud.automl.v1.AutoMl.UndeployModel", - index=14, - containing_service=None, - input_type=_UNDEPLOYMODELREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\0028"3/v1/{name=projects/*/locations/*/models/*}:undeploy:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="ExportModel", - full_name="google.cloud.automl.v1.AutoMl.ExportModel", - index=15, - containing_service=None, - input_type=_EXPORTMODELREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\0026"1/v1/{name=projects/*/locations/*/models/*}:export:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="GetModelEvaluation", - full_name="google.cloud.automl.v1.AutoMl.GetModelEvaluation", - index=16, - containing_service=None, - input_type=_GETMODELEVALUATIONREQUEST, - output_type=google_dot_cloud_dot_automl__v1_dot_proto_dot_model__evaluation__pb2._MODELEVALUATION, - serialized_options=_b( - "\202\323\344\223\002?\022=/v1/{name=projects/*/locations/*/models/*/modelEvaluations/*}" - ), - ), - _descriptor.MethodDescriptor( - name="ListModelEvaluations", - full_name="google.cloud.automl.v1.AutoMl.ListModelEvaluations", - index=17, - containing_service=None, - input_type=_LISTMODELEVALUATIONSREQUEST, - output_type=_LISTMODELEVALUATIONSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002?\022=/v1/{parent=projects/*/locations/*/models/*}/modelEvaluations" - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_AUTOML) - -DESCRIPTOR.services_by_name["AutoMl"] = _AUTOML - -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1/proto/service_pb2_grpc.py b/automl/google/cloud/automl_v1/proto/service_pb2_grpc.py deleted file mode 100644 index 0ad909146595..000000000000 --- a/automl/google/cloud/automl_v1/proto/service_pb2_grpc.py +++ /dev/null @@ -1,416 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.automl_v1.proto import ( - annotation_spec_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_annotation__spec__pb2, -) -from google.cloud.automl_v1.proto import ( - dataset_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_dataset__pb2, -) -from google.cloud.automl_v1.proto import ( - model_evaluation_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_model__evaluation__pb2, -) -from google.cloud.automl_v1.proto import ( - model_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_model__pb2, -) -from google.cloud.automl_v1.proto import ( - service_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -class AutoMlStub(object): - """AutoML Server API. - - The resource names are assigned by the server. - The server never reuses names that it has created after the resources with - those names are deleted. - - An ID of a resource is the last element of the item's resource name. For - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then - the id for the item is `{dataset_id}`. - - Currently the only supported `location_id` is "us-central1". - - On any input that is documented to expect a string parameter in - snake_case or kebab-case, either of those cases is accepted. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateDataset = channel.unary_unary( - "/google.cloud.automl.v1.AutoMl/CreateDataset", - request_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.CreateDatasetRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.GetDataset = channel.unary_unary( - "/google.cloud.automl.v1.AutoMl/GetDataset", - request_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.GetDatasetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_dataset__pb2.Dataset.FromString, - ) - self.ListDatasets = channel.unary_unary( - "/google.cloud.automl.v1.AutoMl/ListDatasets", - request_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.ListDatasetsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.ListDatasetsResponse.FromString, - ) - self.UpdateDataset = channel.unary_unary( - "/google.cloud.automl.v1.AutoMl/UpdateDataset", - request_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.UpdateDatasetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_dataset__pb2.Dataset.FromString, - ) - self.DeleteDataset = channel.unary_unary( - "/google.cloud.automl.v1.AutoMl/DeleteDataset", - request_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.DeleteDatasetRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.ImportData = channel.unary_unary( - "/google.cloud.automl.v1.AutoMl/ImportData", - request_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.ImportDataRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.ExportData = channel.unary_unary( - "/google.cloud.automl.v1.AutoMl/ExportData", - request_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.ExportDataRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.GetAnnotationSpec = channel.unary_unary( - "/google.cloud.automl.v1.AutoMl/GetAnnotationSpec", - request_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.GetAnnotationSpecRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_annotation__spec__pb2.AnnotationSpec.FromString, - ) - self.CreateModel = channel.unary_unary( - "/google.cloud.automl.v1.AutoMl/CreateModel", - request_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.CreateModelRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.GetModel = channel.unary_unary( - "/google.cloud.automl.v1.AutoMl/GetModel", - request_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.GetModelRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_model__pb2.Model.FromString, - ) - self.ListModels = channel.unary_unary( - "/google.cloud.automl.v1.AutoMl/ListModels", - request_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.ListModelsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.ListModelsResponse.FromString, - ) - self.DeleteModel = channel.unary_unary( - "/google.cloud.automl.v1.AutoMl/DeleteModel", - request_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.DeleteModelRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.UpdateModel = channel.unary_unary( - "/google.cloud.automl.v1.AutoMl/UpdateModel", - request_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.UpdateModelRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_model__pb2.Model.FromString, - ) - self.DeployModel = channel.unary_unary( - "/google.cloud.automl.v1.AutoMl/DeployModel", - request_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.DeployModelRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.UndeployModel = channel.unary_unary( - "/google.cloud.automl.v1.AutoMl/UndeployModel", - request_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.UndeployModelRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.ExportModel = channel.unary_unary( - "/google.cloud.automl.v1.AutoMl/ExportModel", - request_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.ExportModelRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.GetModelEvaluation = channel.unary_unary( - "/google.cloud.automl.v1.AutoMl/GetModelEvaluation", - request_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.GetModelEvaluationRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_model__evaluation__pb2.ModelEvaluation.FromString, - ) - self.ListModelEvaluations = channel.unary_unary( - "/google.cloud.automl.v1.AutoMl/ListModelEvaluations", - request_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.ListModelEvaluationsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.ListModelEvaluationsResponse.FromString, - ) - - -class AutoMlServicer(object): - """AutoML Server API. - - The resource names are assigned by the server. - The server never reuses names that it has created after the resources with - those names are deleted. - - An ID of a resource is the last element of the item's resource name. For - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then - the id for the item is `{dataset_id}`. - - Currently the only supported `location_id` is "us-central1". - - On any input that is documented to expect a string parameter in - snake_case or kebab-case, either of those cases is accepted. - """ - - def CreateDataset(self, request, context): - """Creates a dataset. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetDataset(self, request, context): - """Gets a dataset. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListDatasets(self, request, context): - """Lists datasets in a project. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateDataset(self, request, context): - """Updates a dataset. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteDataset(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ImportData(self, request, context): - """Imports data into a dataset. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ExportData(self, request, context): - """Exports dataset's data to the provided output location. - Returns an empty response in the - [response][google.longrunning.Operation.response] field when it completes. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetAnnotationSpec(self, request, context): - """Gets an annotation spec. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateModel(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetModel(self, request, context): - """Gets a model. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListModels(self, request, context): - """Lists models. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteModel(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateModel(self, request, context): - """Updates a model. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeployModel(self, request, context): - """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.v1.ImageObjectDetectionModelDeploymentMetadata.node_number]) - will reset the deployment state without pausing the model's availability. - - Only applicable for Text Classification, Image Object Detection; all other - domains manage deployment automatically. - - Returns an empty response in the - [response][google.longrunning.Operation.response] field when it completes. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UndeployModel(self, request, context): - """Undeploys a model. If the model is not deployed this method has no effect. - - Only applicable for Text Classification, Image Object Detection; - all other domains manage deployment automatically. - - Returns an empty response in the - [response][google.longrunning.Operation.response] field when it completes. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ExportModel(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetModelEvaluation(self, request, context): - """Gets a model evaluation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListModelEvaluations(self, request, context): - """Lists model evaluations. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_AutoMlServicer_to_server(servicer, server): - rpc_method_handlers = { - "CreateDataset": grpc.unary_unary_rpc_method_handler( - servicer.CreateDataset, - request_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.CreateDatasetRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "GetDataset": grpc.unary_unary_rpc_method_handler( - servicer.GetDataset, - request_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.GetDatasetRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_dataset__pb2.Dataset.SerializeToString, - ), - "ListDatasets": grpc.unary_unary_rpc_method_handler( - servicer.ListDatasets, - request_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.ListDatasetsRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.ListDatasetsResponse.SerializeToString, - ), - "UpdateDataset": grpc.unary_unary_rpc_method_handler( - servicer.UpdateDataset, - request_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.UpdateDatasetRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_dataset__pb2.Dataset.SerializeToString, - ), - "DeleteDataset": grpc.unary_unary_rpc_method_handler( - servicer.DeleteDataset, - request_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.DeleteDatasetRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "ImportData": grpc.unary_unary_rpc_method_handler( - servicer.ImportData, - request_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.ImportDataRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "ExportData": grpc.unary_unary_rpc_method_handler( - servicer.ExportData, - request_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.ExportDataRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "GetAnnotationSpec": grpc.unary_unary_rpc_method_handler( - servicer.GetAnnotationSpec, - request_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.GetAnnotationSpecRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_annotation__spec__pb2.AnnotationSpec.SerializeToString, - ), - "CreateModel": grpc.unary_unary_rpc_method_handler( - servicer.CreateModel, - request_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.CreateModelRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "GetModel": grpc.unary_unary_rpc_method_handler( - servicer.GetModel, - request_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.GetModelRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_model__pb2.Model.SerializeToString, - ), - "ListModels": grpc.unary_unary_rpc_method_handler( - servicer.ListModels, - request_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.ListModelsRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.ListModelsResponse.SerializeToString, - ), - "DeleteModel": grpc.unary_unary_rpc_method_handler( - servicer.DeleteModel, - request_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.DeleteModelRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "UpdateModel": grpc.unary_unary_rpc_method_handler( - servicer.UpdateModel, - request_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.UpdateModelRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_model__pb2.Model.SerializeToString, - ), - "DeployModel": grpc.unary_unary_rpc_method_handler( - servicer.DeployModel, - request_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.DeployModelRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "UndeployModel": grpc.unary_unary_rpc_method_handler( - servicer.UndeployModel, - request_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.UndeployModelRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "ExportModel": grpc.unary_unary_rpc_method_handler( - servicer.ExportModel, - request_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.ExportModelRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "GetModelEvaluation": grpc.unary_unary_rpc_method_handler( - servicer.GetModelEvaluation, - request_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.GetModelEvaluationRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_model__evaluation__pb2.ModelEvaluation.SerializeToString, - ), - "ListModelEvaluations": grpc.unary_unary_rpc_method_handler( - servicer.ListModelEvaluations, - request_deserializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.ListModelEvaluationsRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1_dot_proto_dot_service__pb2.ListModelEvaluationsResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.automl.v1.AutoMl", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/automl/google/cloud/automl_v1/proto/text.proto b/automl/google/cloud/automl_v1/proto/text.proto deleted file mode 100644 index bffe9634f62f..000000000000 --- a/automl/google/cloud/automl_v1/proto/text.proto +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1; - -import "google/api/annotations.proto"; -import "google/cloud/automl/v1/classification.proto"; - -option csharp_namespace = "Google.Cloud.AutoML.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; -option java_multiple_files = true; -option java_outer_classname = "TextProto"; -option java_package = "com.google.cloud.automl.v1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1"; -option ruby_package = "Google::Cloud::AutoML::V1"; - -// Dataset metadata for classification. -message TextClassificationDatasetMetadata { - // Required. Type of the classification problem. - ClassificationType classification_type = 1; -} - -// Model metadata that is specific to text classification. -message TextClassificationModelMetadata { - // Output only. Classification type of the dataset used to train this model. - ClassificationType classification_type = 3; -} - -// Dataset metadata that is specific to text extraction -message TextExtractionDatasetMetadata {} - -// Model metadata that is specific to text extraction. -message TextExtractionModelMetadata {} - -// Dataset metadata for text sentiment. -message TextSentimentDatasetMetadata { - // 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). - int32 sentiment_max = 1; -} - -// Model metadata that is specific to text sentiment. -message TextSentimentModelMetadata {} diff --git a/automl/google/cloud/automl_v1/proto/text_extraction.proto b/automl/google/cloud/automl_v1/proto/text_extraction.proto deleted file mode 100644 index 02119f5c3ef6..000000000000 --- a/automl/google/cloud/automl_v1/proto/text_extraction.proto +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1; - -import "google/cloud/automl/v1/text_segment.proto"; -import "google/api/annotations.proto"; - -option csharp_namespace = "Google.Cloud.AutoML.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1"; -option ruby_package = "Google::Cloud::AutoML::V1"; - -// Annotation for identifying spans of text. -message TextExtractionAnnotation { - // Required. Text extraction annotations can either be a text segment or a - // text relation. - oneof annotation { - // An entity annotation will set this, which is the part of the original - // text to which the annotation pertains. - TextSegment text_segment = 3; - } - - // Output only. A confidence estimate between 0.0 and 1.0. A higher value - // means greater confidence in correctness of the annotation. - float score = 1; -} - -// Model evaluation metrics for text extraction problems. -message TextExtractionEvaluationMetrics { - // Metrics for a single confidence threshold. - message ConfidenceMetricsEntry { - // 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. - float confidence_threshold = 1; - - // Output only. Recall under the given confidence threshold. - float recall = 3; - - // Output only. Precision under the given confidence threshold. - float precision = 4; - - // Output only. The harmonic mean of recall and precision. - float f1_score = 5; - } - - // Output only. The Area under precision recall curve metric. - float au_prc = 1; - - // Output only. Metrics that have confidence thresholds. - // Precision-recall curve can be derived from it. - repeated ConfidenceMetricsEntry confidence_metrics_entries = 2; -} diff --git a/automl/google/cloud/automl_v1/proto/text_extraction_pb2.py b/automl/google/cloud/automl_v1/proto/text_extraction_pb2.py deleted file mode 100644 index c1106e2517d4..000000000000 --- a/automl/google/cloud/automl_v1/proto/text_extraction_pb2.py +++ /dev/null @@ -1,351 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1/proto/text_extraction.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.cloud.automl_v1.proto import ( - text_segment_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_text__segment__pb2, -) -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1/proto/text_extraction.proto", - package="google.cloud.automl.v1", - syntax="proto3", - serialized_options=_b( - "\n\032com.google.cloud.automl.v1P\001Z>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `dataset`: - >>> dataset = {} - >>> - >>> response = client.create_dataset(parent, dataset) - - Args: - parent (str): The resource name of the project to create the dataset for. - dataset (Union[dict, ~google.cloud.automl_v1beta1.types.Dataset]): The dataset to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.Dataset` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.Dataset` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_dataset" not in self._inner_api_calls: - self._inner_api_calls[ - "create_dataset" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_dataset, - default_retry=self._method_configs["CreateDataset"].retry, - default_timeout=self._method_configs["CreateDataset"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.CreateDatasetRequest(parent=parent, dataset=dataset) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_dataset"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_dataset( - self, - dataset, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates a dataset. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> # TODO: Initialize `dataset`: - >>> dataset = {} - >>> - >>> response = client.update_dataset(dataset) - - Args: - dataset (Union[dict, ~google.cloud.automl_v1beta1.types.Dataset]): The dataset which replaces the resource on the server. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.Dataset` - update_mask (Union[dict, ~google.cloud.automl_v1beta1.types.FieldMask]): The update mask applies to the resource. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.Dataset` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_dataset" not in self._inner_api_calls: - self._inner_api_calls[ - "update_dataset" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_dataset, - default_retry=self._method_configs["UpdateDataset"].retry, - default_timeout=self._method_configs["UpdateDataset"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.UpdateDatasetRequest( - dataset=dataset, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("dataset.name", dataset.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_dataset"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_dataset( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a dataset. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> name = client.dataset_path('[PROJECT]', '[LOCATION]', '[DATASET]') - >>> - >>> response = client.get_dataset(name) - - Args: - name (str): The resource name of the dataset to retrieve. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.Dataset` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_dataset" not in self._inner_api_calls: - self._inner_api_calls[ - "get_dataset" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_dataset, - default_retry=self._method_configs["GetDataset"].retry, - default_timeout=self._method_configs["GetDataset"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.GetDatasetRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_dataset"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_datasets( - self, - parent, - filter_=None, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists datasets in a project. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # Iterate over all results - >>> for element in client.list_datasets(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_datasets(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): The resource name of the project from which to list datasets. - filter_ (str): 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. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.automl_v1beta1.types.Dataset` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_datasets" not in self._inner_api_calls: - self._inner_api_calls[ - "list_datasets" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_datasets, - default_retry=self._method_configs["ListDatasets"].retry, - default_timeout=self._method_configs["ListDatasets"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.ListDatasetsRequest( - parent=parent, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_datasets"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="datasets", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def delete_dataset( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a dataset and all of its contents. Returns empty response in the - ``response`` field when it completes, and ``delete_details`` in the - ``metadata`` field. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> name = client.dataset_path('[PROJECT]', '[LOCATION]', '[DATASET]') - >>> - >>> response = client.delete_dataset(name) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): The resource name of the dataset to delete. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_dataset" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_dataset" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_dataset, - default_retry=self._method_configs["DeleteDataset"].retry, - default_timeout=self._method_configs["DeleteDataset"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.DeleteDatasetRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["delete_dataset"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - empty_pb2.Empty, - metadata_type=proto_operations_pb2.OperationMetadata, - ) - - def import_data( - self, - name, - input_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Imports data into a dataset. For Tables this method can only be called - on an empty Dataset. - - For Tables: - - - A ``schema_inference_version`` parameter must be explicitly set. - Returns an empty response in the ``response`` field when it - completes. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> name = client.dataset_path('[PROJECT]', '[LOCATION]', '[DATASET]') - >>> - >>> # TODO: Initialize `input_config`: - >>> input_config = {} - >>> - >>> response = client.import_data(name, input_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. Dataset name. Dataset must already exist. All imported - annotations and examples will be added. - input_config (Union[dict, ~google.cloud.automl_v1beta1.types.InputConfig]): Required. The desired input location and its domain specific semantics, - if any. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.InputConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "import_data" not in self._inner_api_calls: - self._inner_api_calls[ - "import_data" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.import_data, - default_retry=self._method_configs["ImportData"].retry, - default_timeout=self._method_configs["ImportData"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.ImportDataRequest(name=name, input_config=input_config) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["import_data"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - empty_pb2.Empty, - metadata_type=proto_operations_pb2.OperationMetadata, - ) - - def export_data( - self, - name, - output_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Exports dataset's data to the provided output location. Returns an empty - response in the ``response`` field when it completes. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> name = client.dataset_path('[PROJECT]', '[LOCATION]', '[DATASET]') - >>> - >>> # TODO: Initialize `output_config`: - >>> output_config = {} - >>> - >>> response = client.export_data(name, output_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. The resource name of the dataset. - output_config (Union[dict, ~google.cloud.automl_v1beta1.types.OutputConfig]): Required. The desired output location. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.OutputConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "export_data" not in self._inner_api_calls: - self._inner_api_calls[ - "export_data" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.export_data, - default_retry=self._method_configs["ExportData"].retry, - default_timeout=self._method_configs["ExportData"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.ExportDataRequest(name=name, output_config=output_config) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["export_data"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - empty_pb2.Empty, - metadata_type=proto_operations_pb2.OperationMetadata, - ) - - def create_model( - self, - parent, - model, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a model. Returns a Model in the ``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. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `model`: - >>> model = {} - >>> - >>> response = client.create_model(parent, model) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - parent (str): Resource name of the parent project where the model is being created. - model (Union[dict, ~google.cloud.automl_v1beta1.types.Model]): The model to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.Model` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_model" not in self._inner_api_calls: - self._inner_api_calls[ - "create_model" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_model, - default_retry=self._method_configs["CreateModel"].retry, - default_timeout=self._method_configs["CreateModel"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.CreateModelRequest(parent=parent, model=model) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["create_model"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - model_pb2.Model, - metadata_type=proto_operations_pb2.OperationMetadata, - ) - - def get_model( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a model. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]') - >>> - >>> response = client.get_model(name) - - Args: - name (str): Resource name of the model. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.Model` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_model" not in self._inner_api_calls: - self._inner_api_calls[ - "get_model" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_model, - default_retry=self._method_configs["GetModel"].retry, - default_timeout=self._method_configs["GetModel"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.GetModelRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_model"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_models( - self, - parent, - filter_=None, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists models. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # Iterate over all results - >>> for element in client.list_models(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_models(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Resource name of the project, from which to list the models. - filter_ (str): 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. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.automl_v1beta1.types.Model` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_models" not in self._inner_api_calls: - self._inner_api_calls[ - "list_models" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_models, - default_retry=self._method_configs["ListModels"].retry, - default_timeout=self._method_configs["ListModels"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.ListModelsRequest( - parent=parent, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_models"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="model", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def delete_model( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a model. Returns ``google.protobuf.Empty`` in the ``response`` - field when it completes, and ``delete_details`` in the ``metadata`` - field. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]') - >>> - >>> response = client.delete_model(name) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Resource name of the model being deleted. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_model" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_model" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_model, - default_retry=self._method_configs["DeleteModel"].retry, - default_timeout=self._method_configs["DeleteModel"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.DeleteModelRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["delete_model"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - empty_pb2.Empty, - metadata_type=proto_operations_pb2.OperationMetadata, - ) - - def deploy_model( - self, - name, - image_object_detection_model_deployment_metadata=None, - image_classification_model_deployment_metadata=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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``) will reset the deployment state without pausing the - model's availability. - - Only applicable for Text Classification, Image Object Detection and - Tables; all other domains manage deployment automatically. - - Returns an empty response in the ``response`` field when it completes. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]') - >>> - >>> response = client.deploy_model(name) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Resource name of the model to deploy. - image_object_detection_model_deployment_metadata (Union[dict, ~google.cloud.automl_v1beta1.types.ImageObjectDetectionModelDeploymentMetadata]): Model deployment metadata specific to Image Object Detection. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.ImageObjectDetectionModelDeploymentMetadata` - image_classification_model_deployment_metadata (Union[dict, ~google.cloud.automl_v1beta1.types.ImageClassificationModelDeploymentMetadata]): Model deployment metadata specific to Image Classification. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.ImageClassificationModelDeploymentMetadata` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "deploy_model" not in self._inner_api_calls: - self._inner_api_calls[ - "deploy_model" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.deploy_model, - default_retry=self._method_configs["DeployModel"].retry, - default_timeout=self._method_configs["DeployModel"].timeout, - client_info=self._client_info, - ) - - # Sanity check: We have some fields which are mutually exclusive; - # raise ValueError if more than one is sent. - google.api_core.protobuf_helpers.check_oneof( - image_object_detection_model_deployment_metadata=image_object_detection_model_deployment_metadata, - image_classification_model_deployment_metadata=image_classification_model_deployment_metadata, - ) - - request = service_pb2.DeployModelRequest( - name=name, - image_object_detection_model_deployment_metadata=image_object_detection_model_deployment_metadata, - image_classification_model_deployment_metadata=image_classification_model_deployment_metadata, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["deploy_model"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - empty_pb2.Empty, - metadata_type=proto_operations_pb2.OperationMetadata, - ) - - def undeploy_model( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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`` field when it completes. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]') - >>> - >>> response = client.undeploy_model(name) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Resource name of the model to undeploy. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "undeploy_model" not in self._inner_api_calls: - self._inner_api_calls[ - "undeploy_model" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.undeploy_model, - default_retry=self._method_configs["UndeployModel"].retry, - default_timeout=self._method_configs["UndeployModel"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.UndeployModelRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["undeploy_model"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - empty_pb2.Empty, - metadata_type=proto_operations_pb2.OperationMetadata, - ) - - def get_model_evaluation( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a model evaluation. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> name = client.model_evaluation_path('[PROJECT]', '[LOCATION]', '[MODEL]', '[MODEL_EVALUATION]') - >>> - >>> response = client.get_model_evaluation(name) - - Args: - name (str): Resource name for the model evaluation. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.ModelEvaluation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_model_evaluation" not in self._inner_api_calls: - self._inner_api_calls[ - "get_model_evaluation" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_model_evaluation, - default_retry=self._method_configs["GetModelEvaluation"].retry, - default_timeout=self._method_configs["GetModelEvaluation"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.GetModelEvaluationRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_model_evaluation"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def export_model( - self, - name, - output_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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``. - - Returns an empty response in the ``response`` field when it completes. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]') - >>> - >>> # TODO: Initialize `output_config`: - >>> output_config = {} - >>> - >>> response = client.export_model(name, output_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. The resource name of the model to export. - output_config (Union[dict, ~google.cloud.automl_v1beta1.types.ModelExportOutputConfig]): Required. The desired output location and configuration. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.ModelExportOutputConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "export_model" not in self._inner_api_calls: - self._inner_api_calls[ - "export_model" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.export_model, - default_retry=self._method_configs["ExportModel"].retry, - default_timeout=self._method_configs["ExportModel"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.ExportModelRequest(name=name, output_config=output_config) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["export_model"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - empty_pb2.Empty, - metadata_type=proto_operations_pb2.OperationMetadata, - ) - - def export_evaluated_examples( - self, - name, - output_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Exports examples on which the model was evaluated (i.e. which were in - the TEST set of the dataset the model was created from), together with - their ground truth annotations and the annotations created (predicted) - by the model. The examples, ground truth and predictions are exported in - the state they were at the moment the model was evaluated. - - This export is available only for 30 days since the model evaluation is - created. - - Currently only available for Tables. - - Returns an empty response in the ``response`` field when it completes. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]') - >>> - >>> # TODO: Initialize `output_config`: - >>> output_config = {} - >>> - >>> response = client.export_evaluated_examples(name, output_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. The resource name of the model whose evaluated examples are to - be exported. - output_config (Union[dict, ~google.cloud.automl_v1beta1.types.ExportEvaluatedExamplesOutputConfig]): Required. The desired output location and configuration. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.ExportEvaluatedExamplesOutputConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "export_evaluated_examples" not in self._inner_api_calls: - self._inner_api_calls[ - "export_evaluated_examples" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.export_evaluated_examples, - default_retry=self._method_configs["ExportEvaluatedExamples"].retry, - default_timeout=self._method_configs["ExportEvaluatedExamples"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.ExportEvaluatedExamplesRequest( - name=name, output_config=output_config - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["export_evaluated_examples"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - empty_pb2.Empty, - metadata_type=proto_operations_pb2.OperationMetadata, - ) - - def list_model_evaluations( - self, - parent, - filter_=None, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists model evaluations. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> parent = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]') - >>> - >>> # Iterate over all results - >>> for element in client.list_model_evaluations(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_model_evaluations(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): 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. - filter_ (str): 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. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.automl_v1beta1.types.ModelEvaluation` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_model_evaluations" not in self._inner_api_calls: - self._inner_api_calls[ - "list_model_evaluations" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_model_evaluations, - default_retry=self._method_configs["ListModelEvaluations"].retry, - default_timeout=self._method_configs["ListModelEvaluations"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.ListModelEvaluationsRequest( - parent=parent, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_model_evaluations"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="model_evaluation", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_annotation_spec( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets an annotation spec. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> name = client.annotation_spec_path('[PROJECT]', '[LOCATION]', '[DATASET]', '[ANNOTATION_SPEC]') - >>> - >>> response = client.get_annotation_spec(name) - - Args: - name (str): The resource name of the annotation spec to retrieve. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.AnnotationSpec` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_annotation_spec" not in self._inner_api_calls: - self._inner_api_calls[ - "get_annotation_spec" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_annotation_spec, - default_retry=self._method_configs["GetAnnotationSpec"].retry, - default_timeout=self._method_configs["GetAnnotationSpec"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.GetAnnotationSpecRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_annotation_spec"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_table_spec( - self, - name, - field_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a table spec. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> name = client.table_spec_path('[PROJECT]', '[LOCATION]', '[DATASET]', '[TABLE_SPEC]') - >>> - >>> response = client.get_table_spec(name) - - Args: - name (str): The resource name of the table spec to retrieve. - field_mask (Union[dict, ~google.cloud.automl_v1beta1.types.FieldMask]): Mask specifying which fields to read. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.TableSpec` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_table_spec" not in self._inner_api_calls: - self._inner_api_calls[ - "get_table_spec" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_table_spec, - default_retry=self._method_configs["GetTableSpec"].retry, - default_timeout=self._method_configs["GetTableSpec"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.GetTableSpecRequest(name=name, field_mask=field_mask) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_table_spec"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_table_specs( - self, - parent, - field_mask=None, - filter_=None, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists table specs in a dataset. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> parent = client.dataset_path('[PROJECT]', '[LOCATION]', '[DATASET]') - >>> - >>> # Iterate over all results - >>> for element in client.list_table_specs(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_table_specs(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): The resource name of the dataset to list table specs from. - field_mask (Union[dict, ~google.cloud.automl_v1beta1.types.FieldMask]): Mask specifying which fields to read. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.FieldMask` - filter_ (str): Filter expression, see go/filtering. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.automl_v1beta1.types.TableSpec` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_table_specs" not in self._inner_api_calls: - self._inner_api_calls[ - "list_table_specs" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_table_specs, - default_retry=self._method_configs["ListTableSpecs"].retry, - default_timeout=self._method_configs["ListTableSpecs"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.ListTableSpecsRequest( - parent=parent, field_mask=field_mask, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_table_specs"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="table_specs", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def update_table_spec( - self, - table_spec, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates a table spec. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> # TODO: Initialize `table_spec`: - >>> table_spec = {} - >>> - >>> response = client.update_table_spec(table_spec) - - Args: - table_spec (Union[dict, ~google.cloud.automl_v1beta1.types.TableSpec]): The table spec which replaces the resource on the server. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.TableSpec` - update_mask (Union[dict, ~google.cloud.automl_v1beta1.types.FieldMask]): The update mask applies to the resource. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.TableSpec` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_table_spec" not in self._inner_api_calls: - self._inner_api_calls[ - "update_table_spec" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_table_spec, - default_retry=self._method_configs["UpdateTableSpec"].retry, - default_timeout=self._method_configs["UpdateTableSpec"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.UpdateTableSpecRequest( - table_spec=table_spec, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("table_spec.name", table_spec.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_table_spec"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_column_spec( - self, - name, - field_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a column spec. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> name = client.column_spec_path('[PROJECT]', '[LOCATION]', '[DATASET]', '[TABLE_SPEC]', '[COLUMN_SPEC]') - >>> - >>> response = client.get_column_spec(name) - - Args: - name (str): The resource name of the column spec to retrieve. - field_mask (Union[dict, ~google.cloud.automl_v1beta1.types.FieldMask]): Mask specifying which fields to read. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.ColumnSpec` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_column_spec" not in self._inner_api_calls: - self._inner_api_calls[ - "get_column_spec" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_column_spec, - default_retry=self._method_configs["GetColumnSpec"].retry, - default_timeout=self._method_configs["GetColumnSpec"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.GetColumnSpecRequest(name=name, field_mask=field_mask) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_column_spec"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_column_specs( - self, - parent, - field_mask=None, - filter_=None, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists column specs in a table spec. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> parent = client.table_spec_path('[PROJECT]', '[LOCATION]', '[DATASET]', '[TABLE_SPEC]') - >>> - >>> # Iterate over all results - >>> for element in client.list_column_specs(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_column_specs(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): The resource name of the table spec to list column specs from. - field_mask (Union[dict, ~google.cloud.automl_v1beta1.types.FieldMask]): Mask specifying which fields to read. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.FieldMask` - filter_ (str): Filter expression, see go/filtering. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.automl_v1beta1.types.ColumnSpec` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_column_specs" not in self._inner_api_calls: - self._inner_api_calls[ - "list_column_specs" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_column_specs, - default_retry=self._method_configs["ListColumnSpecs"].retry, - default_timeout=self._method_configs["ListColumnSpecs"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.ListColumnSpecsRequest( - parent=parent, field_mask=field_mask, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_column_specs"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="column_specs", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def update_column_spec( - self, - column_spec, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates a column spec. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.AutoMlClient() - >>> - >>> # TODO: Initialize `column_spec`: - >>> column_spec = {} - >>> - >>> response = client.update_column_spec(column_spec) - - Args: - column_spec (Union[dict, ~google.cloud.automl_v1beta1.types.ColumnSpec]): The column spec which replaces the resource on the server. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.ColumnSpec` - update_mask (Union[dict, ~google.cloud.automl_v1beta1.types.FieldMask]): The update mask applies to the resource. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.ColumnSpec` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_column_spec" not in self._inner_api_calls: - self._inner_api_calls[ - "update_column_spec" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_column_spec, - default_retry=self._method_configs["UpdateColumnSpec"].retry, - default_timeout=self._method_configs["UpdateColumnSpec"].timeout, - client_info=self._client_info, - ) - - request = service_pb2.UpdateColumnSpecRequest( - column_spec=column_spec, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("column_spec.name", column_spec.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_column_spec"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/automl/google/cloud/automl_v1beta1/gapic/auto_ml_client_config.py b/automl/google/cloud/automl_v1beta1/gapic/auto_ml_client_config.py deleted file mode 100644 index d127ce6f478b..000000000000 --- a/automl/google/cloud/automl_v1beta1/gapic/auto_ml_client_config.py +++ /dev/null @@ -1,143 +0,0 @@ -config = { - "interfaces": { - "google.cloud.automl.v1beta1.AutoMl": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "CreateDataset": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateDataset": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetDataset": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListDatasets": { - "timeout_millis": 50000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteDataset": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ImportData": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ExportData": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "CreateModel": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetModel": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListModels": { - "timeout_millis": 50000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteModel": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeployModel": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UndeployModel": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetModelEvaluation": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ExportModel": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ExportEvaluatedExamples": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListModelEvaluations": { - "timeout_millis": 50000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetAnnotationSpec": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetTableSpec": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListTableSpecs": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateTableSpec": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetColumnSpec": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListColumnSpecs": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateColumnSpec": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/automl/google/cloud/automl_v1beta1/gapic/enums.py b/automl/google/cloud/automl_v1beta1/gapic/enums.py deleted file mode 100644 index 9f09f9cedcb4..000000000000 --- a/automl/google/cloud/automl_v1beta1/gapic/enums.py +++ /dev/null @@ -1,158 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class ClassificationType(enum.IntEnum): - """ - Type of the classification problem. - - Attributes: - CLASSIFICATION_TYPE_UNSPECIFIED (int): An un-set value of this enum. - MULTICLASS (int): At most one label is allowed per example. - MULTILABEL (int): Multiple labels are allowed for one example. - """ - - CLASSIFICATION_TYPE_UNSPECIFIED = 0 - MULTICLASS = 1 - MULTILABEL = 2 - - -class NullValue(enum.IntEnum): - """ - ``NullValue`` is a singleton enumeration to represent the null value for - the ``Value`` type union. - - The JSON representation for ``NullValue`` is JSON ``null``. - - Attributes: - NULL_VALUE (int): Null value. - """ - - NULL_VALUE = 0 - - -class TypeCode(enum.IntEnum): - """ - ``TypeCode`` is used as a part of ``DataType``. - - Attributes: - TYPE_CODE_UNSPECIFIED (int): Not specified. Should not be used. - FLOAT64 (int): Encoded as ``number``, or the strings ``"NaN"``, ``"Infinity"``, or - ``"-Infinity"``. - TIMESTAMP (int): Must be between 0AD and 9999AD. Encoded as ``string`` according to - ``time_format``, or, if that format is not set, then in RFC 3339 - ``date-time`` format, where ``time-offset`` = ``"Z"`` (e.g. - 1985-04-12T23:20:50.52Z). - STRING (int): Encoded as ``string``. - ARRAY (int): Encoded as ``list``, where the list elements are represented according - to - - ``list_element_type``. - STRUCT (int): Encoded as ``struct``, where field values are represented according to - ``struct_type``. - CATEGORY (int): Values of this type are not further understood by AutoML, e.g. AutoML is - unable to tell the order of values (as it could with FLOAT64), or is - unable to say if one value contains another (as it could with STRING). - Encoded as ``string`` (bytes should be base64-encoded, as described in - RFC 4648, section 4). - """ - - TYPE_CODE_UNSPECIFIED = 0 - FLOAT64 = 3 - TIMESTAMP = 4 - STRING = 6 - ARRAY = 8 - STRUCT = 9 - CATEGORY = 10 - - -class Document(object): - class Layout(object): - class TextSegmentType(enum.IntEnum): - """ - The type of TextSegment in the context of the original document. - - Attributes: - TEXT_SEGMENT_TYPE_UNSPECIFIED (int): Should not be used. - TOKEN (int): The text segment is a token. e.g. word. - PARAGRAPH (int): The text segment is a paragraph. - FORM_FIELD (int): The text segment is a form field. - FORM_FIELD_NAME (int): 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. - FORM_FIELD_CONTENTS (int): 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. - TABLE (int): The text segment is a whole table, including headers, and all rows. - TABLE_HEADER (int): 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. - TABLE_ROW (int): 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. - TABLE_CELL (int): 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. - """ - - TEXT_SEGMENT_TYPE_UNSPECIFIED = 0 - TOKEN = 1 - PARAGRAPH = 2 - FORM_FIELD = 3 - FORM_FIELD_NAME = 4 - FORM_FIELD_CONTENTS = 5 - TABLE = 6 - TABLE_HEADER = 7 - TABLE_ROW = 8 - TABLE_CELL = 9 - - -class DocumentDimensions(object): - class DocumentDimensionUnit(enum.IntEnum): - """ - Unit of the document dimension. - - Attributes: - DOCUMENT_DIMENSION_UNIT_UNSPECIFIED (int): Should not be used. - INCH (int): Document dimension is measured in inches. - CENTIMETER (int): Document dimension is measured in centimeters. - POINT (int): Document dimension is measured in points. 72 points = 1 inch. - """ - - DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0 - INCH = 1 - CENTIMETER = 2 - POINT = 3 - - -class Model(object): - class DeploymentState(enum.IntEnum): - """ - Deployment state of the model. - - Attributes: - DEPLOYMENT_STATE_UNSPECIFIED (int): Should not be used, an un-set enum has this value by default. - DEPLOYED (int): Model is deployed. - UNDEPLOYED (int): Model is not deployed. - """ - - DEPLOYMENT_STATE_UNSPECIFIED = 0 - DEPLOYED = 1 - UNDEPLOYED = 2 diff --git a/automl/google/cloud/automl_v1beta1/gapic/prediction_service_client.py b/automl/google/cloud/automl_v1beta1/gapic/prediction_service_client.py deleted file mode 100644 index 57cedc90a892..000000000000 --- a/automl/google/cloud/automl_v1beta1/gapic/prediction_service_client.py +++ /dev/null @@ -1,517 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.cloud.automl.v1beta1 PredictionService API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.operation -import google.api_core.operations_v1 -import google.api_core.path_template -import grpc - -from google.cloud.automl_v1beta1.gapic import enums -from google.cloud.automl_v1beta1.gapic import prediction_service_client_config -from google.cloud.automl_v1beta1.gapic.transports import ( - prediction_service_grpc_transport, -) -from google.cloud.automl_v1beta1.proto import annotation_spec_pb2 -from google.cloud.automl_v1beta1.proto import column_spec_pb2 -from google.cloud.automl_v1beta1.proto import data_items_pb2 -from google.cloud.automl_v1beta1.proto import dataset_pb2 -from google.cloud.automl_v1beta1.proto import image_pb2 -from google.cloud.automl_v1beta1.proto import io_pb2 -from google.cloud.automl_v1beta1.proto import model_evaluation_pb2 -from google.cloud.automl_v1beta1.proto import model_pb2 -from google.cloud.automl_v1beta1.proto import operations_pb2 as proto_operations_pb2 -from google.cloud.automl_v1beta1.proto import prediction_service_pb2 -from google.cloud.automl_v1beta1.proto import prediction_service_pb2_grpc -from google.cloud.automl_v1beta1.proto import service_pb2 -from google.cloud.automl_v1beta1.proto import service_pb2_grpc -from google.cloud.automl_v1beta1.proto import table_spec_pb2 -from google.longrunning import operations_pb2 as longrunning_operations_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-automl").version - - -class PredictionServiceClient(object): - """ - AutoML Prediction API. - - On any input that is documented to expect a string parameter in - snake\_case or kebab-case, either of those cases is accepted. - """ - - SERVICE_ADDRESS = "automl.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.automl.v1beta1.PredictionService" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - PredictionServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def model_path(cls, project, location, model): - """Return a fully-qualified model string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/models/{model}", - project=project, - location=location, - model=model, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.PredictionServiceGrpcTransport, - Callable[[~.Credentials, type], ~.PredictionServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = prediction_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=prediction_service_grpc_transport.PredictionServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = prediction_service_grpc_transport.PredictionServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def predict( - self, - name, - payload, - params=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Perform an online prediction. The prediction result will be directly - returned in the response. Available for following ML problems, and their - expected request payloads: - - - Image Classification - Image in .JPEG, .GIF or .PNG format, - image\_bytes up to 30MB. - - Image Object Detection - Image in .JPEG, .GIF or .PNG format, - image\_bytes up to 30MB. - - Text Classification - TextSnippet, content up to 60,000 characters, - UTF-8 encoded. - - Text Extraction - TextSnippet, content up to 30,000 characters, UTF-8 - NFC encoded. - - Translation - TextSnippet, content up to 25,000 characters, UTF-8 - encoded. - - Tables - Row, with column values matching the columns of the model, - up to 5MB. Not available for FORECASTING - - ``prediction_type``. - - - Text Sentiment - TextSnippet, content up 500 characters, UTF-8 - encoded. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.PredictionServiceClient() - >>> - >>> name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]') - >>> - >>> # TODO: Initialize `payload`: - >>> payload = {} - >>> - >>> response = client.predict(name, payload) - - Args: - name (str): Name of the model requested to serve the prediction. - payload (Union[dict, ~google.cloud.automl_v1beta1.types.ExamplePayload]): Required. Payload to perform a prediction on. The payload must match the - problem type that the model was trained to solve. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.ExamplePayload` - params (dict[str -> str]): Additional domain-specific parameters, any string must be up to 25000 - characters long. - - - For Image 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. - - - For Image 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) No more than - this number of bounding boxes will be returned in the response. - Default is 100, the requested value may be limited by server. - - - For Tables: ``feature_importance`` - (boolean) Whether - - [feature\_importance][[google.cloud.automl.v1beta1.TablesModelColumnInfo.feature\_importance] - should be populated in the returned - - [TablesAnnotation(-s)][[google.cloud.automl.v1beta1.TablesAnnotation]. - The default is false. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.PredictResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "predict" not in self._inner_api_calls: - self._inner_api_calls[ - "predict" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.predict, - default_retry=self._method_configs["Predict"].retry, - default_timeout=self._method_configs["Predict"].timeout, - client_info=self._client_info, - ) - - request = prediction_service_pb2.PredictRequest( - name=name, payload=payload, params=params - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["predict"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def batch_predict( - self, - name, - input_config, - output_config, - params=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Perform a batch prediction. Unlike the online ``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`` method. Once the operation is - done, ``BatchPredictResult`` is returned in the ``response`` field. - Available for following ML problems: - - - Image Classification - - Image Object Detection - - Video Classification - - Video Object Tracking \* Text Extraction - - Tables - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.PredictionServiceClient() - >>> - >>> name = client.model_path('[PROJECT]', '[LOCATION]', '[MODEL]') - >>> - >>> # TODO: Initialize `input_config`: - >>> input_config = {} - >>> - >>> # TODO: Initialize `output_config`: - >>> output_config = {} - >>> - >>> response = client.batch_predict(name, input_config, output_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Name of the model requested to serve the batch prediction. - input_config (Union[dict, ~google.cloud.automl_v1beta1.types.BatchPredictInputConfig]): Required. The input configuration for batch prediction. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.BatchPredictInputConfig` - output_config (Union[dict, ~google.cloud.automl_v1beta1.types.BatchPredictOutputConfig]): Required. The Configuration specifying where output predictions should - be written. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.automl_v1beta1.types.BatchPredictOutputConfig` - params (dict[str -> str]): Additional domain-specific parameters for the predictions, any string - must be up to 25000 characters long. - - - For Text 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. - - - For Image 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. - - - For Image 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) No more than this number of - bounding boxes will be produced per image. Default is 100, the - requested value may be limited by server. - - - For Video 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. 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. The default is "false". - ``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. 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. The default - is "false". - - - For Video 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) No more than - this number of bounding boxes will be returned per frame. Default is - 100, the requested value may be limited by server. - ``min_bounding_box_size`` - (float) Only bounding boxes with shortest - edge at least that long as a relative value of video frame size will - be returned. Value in 0 to 1 range. Default is 0. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "batch_predict" not in self._inner_api_calls: - self._inner_api_calls[ - "batch_predict" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.batch_predict, - default_retry=self._method_configs["BatchPredict"].retry, - default_timeout=self._method_configs["BatchPredict"].timeout, - client_info=self._client_info, - ) - - request = prediction_service_pb2.BatchPredictRequest( - name=name, - input_config=input_config, - output_config=output_config, - params=params, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["batch_predict"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - prediction_service_pb2.BatchPredictResult, - metadata_type=proto_operations_pb2.OperationMetadata, - ) diff --git a/automl/google/cloud/automl_v1beta1/gapic/prediction_service_client_config.py b/automl/google/cloud/automl_v1beta1/gapic/prediction_service_client_config.py deleted file mode 100644 index d93ca92f8ed2..000000000000 --- a/automl/google/cloud/automl_v1beta1/gapic/prediction_service_client_config.py +++ /dev/null @@ -1,33 +0,0 @@ -config = { - "interfaces": { - "google.cloud.automl.v1beta1.PredictionService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "Predict": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "BatchPredict": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/automl/google/cloud/automl_v1beta1/gapic/transports/__init__.py b/automl/google/cloud/automl_v1beta1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/automl/google/cloud/automl_v1beta1/gapic/transports/auto_ml_grpc_transport.py b/automl/google/cloud/automl_v1beta1/gapic/transports/auto_ml_grpc_transport.py deleted file mode 100644 index 106c3c6c506a..000000000000 --- a/automl/google/cloud/automl_v1beta1/gapic/transports/auto_ml_grpc_transport.py +++ /dev/null @@ -1,474 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers -import google.api_core.operations_v1 - -from google.cloud.automl_v1beta1.proto import service_pb2_grpc - - -class AutoMlGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.automl.v1beta1 AutoMl API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="automl.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = {"auto_ml_stub": service_pb2_grpc.AutoMlStub(channel)} - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="automl.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def create_dataset(self): - """Return the gRPC stub for :meth:`AutoMlClient.create_dataset`. - - Creates a dataset. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].CreateDataset - - @property - def update_dataset(self): - """Return the gRPC stub for :meth:`AutoMlClient.update_dataset`. - - Updates a dataset. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].UpdateDataset - - @property - def get_dataset(self): - """Return the gRPC stub for :meth:`AutoMlClient.get_dataset`. - - Gets a dataset. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].GetDataset - - @property - def list_datasets(self): - """Return the gRPC stub for :meth:`AutoMlClient.list_datasets`. - - Lists datasets in a project. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].ListDatasets - - @property - def delete_dataset(self): - """Return the gRPC stub for :meth:`AutoMlClient.delete_dataset`. - - Deletes a dataset and all of its contents. Returns empty response in the - ``response`` field when it completes, and ``delete_details`` in the - ``metadata`` field. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].DeleteDataset - - @property - def import_data(self): - """Return the gRPC stub for :meth:`AutoMlClient.import_data`. - - Imports data into a dataset. For Tables this method can only be called - on an empty Dataset. - - For Tables: - - - A ``schema_inference_version`` parameter must be explicitly set. - Returns an empty response in the ``response`` field when it - completes. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].ImportData - - @property - def export_data(self): - """Return the gRPC stub for :meth:`AutoMlClient.export_data`. - - Exports dataset's data to the provided output location. Returns an empty - response in the ``response`` field when it completes. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].ExportData - - @property - def create_model(self): - """Return the gRPC stub for :meth:`AutoMlClient.create_model`. - - Creates a model. Returns a Model in the ``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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].CreateModel - - @property - def get_model(self): - """Return the gRPC stub for :meth:`AutoMlClient.get_model`. - - Gets a model. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].GetModel - - @property - def list_models(self): - """Return the gRPC stub for :meth:`AutoMlClient.list_models`. - - Lists models. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].ListModels - - @property - def delete_model(self): - """Return the gRPC stub for :meth:`AutoMlClient.delete_model`. - - Deletes a model. Returns ``google.protobuf.Empty`` in the ``response`` - field when it completes, and ``delete_details`` in the ``metadata`` - field. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].DeleteModel - - @property - def deploy_model(self): - """Return the gRPC stub for :meth:`AutoMlClient.deploy_model`. - - 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``) will reset the deployment state without pausing the - model's availability. - - Only applicable for Text Classification, Image Object Detection and - Tables; all other domains manage deployment automatically. - - Returns an empty response in the ``response`` field when it completes. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].DeployModel - - @property - def undeploy_model(self): - """Return the gRPC stub for :meth:`AutoMlClient.undeploy_model`. - - 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`` field when it completes. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].UndeployModel - - @property - def get_model_evaluation(self): - """Return the gRPC stub for :meth:`AutoMlClient.get_model_evaluation`. - - Gets a model evaluation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].GetModelEvaluation - - @property - def export_model(self): - """Return the gRPC stub for :meth:`AutoMlClient.export_model`. - - 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``. - - Returns an empty response in the ``response`` field when it completes. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].ExportModel - - @property - def export_evaluated_examples(self): - """Return the gRPC stub for :meth:`AutoMlClient.export_evaluated_examples`. - - Exports examples on which the model was evaluated (i.e. which were in - the TEST set of the dataset the model was created from), together with - their ground truth annotations and the annotations created (predicted) - by the model. The examples, ground truth and predictions are exported in - the state they were at the moment the model was evaluated. - - This export is available only for 30 days since the model evaluation is - created. - - Currently only available for Tables. - - Returns an empty response in the ``response`` field when it completes. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].ExportEvaluatedExamples - - @property - def list_model_evaluations(self): - """Return the gRPC stub for :meth:`AutoMlClient.list_model_evaluations`. - - Lists model evaluations. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].ListModelEvaluations - - @property - def get_annotation_spec(self): - """Return the gRPC stub for :meth:`AutoMlClient.get_annotation_spec`. - - Gets an annotation spec. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].GetAnnotationSpec - - @property - def get_table_spec(self): - """Return the gRPC stub for :meth:`AutoMlClient.get_table_spec`. - - Gets a table spec. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].GetTableSpec - - @property - def list_table_specs(self): - """Return the gRPC stub for :meth:`AutoMlClient.list_table_specs`. - - Lists table specs in a dataset. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].ListTableSpecs - - @property - def update_table_spec(self): - """Return the gRPC stub for :meth:`AutoMlClient.update_table_spec`. - - Updates a table spec. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].UpdateTableSpec - - @property - def get_column_spec(self): - """Return the gRPC stub for :meth:`AutoMlClient.get_column_spec`. - - Gets a column spec. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].GetColumnSpec - - @property - def list_column_specs(self): - """Return the gRPC stub for :meth:`AutoMlClient.list_column_specs`. - - Lists column specs in a table spec. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].ListColumnSpecs - - @property - def update_column_spec(self): - """Return the gRPC stub for :meth:`AutoMlClient.update_column_spec`. - - Updates a column spec. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["auto_ml_stub"].UpdateColumnSpec diff --git a/automl/google/cloud/automl_v1beta1/gapic/transports/prediction_service_grpc_transport.py b/automl/google/cloud/automl_v1beta1/gapic/transports/prediction_service_grpc_transport.py deleted file mode 100644 index 69ebca84d2cb..000000000000 --- a/automl/google/cloud/automl_v1beta1/gapic/transports/prediction_service_grpc_transport.py +++ /dev/null @@ -1,175 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers -import google.api_core.operations_v1 - -from google.cloud.automl_v1beta1.proto import prediction_service_pb2_grpc - - -class PredictionServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.automl.v1beta1 PredictionService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="automl.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "prediction_service_stub": prediction_service_pb2_grpc.PredictionServiceStub( - channel - ) - } - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="automl.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def predict(self): - """Return the gRPC stub for :meth:`PredictionServiceClient.predict`. - - Perform an online prediction. The prediction result will be directly - returned in the response. Available for following ML problems, and their - expected request payloads: - - - Image Classification - Image in .JPEG, .GIF or .PNG format, - image\_bytes up to 30MB. - - Image Object Detection - Image in .JPEG, .GIF or .PNG format, - image\_bytes up to 30MB. - - Text Classification - TextSnippet, content up to 60,000 characters, - UTF-8 encoded. - - Text Extraction - TextSnippet, content up to 30,000 characters, UTF-8 - NFC encoded. - - Translation - TextSnippet, content up to 25,000 characters, UTF-8 - encoded. - - Tables - Row, with column values matching the columns of the model, - up to 5MB. Not available for FORECASTING - - ``prediction_type``. - - - Text Sentiment - TextSnippet, content up 500 characters, UTF-8 - encoded. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["prediction_service_stub"].Predict - - @property - def batch_predict(self): - """Return the gRPC stub for :meth:`PredictionServiceClient.batch_predict`. - - Perform a batch prediction. Unlike the online ``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`` method. Once the operation is - done, ``BatchPredictResult`` is returned in the ``response`` field. - Available for following ML problems: - - - Image Classification - - Image Object Detection - - Video Classification - - Video Object Tracking \* Text Extraction - - Tables - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["prediction_service_stub"].BatchPredict diff --git a/automl/google/cloud/automl_v1beta1/proto/__init__.py b/automl/google/cloud/automl_v1beta1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/automl/google/cloud/automl_v1beta1/proto/annotation_payload.proto b/automl/google/cloud/automl_v1beta1/proto/annotation_payload.proto deleted file mode 100644 index 7cc2860f1597..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/annotation_payload.proto +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/cloud/automl/v1beta1/classification.proto"; -import "google/cloud/automl/v1beta1/detection.proto"; -import "google/cloud/automl/v1beta1/tables.proto"; -import "google/cloud/automl/v1beta1/text_extraction.proto"; -import "google/cloud/automl/v1beta1/text_sentiment.proto"; -import "google/cloud/automl/v1beta1/translation.proto"; -import "google/protobuf/any.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// Contains annotation information that is relevant to AutoML. -message AnnotationPayload { - // Output only . Additional information about the annotation - // specific to the AutoML domain. - oneof detail { - // Annotation details for translation. - TranslationAnnotation translation = 2; - - // Annotation details for content or image classification. - ClassificationAnnotation classification = 3; - - // Annotation details for image object detection. - ImageObjectDetectionAnnotation image_object_detection = 4; - - // Annotation details for video classification. - // Returned for Video Classification predictions. - VideoClassificationAnnotation video_classification = 9; - - // Annotation details for video object tracking. - VideoObjectTrackingAnnotation video_object_tracking = 8; - - // Annotation details for text extraction. - TextExtractionAnnotation text_extraction = 6; - - // Annotation details for text sentiment. - TextSentimentAnnotation text_sentiment = 7; - - // Annotation details for Tables. - TablesAnnotation tables = 10; - } - - // 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. - string annotation_spec_id = 1; - - // Output only. The value of - // [display_name][google.cloud.automl.v1beta1.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. - string display_name = 5; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/annotation_payload_pb2.py b/automl/google/cloud/automl_v1beta1/proto/annotation_payload_pb2.py deleted file mode 100644 index f80363186080..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/annotation_payload_pb2.py +++ /dev/null @@ -1,413 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/annotation_payload.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.cloud.automl_v1beta1.proto import ( - classification_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - detection_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_detection__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - tables_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_tables__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - text_extraction_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__extraction__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - text_sentiment_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__sentiment__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - translation_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_translation__pb2, -) -from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/annotation_payload.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1P\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n:google/cloud/automl_v1beta1/proto/annotation_payload.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x36google/cloud/automl_v1beta1/proto/classification.proto\x1a\x31google/cloud/automl_v1beta1/proto/detection.proto\x1a.google/cloud/automl_v1beta1/proto/tables.proto\x1a\x37google/cloud/automl_v1beta1/proto/text_extraction.proto\x1a\x36google/cloud/automl_v1beta1/proto/text_sentiment.proto\x1a\x33google/cloud/automl_v1beta1/proto/translation.proto\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/api/annotations.proto"\xe6\x05\n\x11\x41nnotationPayload\x12I\n\x0btranslation\x18\x02 \x01(\x0b\x32\x32.google.cloud.automl.v1beta1.TranslationAnnotationH\x00\x12O\n\x0e\x63lassification\x18\x03 \x01(\x0b\x32\x35.google.cloud.automl.v1beta1.ClassificationAnnotationH\x00\x12]\n\x16image_object_detection\x18\x04 \x01(\x0b\x32;.google.cloud.automl.v1beta1.ImageObjectDetectionAnnotationH\x00\x12Z\n\x14video_classification\x18\t \x01(\x0b\x32:.google.cloud.automl.v1beta1.VideoClassificationAnnotationH\x00\x12[\n\x15video_object_tracking\x18\x08 \x01(\x0b\x32:.google.cloud.automl.v1beta1.VideoObjectTrackingAnnotationH\x00\x12P\n\x0ftext_extraction\x18\x06 \x01(\x0b\x32\x35.google.cloud.automl.v1beta1.TextExtractionAnnotationH\x00\x12N\n\x0etext_sentiment\x18\x07 \x01(\x0b\x32\x34.google.cloud.automl.v1beta1.TextSentimentAnnotationH\x00\x12?\n\x06tables\x18\n \x01(\x0b\x32-.google.cloud.automl.v1beta1.TablesAnnotationH\x00\x12\x1a\n\x12\x61nnotation_spec_id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x05 \x01(\tB\x08\n\x06\x64\x65tailB\xa5\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_detection__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_tables__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__extraction__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__sentiment__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_translation__pb2.DESCRIPTOR, - google_dot_protobuf_dot_any__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_ANNOTATIONPAYLOAD = _descriptor.Descriptor( - name="AnnotationPayload", - full_name="google.cloud.automl.v1beta1.AnnotationPayload", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="translation", - full_name="google.cloud.automl.v1beta1.AnnotationPayload.translation", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="classification", - full_name="google.cloud.automl.v1beta1.AnnotationPayload.classification", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_object_detection", - full_name="google.cloud.automl.v1beta1.AnnotationPayload.image_object_detection", - index=2, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_classification", - full_name="google.cloud.automl.v1beta1.AnnotationPayload.video_classification", - index=3, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_object_tracking", - full_name="google.cloud.automl.v1beta1.AnnotationPayload.video_object_tracking", - index=4, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_extraction", - full_name="google.cloud.automl.v1beta1.AnnotationPayload.text_extraction", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_sentiment", - full_name="google.cloud.automl.v1beta1.AnnotationPayload.text_sentiment", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tables", - full_name="google.cloud.automl.v1beta1.AnnotationPayload.tables", - index=7, - number=10, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_spec_id", - full_name="google.cloud.automl.v1beta1.AnnotationPayload.annotation_spec_id", - index=8, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.automl.v1beta1.AnnotationPayload.display_name", - index=9, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="detail", - full_name="google.cloud.automl.v1beta1.AnnotationPayload.detail", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=470, - serialized_end=1212, -) - -_ANNOTATIONPAYLOAD.fields_by_name[ - "translation" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_translation__pb2._TRANSLATIONANNOTATION -) -_ANNOTATIONPAYLOAD.fields_by_name[ - "classification" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2._CLASSIFICATIONANNOTATION -) -_ANNOTATIONPAYLOAD.fields_by_name[ - "image_object_detection" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_detection__pb2._IMAGEOBJECTDETECTIONANNOTATION -) -_ANNOTATIONPAYLOAD.fields_by_name[ - "video_classification" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2._VIDEOCLASSIFICATIONANNOTATION -) -_ANNOTATIONPAYLOAD.fields_by_name[ - "video_object_tracking" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_detection__pb2._VIDEOOBJECTTRACKINGANNOTATION -) -_ANNOTATIONPAYLOAD.fields_by_name[ - "text_extraction" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__extraction__pb2._TEXTEXTRACTIONANNOTATION -) -_ANNOTATIONPAYLOAD.fields_by_name[ - "text_sentiment" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__sentiment__pb2._TEXTSENTIMENTANNOTATION -) -_ANNOTATIONPAYLOAD.fields_by_name[ - "tables" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_tables__pb2._TABLESANNOTATION -) -_ANNOTATIONPAYLOAD.oneofs_by_name["detail"].fields.append( - _ANNOTATIONPAYLOAD.fields_by_name["translation"] -) -_ANNOTATIONPAYLOAD.fields_by_name[ - "translation" -].containing_oneof = _ANNOTATIONPAYLOAD.oneofs_by_name["detail"] -_ANNOTATIONPAYLOAD.oneofs_by_name["detail"].fields.append( - _ANNOTATIONPAYLOAD.fields_by_name["classification"] -) -_ANNOTATIONPAYLOAD.fields_by_name[ - "classification" -].containing_oneof = _ANNOTATIONPAYLOAD.oneofs_by_name["detail"] -_ANNOTATIONPAYLOAD.oneofs_by_name["detail"].fields.append( - _ANNOTATIONPAYLOAD.fields_by_name["image_object_detection"] -) -_ANNOTATIONPAYLOAD.fields_by_name[ - "image_object_detection" -].containing_oneof = _ANNOTATIONPAYLOAD.oneofs_by_name["detail"] -_ANNOTATIONPAYLOAD.oneofs_by_name["detail"].fields.append( - _ANNOTATIONPAYLOAD.fields_by_name["video_classification"] -) -_ANNOTATIONPAYLOAD.fields_by_name[ - "video_classification" -].containing_oneof = _ANNOTATIONPAYLOAD.oneofs_by_name["detail"] -_ANNOTATIONPAYLOAD.oneofs_by_name["detail"].fields.append( - _ANNOTATIONPAYLOAD.fields_by_name["video_object_tracking"] -) -_ANNOTATIONPAYLOAD.fields_by_name[ - "video_object_tracking" -].containing_oneof = _ANNOTATIONPAYLOAD.oneofs_by_name["detail"] -_ANNOTATIONPAYLOAD.oneofs_by_name["detail"].fields.append( - _ANNOTATIONPAYLOAD.fields_by_name["text_extraction"] -) -_ANNOTATIONPAYLOAD.fields_by_name[ - "text_extraction" -].containing_oneof = _ANNOTATIONPAYLOAD.oneofs_by_name["detail"] -_ANNOTATIONPAYLOAD.oneofs_by_name["detail"].fields.append( - _ANNOTATIONPAYLOAD.fields_by_name["text_sentiment"] -) -_ANNOTATIONPAYLOAD.fields_by_name[ - "text_sentiment" -].containing_oneof = _ANNOTATIONPAYLOAD.oneofs_by_name["detail"] -_ANNOTATIONPAYLOAD.oneofs_by_name["detail"].fields.append( - _ANNOTATIONPAYLOAD.fields_by_name["tables"] -) -_ANNOTATIONPAYLOAD.fields_by_name[ - "tables" -].containing_oneof = _ANNOTATIONPAYLOAD.oneofs_by_name["detail"] -DESCRIPTOR.message_types_by_name["AnnotationPayload"] = _ANNOTATIONPAYLOAD -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -AnnotationPayload = _reflection.GeneratedProtocolMessageType( - "AnnotationPayload", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATIONPAYLOAD, - __module__="google.cloud.automl_v1beta1.proto.annotation_payload_pb2", - __doc__="""Contains annotation information that is relevant to - AutoML. - - - Attributes: - detail: - Output only . Additional information about the annotation - specific to the AutoML domain. - translation: - Annotation details for translation. - classification: - Annotation details for content or image classification. - image_object_detection: - Annotation details for image object detection. - video_classification: - Annotation details for video classification. Returned for - Video Classification predictions. - video_object_tracking: - Annotation details for video object tracking. - text_extraction: - Annotation details for text extraction. - text_sentiment: - Annotation details for text sentiment. - tables: - Annotation details for Tables. - 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. - display_name: - Output only. The value of [display\_name][google.cloud.automl. - v1beta1.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. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.AnnotationPayload) - ), -) -_sym_db.RegisterMessage(AnnotationPayload) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/annotation_payload_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/annotation_payload_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/annotation_payload_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/annotation_spec.proto b/automl/google/cloud/automl_v1beta1/proto/annotation_spec.proto deleted file mode 100644 index 483792b6678a..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/annotation_spec.proto +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// A definition of an annotation spec. -message AnnotationSpec { - // Output only. Resource name of the annotation spec. - // Form: - // - // 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}' - string name = 1; - - // 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_]+`. - // (_), and ASCII digits 0-9. - string display_name = 2; - - // Output only. The number of examples in the parent dataset - // labeled by the annotation spec. - int32 example_count = 9; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/annotation_spec_pb2.py b/automl/google/cloud/automl_v1beta1/proto/annotation_spec_pb2.py deleted file mode 100644 index 80ae0a8af98a..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/annotation_spec_pb2.py +++ /dev/null @@ -1,142 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/annotation_spec.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/annotation_spec.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1P\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n7google/cloud/automl_v1beta1/proto/annotation_spec.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x1cgoogle/api/annotations.proto"K\n\x0e\x41nnotationSpec\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x15\n\rexample_count\x18\t \x01(\x05\x42\xa5\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], -) - - -_ANNOTATIONSPEC = _descriptor.Descriptor( - name="AnnotationSpec", - full_name="google.cloud.automl.v1beta1.AnnotationSpec", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.AnnotationSpec.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.automl.v1beta1.AnnotationSpec.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="example_count", - full_name="google.cloud.automl.v1beta1.AnnotationSpec.example_count", - index=2, - number=9, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=118, - serialized_end=193, -) - -DESCRIPTOR.message_types_by_name["AnnotationSpec"] = _ANNOTATIONSPEC -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -AnnotationSpec = _reflection.GeneratedProtocolMessageType( - "AnnotationSpec", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATIONSPEC, - __module__="google.cloud.automl_v1beta1.proto.annotation_spec_pb2", - __doc__="""A definition of an annotation spec. - - - Attributes: - name: - Output only. Resource name of the annotation spec. Form: 'pro - jects/{project\_id}/locations/{location\_id}/datasets/{dataset - \_id}/annotationSpecs/{annotation\_spec\_id}' - 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_]+``. (\_), and ASCII digits - 0-9. - example_count: - Output only. The number of examples in the parent dataset - labeled by the annotation spec. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.AnnotationSpec) - ), -) -_sym_db.RegisterMessage(AnnotationSpec) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/annotation_spec_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/annotation_spec_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/annotation_spec_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/classification.proto b/automl/google/cloud/automl_v1beta1/proto/classification.proto deleted file mode 100644 index c8475542a729..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/classification.proto +++ /dev/null @@ -1,222 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/api/annotations.proto"; -import "google/cloud/automl/v1beta1/temporal.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_outer_classname = "ClassificationProto"; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// Type of the classification problem. -enum ClassificationType { - // An un-set value of this enum. - CLASSIFICATION_TYPE_UNSPECIFIED = 0; - - // At most one label is allowed per example. - MULTICLASS = 1; - - // Multiple labels are allowed for one example. - MULTILABEL = 2; -} - -// Contains annotation details specific to classification. -message ClassificationAnnotation { - // 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. - float score = 1; -} - -// Contains annotation details specific to video classification. -message VideoClassificationAnnotation { - // Output only. Expresses the type of video classification. Possible values: - // - // * `segment` - Classification done on a specified by user - // time segment of a video. AnnotationSpec is answered to be present - // in that time segment, if it is present in any part of it. The video - // ML model evaluations are done only for this type of classification. - // - // * `shot`- 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. - // 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` - 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. - // 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. - string type = 1; - - // Output only . The classification details of this annotation. - ClassificationAnnotation classification_annotation = 2; - - // Output only . The time segment of the video to which the - // annotation applies. - TimeSegment time_segment = 3; -} - -// Model evaluation metrics for classification problems. -// Note: For Video Classification this metrics only describe quality of the -// Video Classification predictions of "segment_classification" type. -message ClassificationEvaluationMetrics { - // Metrics for a single confidence threshold. - message ConfidenceMetricsEntry { - // Output only. Metrics are computed with an assumption that the model - // never returns predictions with score lower than this value. - float confidence_threshold = 1; - - // 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. - int32 position_threshold = 14; - - // Output only. Recall (True Positive Rate) for the given confidence - // threshold. - float recall = 2; - - // Output only. Precision for the given confidence threshold. - float precision = 3; - - // Output only. False Positive Rate for the given confidence threshold. - float false_positive_rate = 8; - - // Output only. The harmonic mean of recall and precision. - float f1_score = 4; - - // 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. - float recall_at1 = 5; - - // Output only. The precision when only considering the label that has the - // highest prediction score and not below the confidence threshold for each - // example. - float precision_at1 = 6; - - // 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. - float false_positive_rate_at1 = 9; - - // Output only. The harmonic mean of - // [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] - // and - // [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. - float f1_score_at1 = 7; - - // Output only. The number of model created labels that match a ground truth - // label. - int64 true_positive_count = 10; - - // Output only. The number of model created labels that do not match a - // ground truth label. - int64 false_positive_count = 11; - - // Output only. The number of ground truth labels that are not matched - // by a model created label. - int64 false_negative_count = 12; - - // 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. - int64 true_negative_count = 13; - } - - // Confusion matrix of the model running the classification. - message ConfusionMatrix { - // Output only. A row in the confusion matrix. - message Row { - // 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.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] - // field. - repeated int32 example_count = 1; - } - - // Output only. IDs of the annotation specs used in the confusion matrix. - // For Tables CLASSIFICATION - // - // [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type] - // only list of [annotation_spec_display_name-s][] is populated. - repeated string annotation_spec_id = 1; - - // 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.v1beta1.TablesModelMetadata.prediction_type], - // distinct values of the target column at the moment of the model - // evaluation are populated here. - repeated string display_name = 3; - - // 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. - repeated Row row = 2; - } - - // Output only. The Area Under Precision-Recall Curve metric. Micro-averaged - // for the overall evaluation. - float au_prc = 1; - - // Output only. The Area Under Precision-Recall Curve metric based on priors. - // Micro-averaged for the overall evaluation. - // Deprecated. - float base_au_prc = 2 [deprecated = true]; - - // Output only. The Area Under Receiver Operating Characteristic curve metric. - // Micro-averaged for the overall evaluation. - float au_roc = 6; - - // Output only. The Log Loss metric. - float log_loss = 7; - - // 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. - repeated ConfidenceMetricsEntry confidence_metrics_entry = 3; - - // 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. - ConfusionMatrix confusion_matrix = 4; - - // Output only. The annotation spec ids used for this evaluation. - repeated string annotation_spec_id = 5; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/classification_pb2.py b/automl/google/cloud/automl_v1beta1/proto/classification_pb2.py deleted file mode 100644 index 68651a84d0ff..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/classification_pb2.py +++ /dev/null @@ -1,993 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/classification.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.cloud.automl_v1beta1.proto import ( - temporal_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_temporal__pb2, -) - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/classification.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1B\023ClassificationProtoZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n6google/cloud/automl_v1beta1/proto/classification.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x30google/cloud/automl_v1beta1/proto/temporal.proto")\n\x18\x43lassificationAnnotation\x12\r\n\x05score\x18\x01 \x01(\x02"\xc7\x01\n\x1dVideoClassificationAnnotation\x12\x0c\n\x04type\x18\x01 \x01(\t\x12X\n\x19\x63lassification_annotation\x18\x02 \x01(\x0b\x32\x35.google.cloud.automl.v1beta1.ClassificationAnnotation\x12>\n\x0ctime_segment\x18\x03 \x01(\x0b\x32(.google.cloud.automl.v1beta1.TimeSegment"\xa9\x07\n\x1f\x43lassificationEvaluationMetrics\x12\x0e\n\x06\x61u_prc\x18\x01 \x01(\x02\x12\x17\n\x0b\x62\x61se_au_prc\x18\x02 \x01(\x02\x42\x02\x18\x01\x12\x0e\n\x06\x61u_roc\x18\x06 \x01(\x02\x12\x10\n\x08log_loss\x18\x07 \x01(\x02\x12u\n\x18\x63onfidence_metrics_entry\x18\x03 \x03(\x0b\x32S.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry\x12\x66\n\x10\x63onfusion_matrix\x18\x04 \x01(\x0b\x32L.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix\x12\x1a\n\x12\x61nnotation_spec_id\x18\x05 \x03(\t\x1a\xfc\x02\n\x16\x43onfidenceMetricsEntry\x12\x1c\n\x14\x63onfidence_threshold\x18\x01 \x01(\x02\x12\x1a\n\x12position_threshold\x18\x0e \x01(\x05\x12\x0e\n\x06recall\x18\x02 \x01(\x02\x12\x11\n\tprecision\x18\x03 \x01(\x02\x12\x1b\n\x13\x66\x61lse_positive_rate\x18\x08 \x01(\x02\x12\x10\n\x08\x66\x31_score\x18\x04 \x01(\x02\x12\x12\n\nrecall_at1\x18\x05 \x01(\x02\x12\x15\n\rprecision_at1\x18\x06 \x01(\x02\x12\x1f\n\x17\x66\x61lse_positive_rate_at1\x18\t \x01(\x02\x12\x14\n\x0c\x66\x31_score_at1\x18\x07 \x01(\x02\x12\x1b\n\x13true_positive_count\x18\n \x01(\x03\x12\x1c\n\x14\x66\x61lse_positive_count\x18\x0b \x01(\x03\x12\x1c\n\x14\x66\x61lse_negative_count\x18\x0c \x01(\x03\x12\x1b\n\x13true_negative_count\x18\r \x01(\x03\x1a\xc0\x01\n\x0f\x43onfusionMatrix\x12\x1a\n\x12\x61nnotation_spec_id\x18\x01 \x03(\t\x12\x14\n\x0c\x64isplay_name\x18\x03 \x03(\t\x12]\n\x03row\x18\x02 \x03(\x0b\x32P.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row\x1a\x1c\n\x03Row\x12\x15\n\rexample_count\x18\x01 \x03(\x05*Y\n\x12\x43lassificationType\x12#\n\x1f\x43LASSIFICATION_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nMULTICLASS\x10\x01\x12\x0e\n\nMULTILABEL\x10\x02\x42\xb8\x01\n\x1f\x63om.google.cloud.automl.v1beta1B\x13\x43lassificationProtoZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_temporal__pb2.DESCRIPTOR, - ], -) - -_CLASSIFICATIONTYPE = _descriptor.EnumDescriptor( - name="ClassificationType", - full_name="google.cloud.automl.v1beta1.ClassificationType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="CLASSIFICATION_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="MULTICLASS", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MULTILABEL", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1352, - serialized_end=1441, -) -_sym_db.RegisterEnumDescriptor(_CLASSIFICATIONTYPE) - -ClassificationType = enum_type_wrapper.EnumTypeWrapper(_CLASSIFICATIONTYPE) -CLASSIFICATION_TYPE_UNSPECIFIED = 0 -MULTICLASS = 1 -MULTILABEL = 2 - - -_CLASSIFICATIONANNOTATION = _descriptor.Descriptor( - name="ClassificationAnnotation", - full_name="google.cloud.automl.v1beta1.ClassificationAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.automl.v1beta1.ClassificationAnnotation.score", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=167, - serialized_end=208, -) - - -_VIDEOCLASSIFICATIONANNOTATION = _descriptor.Descriptor( - name="VideoClassificationAnnotation", - full_name="google.cloud.automl.v1beta1.VideoClassificationAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.automl.v1beta1.VideoClassificationAnnotation.type", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="classification_annotation", - full_name="google.cloud.automl.v1beta1.VideoClassificationAnnotation.classification_annotation", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_segment", - full_name="google.cloud.automl.v1beta1.VideoClassificationAnnotation.time_segment", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=211, - serialized_end=410, -) - - -_CLASSIFICATIONEVALUATIONMETRICS_CONFIDENCEMETRICSENTRY = _descriptor.Descriptor( - name="ConfidenceMetricsEntry", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="confidence_threshold", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.confidence_threshold", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="position_threshold", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.position_threshold", - index=1, - number=14, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="recall", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall", - index=2, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="precision", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision", - index=3, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="false_positive_rate", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.false_positive_rate", - index=4, - number=8, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="f1_score", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.f1_score", - index=5, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="recall_at1", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1", - index=6, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="precision_at1", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1", - index=7, - number=6, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="false_positive_rate_at1", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.false_positive_rate_at1", - index=8, - number=9, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="f1_score_at1", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.f1_score_at1", - index=9, - number=7, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="true_positive_count", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.true_positive_count", - index=10, - number=10, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="false_positive_count", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.false_positive_count", - index=11, - number=11, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="false_negative_count", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.false_negative_count", - index=12, - number=12, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="true_negative_count", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.true_negative_count", - index=13, - number=13, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=775, - serialized_end=1155, -) - -_CLASSIFICATIONEVALUATIONMETRICS_CONFUSIONMATRIX_ROW = _descriptor.Descriptor( - name="Row", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="example_count", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.example_count", - index=0, - number=1, - type=5, - cpp_type=1, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1322, - serialized_end=1350, -) - -_CLASSIFICATIONEVALUATIONMETRICS_CONFUSIONMATRIX = _descriptor.Descriptor( - name="ConfusionMatrix", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec_id", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.annotation_spec_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name", - index=1, - number=3, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="row", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.row", - index=2, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_CLASSIFICATIONEVALUATIONMETRICS_CONFUSIONMATRIX_ROW], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1158, - serialized_end=1350, -) - -_CLASSIFICATIONEVALUATIONMETRICS = _descriptor.Descriptor( - name="ClassificationEvaluationMetrics", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="au_prc", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.au_prc", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="base_au_prc", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.base_au_prc", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="au_roc", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.au_roc", - index=2, - number=6, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="log_loss", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.log_loss", - index=3, - number=7, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence_metrics_entry", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.confidence_metrics_entry", - index=4, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confusion_matrix", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.confusion_matrix", - index=5, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_spec_id", - full_name="google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.annotation_spec_id", - index=6, - number=5, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[ - _CLASSIFICATIONEVALUATIONMETRICS_CONFIDENCEMETRICSENTRY, - _CLASSIFICATIONEVALUATIONMETRICS_CONFUSIONMATRIX, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=413, - serialized_end=1350, -) - -_VIDEOCLASSIFICATIONANNOTATION.fields_by_name[ - "classification_annotation" -].message_type = _CLASSIFICATIONANNOTATION -_VIDEOCLASSIFICATIONANNOTATION.fields_by_name[ - "time_segment" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_temporal__pb2._TIMESEGMENT -) -_CLASSIFICATIONEVALUATIONMETRICS_CONFIDENCEMETRICSENTRY.containing_type = ( - _CLASSIFICATIONEVALUATIONMETRICS -) -_CLASSIFICATIONEVALUATIONMETRICS_CONFUSIONMATRIX_ROW.containing_type = ( - _CLASSIFICATIONEVALUATIONMETRICS_CONFUSIONMATRIX -) -_CLASSIFICATIONEVALUATIONMETRICS_CONFUSIONMATRIX.fields_by_name[ - "row" -].message_type = _CLASSIFICATIONEVALUATIONMETRICS_CONFUSIONMATRIX_ROW -_CLASSIFICATIONEVALUATIONMETRICS_CONFUSIONMATRIX.containing_type = ( - _CLASSIFICATIONEVALUATIONMETRICS -) -_CLASSIFICATIONEVALUATIONMETRICS.fields_by_name[ - "confidence_metrics_entry" -].message_type = _CLASSIFICATIONEVALUATIONMETRICS_CONFIDENCEMETRICSENTRY -_CLASSIFICATIONEVALUATIONMETRICS.fields_by_name[ - "confusion_matrix" -].message_type = _CLASSIFICATIONEVALUATIONMETRICS_CONFUSIONMATRIX -DESCRIPTOR.message_types_by_name["ClassificationAnnotation"] = _CLASSIFICATIONANNOTATION -DESCRIPTOR.message_types_by_name[ - "VideoClassificationAnnotation" -] = _VIDEOCLASSIFICATIONANNOTATION -DESCRIPTOR.message_types_by_name[ - "ClassificationEvaluationMetrics" -] = _CLASSIFICATIONEVALUATIONMETRICS -DESCRIPTOR.enum_types_by_name["ClassificationType"] = _CLASSIFICATIONTYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ClassificationAnnotation = _reflection.GeneratedProtocolMessageType( - "ClassificationAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_CLASSIFICATIONANNOTATION, - __module__="google.cloud.automl_v1beta1.proto.classification_pb2", - __doc__="""Contains annotation details specific to classification. - - - Attributes: - 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. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ClassificationAnnotation) - ), -) -_sym_db.RegisterMessage(ClassificationAnnotation) - -VideoClassificationAnnotation = _reflection.GeneratedProtocolMessageType( - "VideoClassificationAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOCLASSIFICATIONANNOTATION, - __module__="google.cloud.automl_v1beta1.proto.classification_pb2", - __doc__="""Contains annotation details specific to video - classification. - - - Attributes: - type: - Output only. Expresses the type of video classification. - Possible values: - ``segment`` - Classification done on a - specified by user time segment of a video. AnnotationSpec - is answered to be present in that time segment, if it is - present in any part of it. The video ML model evaluations - are done only for this type of classification. - ``shot``- - 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. 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`` - - 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. - 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. - classification_annotation: - Output only . The classification details of this annotation. - time_segment: - Output only . The time segment of the video to which the - annotation applies. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.VideoClassificationAnnotation) - ), -) -_sym_db.RegisterMessage(VideoClassificationAnnotation) - -ClassificationEvaluationMetrics = _reflection.GeneratedProtocolMessageType( - "ClassificationEvaluationMetrics", - (_message.Message,), - dict( - ConfidenceMetricsEntry=_reflection.GeneratedProtocolMessageType( - "ConfidenceMetricsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_CLASSIFICATIONEVALUATIONMETRICS_CONFIDENCEMETRICSENTRY, - __module__="google.cloud.automl_v1beta1.proto.classification_pb2", - __doc__="""Metrics for a single confidence threshold. - - - Attributes: - confidence_threshold: - Output only. Metrics are computed with an assumption that the - model never returns predictions with score lower than this - value. - 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. - recall: - Output only. Recall (True Positive Rate) for the given - confidence threshold. - precision: - Output only. Precision for the given confidence threshold. - false_positive_rate: - Output only. False Positive Rate for the given confidence - threshold. - f1_score: - Output only. The harmonic mean of recall and precision. - 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. - 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. - 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. - f1_score_at1: - Output only. The harmonic mean of [recall\_at1][google.cloud.a - utoml.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetric - sEntry.recall\_at1] and [precision\_at1][google.cloud.automl.v - 1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry. - precision\_at1]. - true_positive_count: - Output only. The number of model created labels that match a - ground truth label. - false_positive_count: - Output only. The number of model created labels that do not - match a ground truth label. - false_negative_count: - Output only. The number of ground truth labels that are not - matched by a model created label. - 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. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) - ), - ), - ConfusionMatrix=_reflection.GeneratedProtocolMessageType( - "ConfusionMatrix", - (_message.Message,), - dict( - Row=_reflection.GeneratedProtocolMessageType( - "Row", - (_message.Message,), - dict( - DESCRIPTOR=_CLASSIFICATIONEVALUATIONMETRICS_CONFUSIONMATRIX_ROW, - __module__="google.cloud.automl_v1beta1.proto.classification_pb2", - __doc__="""Output only. A row in the confusion matrix. - - - Attributes: - 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.v1beta1.ClassificationEvaluationMe - trics.ConfusionMatrix.display\_name] field. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) - ), - ), - DESCRIPTOR=_CLASSIFICATIONEVALUATIONMETRICS_CONFUSIONMATRIX, - __module__="google.cloud.automl_v1beta1.proto.classification_pb2", - __doc__="""Confusion matrix of the model running the classification. - - - Attributes: - annotation_spec_id: - Output only. IDs of the annotation specs used in the confusion - matrix. For Tables CLASSIFICATION [prediction\_type][google.c - loud.automl.v1beta1.TablesModelMetadata.prediction\_type] only - list of [annotation\_spec\_display\_name-s][] is populated. - 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][go - ogle.cloud.automl.v1beta1.TablesModelMetadata.prediction\_type - ], distinct values of the target column at the moment of the - model evaluation are populated here. - 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. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix) - ), - ), - DESCRIPTOR=_CLASSIFICATIONEVALUATIONMETRICS, - __module__="google.cloud.automl_v1beta1.proto.classification_pb2", - __doc__="""Model evaluation metrics for classification problems. - Note: For Video Classification this metrics only describe quality of the - Video Classification predictions of "segment\_classification" type. - - - Attributes: - au_prc: - Output only. The Area Under Precision-Recall Curve metric. - Micro-averaged for the overall evaluation. - base_au_prc: - Output only. The Area Under Precision-Recall Curve metric - based on priors. Micro-averaged for the overall evaluation. - Deprecated. - au_roc: - Output only. The Area Under Receiver Operating Characteristic - curve metric. Micro-averaged for the overall evaluation. - log_loss: - Output only. The Log Loss metric. - 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. - 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. - annotation_spec_id: - Output only. The annotation spec ids used for this evaluation. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ClassificationEvaluationMetrics) - ), -) -_sym_db.RegisterMessage(ClassificationEvaluationMetrics) -_sym_db.RegisterMessage(ClassificationEvaluationMetrics.ConfidenceMetricsEntry) -_sym_db.RegisterMessage(ClassificationEvaluationMetrics.ConfusionMatrix) -_sym_db.RegisterMessage(ClassificationEvaluationMetrics.ConfusionMatrix.Row) - - -DESCRIPTOR._options = None -_CLASSIFICATIONEVALUATIONMETRICS.fields_by_name["base_au_prc"]._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/classification_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/classification_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/classification_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/column_spec.proto b/automl/google/cloud/automl_v1beta1/proto/column_spec.proto deleted file mode 100644 index b8f437f793ee..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/column_spec.proto +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/cloud/automl/v1beta1/data_stats.proto"; -import "google/cloud/automl/v1beta1/data_types.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// A representation of a column in a relational table. When listing them, column specs are returned in the same order in which they were -// given on import . -// Used by: -// * Tables -message ColumnSpec { - // Identifies the table's column, and its correlation with the column this - // ColumnSpec describes. - message CorrelatedColumn { - // The column_spec_id of the correlated column, which belongs to the same - // table as the in-context column. - string column_spec_id = 1; - - // Correlation between this and the in-context column. - CorrelationStats correlation_stats = 2; - } - - // Output only. The resource name of the column specs. - // Form: - // - // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/tableSpecs/{table_spec_id}/columnSpecs/{column_spec_id}` - string name = 1; - - // The data type of elements stored in the column. - DataType data_type = 2; - - // Output only. The name of the column to show in the interface. The name can - // be up to 100 characters long and can consist only of ASCII Latin letters - // A-Z and a-z, ASCII digits 0-9, underscores(_), and forward slashes(/), and - // must start with a letter or a digit. - string display_name = 3; - - // Output only. Stats of the series of values in the column. - // This field may be stale, see the ancestor's - // Dataset.tables_dataset_metadata.stats_update_time field - // for the timestamp at which these stats were last updated. - DataStats data_stats = 4; - - // Deprecated. - repeated CorrelatedColumn top_correlated_columns = 5; - - // Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 6; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/column_spec_pb2.py b/automl/google/cloud/automl_v1beta1/proto/column_spec_pb2.py deleted file mode 100644 index 844bc0585b59..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/column_spec_pb2.py +++ /dev/null @@ -1,314 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/column_spec.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.cloud.automl_v1beta1.proto import ( - data_stats_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_data__stats__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - data_types_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_data__types__pb2, -) -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/column_spec.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1P\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n3google/cloud/automl_v1beta1/proto/column_spec.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x32google/cloud/automl_v1beta1/proto/data_stats.proto\x1a\x32google/cloud/automl_v1beta1/proto/data_types.proto\x1a\x1cgoogle/api/annotations.proto"\x84\x03\n\nColumnSpec\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x38\n\tdata_type\x18\x02 \x01(\x0b\x32%.google.cloud.automl.v1beta1.DataType\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12:\n\ndata_stats\x18\x04 \x01(\x0b\x32&.google.cloud.automl.v1beta1.DataStats\x12X\n\x16top_correlated_columns\x18\x05 \x03(\x0b\x32\x38.google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn\x12\x0c\n\x04\x65tag\x18\x06 \x01(\t\x1at\n\x10\x43orrelatedColumn\x12\x16\n\x0e\x63olumn_spec_id\x18\x01 \x01(\t\x12H\n\x11\x63orrelation_stats\x18\x02 \x01(\x0b\x32-.google.cloud.automl.v1beta1.CorrelationStatsB\xa5\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_data__stats__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_data__types__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_COLUMNSPEC_CORRELATEDCOLUMN = _descriptor.Descriptor( - name="CorrelatedColumn", - full_name="google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="column_spec_id", - full_name="google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.column_spec_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="correlation_stats", - full_name="google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.correlation_stats", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=491, - serialized_end=607, -) - -_COLUMNSPEC = _descriptor.Descriptor( - name="ColumnSpec", - full_name="google.cloud.automl.v1beta1.ColumnSpec", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.ColumnSpec.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="data_type", - full_name="google.cloud.automl.v1beta1.ColumnSpec.data_type", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.automl.v1beta1.ColumnSpec.display_name", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="data_stats", - full_name="google.cloud.automl.v1beta1.ColumnSpec.data_stats", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="top_correlated_columns", - full_name="google.cloud.automl.v1beta1.ColumnSpec.top_correlated_columns", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="etag", - full_name="google.cloud.automl.v1beta1.ColumnSpec.etag", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_COLUMNSPEC_CORRELATEDCOLUMN], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=219, - serialized_end=607, -) - -_COLUMNSPEC_CORRELATEDCOLUMN.fields_by_name[ - "correlation_stats" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_data__stats__pb2._CORRELATIONSTATS -) -_COLUMNSPEC_CORRELATEDCOLUMN.containing_type = _COLUMNSPEC -_COLUMNSPEC.fields_by_name[ - "data_type" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_data__types__pb2._DATATYPE -) -_COLUMNSPEC.fields_by_name[ - "data_stats" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_data__stats__pb2._DATASTATS -) -_COLUMNSPEC.fields_by_name[ - "top_correlated_columns" -].message_type = _COLUMNSPEC_CORRELATEDCOLUMN -DESCRIPTOR.message_types_by_name["ColumnSpec"] = _COLUMNSPEC -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ColumnSpec = _reflection.GeneratedProtocolMessageType( - "ColumnSpec", - (_message.Message,), - dict( - CorrelatedColumn=_reflection.GeneratedProtocolMessageType( - "CorrelatedColumn", - (_message.Message,), - dict( - DESCRIPTOR=_COLUMNSPEC_CORRELATEDCOLUMN, - __module__="google.cloud.automl_v1beta1.proto.column_spec_pb2", - __doc__="""Identifies the table's column, and its correlation with - the column this ColumnSpec describes. - - - Attributes: - column_spec_id: - The column\_spec\_id of the correlated column, which belongs - to the same table as the in-context column. - correlation_stats: - Correlation between this and the in-context column. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn) - ), - ), - DESCRIPTOR=_COLUMNSPEC, - __module__="google.cloud.automl_v1beta1.proto.column_spec_pb2", - __doc__="""A representation of a column in a relational table. When - listing them, column specs are returned in the same order in which they - were given on import . Used by: \* Tables - - - Attributes: - name: - Output only. The resource name of the column specs. Form: ``p - rojects/{project_id}/locations/{location_id}/datasets/{dataset - _id}/tableSpecs/{table_spec_id}/columnSpecs/{column_spec_id}`` - data_type: - The data type of elements stored in the column. - display_name: - Output only. The name of the column to show in the interface. - The name can be up to 100 characters long and can consist only - of ASCII Latin letters A-Z and a-z, ASCII digits 0-9, - underscores(\_), and forward slashes(/), and must start with a - letter or a digit. - data_stats: - Output only. Stats of the series of values in the column. This - field may be stale, see the ancestor's - Dataset.tables\_dataset\_metadata.stats\_update\_time field - for the timestamp at which these stats were last updated. - top_correlated_columns: - Deprecated. - etag: - Used to perform consistent read-modify-write updates. If not - set, a blind "overwrite" update happens. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ColumnSpec) - ), -) -_sym_db.RegisterMessage(ColumnSpec) -_sym_db.RegisterMessage(ColumnSpec.CorrelatedColumn) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/column_spec_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/column_spec_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/column_spec_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/data_items.proto b/automl/google/cloud/automl_v1beta1/proto/data_items.proto deleted file mode 100644 index 424a0c64f071..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/data_items.proto +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/api/annotations.proto"; -import "google/cloud/automl/v1beta1/geometry.proto"; -import "google/cloud/automl/v1beta1/io.proto"; -import "google/cloud/automl/v1beta1/text_segment.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/struct.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// A representation of an image. -// Only images up to 30MB in size are supported. -message Image { - // Input only. The data representing the image. - // For Predict calls - // [image_bytes][google.cloud.automl.v1beta1.Image.image_bytes] must be set, - // as other options are not currently supported by prediction API. You can - // read the contents of an uploaded image by using the - // [content_uri][google.cloud.automl.v1beta1.Image.content_uri] field. - oneof 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. - bytes image_bytes = 1; - - // An input config specifying the content of the image. - InputConfig input_config = 6; - } - - // Output only. HTTP URI to the thumbnail image. - string thumbnail_uri = 4; -} - -// A representation of a text snippet. -message TextSnippet { - // Required. The content of the text snippet as a string. Up to 250000 - // characters long. - string content = 1; - - // Optional. The format of - // [content][google.cloud.automl.v1beta1.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.v1beta1.TextSnippet.content]. - string mime_type = 2; - - // Output only. HTTP URI where you can download the content. - string content_uri = 4; -} - -// Message that describes dimension of a document. -message DocumentDimensions { - // Unit of the document dimension. - enum DocumentDimensionUnit { - // Should not be used. - DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0; - - // Document dimension is measured in inches. - INCH = 1; - - // Document dimension is measured in centimeters. - CENTIMETER = 2; - - // Document dimension is measured in points. 72 points = 1 inch. - POINT = 3; - } - - // Unit of the dimension. - DocumentDimensionUnit unit = 1; - - // Width value of the document, works together with the unit. - float width = 2; - - // Height value of the document, works together with the unit. - float height = 3; -} - -// A structured text document e.g. a PDF. -message Document { - // Describes the layout information of a - // [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment] in - // the document. - message Layout { - // The type of TextSegment in the context of the original document. - enum TextSegmentType { - // Should not be used. - TEXT_SEGMENT_TYPE_UNSPECIFIED = 0; - - // The text segment is a token. e.g. word. - TOKEN = 1; - - // The text segment is a paragraph. - PARAGRAPH = 2; - - // The text segment is a form field. - 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. - 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. - FORM_FIELD_CONTENTS = 5; - - // The text segment is a whole table, including headers, and all rows. - 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. - 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. - 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. - TABLE_CELL = 9; - } - - // Text Segment that represents a segment in - // [document_text][google.cloud.automl.v1beta1.Document.document_text]. - TextSegment text_segment = 1; - - // Page number of the - // [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment] - // in the original document, starts from 1. - int32 page_number = 2; - - // The position of the - // [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment] - // in the page. Contains exactly 4 - // - // [normalized_vertices][google.cloud.automl.v1beta1.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.v1beta1.NormalizedVertex] are - // relative to the page. - // Coordinates are based on top-left as point (0,0). - BoundingPoly bounding_poly = 3; - - // The type of the - // [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment] - // in document. - TextSegmentType text_segment_type = 4; - } - - // An input config specifying the content of the document. - DocumentInputConfig input_config = 1; - - // The plain text version of this document. - TextSnippet document_text = 2; - - // Describes the layout of the document. - // Sorted by [page_number][]. - repeated Layout layout = 3; - - // The dimensions of the page in the document. - DocumentDimensions document_dimensions = 4; - - // Number of pages in the document. - int32 page_count = 5; -} - -// A representation of a row in a relational table. -message Row { - // The resource IDs of the column specs describing the columns of the row. - // If set must contain, but possibly in a different order, all input - // feature - // - // [column_spec_ids][google.cloud.automl.v1beta1.TablesModelMetadata.input_feature_column_specs] - // of the Model this row is being passed to. - // Note: The below `values` field must match order of this field, if this - // field is set. - repeated string column_spec_ids = 2; - - // Required. The values of the row cells, given in the same order as the - // column_spec_ids, or, if not set, then in the same order as input - // feature - // - // [column_specs][google.cloud.automl.v1beta1.TablesModelMetadata.input_feature_column_specs] - // of the Model this row is being passed to. - repeated google.protobuf.Value values = 3; -} - -// Example data used for training or prediction. -message ExamplePayload { - // Required. Input only. The example data. - oneof payload { - // Example image. - Image image = 1; - - // Example text. - TextSnippet text_snippet = 2; - - // Example document. - Document document = 4; - - // Example relational table row. - Row row = 3; - } -} diff --git a/automl/google/cloud/automl_v1beta1/proto/data_items_pb2.py b/automl/google/cloud/automl_v1beta1/proto/data_items_pb2.py deleted file mode 100644 index c76bcf28d7bd..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/data_items_pb2.py +++ /dev/null @@ -1,1010 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/data_items.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.cloud.automl_v1beta1.proto import ( - geometry_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_geometry__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - io_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_io__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - text_segment_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__segment__pb2, -) -from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/data_items.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1P\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n2google/cloud/automl_v1beta1/proto/data_items.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x30google/cloud/automl_v1beta1/proto/geometry.proto\x1a*google/cloud/automl_v1beta1/proto/io.proto\x1a\x34google/cloud/automl_v1beta1/proto/text_segment.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto"\x7f\n\x05Image\x12\x15\n\x0bimage_bytes\x18\x01 \x01(\x0cH\x00\x12@\n\x0cinput_config\x18\x06 \x01(\x0b\x32(.google.cloud.automl.v1beta1.InputConfigH\x00\x12\x15\n\rthumbnail_uri\x18\x04 \x01(\tB\x06\n\x04\x64\x61ta"F\n\x0bTextSnippet\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t\x12\x13\n\x0b\x63ontent_uri\x18\x04 \x01(\t"\xef\x01\n\x12\x44ocumentDimensions\x12S\n\x04unit\x18\x01 \x01(\x0e\x32\x45.google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit\x12\r\n\x05width\x18\x02 \x01(\x02\x12\x0e\n\x06height\x18\x03 \x01(\x02"e\n\x15\x44ocumentDimensionUnit\x12\'\n#DOCUMENT_DIMENSION_UNIT_UNSPECIFIED\x10\x00\x12\x08\n\x04INCH\x10\x01\x12\x0e\n\nCENTIMETER\x10\x02\x12\t\n\x05POINT\x10\x03"\xf9\x05\n\x08\x44ocument\x12\x46\n\x0cinput_config\x18\x01 \x01(\x0b\x32\x30.google.cloud.automl.v1beta1.DocumentInputConfig\x12?\n\rdocument_text\x18\x02 \x01(\x0b\x32(.google.cloud.automl.v1beta1.TextSnippet\x12<\n\x06layout\x18\x03 \x03(\x0b\x32,.google.cloud.automl.v1beta1.Document.Layout\x12L\n\x13\x64ocument_dimensions\x18\x04 \x01(\x0b\x32/.google.cloud.automl.v1beta1.DocumentDimensions\x12\x12\n\npage_count\x18\x05 \x01(\x05\x1a\xc3\x03\n\x06Layout\x12>\n\x0ctext_segment\x18\x01 \x01(\x0b\x32(.google.cloud.automl.v1beta1.TextSegment\x12\x13\n\x0bpage_number\x18\x02 \x01(\x05\x12@\n\rbounding_poly\x18\x03 \x01(\x0b\x32).google.cloud.automl.v1beta1.BoundingPoly\x12W\n\x11text_segment_type\x18\x04 \x01(\x0e\x32<.google.cloud.automl.v1beta1.Document.Layout.TextSegmentType"\xc8\x01\n\x0fTextSegmentType\x12!\n\x1dTEXT_SEGMENT_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05TOKEN\x10\x01\x12\r\n\tPARAGRAPH\x10\x02\x12\x0e\n\nFORM_FIELD\x10\x03\x12\x13\n\x0f\x46ORM_FIELD_NAME\x10\x04\x12\x17\n\x13\x46ORM_FIELD_CONTENTS\x10\x05\x12\t\n\x05TABLE\x10\x06\x12\x10\n\x0cTABLE_HEADER\x10\x07\x12\r\n\tTABLE_ROW\x10\x08\x12\x0e\n\nTABLE_CELL\x10\t"F\n\x03Row\x12\x17\n\x0f\x63olumn_spec_ids\x18\x02 \x03(\t\x12&\n\x06values\x18\x03 \x03(\x0b\x32\x16.google.protobuf.Value"\xfe\x01\n\x0e\x45xamplePayload\x12\x33\n\x05image\x18\x01 \x01(\x0b\x32".google.cloud.automl.v1beta1.ImageH\x00\x12@\n\x0ctext_snippet\x18\x02 \x01(\x0b\x32(.google.cloud.automl.v1beta1.TextSnippetH\x00\x12\x39\n\x08\x64ocument\x18\x04 \x01(\x0b\x32%.google.cloud.automl.v1beta1.DocumentH\x00\x12/\n\x03row\x18\x03 \x01(\x0b\x32 .google.cloud.automl.v1beta1.RowH\x00\x42\t\n\x07payloadB\xa5\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_geometry__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_io__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__segment__pb2.DESCRIPTOR, - google_dot_protobuf_dot_any__pb2.DESCRIPTOR, - google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, - google_dot_protobuf_dot_struct__pb2.DESCRIPTOR, - ], -) - - -_DOCUMENTDIMENSIONS_DOCUMENTDIMENSIONUNIT = _descriptor.EnumDescriptor( - name="DocumentDimensionUnit", - full_name="google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="DOCUMENT_DIMENSION_UNIT_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="INCH", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CENTIMETER", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="POINT", index=3, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=690, - serialized_end=791, -) -_sym_db.RegisterEnumDescriptor(_DOCUMENTDIMENSIONS_DOCUMENTDIMENSIONUNIT) - -_DOCUMENT_LAYOUT_TEXTSEGMENTTYPE = _descriptor.EnumDescriptor( - name="TextSegmentType", - full_name="google.cloud.automl.v1beta1.Document.Layout.TextSegmentType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="TEXT_SEGMENT_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TOKEN", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PARAGRAPH", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FORM_FIELD", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FORM_FIELD_NAME", - index=4, - number=4, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FORM_FIELD_CONTENTS", - index=5, - number=5, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TABLE", index=6, number=6, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TABLE_HEADER", index=7, number=7, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TABLE_ROW", index=8, number=8, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TABLE_CELL", index=9, number=9, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1355, - serialized_end=1555, -) -_sym_db.RegisterEnumDescriptor(_DOCUMENT_LAYOUT_TEXTSEGMENTTYPE) - - -_IMAGE = _descriptor.Descriptor( - name="Image", - full_name="google.cloud.automl.v1beta1.Image", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="image_bytes", - full_name="google.cloud.automl.v1beta1.Image.image_bytes", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="input_config", - full_name="google.cloud.automl.v1beta1.Image.input_config", - index=1, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="thumbnail_uri", - full_name="google.cloud.automl.v1beta1.Image.thumbnail_uri", - index=2, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="data", - full_name="google.cloud.automl.v1beta1.Image.data", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=350, - serialized_end=477, -) - - -_TEXTSNIPPET = _descriptor.Descriptor( - name="TextSnippet", - full_name="google.cloud.automl.v1beta1.TextSnippet", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="content", - full_name="google.cloud.automl.v1beta1.TextSnippet.content", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.automl.v1beta1.TextSnippet.mime_type", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="content_uri", - full_name="google.cloud.automl.v1beta1.TextSnippet.content_uri", - index=2, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=479, - serialized_end=549, -) - - -_DOCUMENTDIMENSIONS = _descriptor.Descriptor( - name="DocumentDimensions", - full_name="google.cloud.automl.v1beta1.DocumentDimensions", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="unit", - full_name="google.cloud.automl.v1beta1.DocumentDimensions.unit", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="width", - full_name="google.cloud.automl.v1beta1.DocumentDimensions.width", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="height", - full_name="google.cloud.automl.v1beta1.DocumentDimensions.height", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_DOCUMENTDIMENSIONS_DOCUMENTDIMENSIONUNIT], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=552, - serialized_end=791, -) - - -_DOCUMENT_LAYOUT = _descriptor.Descriptor( - name="Layout", - full_name="google.cloud.automl.v1beta1.Document.Layout", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="text_segment", - full_name="google.cloud.automl.v1beta1.Document.Layout.text_segment", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_number", - full_name="google.cloud.automl.v1beta1.Document.Layout.page_number", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.automl.v1beta1.Document.Layout.bounding_poly", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_segment_type", - full_name="google.cloud.automl.v1beta1.Document.Layout.text_segment_type", - index=3, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_DOCUMENT_LAYOUT_TEXTSEGMENTTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1104, - serialized_end=1555, -) - -_DOCUMENT = _descriptor.Descriptor( - name="Document", - full_name="google.cloud.automl.v1beta1.Document", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_config", - full_name="google.cloud.automl.v1beta1.Document.input_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="document_text", - full_name="google.cloud.automl.v1beta1.Document.document_text", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="layout", - full_name="google.cloud.automl.v1beta1.Document.layout", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="document_dimensions", - full_name="google.cloud.automl.v1beta1.Document.document_dimensions", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_count", - full_name="google.cloud.automl.v1beta1.Document.page_count", - index=4, - number=5, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_DOCUMENT_LAYOUT], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=794, - serialized_end=1555, -) - - -_ROW = _descriptor.Descriptor( - name="Row", - full_name="google.cloud.automl.v1beta1.Row", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="column_spec_ids", - full_name="google.cloud.automl.v1beta1.Row.column_spec_ids", - index=0, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="values", - full_name="google.cloud.automl.v1beta1.Row.values", - index=1, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1557, - serialized_end=1627, -) - - -_EXAMPLEPAYLOAD = _descriptor.Descriptor( - name="ExamplePayload", - full_name="google.cloud.automl.v1beta1.ExamplePayload", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="image", - full_name="google.cloud.automl.v1beta1.ExamplePayload.image", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_snippet", - full_name="google.cloud.automl.v1beta1.ExamplePayload.text_snippet", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="document", - full_name="google.cloud.automl.v1beta1.ExamplePayload.document", - index=2, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="row", - full_name="google.cloud.automl.v1beta1.ExamplePayload.row", - index=3, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="payload", - full_name="google.cloud.automl.v1beta1.ExamplePayload.payload", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1630, - serialized_end=1884, -) - -_IMAGE.fields_by_name[ - "input_config" -].message_type = google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_io__pb2._INPUTCONFIG -_IMAGE.oneofs_by_name["data"].fields.append(_IMAGE.fields_by_name["image_bytes"]) -_IMAGE.fields_by_name["image_bytes"].containing_oneof = _IMAGE.oneofs_by_name["data"] -_IMAGE.oneofs_by_name["data"].fields.append(_IMAGE.fields_by_name["input_config"]) -_IMAGE.fields_by_name["input_config"].containing_oneof = _IMAGE.oneofs_by_name["data"] -_DOCUMENTDIMENSIONS.fields_by_name[ - "unit" -].enum_type = _DOCUMENTDIMENSIONS_DOCUMENTDIMENSIONUNIT -_DOCUMENTDIMENSIONS_DOCUMENTDIMENSIONUNIT.containing_type = _DOCUMENTDIMENSIONS -_DOCUMENT_LAYOUT.fields_by_name[ - "text_segment" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__segment__pb2._TEXTSEGMENT -) -_DOCUMENT_LAYOUT.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_DOCUMENT_LAYOUT.fields_by_name[ - "text_segment_type" -].enum_type = _DOCUMENT_LAYOUT_TEXTSEGMENTTYPE -_DOCUMENT_LAYOUT.containing_type = _DOCUMENT -_DOCUMENT_LAYOUT_TEXTSEGMENTTYPE.containing_type = _DOCUMENT_LAYOUT -_DOCUMENT.fields_by_name[ - "input_config" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_io__pb2._DOCUMENTINPUTCONFIG -) -_DOCUMENT.fields_by_name["document_text"].message_type = _TEXTSNIPPET -_DOCUMENT.fields_by_name["layout"].message_type = _DOCUMENT_LAYOUT -_DOCUMENT.fields_by_name["document_dimensions"].message_type = _DOCUMENTDIMENSIONS -_ROW.fields_by_name["values"].message_type = google_dot_protobuf_dot_struct__pb2._VALUE -_EXAMPLEPAYLOAD.fields_by_name["image"].message_type = _IMAGE -_EXAMPLEPAYLOAD.fields_by_name["text_snippet"].message_type = _TEXTSNIPPET -_EXAMPLEPAYLOAD.fields_by_name["document"].message_type = _DOCUMENT -_EXAMPLEPAYLOAD.fields_by_name["row"].message_type = _ROW -_EXAMPLEPAYLOAD.oneofs_by_name["payload"].fields.append( - _EXAMPLEPAYLOAD.fields_by_name["image"] -) -_EXAMPLEPAYLOAD.fields_by_name[ - "image" -].containing_oneof = _EXAMPLEPAYLOAD.oneofs_by_name["payload"] -_EXAMPLEPAYLOAD.oneofs_by_name["payload"].fields.append( - _EXAMPLEPAYLOAD.fields_by_name["text_snippet"] -) -_EXAMPLEPAYLOAD.fields_by_name[ - "text_snippet" -].containing_oneof = _EXAMPLEPAYLOAD.oneofs_by_name["payload"] -_EXAMPLEPAYLOAD.oneofs_by_name["payload"].fields.append( - _EXAMPLEPAYLOAD.fields_by_name["document"] -) -_EXAMPLEPAYLOAD.fields_by_name[ - "document" -].containing_oneof = _EXAMPLEPAYLOAD.oneofs_by_name["payload"] -_EXAMPLEPAYLOAD.oneofs_by_name["payload"].fields.append( - _EXAMPLEPAYLOAD.fields_by_name["row"] -) -_EXAMPLEPAYLOAD.fields_by_name["row"].containing_oneof = _EXAMPLEPAYLOAD.oneofs_by_name[ - "payload" -] -DESCRIPTOR.message_types_by_name["Image"] = _IMAGE -DESCRIPTOR.message_types_by_name["TextSnippet"] = _TEXTSNIPPET -DESCRIPTOR.message_types_by_name["DocumentDimensions"] = _DOCUMENTDIMENSIONS -DESCRIPTOR.message_types_by_name["Document"] = _DOCUMENT -DESCRIPTOR.message_types_by_name["Row"] = _ROW -DESCRIPTOR.message_types_by_name["ExamplePayload"] = _EXAMPLEPAYLOAD -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Image = _reflection.GeneratedProtocolMessageType( - "Image", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGE, - __module__="google.cloud.automl_v1beta1.proto.data_items_pb2", - __doc__="""A representation of an image. Only images up to 30MB in - size are supported. - - - Attributes: - data: - Input only. The data representing the image. For Predict calls - [image\_bytes][google.cloud.automl.v1beta1.Image.image\_bytes] - must be set, as other options are not currently supported by - prediction API. You can read the contents of an uploaded image - by using the - [content\_uri][google.cloud.automl.v1beta1.Image.content\_uri] - field. - 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. - input_config: - An input config specifying the content of the image. - thumbnail_uri: - Output only. HTTP URI to the thumbnail image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.Image) - ), -) -_sym_db.RegisterMessage(Image) - -TextSnippet = _reflection.GeneratedProtocolMessageType( - "TextSnippet", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTSNIPPET, - __module__="google.cloud.automl_v1beta1.proto.data_items_pb2", - __doc__="""A representation of a text snippet. - - - Attributes: - content: - Required. The content of the text snippet as a string. Up to - 250000 characters long. - mime_type: - Optional. The format of - [content][google.cloud.automl.v1beta1.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.v1beta1.TextSnippet.content]. - content_uri: - Output only. HTTP URI where you can download the content. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TextSnippet) - ), -) -_sym_db.RegisterMessage(TextSnippet) - -DocumentDimensions = _reflection.GeneratedProtocolMessageType( - "DocumentDimensions", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENTDIMENSIONS, - __module__="google.cloud.automl_v1beta1.proto.data_items_pb2", - __doc__="""Message that describes dimension of a document. - - - Attributes: - unit: - Unit of the dimension. - width: - Width value of the document, works together with the unit. - height: - Height value of the document, works together with the unit. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.DocumentDimensions) - ), -) -_sym_db.RegisterMessage(DocumentDimensions) - -Document = _reflection.GeneratedProtocolMessageType( - "Document", - (_message.Message,), - dict( - Layout=_reflection.GeneratedProtocolMessageType( - "Layout", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENT_LAYOUT, - __module__="google.cloud.automl_v1beta1.proto.data_items_pb2", - __doc__="""Describes the layout information of a - [text\_segment][google.cloud.automl.v1beta1.Document.Layout.text\_segment] - in the document. - - - Attributes: - text_segment: - Text Segment that represents a segment in [document\_text][goo - gle.cloud.automl.v1beta1.Document.document\_text]. - page_number: - Page number of the [text\_segment][google.cloud.automl.v1beta1 - .Document.Layout.text\_segment] in the original document, - starts from 1. - bounding_poly: - The position of the [text\_segment][google.cloud.automl.v1beta - 1.Document.Layout.text\_segment] in the page. Contains exactly - 4 [normalized\_vertices][google.cloud.automl.v1beta1.Bounding - Poly.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.v1b - eta1.NormalizedVertex] are relative to the page. Coordinates - are based on top-left as point (0,0). - text_segment_type: - The type of the [text\_segment][google.cloud.automl.v1beta1.Do - cument.Layout.text\_segment] in document. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.Document.Layout) - ), - ), - DESCRIPTOR=_DOCUMENT, - __module__="google.cloud.automl_v1beta1.proto.data_items_pb2", - __doc__="""A structured text document e.g. a PDF. - - - Attributes: - input_config: - An input config specifying the content of the document. - document_text: - The plain text version of this document. - layout: - Describes the layout of the document. Sorted by - [page\_number][]. - document_dimensions: - The dimensions of the page in the document. - page_count: - Number of pages in the document. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.Document) - ), -) -_sym_db.RegisterMessage(Document) -_sym_db.RegisterMessage(Document.Layout) - -Row = _reflection.GeneratedProtocolMessageType( - "Row", - (_message.Message,), - dict( - DESCRIPTOR=_ROW, - __module__="google.cloud.automl_v1beta1.proto.data_items_pb2", - __doc__="""A representation of a row in a relational table. - - - Attributes: - column_spec_ids: - The resource IDs of the column specs describing the columns of - the row. If set must contain, but possibly in a different - order, all input feature [column\_spec\_ids][google.cloud.aut - oml.v1beta1.TablesModelMetadata.input\_feature\_column\_specs] - of the Model this row is being passed to. Note: The below - ``values`` field must match order of this field, if this field - is set. - values: - Required. The values of the row cells, given in the same order - as the column\_spec\_ids, or, if not set, then in the same - order as input feature [column\_specs][google.cloud.automl.v1 - beta1.TablesModelMetadata.input\_feature\_column\_specs] of - the Model this row is being passed to. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.Row) - ), -) -_sym_db.RegisterMessage(Row) - -ExamplePayload = _reflection.GeneratedProtocolMessageType( - "ExamplePayload", - (_message.Message,), - dict( - DESCRIPTOR=_EXAMPLEPAYLOAD, - __module__="google.cloud.automl_v1beta1.proto.data_items_pb2", - __doc__="""Example data used for training or prediction. - - - Attributes: - payload: - Required. Input only. The example data. - image: - Example image. - text_snippet: - Example text. - document: - Example document. - row: - Example relational table row. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ExamplePayload) - ), -) -_sym_db.RegisterMessage(ExamplePayload) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/data_items_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/data_items_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/data_items_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/data_stats.proto b/automl/google/cloud/automl_v1beta1/proto/data_stats.proto deleted file mode 100644 index 5d941a5baa81..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/data_stats.proto +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// The data statistics of a series of values that share the same DataType. -message DataStats { - // The data statistics specific to a DataType. - oneof stats { - // The statistics for FLOAT64 DataType. - Float64Stats float64_stats = 3; - - // The statistics for STRING DataType. - StringStats string_stats = 4; - - // The statistics for TIMESTAMP DataType. - TimestampStats timestamp_stats = 5; - - // The statistics for ARRAY DataType. - ArrayStats array_stats = 6; - - // The statistics for STRUCT DataType. - StructStats struct_stats = 7; - - // The statistics for CATEGORY DataType. - CategoryStats category_stats = 8; - } - - // The number of distinct values. - int64 distinct_value_count = 1; - - // The number of values that are null. - int64 null_value_count = 2; - - // The number of values that are valid. - int64 valid_value_count = 9; -} - -// The data statistics of a series of FLOAT64 values. -message Float64Stats { - // A bucket of a histogram. - message HistogramBucket { - // The minimum value of the bucket, inclusive. - double min = 1; - - // The maximum value of the bucket, exclusive unless max = `"Infinity"`, in - // which case it's inclusive. - double max = 2; - - // The number of data values that are in the bucket, i.e. are between - // min and max values. - int64 count = 3; - } - - // The mean of the series. - double mean = 1; - - // The standard deviation of the series. - double standard_deviation = 2; - - // Ordered from 0 to k k-quantile values of the data series of n values. - // The value at index i is, approximately, the i*n/k-th smallest value in the - // series; for i = 0 and i = k these are, respectively, the min and max - // values. - repeated double quantiles = 3; - - // Histogram buckets of the data series. Sorted by the min value of the - // bucket, ascendingly, and the number of the buckets is dynamically - // generated. The buckets are non-overlapping and completely cover whole - // FLOAT64 range with min of first bucket being `"-Infinity"`, and max of - // the last one being `"Infinity"`. - repeated HistogramBucket histogram_buckets = 4; -} - -// The data statistics of a series of STRING values. -message StringStats { - // The statistics of a unigram. - message UnigramStats { - // The unigram. - string value = 1; - - // The number of occurrences of this unigram in the series. - int64 count = 2; - } - - // The statistics of the top 20 unigrams, ordered by - // [count][google.cloud.automl.v1beta1.StringStats.UnigramStats.count]. - repeated UnigramStats top_unigram_stats = 1; -} - -// The data statistics of a series of TIMESTAMP values. -message TimestampStats { - // Stats split by a defined in context granularity. - message GranularStats { - // A map from granularity key to example count for that key. - // E.g. for hour_of_day `13` means 1pm, or for month_of_year `5` means May). - map buckets = 1; - } - - // The string key is the pre-defined granularity. Currently supported: - // hour_of_day, day_of_week, month_of_year. - // Granularities finer that the granularity of timestamp data are not - // populated (e.g. if timestamps are at day granularity, then hour_of_day - // is not populated). - map granular_stats = 1; -} - -// The data statistics of a series of ARRAY values. -message ArrayStats { - // Stats of all the values of all arrays, as if they were a single long - // series of data. The type depends on the element type of the array. - DataStats member_stats = 2; -} - -// The data statistics of a series of STRUCT values. -message StructStats { - // Map from a field name of the struct to data stats aggregated over series - // of all data in that field across all the structs. - map field_stats = 1; -} - -// The data statistics of a series of CATEGORY values. -message CategoryStats { - // The statistics of a single CATEGORY value. - message SingleCategoryStats { - // The CATEGORY value. - string value = 1; - - // The number of occurrences of this value in the series. - int64 count = 2; - } - - // The statistics of the top 20 CATEGORY values, ordered by - // - // [count][google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.count]. - repeated SingleCategoryStats top_category_stats = 1; -} - -// A correlation statistics between two series of DataType values. The series -// may have differing DataType-s, but within a single series the DataType must -// be the same. -message CorrelationStats { - // The correlation value using the Cramer's V measure. - double cramers_v = 1; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/data_stats_pb2.py b/automl/google/cloud/automl_v1beta1/proto/data_stats_pb2.py deleted file mode 100644 index 85f18cee98ac..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/data_stats_pb2.py +++ /dev/null @@ -1,1330 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/data_stats.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/data_stats.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1P\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n2google/cloud/automl_v1beta1/proto/data_stats.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x1cgoogle/api/annotations.proto"\xfd\x03\n\tDataStats\x12\x42\n\rfloat64_stats\x18\x03 \x01(\x0b\x32).google.cloud.automl.v1beta1.Float64StatsH\x00\x12@\n\x0cstring_stats\x18\x04 \x01(\x0b\x32(.google.cloud.automl.v1beta1.StringStatsH\x00\x12\x46\n\x0ftimestamp_stats\x18\x05 \x01(\x0b\x32+.google.cloud.automl.v1beta1.TimestampStatsH\x00\x12>\n\x0b\x61rray_stats\x18\x06 \x01(\x0b\x32\'.google.cloud.automl.v1beta1.ArrayStatsH\x00\x12@\n\x0cstruct_stats\x18\x07 \x01(\x0b\x32(.google.cloud.automl.v1beta1.StructStatsH\x00\x12\x44\n\x0e\x63\x61tegory_stats\x18\x08 \x01(\x0b\x32*.google.cloud.automl.v1beta1.CategoryStatsH\x00\x12\x1c\n\x14\x64istinct_value_count\x18\x01 \x01(\x03\x12\x18\n\x10null_value_count\x18\x02 \x01(\x03\x12\x19\n\x11valid_value_count\x18\t \x01(\x03\x42\x07\n\x05stats"\xdd\x01\n\x0c\x46loat64Stats\x12\x0c\n\x04mean\x18\x01 \x01(\x01\x12\x1a\n\x12standard_deviation\x18\x02 \x01(\x01\x12\x11\n\tquantiles\x18\x03 \x03(\x01\x12T\n\x11histogram_buckets\x18\x04 \x03(\x0b\x32\x39.google.cloud.automl.v1beta1.Float64Stats.HistogramBucket\x1a:\n\x0fHistogramBucket\x12\x0b\n\x03min\x18\x01 \x01(\x01\x12\x0b\n\x03max\x18\x02 \x01(\x01\x12\r\n\x05\x63ount\x18\x03 \x01(\x03"\x8d\x01\n\x0bStringStats\x12P\n\x11top_unigram_stats\x18\x01 \x03(\x0b\x32\x35.google.cloud.automl.v1beta1.StringStats.UnigramStats\x1a,\n\x0cUnigramStats\x12\r\n\x05value\x18\x01 \x01(\t\x12\r\n\x05\x63ount\x18\x02 \x01(\x03"\xf4\x02\n\x0eTimestampStats\x12V\n\x0egranular_stats\x18\x01 \x03(\x0b\x32>.google.cloud.automl.v1beta1.TimestampStats.GranularStatsEntry\x1a\x98\x01\n\rGranularStats\x12W\n\x07\x62uckets\x18\x01 \x03(\x0b\x32\x46.google.cloud.automl.v1beta1.TimestampStats.GranularStats.BucketsEntry\x1a.\n\x0c\x42ucketsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1ao\n\x12GranularStatsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.automl.v1beta1.TimestampStats.GranularStats:\x02\x38\x01"J\n\nArrayStats\x12<\n\x0cmember_stats\x18\x02 \x01(\x0b\x32&.google.cloud.automl.v1beta1.DataStats"\xb7\x01\n\x0bStructStats\x12M\n\x0b\x66ield_stats\x18\x01 \x03(\x0b\x32\x38.google.cloud.automl.v1beta1.StructStats.FieldStatsEntry\x1aY\n\x0f\x46ieldStatsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x35\n\x05value\x18\x02 \x01(\x0b\x32&.google.cloud.automl.v1beta1.DataStats:\x02\x38\x01"\xa0\x01\n\rCategoryStats\x12Z\n\x12top_category_stats\x18\x01 \x03(\x0b\x32>.google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats\x1a\x33\n\x13SingleCategoryStats\x12\r\n\x05value\x18\x01 \x01(\t\x12\r\n\x05\x63ount\x18\x02 \x01(\x03"%\n\x10\x43orrelationStats\x12\x11\n\tcramers_v\x18\x01 \x01(\x01\x42\xa5\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], -) - - -_DATASTATS = _descriptor.Descriptor( - name="DataStats", - full_name="google.cloud.automl.v1beta1.DataStats", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="float64_stats", - full_name="google.cloud.automl.v1beta1.DataStats.float64_stats", - index=0, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="string_stats", - full_name="google.cloud.automl.v1beta1.DataStats.string_stats", - index=1, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="timestamp_stats", - full_name="google.cloud.automl.v1beta1.DataStats.timestamp_stats", - index=2, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="array_stats", - full_name="google.cloud.automl.v1beta1.DataStats.array_stats", - index=3, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="struct_stats", - full_name="google.cloud.automl.v1beta1.DataStats.struct_stats", - index=4, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="category_stats", - full_name="google.cloud.automl.v1beta1.DataStats.category_stats", - index=5, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="distinct_value_count", - full_name="google.cloud.automl.v1beta1.DataStats.distinct_value_count", - index=6, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="null_value_count", - full_name="google.cloud.automl.v1beta1.DataStats.null_value_count", - index=7, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="valid_value_count", - full_name="google.cloud.automl.v1beta1.DataStats.valid_value_count", - index=8, - number=9, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="stats", - full_name="google.cloud.automl.v1beta1.DataStats.stats", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=114, - serialized_end=623, -) - - -_FLOAT64STATS_HISTOGRAMBUCKET = _descriptor.Descriptor( - name="HistogramBucket", - full_name="google.cloud.automl.v1beta1.Float64Stats.HistogramBucket", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="min", - full_name="google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.min", - index=0, - number=1, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max", - full_name="google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.max", - index=1, - number=2, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="count", - full_name="google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.count", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=789, - serialized_end=847, -) - -_FLOAT64STATS = _descriptor.Descriptor( - name="Float64Stats", - full_name="google.cloud.automl.v1beta1.Float64Stats", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="mean", - full_name="google.cloud.automl.v1beta1.Float64Stats.mean", - index=0, - number=1, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="standard_deviation", - full_name="google.cloud.automl.v1beta1.Float64Stats.standard_deviation", - index=1, - number=2, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="quantiles", - full_name="google.cloud.automl.v1beta1.Float64Stats.quantiles", - index=2, - number=3, - type=1, - cpp_type=5, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="histogram_buckets", - full_name="google.cloud.automl.v1beta1.Float64Stats.histogram_buckets", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_FLOAT64STATS_HISTOGRAMBUCKET], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=626, - serialized_end=847, -) - - -_STRINGSTATS_UNIGRAMSTATS = _descriptor.Descriptor( - name="UnigramStats", - full_name="google.cloud.automl.v1beta1.StringStats.UnigramStats", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.automl.v1beta1.StringStats.UnigramStats.value", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="count", - full_name="google.cloud.automl.v1beta1.StringStats.UnigramStats.count", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=947, - serialized_end=991, -) - -_STRINGSTATS = _descriptor.Descriptor( - name="StringStats", - full_name="google.cloud.automl.v1beta1.StringStats", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="top_unigram_stats", - full_name="google.cloud.automl.v1beta1.StringStats.top_unigram_stats", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[_STRINGSTATS_UNIGRAMSTATS], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=850, - serialized_end=991, -) - - -_TIMESTAMPSTATS_GRANULARSTATS_BUCKETSENTRY = _descriptor.Descriptor( - name="BucketsEntry", - full_name="google.cloud.automl.v1beta1.TimestampStats.GranularStats.BucketsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.automl.v1beta1.TimestampStats.GranularStats.BucketsEntry.key", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.automl.v1beta1.TimestampStats.GranularStats.BucketsEntry.value", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1207, - serialized_end=1253, -) - -_TIMESTAMPSTATS_GRANULARSTATS = _descriptor.Descriptor( - name="GranularStats", - full_name="google.cloud.automl.v1beta1.TimestampStats.GranularStats", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="buckets", - full_name="google.cloud.automl.v1beta1.TimestampStats.GranularStats.buckets", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[_TIMESTAMPSTATS_GRANULARSTATS_BUCKETSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1101, - serialized_end=1253, -) - -_TIMESTAMPSTATS_GRANULARSTATSENTRY = _descriptor.Descriptor( - name="GranularStatsEntry", - full_name="google.cloud.automl.v1beta1.TimestampStats.GranularStatsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.automl.v1beta1.TimestampStats.GranularStatsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.automl.v1beta1.TimestampStats.GranularStatsEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1255, - serialized_end=1366, -) - -_TIMESTAMPSTATS = _descriptor.Descriptor( - name="TimestampStats", - full_name="google.cloud.automl.v1beta1.TimestampStats", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="granular_stats", - full_name="google.cloud.automl.v1beta1.TimestampStats.granular_stats", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[_TIMESTAMPSTATS_GRANULARSTATS, _TIMESTAMPSTATS_GRANULARSTATSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=994, - serialized_end=1366, -) - - -_ARRAYSTATS = _descriptor.Descriptor( - name="ArrayStats", - full_name="google.cloud.automl.v1beta1.ArrayStats", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="member_stats", - full_name="google.cloud.automl.v1beta1.ArrayStats.member_stats", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1368, - serialized_end=1442, -) - - -_STRUCTSTATS_FIELDSTATSENTRY = _descriptor.Descriptor( - name="FieldStatsEntry", - full_name="google.cloud.automl.v1beta1.StructStats.FieldStatsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.automl.v1beta1.StructStats.FieldStatsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.automl.v1beta1.StructStats.FieldStatsEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1539, - serialized_end=1628, -) - -_STRUCTSTATS = _descriptor.Descriptor( - name="StructStats", - full_name="google.cloud.automl.v1beta1.StructStats", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="field_stats", - full_name="google.cloud.automl.v1beta1.StructStats.field_stats", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[_STRUCTSTATS_FIELDSTATSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1445, - serialized_end=1628, -) - - -_CATEGORYSTATS_SINGLECATEGORYSTATS = _descriptor.Descriptor( - name="SingleCategoryStats", - full_name="google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.value", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="count", - full_name="google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.count", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1740, - serialized_end=1791, -) - -_CATEGORYSTATS = _descriptor.Descriptor( - name="CategoryStats", - full_name="google.cloud.automl.v1beta1.CategoryStats", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="top_category_stats", - full_name="google.cloud.automl.v1beta1.CategoryStats.top_category_stats", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[_CATEGORYSTATS_SINGLECATEGORYSTATS], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1631, - serialized_end=1791, -) - - -_CORRELATIONSTATS = _descriptor.Descriptor( - name="CorrelationStats", - full_name="google.cloud.automl.v1beta1.CorrelationStats", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="cramers_v", - full_name="google.cloud.automl.v1beta1.CorrelationStats.cramers_v", - index=0, - number=1, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1793, - serialized_end=1830, -) - -_DATASTATS.fields_by_name["float64_stats"].message_type = _FLOAT64STATS -_DATASTATS.fields_by_name["string_stats"].message_type = _STRINGSTATS -_DATASTATS.fields_by_name["timestamp_stats"].message_type = _TIMESTAMPSTATS -_DATASTATS.fields_by_name["array_stats"].message_type = _ARRAYSTATS -_DATASTATS.fields_by_name["struct_stats"].message_type = _STRUCTSTATS -_DATASTATS.fields_by_name["category_stats"].message_type = _CATEGORYSTATS -_DATASTATS.oneofs_by_name["stats"].fields.append( - _DATASTATS.fields_by_name["float64_stats"] -) -_DATASTATS.fields_by_name["float64_stats"].containing_oneof = _DATASTATS.oneofs_by_name[ - "stats" -] -_DATASTATS.oneofs_by_name["stats"].fields.append( - _DATASTATS.fields_by_name["string_stats"] -) -_DATASTATS.fields_by_name["string_stats"].containing_oneof = _DATASTATS.oneofs_by_name[ - "stats" -] -_DATASTATS.oneofs_by_name["stats"].fields.append( - _DATASTATS.fields_by_name["timestamp_stats"] -) -_DATASTATS.fields_by_name[ - "timestamp_stats" -].containing_oneof = _DATASTATS.oneofs_by_name["stats"] -_DATASTATS.oneofs_by_name["stats"].fields.append( - _DATASTATS.fields_by_name["array_stats"] -) -_DATASTATS.fields_by_name["array_stats"].containing_oneof = _DATASTATS.oneofs_by_name[ - "stats" -] -_DATASTATS.oneofs_by_name["stats"].fields.append( - _DATASTATS.fields_by_name["struct_stats"] -) -_DATASTATS.fields_by_name["struct_stats"].containing_oneof = _DATASTATS.oneofs_by_name[ - "stats" -] -_DATASTATS.oneofs_by_name["stats"].fields.append( - _DATASTATS.fields_by_name["category_stats"] -) -_DATASTATS.fields_by_name[ - "category_stats" -].containing_oneof = _DATASTATS.oneofs_by_name["stats"] -_FLOAT64STATS_HISTOGRAMBUCKET.containing_type = _FLOAT64STATS -_FLOAT64STATS.fields_by_name[ - "histogram_buckets" -].message_type = _FLOAT64STATS_HISTOGRAMBUCKET -_STRINGSTATS_UNIGRAMSTATS.containing_type = _STRINGSTATS -_STRINGSTATS.fields_by_name[ - "top_unigram_stats" -].message_type = _STRINGSTATS_UNIGRAMSTATS -_TIMESTAMPSTATS_GRANULARSTATS_BUCKETSENTRY.containing_type = ( - _TIMESTAMPSTATS_GRANULARSTATS -) -_TIMESTAMPSTATS_GRANULARSTATS.fields_by_name[ - "buckets" -].message_type = _TIMESTAMPSTATS_GRANULARSTATS_BUCKETSENTRY -_TIMESTAMPSTATS_GRANULARSTATS.containing_type = _TIMESTAMPSTATS -_TIMESTAMPSTATS_GRANULARSTATSENTRY.fields_by_name[ - "value" -].message_type = _TIMESTAMPSTATS_GRANULARSTATS -_TIMESTAMPSTATS_GRANULARSTATSENTRY.containing_type = _TIMESTAMPSTATS -_TIMESTAMPSTATS.fields_by_name[ - "granular_stats" -].message_type = _TIMESTAMPSTATS_GRANULARSTATSENTRY -_ARRAYSTATS.fields_by_name["member_stats"].message_type = _DATASTATS -_STRUCTSTATS_FIELDSTATSENTRY.fields_by_name["value"].message_type = _DATASTATS -_STRUCTSTATS_FIELDSTATSENTRY.containing_type = _STRUCTSTATS -_STRUCTSTATS.fields_by_name["field_stats"].message_type = _STRUCTSTATS_FIELDSTATSENTRY -_CATEGORYSTATS_SINGLECATEGORYSTATS.containing_type = _CATEGORYSTATS -_CATEGORYSTATS.fields_by_name[ - "top_category_stats" -].message_type = _CATEGORYSTATS_SINGLECATEGORYSTATS -DESCRIPTOR.message_types_by_name["DataStats"] = _DATASTATS -DESCRIPTOR.message_types_by_name["Float64Stats"] = _FLOAT64STATS -DESCRIPTOR.message_types_by_name["StringStats"] = _STRINGSTATS -DESCRIPTOR.message_types_by_name["TimestampStats"] = _TIMESTAMPSTATS -DESCRIPTOR.message_types_by_name["ArrayStats"] = _ARRAYSTATS -DESCRIPTOR.message_types_by_name["StructStats"] = _STRUCTSTATS -DESCRIPTOR.message_types_by_name["CategoryStats"] = _CATEGORYSTATS -DESCRIPTOR.message_types_by_name["CorrelationStats"] = _CORRELATIONSTATS -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -DataStats = _reflection.GeneratedProtocolMessageType( - "DataStats", - (_message.Message,), - dict( - DESCRIPTOR=_DATASTATS, - __module__="google.cloud.automl_v1beta1.proto.data_stats_pb2", - __doc__="""The data statistics of a series of values that share the - same DataType. - - - Attributes: - stats: - The data statistics specific to a DataType. - float64_stats: - The statistics for FLOAT64 DataType. - string_stats: - The statistics for STRING DataType. - timestamp_stats: - The statistics for TIMESTAMP DataType. - array_stats: - The statistics for ARRAY DataType. - struct_stats: - The statistics for STRUCT DataType. - category_stats: - The statistics for CATEGORY DataType. - distinct_value_count: - The number of distinct values. - null_value_count: - The number of values that are null. - valid_value_count: - The number of values that are valid. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.DataStats) - ), -) -_sym_db.RegisterMessage(DataStats) - -Float64Stats = _reflection.GeneratedProtocolMessageType( - "Float64Stats", - (_message.Message,), - dict( - HistogramBucket=_reflection.GeneratedProtocolMessageType( - "HistogramBucket", - (_message.Message,), - dict( - DESCRIPTOR=_FLOAT64STATS_HISTOGRAMBUCKET, - __module__="google.cloud.automl_v1beta1.proto.data_stats_pb2", - __doc__="""A bucket of a histogram. - - - Attributes: - min: - The minimum value of the bucket, inclusive. - max: - The maximum value of the bucket, exclusive unless max = - ``"Infinity"``, in which case it's inclusive. - count: - The number of data values that are in the bucket, i.e. are - between min and max values. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.Float64Stats.HistogramBucket) - ), - ), - DESCRIPTOR=_FLOAT64STATS, - __module__="google.cloud.automl_v1beta1.proto.data_stats_pb2", - __doc__="""The data statistics of a series of FLOAT64 values. - - - Attributes: - mean: - The mean of the series. - standard_deviation: - The standard deviation of the series. - quantiles: - Ordered from 0 to k k-quantile values of the data series of n - values. The value at index i is, approximately, the i\*n/k-th - smallest value in the series; for i = 0 and i = k these are, - respectively, the min and max values. - histogram_buckets: - Histogram buckets of the data series. Sorted by the min value - of the bucket, ascendingly, and the number of the buckets is - dynamically generated. The buckets are non-overlapping and - completely cover whole FLOAT64 range with min of first bucket - being ``"-Infinity"``, and max of the last one being - ``"Infinity"``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.Float64Stats) - ), -) -_sym_db.RegisterMessage(Float64Stats) -_sym_db.RegisterMessage(Float64Stats.HistogramBucket) - -StringStats = _reflection.GeneratedProtocolMessageType( - "StringStats", - (_message.Message,), - dict( - UnigramStats=_reflection.GeneratedProtocolMessageType( - "UnigramStats", - (_message.Message,), - dict( - DESCRIPTOR=_STRINGSTATS_UNIGRAMSTATS, - __module__="google.cloud.automl_v1beta1.proto.data_stats_pb2", - __doc__="""The statistics of a unigram. - - - Attributes: - value: - The unigram. - count: - The number of occurrences of this unigram in the series. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.StringStats.UnigramStats) - ), - ), - DESCRIPTOR=_STRINGSTATS, - __module__="google.cloud.automl_v1beta1.proto.data_stats_pb2", - __doc__="""The data statistics of a series of STRING values. - - - Attributes: - top_unigram_stats: - The statistics of the top 20 unigrams, ordered by [count][goog - le.cloud.automl.v1beta1.StringStats.UnigramStats.count]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.StringStats) - ), -) -_sym_db.RegisterMessage(StringStats) -_sym_db.RegisterMessage(StringStats.UnigramStats) - -TimestampStats = _reflection.GeneratedProtocolMessageType( - "TimestampStats", - (_message.Message,), - dict( - GranularStats=_reflection.GeneratedProtocolMessageType( - "GranularStats", - (_message.Message,), - dict( - BucketsEntry=_reflection.GeneratedProtocolMessageType( - "BucketsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_TIMESTAMPSTATS_GRANULARSTATS_BUCKETSENTRY, - __module__="google.cloud.automl_v1beta1.proto.data_stats_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TimestampStats.GranularStats.BucketsEntry) - ), - ), - DESCRIPTOR=_TIMESTAMPSTATS_GRANULARSTATS, - __module__="google.cloud.automl_v1beta1.proto.data_stats_pb2", - __doc__="""Stats split by a defined in context granularity. - - - Attributes: - buckets: - A map from granularity key to example count for that key. E.g. - for hour\_of\_day ``13`` means 1pm, or for month\_of\_year - ``5`` means May). - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TimestampStats.GranularStats) - ), - ), - GranularStatsEntry=_reflection.GeneratedProtocolMessageType( - "GranularStatsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_TIMESTAMPSTATS_GRANULARSTATSENTRY, - __module__="google.cloud.automl_v1beta1.proto.data_stats_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TimestampStats.GranularStatsEntry) - ), - ), - DESCRIPTOR=_TIMESTAMPSTATS, - __module__="google.cloud.automl_v1beta1.proto.data_stats_pb2", - __doc__="""The data statistics of a series of TIMESTAMP values. - - - Attributes: - granular_stats: - The string key is the pre-defined granularity. Currently - supported: hour\_of\_day, day\_of\_week, month\_of\_year. - Granularities finer that the granularity of timestamp data are - not populated (e.g. if timestamps are at day granularity, then - hour\_of\_day is not populated). - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TimestampStats) - ), -) -_sym_db.RegisterMessage(TimestampStats) -_sym_db.RegisterMessage(TimestampStats.GranularStats) -_sym_db.RegisterMessage(TimestampStats.GranularStats.BucketsEntry) -_sym_db.RegisterMessage(TimestampStats.GranularStatsEntry) - -ArrayStats = _reflection.GeneratedProtocolMessageType( - "ArrayStats", - (_message.Message,), - dict( - DESCRIPTOR=_ARRAYSTATS, - __module__="google.cloud.automl_v1beta1.proto.data_stats_pb2", - __doc__="""The data statistics of a series of ARRAY values. - - - Attributes: - member_stats: - Stats of all the values of all arrays, as if they were a - single long series of data. The type depends on the element - type of the array. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ArrayStats) - ), -) -_sym_db.RegisterMessage(ArrayStats) - -StructStats = _reflection.GeneratedProtocolMessageType( - "StructStats", - (_message.Message,), - dict( - FieldStatsEntry=_reflection.GeneratedProtocolMessageType( - "FieldStatsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_STRUCTSTATS_FIELDSTATSENTRY, - __module__="google.cloud.automl_v1beta1.proto.data_stats_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.StructStats.FieldStatsEntry) - ), - ), - DESCRIPTOR=_STRUCTSTATS, - __module__="google.cloud.automl_v1beta1.proto.data_stats_pb2", - __doc__="""The data statistics of a series of STRUCT values. - - - Attributes: - field_stats: - Map from a field name of the struct to data stats aggregated - over series of all data in that field across all the structs. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.StructStats) - ), -) -_sym_db.RegisterMessage(StructStats) -_sym_db.RegisterMessage(StructStats.FieldStatsEntry) - -CategoryStats = _reflection.GeneratedProtocolMessageType( - "CategoryStats", - (_message.Message,), - dict( - SingleCategoryStats=_reflection.GeneratedProtocolMessageType( - "SingleCategoryStats", - (_message.Message,), - dict( - DESCRIPTOR=_CATEGORYSTATS_SINGLECATEGORYSTATS, - __module__="google.cloud.automl_v1beta1.proto.data_stats_pb2", - __doc__="""The statistics of a single CATEGORY value. - - - Attributes: - value: - The CATEGORY value. - count: - The number of occurrences of this value in the series. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats) - ), - ), - DESCRIPTOR=_CATEGORYSTATS, - __module__="google.cloud.automl_v1beta1.proto.data_stats_pb2", - __doc__="""The data statistics of a series of CATEGORY values. - - - Attributes: - top_category_stats: - The statistics of the top 20 CATEGORY values, ordered by [cou - nt][google.cloud.automl.v1beta1.CategoryStats.SingleCategorySt - ats.count]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.CategoryStats) - ), -) -_sym_db.RegisterMessage(CategoryStats) -_sym_db.RegisterMessage(CategoryStats.SingleCategoryStats) - -CorrelationStats = _reflection.GeneratedProtocolMessageType( - "CorrelationStats", - (_message.Message,), - dict( - DESCRIPTOR=_CORRELATIONSTATS, - __module__="google.cloud.automl_v1beta1.proto.data_stats_pb2", - __doc__="""A correlation statistics between two series of DataType - values. The series may have differing DataType-s, but within a single - series the DataType must be the same. - - - Attributes: - cramers_v: - The correlation value using the Cramer's V measure. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.CorrelationStats) - ), -) -_sym_db.RegisterMessage(CorrelationStats) - - -DESCRIPTOR._options = None -_TIMESTAMPSTATS_GRANULARSTATS_BUCKETSENTRY._options = None -_TIMESTAMPSTATS_GRANULARSTATSENTRY._options = None -_STRUCTSTATS_FIELDSTATSENTRY._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/data_stats_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/data_stats_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/data_stats_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/data_types.proto b/automl/google/cloud/automl_v1beta1/proto/data_types.proto deleted file mode 100644 index 086e96e32629..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/data_types.proto +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// `TypeCode` is used as a part of -// [DataType][google.cloud.automl.v1beta1.DataType]. -enum TypeCode { - // Not specified. Should not be used. - TYPE_CODE_UNSPECIFIED = 0; - - // Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or - // `"-Infinity"`. - FLOAT64 = 3; - - // Must be between 0AD and 9999AD. Encoded as `string` according to - // [time_format][google.cloud.automl.v1beta1.DataType.time_format], or, if - // that format is not set, then in RFC 3339 `date-time` format, where - // `time-offset` = `"Z"` (e.g. 1985-04-12T23:20:50.52Z). - TIMESTAMP = 4; - - // Encoded as `string`. - STRING = 6; - - // Encoded as `list`, where the list elements are represented according to - // - // [list_element_type][google.cloud.automl.v1beta1.DataType.list_element_type]. - ARRAY = 8; - - // Encoded as `struct`, where field values are represented according to - // [struct_type][google.cloud.automl.v1beta1.DataType.struct_type]. - STRUCT = 9; - - // Values of this type are not further understood by AutoML, - // e.g. AutoML is unable to tell the order of values (as it could with - // FLOAT64), or is unable to say if one value contains another (as it - // could with STRING). - // Encoded as `string` (bytes should be base64-encoded, as described in RFC - // 4648, section 4). - CATEGORY = 10; -} - -// Indicated the type of data that can be stored in a structured data entity -// (e.g. a table). -message DataType { - // Details of DataType-s that need additional specification. - oneof details { - // If [type_code][google.cloud.automl.v1beta1.DataType.type_code] == [ARRAY][google.cloud.automl.v1beta1.TypeCode.ARRAY], - // then `list_element_type` is the type of the elements. - DataType list_element_type = 2; - - // If [type_code][google.cloud.automl.v1beta1.DataType.type_code] == [STRUCT][google.cloud.automl.v1beta1.TypeCode.STRUCT], then `struct_type` - // provides type information for the struct's fields. - StructType struct_type = 3; - - // If [type_code][google.cloud.automl.v1beta1.DataType.type_code] == [TIMESTAMP][google.cloud.automl.v1beta1.TypeCode.TIMESTAMP] - // then `time_format` provides the format in which that time field is - // expressed. The time_format must either be one of: - // * `UNIX_SECONDS` - // * `UNIX_MILLISECONDS` - // * `UNIX_MICROSECONDS` - // * `UNIX_NANOSECONDS` - // (for respectively number of seconds, milliseconds, microseconds and - // nanoseconds since start of the Unix epoch); - // or be written in `strftime` syntax. If time_format is not set, then the - // default format as described on the type_code is used. - string time_format = 5; - } - - // Required. The [TypeCode][google.cloud.automl.v1beta1.TypeCode] for this type. - TypeCode type_code = 1; - - // If true, this DataType can also be `NULL`. In .CSV files `NULL` value is - // expressed as an empty string. - bool nullable = 4; -} - -// `StructType` defines the DataType-s of a [STRUCT][google.cloud.automl.v1beta1.TypeCode.STRUCT] type. -message StructType { - // Unordered map of struct field names to their data types. - // Fields cannot be added or removed via Update. Their names and - // data types are still mutable. - map fields = 1; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/data_types_pb2.py b/automl/google/cloud/automl_v1beta1/proto/data_types_pb2.py deleted file mode 100644 index 96121059839d..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/data_types_pb2.py +++ /dev/null @@ -1,408 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/data_types.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/data_types.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1P\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n2google/cloud/automl_v1beta1/proto/data_types.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x1cgoogle/api/annotations.proto"\xfc\x01\n\x08\x44\x61taType\x12\x42\n\x11list_element_type\x18\x02 \x01(\x0b\x32%.google.cloud.automl.v1beta1.DataTypeH\x00\x12>\n\x0bstruct_type\x18\x03 \x01(\x0b\x32\'.google.cloud.automl.v1beta1.StructTypeH\x00\x12\x15\n\x0btime_format\x18\x05 \x01(\tH\x00\x12\x38\n\ttype_code\x18\x01 \x01(\x0e\x32%.google.cloud.automl.v1beta1.TypeCode\x12\x10\n\x08nullable\x18\x04 \x01(\x08\x42\t\n\x07\x64\x65tails"\xa7\x01\n\nStructType\x12\x43\n\x06\x66ields\x18\x01 \x03(\x0b\x32\x33.google.cloud.automl.v1beta1.StructType.FieldsEntry\x1aT\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.google.cloud.automl.v1beta1.DataType:\x02\x38\x01*r\n\x08TypeCode\x12\x19\n\x15TYPE_CODE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x46LOAT64\x10\x03\x12\r\n\tTIMESTAMP\x10\x04\x12\n\n\x06STRING\x10\x06\x12\t\n\x05\x41RRAY\x10\x08\x12\n\n\x06STRUCT\x10\t\x12\x0c\n\x08\x43\x41TEGORY\x10\nB\xa5\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], -) - -_TYPECODE = _descriptor.EnumDescriptor( - name="TypeCode", - full_name="google.cloud.automl.v1beta1.TypeCode", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="TYPE_CODE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FLOAT64", index=1, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TIMESTAMP", index=2, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="STRING", index=3, number=6, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="ARRAY", index=4, number=8, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="STRUCT", index=5, number=9, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CATEGORY", index=6, number=10, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=538, - serialized_end=652, -) -_sym_db.RegisterEnumDescriptor(_TYPECODE) - -TypeCode = enum_type_wrapper.EnumTypeWrapper(_TYPECODE) -TYPE_CODE_UNSPECIFIED = 0 -FLOAT64 = 3 -TIMESTAMP = 4 -STRING = 6 -ARRAY = 8 -STRUCT = 9 -CATEGORY = 10 - - -_DATATYPE = _descriptor.Descriptor( - name="DataType", - full_name="google.cloud.automl.v1beta1.DataType", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="list_element_type", - full_name="google.cloud.automl.v1beta1.DataType.list_element_type", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="struct_type", - full_name="google.cloud.automl.v1beta1.DataType.struct_type", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_format", - full_name="google.cloud.automl.v1beta1.DataType.time_format", - index=2, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="type_code", - full_name="google.cloud.automl.v1beta1.DataType.type_code", - index=3, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="nullable", - full_name="google.cloud.automl.v1beta1.DataType.nullable", - index=4, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="details", - full_name="google.cloud.automl.v1beta1.DataType.details", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=114, - serialized_end=366, -) - - -_STRUCTTYPE_FIELDSENTRY = _descriptor.Descriptor( - name="FieldsEntry", - full_name="google.cloud.automl.v1beta1.StructType.FieldsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.automl.v1beta1.StructType.FieldsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.automl.v1beta1.StructType.FieldsEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=452, - serialized_end=536, -) - -_STRUCTTYPE = _descriptor.Descriptor( - name="StructType", - full_name="google.cloud.automl.v1beta1.StructType", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="fields", - full_name="google.cloud.automl.v1beta1.StructType.fields", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[_STRUCTTYPE_FIELDSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=369, - serialized_end=536, -) - -_DATATYPE.fields_by_name["list_element_type"].message_type = _DATATYPE -_DATATYPE.fields_by_name["struct_type"].message_type = _STRUCTTYPE -_DATATYPE.fields_by_name["type_code"].enum_type = _TYPECODE -_DATATYPE.oneofs_by_name["details"].fields.append( - _DATATYPE.fields_by_name["list_element_type"] -) -_DATATYPE.fields_by_name[ - "list_element_type" -].containing_oneof = _DATATYPE.oneofs_by_name["details"] -_DATATYPE.oneofs_by_name["details"].fields.append( - _DATATYPE.fields_by_name["struct_type"] -) -_DATATYPE.fields_by_name["struct_type"].containing_oneof = _DATATYPE.oneofs_by_name[ - "details" -] -_DATATYPE.oneofs_by_name["details"].fields.append( - _DATATYPE.fields_by_name["time_format"] -) -_DATATYPE.fields_by_name["time_format"].containing_oneof = _DATATYPE.oneofs_by_name[ - "details" -] -_STRUCTTYPE_FIELDSENTRY.fields_by_name["value"].message_type = _DATATYPE -_STRUCTTYPE_FIELDSENTRY.containing_type = _STRUCTTYPE -_STRUCTTYPE.fields_by_name["fields"].message_type = _STRUCTTYPE_FIELDSENTRY -DESCRIPTOR.message_types_by_name["DataType"] = _DATATYPE -DESCRIPTOR.message_types_by_name["StructType"] = _STRUCTTYPE -DESCRIPTOR.enum_types_by_name["TypeCode"] = _TYPECODE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -DataType = _reflection.GeneratedProtocolMessageType( - "DataType", - (_message.Message,), - dict( - DESCRIPTOR=_DATATYPE, - __module__="google.cloud.automl_v1beta1.proto.data_types_pb2", - __doc__="""Indicated the type of data that can be stored in a - structured data entity (e.g. a table). - - - Attributes: - details: - Details of DataType-s that need additional specification. - list_element_type: - If - [type\_code][google.cloud.automl.v1beta1.DataType.type\_code] - == [ARRAY][google.cloud.automl.v1beta1.TypeCode.ARRAY], then - ``list_element_type`` is the type of the elements. - struct_type: - If - [type\_code][google.cloud.automl.v1beta1.DataType.type\_code] - == [STRUCT][google.cloud.automl.v1beta1.TypeCode.STRUCT], then - ``struct_type`` provides type information for the struct's - fields. - time_format: - If - [type\_code][google.cloud.automl.v1beta1.DataType.type\_code] - == [TIMESTAMP][google.cloud.automl.v1beta1.TypeCode.TIMESTAMP] - then ``time_format`` provides the format in which that time - field is expressed. The time\_format must either be one of: \* - ``UNIX_SECONDS`` \* ``UNIX_MILLISECONDS`` \* - ``UNIX_MICROSECONDS`` \* ``UNIX_NANOSECONDS`` (for - respectively number of seconds, milliseconds, microseconds and - nanoseconds since start of the Unix epoch); or be written in - ``strftime`` syntax. If time\_format is not set, then the - default format as described on the type\_code is used. - type_code: - Required. The [TypeCode][google.cloud.automl.v1beta1.TypeCode] - for this type. - nullable: - If true, this DataType can also be ``NULL``. In .CSV files - ``NULL`` value is expressed as an empty string. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.DataType) - ), -) -_sym_db.RegisterMessage(DataType) - -StructType = _reflection.GeneratedProtocolMessageType( - "StructType", - (_message.Message,), - dict( - FieldsEntry=_reflection.GeneratedProtocolMessageType( - "FieldsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_STRUCTTYPE_FIELDSENTRY, - __module__="google.cloud.automl_v1beta1.proto.data_types_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.StructType.FieldsEntry) - ), - ), - DESCRIPTOR=_STRUCTTYPE, - __module__="google.cloud.automl_v1beta1.proto.data_types_pb2", - __doc__="""\ ``StructType`` defines the DataType-s of a - [STRUCT][google.cloud.automl.v1beta1.TypeCode.STRUCT] type. - - - Attributes: - fields: - Unordered map of struct field names to their data types. - Fields cannot be added or removed via Update. Their names and - data types are still mutable. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.StructType) - ), -) -_sym_db.RegisterMessage(StructType) -_sym_db.RegisterMessage(StructType.FieldsEntry) - - -DESCRIPTOR._options = None -_STRUCTTYPE_FIELDSENTRY._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/data_types_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/data_types_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/data_types_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/dataset.proto b/automl/google/cloud/automl_v1beta1/proto/dataset.proto deleted file mode 100644 index e07b17841777..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/dataset.proto +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/cloud/automl/v1beta1/image.proto"; -import "google/cloud/automl/v1beta1/tables.proto"; -import "google/cloud/automl/v1beta1/text.proto"; -import "google/cloud/automl/v1beta1/translation.proto"; -import "google/cloud/automl/v1beta1/video.proto"; -import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// A workspace for solving a single, particular machine learning (ML) problem. -// A workspace contains examples that may be annotated. -message Dataset { - // Required. - // The dataset metadata that is specific to the problem type. - oneof dataset_metadata { - // Metadata for a dataset used for translation. - TranslationDatasetMetadata translation_dataset_metadata = 23; - - // Metadata for a dataset used for image classification. - ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; - - // Metadata for a dataset used for text classification. - TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; - - // Metadata for a dataset used for image object detection. - ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; - - // Metadata for a dataset used for video classification. - VideoClassificationDatasetMetadata video_classification_dataset_metadata = 31; - - // Metadata for a dataset used for video object tracking. - VideoObjectTrackingDatasetMetadata video_object_tracking_dataset_metadata = 29; - - // Metadata for a dataset used for text extraction. - TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; - - // Metadata for a dataset used for text sentiment. - TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; - - // Metadata for a dataset used for Tables. - TablesDatasetMetadata tables_dataset_metadata = 33; - } - - // Output only. The resource name of the dataset. - // Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}` - string name = 1; - - // 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. - string display_name = 2; - - // User-provided description of the dataset. The description can be up to - // 25000 characters long. - string description = 3; - - // Output only. The number of examples in the dataset. - int32 example_count = 21; - - // Output only. Timestamp when this dataset was created. - google.protobuf.Timestamp create_time = 14; - - // Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 17; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/dataset_pb2.py b/automl/google/cloud/automl_v1beta1/proto/dataset_pb2.py deleted file mode 100644 index fa8b2153619a..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/dataset_pb2.py +++ /dev/null @@ -1,521 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/dataset.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.cloud.automl_v1beta1.proto import ( - image_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_image__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - tables_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_tables__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - text_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - translation_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_translation__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - video_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_video__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/dataset.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1P\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - "\n/google/cloud/automl_v1beta1/proto/dataset.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a-google/cloud/automl_v1beta1/proto/image.proto\x1a.google/cloud/automl_v1beta1/proto/tables.proto\x1a,google/cloud/automl_v1beta1/proto/text.proto\x1a\x33google/cloud/automl_v1beta1/proto/translation.proto\x1a-google/cloud/automl_v1beta1/proto/video.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto\"\xee\x08\n\x07\x44\x61taset\x12_\n\x1ctranslation_dataset_metadata\x18\x17 \x01(\x0b\x32\x37.google.cloud.automl.v1beta1.TranslationDatasetMetadataH\x00\x12p\n%image_classification_dataset_metadata\x18\x18 \x01(\x0b\x32?.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadataH\x00\x12n\n$text_classification_dataset_metadata\x18\x19 \x01(\x0b\x32>.google.cloud.automl.v1beta1.TextClassificationDatasetMetadataH\x00\x12s\n'image_object_detection_dataset_metadata\x18\x1a \x01(\x0b\x32@.google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadataH\x00\x12p\n%video_classification_dataset_metadata\x18\x1f \x01(\x0b\x32?.google.cloud.automl.v1beta1.VideoClassificationDatasetMetadataH\x00\x12q\n&video_object_tracking_dataset_metadata\x18\x1d \x01(\x0b\x32?.google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadataH\x00\x12\x66\n text_extraction_dataset_metadata\x18\x1c \x01(\x0b\x32:.google.cloud.automl.v1beta1.TextExtractionDatasetMetadataH\x00\x12\x64\n\x1ftext_sentiment_dataset_metadata\x18\x1e \x01(\x0b\x32\x39.google.cloud.automl.v1beta1.TextSentimentDatasetMetadataH\x00\x12U\n\x17tables_dataset_metadata\x18! \x01(\x0b\x32\x32.google.cloud.automl.v1beta1.TablesDatasetMetadataH\x00\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x15\n\rexample_count\x18\x15 \x01(\x05\x12/\n\x0b\x63reate_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0c\n\x04\x65tag\x18\x11 \x01(\tB\x12\n\x10\x64\x61taset_metadataB\xa5\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3" - ), - dependencies=[ - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_image__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_tables__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_translation__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_video__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_DATASET = _descriptor.Descriptor( - name="Dataset", - full_name="google.cloud.automl.v1beta1.Dataset", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="translation_dataset_metadata", - full_name="google.cloud.automl.v1beta1.Dataset.translation_dataset_metadata", - index=0, - number=23, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_classification_dataset_metadata", - full_name="google.cloud.automl.v1beta1.Dataset.image_classification_dataset_metadata", - index=1, - number=24, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_classification_dataset_metadata", - full_name="google.cloud.automl.v1beta1.Dataset.text_classification_dataset_metadata", - index=2, - number=25, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_object_detection_dataset_metadata", - full_name="google.cloud.automl.v1beta1.Dataset.image_object_detection_dataset_metadata", - index=3, - number=26, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_classification_dataset_metadata", - full_name="google.cloud.automl.v1beta1.Dataset.video_classification_dataset_metadata", - index=4, - number=31, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_object_tracking_dataset_metadata", - full_name="google.cloud.automl.v1beta1.Dataset.video_object_tracking_dataset_metadata", - index=5, - number=29, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_extraction_dataset_metadata", - full_name="google.cloud.automl.v1beta1.Dataset.text_extraction_dataset_metadata", - index=6, - number=28, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_sentiment_dataset_metadata", - full_name="google.cloud.automl.v1beta1.Dataset.text_sentiment_dataset_metadata", - index=7, - number=30, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tables_dataset_metadata", - full_name="google.cloud.automl.v1beta1.Dataset.tables_dataset_metadata", - index=8, - number=33, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.Dataset.name", - index=9, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.automl.v1beta1.Dataset.display_name", - index=10, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.automl.v1beta1.Dataset.description", - index=11, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="example_count", - full_name="google.cloud.automl.v1beta1.Dataset.example_count", - index=12, - number=21, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.automl.v1beta1.Dataset.create_time", - index=13, - number=14, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="etag", - full_name="google.cloud.automl.v1beta1.Dataset.etag", - index=14, - number=17, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="dataset_metadata", - full_name="google.cloud.automl.v1beta1.Dataset.dataset_metadata", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=385, - serialized_end=1519, -) - -_DATASET.fields_by_name[ - "translation_dataset_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_translation__pb2._TRANSLATIONDATASETMETADATA -) -_DATASET.fields_by_name[ - "image_classification_dataset_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_image__pb2._IMAGECLASSIFICATIONDATASETMETADATA -) -_DATASET.fields_by_name[ - "text_classification_dataset_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__pb2._TEXTCLASSIFICATIONDATASETMETADATA -) -_DATASET.fields_by_name[ - "image_object_detection_dataset_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_image__pb2._IMAGEOBJECTDETECTIONDATASETMETADATA -) -_DATASET.fields_by_name[ - "video_classification_dataset_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_video__pb2._VIDEOCLASSIFICATIONDATASETMETADATA -) -_DATASET.fields_by_name[ - "video_object_tracking_dataset_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_video__pb2._VIDEOOBJECTTRACKINGDATASETMETADATA -) -_DATASET.fields_by_name[ - "text_extraction_dataset_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__pb2._TEXTEXTRACTIONDATASETMETADATA -) -_DATASET.fields_by_name[ - "text_sentiment_dataset_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__pb2._TEXTSENTIMENTDATASETMETADATA -) -_DATASET.fields_by_name[ - "tables_dataset_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_tables__pb2._TABLESDATASETMETADATA -) -_DATASET.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_DATASET.oneofs_by_name["dataset_metadata"].fields.append( - _DATASET.fields_by_name["translation_dataset_metadata"] -) -_DATASET.fields_by_name[ - "translation_dataset_metadata" -].containing_oneof = _DATASET.oneofs_by_name["dataset_metadata"] -_DATASET.oneofs_by_name["dataset_metadata"].fields.append( - _DATASET.fields_by_name["image_classification_dataset_metadata"] -) -_DATASET.fields_by_name[ - "image_classification_dataset_metadata" -].containing_oneof = _DATASET.oneofs_by_name["dataset_metadata"] -_DATASET.oneofs_by_name["dataset_metadata"].fields.append( - _DATASET.fields_by_name["text_classification_dataset_metadata"] -) -_DATASET.fields_by_name[ - "text_classification_dataset_metadata" -].containing_oneof = _DATASET.oneofs_by_name["dataset_metadata"] -_DATASET.oneofs_by_name["dataset_metadata"].fields.append( - _DATASET.fields_by_name["image_object_detection_dataset_metadata"] -) -_DATASET.fields_by_name[ - "image_object_detection_dataset_metadata" -].containing_oneof = _DATASET.oneofs_by_name["dataset_metadata"] -_DATASET.oneofs_by_name["dataset_metadata"].fields.append( - _DATASET.fields_by_name["video_classification_dataset_metadata"] -) -_DATASET.fields_by_name[ - "video_classification_dataset_metadata" -].containing_oneof = _DATASET.oneofs_by_name["dataset_metadata"] -_DATASET.oneofs_by_name["dataset_metadata"].fields.append( - _DATASET.fields_by_name["video_object_tracking_dataset_metadata"] -) -_DATASET.fields_by_name[ - "video_object_tracking_dataset_metadata" -].containing_oneof = _DATASET.oneofs_by_name["dataset_metadata"] -_DATASET.oneofs_by_name["dataset_metadata"].fields.append( - _DATASET.fields_by_name["text_extraction_dataset_metadata"] -) -_DATASET.fields_by_name[ - "text_extraction_dataset_metadata" -].containing_oneof = _DATASET.oneofs_by_name["dataset_metadata"] -_DATASET.oneofs_by_name["dataset_metadata"].fields.append( - _DATASET.fields_by_name["text_sentiment_dataset_metadata"] -) -_DATASET.fields_by_name[ - "text_sentiment_dataset_metadata" -].containing_oneof = _DATASET.oneofs_by_name["dataset_metadata"] -_DATASET.oneofs_by_name["dataset_metadata"].fields.append( - _DATASET.fields_by_name["tables_dataset_metadata"] -) -_DATASET.fields_by_name[ - "tables_dataset_metadata" -].containing_oneof = _DATASET.oneofs_by_name["dataset_metadata"] -DESCRIPTOR.message_types_by_name["Dataset"] = _DATASET -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Dataset = _reflection.GeneratedProtocolMessageType( - "Dataset", - (_message.Message,), - dict( - DESCRIPTOR=_DATASET, - __module__="google.cloud.automl_v1beta1.proto.dataset_pb2", - __doc__="""A workspace for solving a single, particular machine - learning (ML) problem. A workspace contains examples that may be - annotated. - - - Attributes: - dataset_metadata: - Required. The dataset metadata that is specific to the problem - type. - translation_dataset_metadata: - Metadata for a dataset used for translation. - image_classification_dataset_metadata: - Metadata for a dataset used for image classification. - text_classification_dataset_metadata: - Metadata for a dataset used for text classification. - image_object_detection_dataset_metadata: - Metadata for a dataset used for image object detection. - video_classification_dataset_metadata: - Metadata for a dataset used for video classification. - video_object_tracking_dataset_metadata: - Metadata for a dataset used for video object tracking. - text_extraction_dataset_metadata: - Metadata for a dataset used for text extraction. - text_sentiment_dataset_metadata: - Metadata for a dataset used for text sentiment. - tables_dataset_metadata: - Metadata for a dataset used for Tables. - name: - Output only. The resource name of the dataset. Form: ``project - s/{project_id}/locations/{location_id}/datasets/{dataset_id}`` - 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. - description: - User-provided description of the dataset. The description can - be up to 25000 characters long. - example_count: - Output only. The number of examples in the dataset. - create_time: - Output only. Timestamp when this dataset was created. - etag: - Used to perform consistent read-modify-write updates. If not - set, a blind "overwrite" update happens. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.Dataset) - ), -) -_sym_db.RegisterMessage(Dataset) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/dataset_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/dataset_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/dataset_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/detection.proto b/automl/google/cloud/automl_v1beta1/proto/detection.proto deleted file mode 100644 index 99761fd52c57..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/detection.proto +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/cloud/automl/v1beta1/geometry.proto"; -import "google/protobuf/duration.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// Annotation details for image object detection. -message ImageObjectDetectionAnnotation { - // Output only. The rectangle representing the object location. - BoundingPoly bounding_box = 1; - - // Output only. The confidence that this annotation is positive for the parent example, - // value in [0, 1], higher means higher positivity confidence. - float score = 2; -} - -// Annotation details for video object tracking. -message VideoObjectTrackingAnnotation { - // Optional. The instance of the object, expressed as a positive integer. Used to tell - // apart objects of the same type (i.e. AnnotationSpec) when multiple are - // present on a single example. - // NOTE: Instance ID prediction quality is not a part of model evaluation and - // is done as best effort. Especially in cases when an entity goes - // off-screen for a longer time (minutes), when it comes back it may be given - // a new instance ID. - string instance_id = 1; - - // Required. A time (frame) of a video to which this annotation pertains. - // Represented as the duration since the video's start. - google.protobuf.Duration time_offset = 2; - - // Required. The rectangle representing the object location on the frame (i.e. - // at the time_offset of the video). - BoundingPoly bounding_box = 3; - - // Output only. The confidence that this annotation is positive for the video at - // the time_offset, value in [0, 1], higher means higher positivity - // confidence. For annotations created by the user the score is 1. When - // user approves an annotation, the original float score is kept (and not - // changed to 1). - float score = 4; -} - -// Bounding box matching model metrics for a single intersection-over-union -// threshold and multiple label match confidence thresholds. -message BoundingBoxMetricsEntry { - // Metrics for a single confidence threshold. - message ConfidenceMetricsEntry { - // Output only. The confidence threshold value used to compute the metrics. - float confidence_threshold = 1; - - // Output only. Recall under the given confidence threshold. - float recall = 2; - - // Output only. Precision under the given confidence threshold. - float precision = 3; - - // Output only. The harmonic mean of recall and precision. - float f1_score = 4; - } - - // Output only. The intersection-over-union threshold value used to compute - // this metrics entry. - float iou_threshold = 1; - - // Output only. The mean average precision, most often close to au_prc. - float mean_average_precision = 2; - - // 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. - repeated ConfidenceMetricsEntry confidence_metrics_entries = 3; -} - -// Model evaluation metrics for image object detection problems. -// Evaluates prediction quality of labeled bounding boxes. -message ImageObjectDetectionEvaluationMetrics { - // Output only. The total number of bounding boxes (i.e. summed over all - // images) the ground truth used to create this evaluation had. - int32 evaluated_bounding_box_count = 1; - - // 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. - repeated BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; - - // Output only. The single metric for bounding boxes evaluation: - // the mean_average_precision averaged over all bounding_box_metrics_entries. - float bounding_box_mean_average_precision = 3; -} - -// Model evaluation metrics for video object tracking problems. -// Evaluates prediction quality of both labeled bounding boxes and labeled -// tracks (i.e. series of bounding boxes sharing same label and instance ID). -message VideoObjectTrackingEvaluationMetrics { - // Output only. The number of video frames used to create this evaluation. - int32 evaluated_frame_count = 1; - - // Output only. The total number of bounding boxes (i.e. summed over all - // frames) the ground truth used to create this evaluation had. - int32 evaluated_bounding_box_count = 2; - - // 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. - repeated BoundingBoxMetricsEntry bounding_box_metrics_entries = 4; - - // Output only. The single metric for bounding boxes evaluation: - // the mean_average_precision averaged over all bounding_box_metrics_entries. - float bounding_box_mean_average_precision = 6; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/detection_pb2.py b/automl/google/cloud/automl_v1beta1/proto/detection_pb2.py deleted file mode 100644 index ab328c84e1f2..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/detection_pb2.py +++ /dev/null @@ -1,747 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/detection.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.cloud.automl_v1beta1.proto import ( - geometry_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_geometry__pb2, -) -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/detection.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1P\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n1google/cloud/automl_v1beta1/proto/detection.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x30google/cloud/automl_v1beta1/proto/geometry.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/api/annotations.proto"p\n\x1eImageObjectDetectionAnnotation\x12?\n\x0c\x62ounding_box\x18\x01 \x01(\x0b\x32).google.cloud.automl.v1beta1.BoundingPoly\x12\r\n\x05score\x18\x02 \x01(\x02"\xb4\x01\n\x1dVideoObjectTrackingAnnotation\x12\x13\n\x0binstance_id\x18\x01 \x01(\t\x12.\n\x0btime_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12?\n\x0c\x62ounding_box\x18\x03 \x01(\x0b\x32).google.cloud.automl.v1beta1.BoundingPoly\x12\r\n\x05score\x18\x04 \x01(\x02"\xae\x02\n\x17\x42oundingBoxMetricsEntry\x12\x15\n\riou_threshold\x18\x01 \x01(\x02\x12\x1e\n\x16mean_average_precision\x18\x02 \x01(\x02\x12o\n\x1a\x63onfidence_metrics_entries\x18\x03 \x03(\x0b\x32K.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry\x1ak\n\x16\x43onfidenceMetricsEntry\x12\x1c\n\x14\x63onfidence_threshold\x18\x01 \x01(\x02\x12\x0e\n\x06recall\x18\x02 \x01(\x02\x12\x11\n\tprecision\x18\x03 \x01(\x02\x12\x10\n\x08\x66\x31_score\x18\x04 \x01(\x02"\xd6\x01\n%ImageObjectDetectionEvaluationMetrics\x12$\n\x1c\x65valuated_bounding_box_count\x18\x01 \x01(\x05\x12Z\n\x1c\x62ounding_box_metrics_entries\x18\x02 \x03(\x0b\x32\x34.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry\x12+\n#bounding_box_mean_average_precision\x18\x03 \x01(\x02"\xf4\x01\n$VideoObjectTrackingEvaluationMetrics\x12\x1d\n\x15\x65valuated_frame_count\x18\x01 \x01(\x05\x12$\n\x1c\x65valuated_bounding_box_count\x18\x02 \x01(\x05\x12Z\n\x1c\x62ounding_box_metrics_entries\x18\x04 \x03(\x0b\x32\x34.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry\x12+\n#bounding_box_mean_average_precision\x18\x06 \x01(\x02\x42\xa5\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_geometry__pb2.DESCRIPTOR, - google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_IMAGEOBJECTDETECTIONANNOTATION = _descriptor.Descriptor( - name="ImageObjectDetectionAnnotation", - full_name="google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bounding_box", - full_name="google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.bounding_box", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.score", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=194, - serialized_end=306, -) - - -_VIDEOOBJECTTRACKINGANNOTATION = _descriptor.Descriptor( - name="VideoObjectTrackingAnnotation", - full_name="google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="instance_id", - full_name="google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.instance_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.time_offset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box", - full_name="google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.bounding_box", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.score", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=309, - serialized_end=489, -) - - -_BOUNDINGBOXMETRICSENTRY_CONFIDENCEMETRICSENTRY = _descriptor.Descriptor( - name="ConfidenceMetricsEntry", - full_name="google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="confidence_threshold", - full_name="google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.confidence_threshold", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="recall", - full_name="google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.recall", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="precision", - full_name="google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.precision", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="f1_score", - full_name="google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.f1_score", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=687, - serialized_end=794, -) - -_BOUNDINGBOXMETRICSENTRY = _descriptor.Descriptor( - name="BoundingBoxMetricsEntry", - full_name="google.cloud.automl.v1beta1.BoundingBoxMetricsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="iou_threshold", - full_name="google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.iou_threshold", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mean_average_precision", - full_name="google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.mean_average_precision", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence_metrics_entries", - full_name="google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.confidence_metrics_entries", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_BOUNDINGBOXMETRICSENTRY_CONFIDENCEMETRICSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=492, - serialized_end=794, -) - - -_IMAGEOBJECTDETECTIONEVALUATIONMETRICS = _descriptor.Descriptor( - name="ImageObjectDetectionEvaluationMetrics", - full_name="google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="evaluated_bounding_box_count", - full_name="google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.evaluated_bounding_box_count", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box_metrics_entries", - full_name="google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.bounding_box_metrics_entries", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box_mean_average_precision", - full_name="google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.bounding_box_mean_average_precision", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=797, - serialized_end=1011, -) - - -_VIDEOOBJECTTRACKINGEVALUATIONMETRICS = _descriptor.Descriptor( - name="VideoObjectTrackingEvaluationMetrics", - full_name="google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="evaluated_frame_count", - full_name="google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.evaluated_frame_count", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="evaluated_bounding_box_count", - full_name="google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.evaluated_bounding_box_count", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box_metrics_entries", - full_name="google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.bounding_box_metrics_entries", - index=2, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box_mean_average_precision", - full_name="google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.bounding_box_mean_average_precision", - index=3, - number=6, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1014, - serialized_end=1258, -) - -_IMAGEOBJECTDETECTIONANNOTATION.fields_by_name[ - "bounding_box" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_VIDEOOBJECTTRACKINGANNOTATION.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_VIDEOOBJECTTRACKINGANNOTATION.fields_by_name[ - "bounding_box" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_BOUNDINGBOXMETRICSENTRY_CONFIDENCEMETRICSENTRY.containing_type = ( - _BOUNDINGBOXMETRICSENTRY -) -_BOUNDINGBOXMETRICSENTRY.fields_by_name[ - "confidence_metrics_entries" -].message_type = _BOUNDINGBOXMETRICSENTRY_CONFIDENCEMETRICSENTRY -_IMAGEOBJECTDETECTIONEVALUATIONMETRICS.fields_by_name[ - "bounding_box_metrics_entries" -].message_type = _BOUNDINGBOXMETRICSENTRY -_VIDEOOBJECTTRACKINGEVALUATIONMETRICS.fields_by_name[ - "bounding_box_metrics_entries" -].message_type = _BOUNDINGBOXMETRICSENTRY -DESCRIPTOR.message_types_by_name[ - "ImageObjectDetectionAnnotation" -] = _IMAGEOBJECTDETECTIONANNOTATION -DESCRIPTOR.message_types_by_name[ - "VideoObjectTrackingAnnotation" -] = _VIDEOOBJECTTRACKINGANNOTATION -DESCRIPTOR.message_types_by_name["BoundingBoxMetricsEntry"] = _BOUNDINGBOXMETRICSENTRY -DESCRIPTOR.message_types_by_name[ - "ImageObjectDetectionEvaluationMetrics" -] = _IMAGEOBJECTDETECTIONEVALUATIONMETRICS -DESCRIPTOR.message_types_by_name[ - "VideoObjectTrackingEvaluationMetrics" -] = _VIDEOOBJECTTRACKINGEVALUATIONMETRICS -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ImageObjectDetectionAnnotation = _reflection.GeneratedProtocolMessageType( - "ImageObjectDetectionAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGEOBJECTDETECTIONANNOTATION, - __module__="google.cloud.automl_v1beta1.proto.detection_pb2", - __doc__="""Annotation details for image object detection. - - - Attributes: - bounding_box: - Output only. The rectangle representing the object location. - score: - Output only. The confidence that this annotation is positive - for the parent example, value in [0, 1], higher means higher - positivity confidence. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation) - ), -) -_sym_db.RegisterMessage(ImageObjectDetectionAnnotation) - -VideoObjectTrackingAnnotation = _reflection.GeneratedProtocolMessageType( - "VideoObjectTrackingAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOOBJECTTRACKINGANNOTATION, - __module__="google.cloud.automl_v1beta1.proto.detection_pb2", - __doc__="""Annotation details for video object tracking. - - - Attributes: - instance_id: - Optional. The instance of the object, expressed as a positive - integer. Used to tell apart objects of the same type (i.e. - AnnotationSpec) when multiple are present on a single example. - NOTE: Instance ID prediction quality is not a part of model - evaluation and is done as best effort. Especially in cases - when an entity goes off-screen for a longer time (minutes), - when it comes back it may be given a new instance ID. - time_offset: - Required. A time (frame) of a video to which this annotation - pertains. Represented as the duration since the video's start. - bounding_box: - Required. The rectangle representing the object location on - the frame (i.e. at the time\_offset of the video). - score: - Output only. The confidence that this annotation is positive - for the video at the time\_offset, value in [0, 1], higher - means higher positivity confidence. For annotations created by - the user the score is 1. When user approves an annotation, the - original float score is kept (and not changed to 1). - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation) - ), -) -_sym_db.RegisterMessage(VideoObjectTrackingAnnotation) - -BoundingBoxMetricsEntry = _reflection.GeneratedProtocolMessageType( - "BoundingBoxMetricsEntry", - (_message.Message,), - dict( - ConfidenceMetricsEntry=_reflection.GeneratedProtocolMessageType( - "ConfidenceMetricsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_BOUNDINGBOXMETRICSENTRY_CONFIDENCEMETRICSENTRY, - __module__="google.cloud.automl_v1beta1.proto.detection_pb2", - __doc__="""Metrics for a single confidence threshold. - - - Attributes: - confidence_threshold: - Output only. The confidence threshold value used to compute - the metrics. - recall: - Output only. Recall under the given confidence threshold. - precision: - Output only. Precision under the given confidence threshold. - f1_score: - Output only. The harmonic mean of recall and precision. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry) - ), - ), - DESCRIPTOR=_BOUNDINGBOXMETRICSENTRY, - __module__="google.cloud.automl_v1beta1.proto.detection_pb2", - __doc__="""Bounding box matching model metrics for a single - intersection-over-union threshold and multiple label match confidence - thresholds. - - - Attributes: - iou_threshold: - Output only. The intersection-over-union threshold value used - to compute this metrics entry. - mean_average_precision: - Output only. The mean average precision, most often close to - au\_prc. - 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. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.BoundingBoxMetricsEntry) - ), -) -_sym_db.RegisterMessage(BoundingBoxMetricsEntry) -_sym_db.RegisterMessage(BoundingBoxMetricsEntry.ConfidenceMetricsEntry) - -ImageObjectDetectionEvaluationMetrics = _reflection.GeneratedProtocolMessageType( - "ImageObjectDetectionEvaluationMetrics", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGEOBJECTDETECTIONEVALUATIONMETRICS, - __module__="google.cloud.automl_v1beta1.proto.detection_pb2", - __doc__="""Model evaluation metrics for image object detection - problems. Evaluates prediction quality of labeled bounding boxes. - - - Attributes: - 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. - 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. - 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. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics) - ), -) -_sym_db.RegisterMessage(ImageObjectDetectionEvaluationMetrics) - -VideoObjectTrackingEvaluationMetrics = _reflection.GeneratedProtocolMessageType( - "VideoObjectTrackingEvaluationMetrics", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOOBJECTTRACKINGEVALUATIONMETRICS, - __module__="google.cloud.automl_v1beta1.proto.detection_pb2", - __doc__="""Model evaluation metrics for video object tracking - problems. Evaluates prediction quality of both labeled bounding boxes - and labeled tracks (i.e. series of bounding boxes sharing same label and - instance ID). - - - Attributes: - evaluated_frame_count: - Output only. The number of video frames used to create this - evaluation. - evaluated_bounding_box_count: - Output only. The total number of bounding boxes (i.e. summed - over all frames) the ground truth used to create this - evaluation had. - 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. - 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. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics) - ), -) -_sym_db.RegisterMessage(VideoObjectTrackingEvaluationMetrics) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/detection_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/detection_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/detection_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/geometry.proto b/automl/google/cloud/automl_v1beta1/proto/geometry.proto deleted file mode 100644 index e5379ab14df6..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/geometry.proto +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// A vertex represents a 2D point in the image. -// The normalized vertex coordinates are between 0 to 1 fractions relative to -// the original plane (image, video). E.g. if the plane (e.g. whole image) would -// have size 10 x 20 then a point with normalized coordinates (0.1, 0.3) would -// be at the position (1, 6) on that plane. -message NormalizedVertex { - // Required. Horizontal coordinate. - float x = 1; - - // Required. Vertical coordinate. - float y = 2; -} - -// A bounding polygon of a detected object on a plane. -// On output both vertices and normalized_vertices are provided. -// The polygon is formed by connecting vertices in the order they are listed. -message BoundingPoly { - // Output only . The bounding polygon normalized vertices. - repeated NormalizedVertex normalized_vertices = 2; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/geometry_pb2.py b/automl/google/cloud/automl_v1beta1/proto/geometry_pb2.py deleted file mode 100644 index 324d76f5f324..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/geometry_pb2.py +++ /dev/null @@ -1,175 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/geometry.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/geometry.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1P\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n0google/cloud/automl_v1beta1/proto/geometry.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x1cgoogle/api/annotations.proto"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02"Z\n\x0c\x42oundingPoly\x12J\n\x13normalized_vertices\x18\x02 \x03(\x0b\x32-.google.cloud.automl.v1beta1.NormalizedVertexB\xa5\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], -) - - -_NORMALIZEDVERTEX = _descriptor.Descriptor( - name="NormalizedVertex", - full_name="google.cloud.automl.v1beta1.NormalizedVertex", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.automl.v1beta1.NormalizedVertex.x", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.automl.v1beta1.NormalizedVertex.y", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=111, - serialized_end=151, -) - - -_BOUNDINGPOLY = _descriptor.Descriptor( - name="BoundingPoly", - full_name="google.cloud.automl.v1beta1.BoundingPoly", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="normalized_vertices", - full_name="google.cloud.automl.v1beta1.BoundingPoly.normalized_vertices", - index=0, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=153, - serialized_end=243, -) - -_BOUNDINGPOLY.fields_by_name["normalized_vertices"].message_type = _NORMALIZEDVERTEX -DESCRIPTOR.message_types_by_name["NormalizedVertex"] = _NORMALIZEDVERTEX -DESCRIPTOR.message_types_by_name["BoundingPoly"] = _BOUNDINGPOLY -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -NormalizedVertex = _reflection.GeneratedProtocolMessageType( - "NormalizedVertex", - (_message.Message,), - dict( - DESCRIPTOR=_NORMALIZEDVERTEX, - __module__="google.cloud.automl_v1beta1.proto.geometry_pb2", - __doc__="""Required. Horizontal coordinate. - - - Attributes: - y: - Required. Vertical coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.NormalizedVertex) - ), -) -_sym_db.RegisterMessage(NormalizedVertex) - -BoundingPoly = _reflection.GeneratedProtocolMessageType( - "BoundingPoly", - (_message.Message,), - dict( - DESCRIPTOR=_BOUNDINGPOLY, - __module__="google.cloud.automl_v1beta1.proto.geometry_pb2", - __doc__="""A bounding polygon of a detected object on a plane. On - output both vertices and normalized\_vertices are provided. The polygon - is formed by connecting vertices in the order they are listed. - - - Attributes: - normalized_vertices: - Output only . The bounding polygon normalized vertices. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.BoundingPoly) - ), -) -_sym_db.RegisterMessage(BoundingPoly) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/geometry_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/geometry_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/geometry_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/image.proto b/automl/google/cloud/automl_v1beta1/proto/image.proto deleted file mode 100644 index 5995efc6eef5..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/image.proto +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/api/annotations.proto"; -import "google/cloud/automl/v1beta1/annotation_spec.proto"; -import "google/cloud/automl/v1beta1/classification.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_outer_classname = "ImageProto"; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// Dataset metadata that is specific to image classification. -message ImageClassificationDatasetMetadata { - // Required. Type of the classification problem. - ClassificationType classification_type = 1; -} - -// Dataset metadata specific to image object detection. -message ImageObjectDetectionDatasetMetadata {} - -// Model metadata for image classification. -message ImageClassificationModelMetadata { - // 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`. - string base_model_id = 1; - - // Required. The train budget of creating this model, expressed in hours. The - // actual `train_cost` will be equal or less than this value. - int64 train_budget = 2; - - // Output only. The actual train cost of creating this model, expressed in - // hours. If this model is created from a `base` model, the train cost used - // to create the `base` model are not included. - int64 train_cost = 3; - - // Output only. The reason that this create model operation stopped, - // e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. - string stop_reason = 5; - - // 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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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. - string model_type = 7; - - // Output only. An approximate number of online prediction QPS that can - // be supported by this model per each node on which it is deployed. - double node_qps = 13; - - // 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. - int64 node_count = 14; -} - -// Model metadata specific to image object detection. -message ImageObjectDetectionModelMetadata { - // 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. - string model_type = 1; - - // 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. - int64 node_count = 3; - - // Output only. An approximate number of online prediction QPS that can - // be supported by this model per each node on which it is deployed. - double node_qps = 4; - - // Output only. The reason that this create model operation stopped, - // e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. - string stop_reason = 5; - - // 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. - int64 train_budget_milli_node_hours = 6; - - // 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. - int64 train_cost_milli_node_hours = 7; -} - -// Model deployment metadata specific to Image Classification. -message ImageClassificationModelDeploymentMetadata { - // 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.v1beta1.ImageClassificationModelMetadata.node_qps]. - // Must be between 1 and 100, inclusive on both ends. - int64 node_count = 1; -} - -// Model deployment metadata specific to Image Object Detection. -message ImageObjectDetectionModelDeploymentMetadata { - // 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.v1beta1.ImageObjectDetectionModelMetadata.qps_per_node]. - // Must be between 1 and 100, inclusive on both ends. - int64 node_count = 1; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/image_pb2.py b/automl/google/cloud/automl_v1beta1/proto/image_pb2.py deleted file mode 100644 index 3a0a54a49d48..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/image_pb2.py +++ /dev/null @@ -1,701 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/image.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.cloud.automl_v1beta1.proto import ( - annotation_spec_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_annotation__spec__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - classification_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/image.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1B\nImageProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n-google/cloud/automl_v1beta1/proto/image.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x37google/cloud/automl_v1beta1/proto/annotation_spec.proto\x1a\x36google/cloud/automl_v1beta1/proto/classification.proto\x1a\x1fgoogle/protobuf/timestamp.proto"r\n"ImageClassificationDatasetMetadata\x12L\n\x13\x63lassification_type\x18\x01 \x01(\x0e\x32/.google.cloud.automl.v1beta1.ClassificationType"%\n#ImageObjectDetectionDatasetMetadata"\xb2\x01\n ImageClassificationModelMetadata\x12\x15\n\rbase_model_id\x18\x01 \x01(\t\x12\x14\n\x0ctrain_budget\x18\x02 \x01(\x03\x12\x12\n\ntrain_cost\x18\x03 \x01(\x03\x12\x13\n\x0bstop_reason\x18\x05 \x01(\t\x12\x12\n\nmodel_type\x18\x07 \x01(\t\x12\x10\n\x08node_qps\x18\r \x01(\x01\x12\x12\n\nnode_count\x18\x0e \x01(\x03"\xbe\x01\n!ImageObjectDetectionModelMetadata\x12\x12\n\nmodel_type\x18\x01 \x01(\t\x12\x12\n\nnode_count\x18\x03 \x01(\x03\x12\x10\n\x08node_qps\x18\x04 \x01(\x01\x12\x13\n\x0bstop_reason\x18\x05 \x01(\t\x12%\n\x1dtrain_budget_milli_node_hours\x18\x06 \x01(\x03\x12#\n\x1btrain_cost_milli_node_hours\x18\x07 \x01(\x03"@\n*ImageClassificationModelDeploymentMetadata\x12\x12\n\nnode_count\x18\x01 \x01(\x03"A\n+ImageObjectDetectionModelDeploymentMetadata\x12\x12\n\nnode_count\x18\x01 \x01(\x03\x42\xb1\x01\n\x1f\x63om.google.cloud.automl.v1beta1B\nImageProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_annotation__spec__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_IMAGECLASSIFICATIONDATASETMETADATA = _descriptor.Descriptor( - name="ImageClassificationDatasetMetadata", - full_name="google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="classification_type", - full_name="google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.classification_type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=254, - serialized_end=368, -) - - -_IMAGEOBJECTDETECTIONDATASETMETADATA = _descriptor.Descriptor( - name="ImageObjectDetectionDatasetMetadata", - full_name="google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=370, - serialized_end=407, -) - - -_IMAGECLASSIFICATIONMODELMETADATA = _descriptor.Descriptor( - name="ImageClassificationModelMetadata", - full_name="google.cloud.automl.v1beta1.ImageClassificationModelMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="base_model_id", - full_name="google.cloud.automl.v1beta1.ImageClassificationModelMetadata.base_model_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="train_budget", - full_name="google.cloud.automl.v1beta1.ImageClassificationModelMetadata.train_budget", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="train_cost", - full_name="google.cloud.automl.v1beta1.ImageClassificationModelMetadata.train_cost", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="stop_reason", - full_name="google.cloud.automl.v1beta1.ImageClassificationModelMetadata.stop_reason", - index=3, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model_type", - full_name="google.cloud.automl.v1beta1.ImageClassificationModelMetadata.model_type", - index=4, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="node_qps", - full_name="google.cloud.automl.v1beta1.ImageClassificationModelMetadata.node_qps", - index=5, - number=13, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="node_count", - full_name="google.cloud.automl.v1beta1.ImageClassificationModelMetadata.node_count", - index=6, - number=14, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=410, - serialized_end=588, -) - - -_IMAGEOBJECTDETECTIONMODELMETADATA = _descriptor.Descriptor( - name="ImageObjectDetectionModelMetadata", - full_name="google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="model_type", - full_name="google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.model_type", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="node_count", - full_name="google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.node_count", - index=1, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="node_qps", - full_name="google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.node_qps", - index=2, - number=4, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="stop_reason", - full_name="google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.stop_reason", - index=3, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="train_budget_milli_node_hours", - full_name="google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.train_budget_milli_node_hours", - index=4, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="train_cost_milli_node_hours", - full_name="google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.train_cost_milli_node_hours", - index=5, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=591, - serialized_end=781, -) - - -_IMAGECLASSIFICATIONMODELDEPLOYMENTMETADATA = _descriptor.Descriptor( - name="ImageClassificationModelDeploymentMetadata", - full_name="google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="node_count", - full_name="google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata.node_count", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=783, - serialized_end=847, -) - - -_IMAGEOBJECTDETECTIONMODELDEPLOYMENTMETADATA = _descriptor.Descriptor( - name="ImageObjectDetectionModelDeploymentMetadata", - full_name="google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="node_count", - full_name="google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_count", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=849, - serialized_end=914, -) - -_IMAGECLASSIFICATIONDATASETMETADATA.fields_by_name[ - "classification_type" -].enum_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2._CLASSIFICATIONTYPE -) -DESCRIPTOR.message_types_by_name[ - "ImageClassificationDatasetMetadata" -] = _IMAGECLASSIFICATIONDATASETMETADATA -DESCRIPTOR.message_types_by_name[ - "ImageObjectDetectionDatasetMetadata" -] = _IMAGEOBJECTDETECTIONDATASETMETADATA -DESCRIPTOR.message_types_by_name[ - "ImageClassificationModelMetadata" -] = _IMAGECLASSIFICATIONMODELMETADATA -DESCRIPTOR.message_types_by_name[ - "ImageObjectDetectionModelMetadata" -] = _IMAGEOBJECTDETECTIONMODELMETADATA -DESCRIPTOR.message_types_by_name[ - "ImageClassificationModelDeploymentMetadata" -] = _IMAGECLASSIFICATIONMODELDEPLOYMENTMETADATA -DESCRIPTOR.message_types_by_name[ - "ImageObjectDetectionModelDeploymentMetadata" -] = _IMAGEOBJECTDETECTIONMODELDEPLOYMENTMETADATA -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ImageClassificationDatasetMetadata = _reflection.GeneratedProtocolMessageType( - "ImageClassificationDatasetMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGECLASSIFICATIONDATASETMETADATA, - __module__="google.cloud.automl_v1beta1.proto.image_pb2", - __doc__="""Dataset metadata that is specific to image classification. - - - Attributes: - classification_type: - Required. Type of the classification problem. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) - ), -) -_sym_db.RegisterMessage(ImageClassificationDatasetMetadata) - -ImageObjectDetectionDatasetMetadata = _reflection.GeneratedProtocolMessageType( - "ImageObjectDetectionDatasetMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGEOBJECTDETECTIONDATASETMETADATA, - __module__="google.cloud.automl_v1beta1.proto.image_pb2", - __doc__="""Dataset metadata specific to image object detection. - - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata) - ), -) -_sym_db.RegisterMessage(ImageObjectDetectionDatasetMetadata) - -ImageClassificationModelMetadata = _reflection.GeneratedProtocolMessageType( - "ImageClassificationModelMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGECLASSIFICATIONMODELMETADATA, - __module__="google.cloud.automl_v1beta1.proto.image_pb2", - __doc__="""Model metadata for image classification. - - - Attributes: - 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``. - train_budget: - Required. The train budget of creating this model, expressed - in hours. The actual ``train_cost`` will be equal or less than - this value. - train_cost: - Output only. The actual train cost of creating this model, - expressed in hours. If this model is created from a ``base`` - model, the train cost used to create the ``base`` model are - not included. - stop_reason: - Output only. The reason that this create model operation - stopped, e.g. ``BUDGET_REACHED``, ``MODEL_CONVERGED``. - 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.clo - ud.automl.v1beta1.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.v1beta1.AutoMl.E - xportModel]) 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 - .v1beta1.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 - .v1beta1.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.E - xportModel][google.cloud.automl.v1beta1.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.v1beta1.AutoMl.E - xportModel]) 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. - 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. - 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. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ImageClassificationModelMetadata) - ), -) -_sym_db.RegisterMessage(ImageClassificationModelMetadata) - -ImageObjectDetectionModelMetadata = _reflection.GeneratedProtocolMessageType( - "ImageObjectDetectionModelMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGEOBJECTDETECTIONMODELMETADATA, - __module__="google.cloud.automl_v1beta1.proto.image_pb2", - __doc__="""Model metadata specific to image object detection. - - - Attributes: - 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. - 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. - 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. - stop_reason: - Output only. The reason that this create model operation - stopped, e.g. ``BUDGET_REACHED``, ``MODEL_CONVERGED``. - train_budget_milli_node_hours: - 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. - 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. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata) - ), -) -_sym_db.RegisterMessage(ImageObjectDetectionModelMetadata) - -ImageClassificationModelDeploymentMetadata = _reflection.GeneratedProtocolMessageType( - "ImageClassificationModelDeploymentMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGECLASSIFICATIONMODELDEPLOYMENTMETADATA, - __module__="google.cloud.automl_v1beta1.proto.image_pb2", - __doc__="""Model deployment metadata specific to Image - Classification. - - - Attributes: - 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][goo - gle.cloud.automl.v1beta1.ImageClassificationModelMetadata.node - \_qps]. Must be between 1 and 100, inclusive on both ends. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata) - ), -) -_sym_db.RegisterMessage(ImageClassificationModelDeploymentMetadata) - -ImageObjectDetectionModelDeploymentMetadata = _reflection.GeneratedProtocolMessageType( - "ImageObjectDetectionModelDeploymentMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGEOBJECTDETECTIONMODELDEPLOYMENTMETADATA, - __module__="google.cloud.automl_v1beta1.proto.image_pb2", - __doc__="""Model deployment metadata specific to Image Object - Detection. - - - Attributes: - 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.v1beta1.ImageObjectDetectionModelMetadat - a.qps\_per\_node]. Must be between 1 and 100, inclusive on - both ends. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata) - ), -) -_sym_db.RegisterMessage(ImageObjectDetectionModelDeploymentMetadata) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/image_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/image_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/image_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/io.proto b/automl/google/cloud/automl_v1beta1/proto/io.proto deleted file mode 100644 index 5cc61c5ea309..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/io.proto +++ /dev/null @@ -1,1133 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// Input configuration for ImportData Action. -// -// The format of input depends on dataset_metadata the Dataset into which -// the import is happening has. As input source the -// [gcs_source][google.cloud.automl.v1beta1.InputConfig.gcs_source] -// is expected, unless specified otherwise. Additionally any input .CSV file -// by itself must be 100MB or smaller, unless specified otherwise. -// If an "example" file (that is, image, video etc.) with identical content -// (even if it had different GCS_FILE_PATH) is mentioned multiple times, then -// its label, bounding boxes etc. are appended. The same file should be always -// provided with the same ML_USE and GCS_FILE_PATH, if it is not, then -// these values are nondeterministically selected from the given ones. -// -// The formats are represented in EBNF with commas being literal and with -// non-terminal symbols defined near the end of this comment. The formats are: -// -// * For Image Classification: -// CSV file(s) with each line in format: -// ML_USE,GCS_FILE_PATH,LABEL,LABEL,... -// GCS_FILE_PATH leads to image of up to 30MB in size. Supported -// extensions: .JPEG, .GIF, .PNG, .WEBP, .BMP, .TIFF, .ICO -// For MULTICLASS classification type, at most one LABEL is allowed -// per image. If an image has not yet been labeled, then it should be -// mentioned just once with no LABEL. -// Some sample rows: -// TRAIN,gs://folder/image1.jpg,daisy -// TEST,gs://folder/image2.jpg,dandelion,tulip,rose -// UNASSIGNED,gs://folder/image3.jpg,daisy -// UNASSIGNED,gs://folder/image4.jpg -// -// * For Image Object Detection: -// CSV file(s) with each line in format: -// ML_USE,GCS_FILE_PATH,(LABEL,BOUNDING_BOX | ,,,,,,,) -// GCS_FILE_PATH leads to image of up to 30MB in size. Supported -// extensions: .JPEG, .GIF, .PNG. -// Each image is assumed to be exhaustively labeled. The minimum -// allowed BOUNDING_BOX edge length is 0.01, and no more than 500 -// BOUNDING_BOX-es per image are allowed (one BOUNDING_BOX is defined -// per line). If an image has not yet been labeled, then it should be -// mentioned just once with no LABEL and the ",,,,,,," in place of the -// BOUNDING_BOX. For images which are known to not contain any -// bounding boxes, they should be labelled explictly as -// "NEGATIVE_IMAGE", followed by ",,,,,,," in place of the -// BOUNDING_BOX. -// Sample rows: -// TRAIN,gs://folder/image1.png,car,0.1,0.1,,,0.3,0.3,, -// TRAIN,gs://folder/image1.png,bike,.7,.6,,,.8,.9,, -// UNASSIGNED,gs://folder/im2.png,car,0.1,0.1,0.2,0.1,0.2,0.3,0.1,0.3 -// TEST,gs://folder/im3.png,,,,,,,,, -// TRAIN,gs://folder/im4.png,NEGATIVE_IMAGE,,,,,,,,, -// -// * For Video Classification: -// CSV file(s) with each line in format: -// ML_USE,GCS_FILE_PATH -// where ML_USE VALIDATE value should not be used. The GCS_FILE_PATH -// should lead to another .csv file which describes examples that have -// 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 end has to be after the start. 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 shuold 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,,, -// -// * For Video Object Tracking: -// CSV file(s) with each line in format: -// ML_USE,GCS_FILE_PATH -// where ML_USE VALIDATE value should not be used. The GCS_FILE_PATH -// should lead to another .csv file which describes examples that have -// given ML_USE, using one of 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_IDs 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,,,,,,,,,,, -// * For Text Extraction: -// CSV file(s) with each line in format: -// ML_USE,GCS_FILE_PATH -// GCS_FILE_PATH leads to a .JSONL (that is, JSON Lines) file which -// either imports text in-line or as documents. Any given -// .JSONL file must be 100MB or smaller. -// The in-line .JSONL file contains, per line, a proto that wraps a -// TextSnippet proto (in json representation) followed by one or more -// AnnotationPayload protos (called annotations), which have -// display_name and text_extraction detail populated. The given text -// is expected to be annotated exhaustively, for example, if you look -// for animals and text contains "dolphin" that is not labeled, then -// "dolphin" is assumed to not be an animal. Any given text snippet -// content must be 10KB or smaller, and also be UTF-8 NFC encoded -// (ASCII already is). -// The document .JSONL file contains, per line, a proto that wraps a -// Document proto. The Document proto must have either document_text -// or input_config set. In document_text case, the Document proto may -// also contain the spatial information of the document, including -// layout, document dimension and page number. In input_config case, -// only PDF documents are supported now, and each document may be up -// to 2MB large. Currently, annotations on documents cannot be -// specified at import. -// Three sample CSV rows: -// TRAIN,gs://folder/file1.jsonl -// VALIDATE,gs://folder/file2.jsonl -// TEST,gs://folder/file3.jsonl -// Sample in-line JSON Lines file for entity extraction (presented here -// with artificial line breaks, but the only actual line break is -// denoted by \n).: -// { -// "document": { -// "document_text": {"content": "dog cat"} -// "layout": [ -// { -// "text_segment": { -// "start_offset": 0, -// "end_offset": 3, -// }, -// "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, -// }, -// { -// "text_segment": { -// "start_offset": 4, -// "end_offset": 7, -// }, -// "page_number": 1, -// "bounding_poly": { -// "normalized_vertices": [ -// {"x": 0.4, "y": 0.1}, -// {"x": 0.4, "y": 0.3}, -// {"x": 0.8, "y": 0.3}, -// {"x": 0.8, "y": 0.1}, -// ], -// }, -// "text_segment_type": TOKEN, -// } -// -// ], -// "document_dimensions": { -// "width": 8.27, -// "height": 11.69, -// "unit": INCH, -// } -// "page_count": 1, -// }, -// "annotations": [ -// { -// "display_name": "animal", -// "text_extraction": {"text_segment": {"start_offset": 0, -// "end_offset": 3}} -// }, -// { -// "display_name": "animal", -// "text_extraction": {"text_segment": {"start_offset": 4, -// "end_offset": 7}} -// } -// ], -// }\n -// { -// "text_snippet": { -// "content": "This dog is good." -// }, -// "annotations": [ -// { -// "display_name": "animal", -// "text_extraction": { -// "text_segment": {"start_offset": 5, "end_offset": 8} -// } -// } -// ] -// } -// Sample document JSON Lines file (presented here with artificial line -// breaks, but the only actual line break is denoted by \n).: -// { -// "document": { -// "input_config": { -// "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] -// } -// } -// } -// }\n -// { -// "document": { -// "input_config": { -// "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ] -// } -// } -// } -// } -// -// * For Text Classification: -// CSV file(s) with each line in format: -// ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),LABEL,LABEL,... -// TEXT_SNIPPET and GCS_FILE_PATH are distinguished by a pattern. If -// the column content is a valid gcs file path, i.e. prefixed by -// "gs://", it will be treated as a GCS_FILE_PATH, else if the content -// is enclosed within double quotes (""), it is -// treated as a TEXT_SNIPPET. In the GCS_FILE_PATH case, the path -// must lead to a .txt file with UTF-8 encoding, for example, -// "gs://folder/content.txt", and the content in it is extracted -// as a text snippet. In TEXT_SNIPPET case, the column content -// excluding quotes is treated as to be imported text snippet. In -// both cases, the text snippet/file size must be within 128kB. -// Maximum 100 unique labels are allowed per CSV row. -// Sample rows: -// TRAIN,"They have bad food and very rude",RudeService,BadFood -// TRAIN,gs://folder/content.txt,SlowService -// TEST,"Typically always bad service there.",RudeService -// VALIDATE,"Stomach ache to go.",BadFood -// -// * For Text Sentiment: -// CSV file(s) with each line in format: -// ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),SENTIMENT -// TEXT_SNIPPET and GCS_FILE_PATH are distinguished by a pattern. If -// the column content is a valid gcs file path, that is, prefixed by -// "gs://", it is treated as a GCS_FILE_PATH, otherwise it is treated -// as a TEXT_SNIPPET. In the GCS_FILE_PATH case, the path -// must lead to a .txt file with UTF-8 encoding, for example, -// "gs://folder/content.txt", and the content in it is extracted -// as a text snippet. In TEXT_SNIPPET case, the column content itself -// is treated as to be imported text snippet. In both cases, the -// text snippet must be up to 500 characters long. -// Sample rows: -// TRAIN,"@freewrytin this is way too good for your product",2 -// TRAIN,"I need this product so bad",3 -// TEST,"Thank you for this product.",4 -// VALIDATE,gs://folder/content.txt,2 -// -// * For Tables: -// Either -// [gcs_source][google.cloud.automl.v1beta1.InputConfig.gcs_source] or -// -// [bigquery_source][google.cloud.automl.v1beta1.InputConfig.bigquery_source] -// can be used. All inputs is concatenated into a single -// -// [primary_table][google.cloud.automl.v1beta1.TablesDatasetMetadata.primary_table_name] -// 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. -// 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 = A path to file on GCS, e.g. "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 -// an 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 = A content of a text snippet, UTF-8 encoded, enclosed within -// double quotes (""). -// 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 -// huge. -// -// 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. -// -message InputConfig { - // The source of the input. - oneof source { - // The Google Cloud Storage location for the input content. - // In ImportData, the gcs_source points to a csv with structure described in - // the comment. - GcsSource gcs_source = 1; - - // The BigQuery location for the input content. - BigQuerySource bigquery_source = 3; - } - - // Additional domain-specific parameters describing the semantic of the - // imported data, any string must be up to 25000 - // characters long. - // - // * For Tables: - // `schema_inference_version` - (integer) Required. The version of the - // algorithm that should be used for the initial inference of the - // schema (columns' DataTypes) of the table the data is being imported - // into. Allowed values: "1". - map params = 2; -} - -// Input configuration for BatchPredict Action. -// -// The format of input depends on the ML problem of the model used for -// prediction. As input source the -// [gcs_source][google.cloud.automl.v1beta1.InputConfig.gcs_source] -// is expected, unless specified otherwise. -// -// The formats are represented in EBNF with commas being literal and with -// non-terminal symbols defined near the end of this comment. The formats -// are: -// -// * For Image Classification: -// CSV file(s) with each line having just a single column: -// GCS_FILE_PATH -// which leads to image of up to 30MB in size. Supported -// extensions: .JPEG, .GIF, .PNG. This path is treated as the ID in -// the Batch predict output. -// Three sample rows: -// gs://folder/image1.jpeg -// gs://folder/image2.gif -// gs://folder/image3.png -// -// * For Image Object Detection: -// CSV file(s) with each line having just a single column: -// GCS_FILE_PATH -// which leads to image of up to 30MB in size. Supported -// extensions: .JPEG, .GIF, .PNG. This path is treated as the ID in -// the Batch predict output. -// Three sample rows: -// gs://folder/image1.jpeg -// gs://folder/image2.gif -// gs://folder/image3.png -// * For Video Classification: -// CSV file(s) with each line in format: -// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END -// GCS_FILE_PATH leads to 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 end has to be after the start. -// Three sample rows: -// gs://folder/video1.mp4,10,40 -// gs://folder/video1.mp4,20,60 -// gs://folder/vid2.mov,0,inf -// -// * For Video Object Tracking: -// CSV file(s) with each line in format: -// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END -// GCS_FILE_PATH leads to 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 end has to be after the start. -// Three sample rows: -// gs://folder/video1.mp4,10,240 -// gs://folder/video1.mp4,300,360 -// gs://folder/vid2.mov,0,inf -// * For Text Classification: -// CSV file(s) with each line having just a single column: -// GCS_FILE_PATH | TEXT_SNIPPET -// Any given text file can have size upto 128kB. -// Any given text snippet content must have 60,000 characters or less. -// Three sample rows: -// gs://folder/text1.txt -// "Some text content to predict" -// gs://folder/text3.pdf -// Supported file extensions: .txt, .pdf -// -// * For Text Sentiment: -// CSV file(s) with each line having just a single column: -// GCS_FILE_PATH | TEXT_SNIPPET -// Any given text file can have size upto 128kB. -// Any given text snippet content must have 500 characters or less. -// Three sample rows: -// gs://folder/text1.txt -// "Some text content to predict" -// gs://folder/text3.pdf -// Supported file extensions: .txt, .pdf -// -// * For Text Extraction -// .JSONL (i.e. JSON Lines) file(s) which either provide text in-line or -// as documents (for a single BatchPredict call only one of the these -// formats may be used). -// The in-line .JSONL file(s) contain per line a proto that -// wraps a temporary user-assigned TextSnippet ID (string up to 2000 -// characters long) called "id", a TextSnippet proto (in -// json representation) and zero or more TextFeature protos. Any given -// text snippet content must have 30,000 characters or less, and also -// be UTF-8 NFC encoded (ASCII already is). The IDs provided should be -// unique. -// The document .JSONL file(s) contain, per line, a proto that wraps a -// Document proto with input_config set. Only PDF documents are -// supported now, and each document must be up to 2MB large. -// Any given .JSONL file must be 100MB or smaller, and no more than 20 -// files may be given. -// Sample in-line JSON Lines file (presented here with artificial line -// breaks, but the only actual line break is denoted by \n): -// { -// "id": "my_first_id", -// "text_snippet": { "content": "dog car cat"}, -// "text_features": [ -// { -// "text_segment": {"start_offset": 4, "end_offset": 6}, -// "structural_type": PARAGRAPH, -// "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}, -// ] -// }, -// } -// ], -// }\n -// { -// "id": "2", -// "text_snippet": { -// "content": "An elaborate content", -// "mime_type": "text/plain" -// } -// } -// Sample document JSON Lines file (presented here with artificial line -// breaks, but the only actual line break is denoted by \n).: -// { -// "document": { -// "input_config": { -// "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] -// } -// } -// } -// }\n -// { -// "document": { -// "input_config": { -// "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ] -// } -// } -// } -// } -// -// * For Tables: -// Either -// [gcs_source][google.cloud.automl.v1beta1.InputConfig.gcs_source] or -// -// [bigquery_source][google.cloud.automl.v1beta1.InputConfig.bigquery_source]. -// GCS case: -// CSV file(s), each by itself 10GB or smaller and total size must be -// 100GB or smaller, where first file must have a header containing -// 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. -// The column names must contain the model's -// -// [input_feature_column_specs'][google.cloud.automl.v1beta1.TablesModelMetadata.input_feature_column_specs] -// -// [display_name-s][google.cloud.automl.v1beta1.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, i.e. the CSV -// lines, will be attempted. For FORECASTING -// -// [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]: -// all columns having -// -// [TIME_SERIES_AVAILABLE_PAST_ONLY][google.cloud.automl.v1beta1.ColumnSpec.ForecastingMetadata.ColumnType] -// type will be ignored. -// First three sample rows of a CSV file: -// "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"}]} -// BigQuery case: -// An 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.v1beta1.TablesModelMetadata.input_feature_column_specs] -// -// [display_name-s][google.cloud.automl.v1beta1.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. For FORECASTING -// -// [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]: -// all columns having -// -// [TIME_SERIES_AVAILABLE_PAST_ONLY][google.cloud.automl.v1beta1.ColumnSpec.ForecastingMetadata.ColumnType] -// type will be ignored. -// -// Definitions: -// GCS_FILE_PATH = A path to file on GCS, e.g. "gs://folder/video.avi". -// TEXT_SNIPPET = A content of a text snippet, UTF-8 encoded, enclosed within -// double quotes ("") -// 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 -// an 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. -message BatchPredictInputConfig { - // Required. The source of the input. - oneof source { - // The Google Cloud Storage location for the input content. - GcsSource gcs_source = 1; - - // The BigQuery location for the input content. - BigQuerySource bigquery_source = 2; - } -} - -// Input configuration of a [Document][google.cloud.automl.v1beta1.Document]. -message DocumentInputConfig { - // The Google Cloud Storage location of the document file. Only a single path - // should be given. - // Max supported size: 512MB. - // Supported extensions: .PDF. - GcsSource gcs_source = 1; -} - -// * For Translation: -// CSV file `translation.csv`, with each line in format: -// ML_USE,GCS_FILE_PATH -// GCS_FILE_PATH leads to a .TSV file which describes examples that have -// given ML_USE, using the following row format per line: -// TEXT_SNIPPET (in source language) \t TEXT_SNIPPET (in target -// language) -// -// * For Tables: -// Output depends on whether the dataset was imported from GCS or -// BigQuery. -// GCS case: -// -// [gcs_destination][google.cloud.automl.v1beta1.OutputConfig.gcs_destination] -// must be set. Exported are CSV file(s) `tables_1.csv`, -// `tables_2.csv`,...,`tables_N.csv` with each having as header line -// the table's column names, and all other lines contain values for -// the header columns. -// BigQuery case: -// -// [bigquery_destination][google.cloud.automl.v1beta1.OutputConfig.bigquery_destination] -// pointing to a BigQuery project must be set. In the given project a -// new dataset will be created with name -// -// `export_data__` -// 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. -message OutputConfig { - // Required. The destination of the output. - oneof destination { - // 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. - GcsDestination gcs_destination = 1; - - // The BigQuery location where the output is to be written to. - BigQueryDestination bigquery_destination = 2; - } -} - -// Output configuration for BatchPredict Action. -// -// As destination the -// -// [gcs_destination][google.cloud.automl.v1beta1.BatchPredictOutputConfig.gcs_destination] -// must be set unless specified otherwise for a domain. If gcs_destination is -// set then in the given directory a new directory is created. Its name -// will be -// "prediction--", -// 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 snippet or input text file and a list of -// zero or more AnnotationPayload protos (called annotations), which -// have classification detail populated. A single text snippet or file -// will be listed only once with all its annotations, and its -// annotations will never be split across files. -// -// If prediction for any text snippet or file 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 text snippet or input text 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 snippet or input text file and a list of -// zero or more AnnotationPayload protos (called annotations), which -// have text_sentiment detail populated. A single text snippet or file -// will be listed only once with all its annotations, and its -// annotations will never be split across files. -// -// If prediction for any text snippet or file 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 text snippet or input text 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.v1beta1.BatchPredictOutputConfig.gcs_destination] -// or -// -// [bigquery_destination][google.cloud.automl.v1beta1.BatchPredictOutputConfig.bigquery_destination] -// is set (either is allowed). -// GCS 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.v1beta1.TablesModelMetadata.prediction_type]: -// Each .csv file will contain a header, listing all columns' -// -// [display_name-s][google.cloud.automl.v1beta1.ColumnSpec.display_name] -// given on input followed by M target column names in the format of -// -// "<[target_column_specs][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] -// -// [display_name][google.cloud.automl.v1beta1.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.v1beta1.TablesAnnotation.score]. -// For REGRESSION and FORECASTING -// -// [prediction_type-s][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]: -// Each .csv file will contain a header, listing all columns' -// [display_name-s][google.cloud.automl.v1beta1.display_name] given -// on input followed by the predicted target column with name in the -// format of -// -// "predicted_<[target_column_specs][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] -// -// [display_name][google.cloud.automl.v1beta1.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.v1beta1.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.v1beta1.ColumnSpec.display_name] -// followed by the target column with name in the format of -// -// "predicted_<[target_column_specs][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] -// -// [display_name][google.cloud.automl.v1beta1.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.v1beta1.AnnotationPayload], -// represented as STRUCT-s, containing -// [TablesAnnotation][google.cloud.automl.v1beta1.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.v1beta1.TablesModelMetadata.target_column_spec] -// -// [display_name][google.cloud.automl.v1beta1.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`. -message BatchPredictOutputConfig { - // Required. The destination of the output. - oneof destination { - // The Google Cloud Storage location of the directory where the output is to - // be written to. - GcsDestination gcs_destination = 1; - - // The BigQuery location where the output is to be written to. - BigQueryDestination bigquery_destination = 2; - } -} - -// Output configuration for ModelExport Action. -message ModelExportOutputConfig { - // Required. The destination of the output. - oneof destination { - // 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. - GcsDestination gcs_destination = 1; - - // The GCR location where model image is to be pushed to. This location - // may only be set for the following model formats: - // "docker". - // - // The model image will be created under the given URI. - GcrDestination gcr_destination = 3; - } - - // 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). - // 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. - string model_format = 4; - - // 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". - map params = 2; -} - -// Output configuration for ExportEvaluatedExamples Action. Note that this call -// is available only for 30 days since the moment the model was evaluated. -// The output depends on the domain, as follows (note that only examples from -// the TEST set are exported): -// -// * For Tables: -// -// [bigquery_destination][google.cloud.automl.v1beta1.OutputConfig.bigquery_destination] -// pointing to a BigQuery project must be set. In the given project a -// new dataset will be created with name -// -// `export_evaluated_examples__` -// 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 an `evaluated_examples` table will be -// created. It will have all the same columns as the -// -// [primary_table][google.cloud.automl.v1beta1.TablesDatasetMetadata.primary_table_spec_id] -// of the -// [dataset][google.cloud.automl.v1beta1.Model.dataset_id] from which -// the model was created, as they were at the moment of model's -// evaluation (this includes the target column with its ground -// truth), followed by a column called "predicted_". That -// last column will contain the model's prediction result for each -// respective row, given as ARRAY of -// [AnnotationPayloads][google.cloud.automl.v1beta1.AnnotationPayload], -// represented as STRUCT-s, containing -// [TablesAnnotation][google.cloud.automl.v1beta1.TablesAnnotation]. -message ExportEvaluatedExamplesOutputConfig { - // Required. The destination of the output. - oneof destination { - // The BigQuery location where the output is to be written to. - BigQueryDestination bigquery_destination = 2; - } -} - -// The Google Cloud Storage location for the input content. -message GcsSource { - // 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 - repeated string input_uris = 1; -} - -// The BigQuery location for the input content. -message BigQuerySource { - // Required. BigQuery URI to a table, up to 2000 characters long. - // Accepted forms: - // * BigQuery path e.g. bq://projectId.bqDatasetId.bqTableId - string input_uri = 1; -} - -// The Google Cloud Storage location where the output is to be written to. -message GcsDestination { - // 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. - string output_uri_prefix = 1; -} - -// The BigQuery location for the output content. -message BigQueryDestination { - // Required. BigQuery URI to a project, up to 2000 characters long. - // Accepted forms: - // * BigQuery path e.g. bq://projectId - string output_uri = 1; -} - -// The GCR location where the image must be pushed to. -message GcrDestination { - // Required. Google Contained Registry URI of the new image, up to 2000 - // characters long. See - // - // https: - // //cloud.google.com/container-registry/do - // // cs/pushing-and-pulling#pushing_an_image_to_a_registry - // Accepted forms: - // * [HOSTNAME]/[PROJECT-ID]/[IMAGE] - // * [HOSTNAME]/[PROJECT-ID]/[IMAGE]:[TAG] - // - // The requesting user must have permission to push images the project. - string output_uri = 1; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/io_pb2.py b/automl/google/cloud/automl_v1beta1/proto/io_pb2.py deleted file mode 100644 index c2fb61388130..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/io_pb2.py +++ /dev/null @@ -1,1921 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/io.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/io.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1P\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n*google/cloud/automl_v1beta1/proto/io.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x1cgoogle/api/annotations.proto"\x92\x02\n\x0bInputConfig\x12<\n\ngcs_source\x18\x01 \x01(\x0b\x32&.google.cloud.automl.v1beta1.GcsSourceH\x00\x12\x46\n\x0f\x62igquery_source\x18\x03 \x01(\x0b\x32+.google.cloud.automl.v1beta1.BigQuerySourceH\x00\x12\x44\n\x06params\x18\x02 \x03(\x0b\x32\x34.google.cloud.automl.v1beta1.InputConfig.ParamsEntry\x1a-\n\x0bParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x08\n\x06source"\xa9\x01\n\x17\x42\x61tchPredictInputConfig\x12<\n\ngcs_source\x18\x01 \x01(\x0b\x32&.google.cloud.automl.v1beta1.GcsSourceH\x00\x12\x46\n\x0f\x62igquery_source\x18\x02 \x01(\x0b\x32+.google.cloud.automl.v1beta1.BigQuerySourceH\x00\x42\x08\n\x06source"Q\n\x13\x44ocumentInputConfig\x12:\n\ngcs_source\x18\x01 \x01(\x0b\x32&.google.cloud.automl.v1beta1.GcsSource"\xb7\x01\n\x0cOutputConfig\x12\x46\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32+.google.cloud.automl.v1beta1.GcsDestinationH\x00\x12P\n\x14\x62igquery_destination\x18\x02 \x01(\x0b\x32\x30.google.cloud.automl.v1beta1.BigQueryDestinationH\x00\x42\r\n\x0b\x64\x65stination"\xc3\x01\n\x18\x42\x61tchPredictOutputConfig\x12\x46\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32+.google.cloud.automl.v1beta1.GcsDestinationH\x00\x12P\n\x14\x62igquery_destination\x18\x02 \x01(\x0b\x32\x30.google.cloud.automl.v1beta1.BigQueryDestinationH\x00\x42\r\n\x0b\x64\x65stination"\xcf\x02\n\x17ModelExportOutputConfig\x12\x46\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32+.google.cloud.automl.v1beta1.GcsDestinationH\x00\x12\x46\n\x0fgcr_destination\x18\x03 \x01(\x0b\x32+.google.cloud.automl.v1beta1.GcrDestinationH\x00\x12\x14\n\x0cmodel_format\x18\x04 \x01(\t\x12P\n\x06params\x18\x02 \x03(\x0b\x32@.google.cloud.automl.v1beta1.ModelExportOutputConfig.ParamsEntry\x1a-\n\x0bParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\r\n\x0b\x64\x65stination"\x86\x01\n#ExportEvaluatedExamplesOutputConfig\x12P\n\x14\x62igquery_destination\x18\x02 \x01(\x0b\x32\x30.google.cloud.automl.v1beta1.BigQueryDestinationH\x00\x42\r\n\x0b\x64\x65stination"\x1f\n\tGcsSource\x12\x12\n\ninput_uris\x18\x01 \x03(\t"#\n\x0e\x42igQuerySource\x12\x11\n\tinput_uri\x18\x01 \x01(\t"+\n\x0eGcsDestination\x12\x19\n\x11output_uri_prefix\x18\x01 \x01(\t")\n\x13\x42igQueryDestination\x12\x12\n\noutput_uri\x18\x01 \x01(\t"$\n\x0eGcrDestination\x12\x12\n\noutput_uri\x18\x01 \x01(\tB\xa5\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], -) - - -_INPUTCONFIG_PARAMSENTRY = _descriptor.Descriptor( - name="ParamsEntry", - full_name="google.cloud.automl.v1beta1.InputConfig.ParamsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.automl.v1beta1.InputConfig.ParamsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.automl.v1beta1.InputConfig.ParamsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=325, - serialized_end=370, -) - -_INPUTCONFIG = _descriptor.Descriptor( - name="InputConfig", - full_name="google.cloud.automl.v1beta1.InputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_source", - full_name="google.cloud.automl.v1beta1.InputConfig.gcs_source", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bigquery_source", - full_name="google.cloud.automl.v1beta1.InputConfig.bigquery_source", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="params", - full_name="google.cloud.automl.v1beta1.InputConfig.params", - index=2, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_INPUTCONFIG_PARAMSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="source", - full_name="google.cloud.automl.v1beta1.InputConfig.source", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=106, - serialized_end=380, -) - - -_BATCHPREDICTINPUTCONFIG = _descriptor.Descriptor( - name="BatchPredictInputConfig", - full_name="google.cloud.automl.v1beta1.BatchPredictInputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_source", - full_name="google.cloud.automl.v1beta1.BatchPredictInputConfig.gcs_source", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bigquery_source", - full_name="google.cloud.automl.v1beta1.BatchPredictInputConfig.bigquery_source", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="source", - full_name="google.cloud.automl.v1beta1.BatchPredictInputConfig.source", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=383, - serialized_end=552, -) - - -_DOCUMENTINPUTCONFIG = _descriptor.Descriptor( - name="DocumentInputConfig", - full_name="google.cloud.automl.v1beta1.DocumentInputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_source", - full_name="google.cloud.automl.v1beta1.DocumentInputConfig.gcs_source", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=554, - serialized_end=635, -) - - -_OUTPUTCONFIG = _descriptor.Descriptor( - name="OutputConfig", - full_name="google.cloud.automl.v1beta1.OutputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_destination", - full_name="google.cloud.automl.v1beta1.OutputConfig.gcs_destination", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bigquery_destination", - full_name="google.cloud.automl.v1beta1.OutputConfig.bigquery_destination", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="destination", - full_name="google.cloud.automl.v1beta1.OutputConfig.destination", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=638, - serialized_end=821, -) - - -_BATCHPREDICTOUTPUTCONFIG = _descriptor.Descriptor( - name="BatchPredictOutputConfig", - full_name="google.cloud.automl.v1beta1.BatchPredictOutputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_destination", - full_name="google.cloud.automl.v1beta1.BatchPredictOutputConfig.gcs_destination", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bigquery_destination", - full_name="google.cloud.automl.v1beta1.BatchPredictOutputConfig.bigquery_destination", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="destination", - full_name="google.cloud.automl.v1beta1.BatchPredictOutputConfig.destination", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=824, - serialized_end=1019, -) - - -_MODELEXPORTOUTPUTCONFIG_PARAMSENTRY = _descriptor.Descriptor( - name="ParamsEntry", - full_name="google.cloud.automl.v1beta1.ModelExportOutputConfig.ParamsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.automl.v1beta1.ModelExportOutputConfig.ParamsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.automl.v1beta1.ModelExportOutputConfig.ParamsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=325, - serialized_end=370, -) - -_MODELEXPORTOUTPUTCONFIG = _descriptor.Descriptor( - name="ModelExportOutputConfig", - full_name="google.cloud.automl.v1beta1.ModelExportOutputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_destination", - full_name="google.cloud.automl.v1beta1.ModelExportOutputConfig.gcs_destination", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="gcr_destination", - full_name="google.cloud.automl.v1beta1.ModelExportOutputConfig.gcr_destination", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model_format", - full_name="google.cloud.automl.v1beta1.ModelExportOutputConfig.model_format", - index=2, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="params", - full_name="google.cloud.automl.v1beta1.ModelExportOutputConfig.params", - index=3, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_MODELEXPORTOUTPUTCONFIG_PARAMSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="destination", - full_name="google.cloud.automl.v1beta1.ModelExportOutputConfig.destination", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1022, - serialized_end=1357, -) - - -_EXPORTEVALUATEDEXAMPLESOUTPUTCONFIG = _descriptor.Descriptor( - name="ExportEvaluatedExamplesOutputConfig", - full_name="google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bigquery_destination", - full_name="google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.bigquery_destination", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="destination", - full_name="google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.destination", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1360, - serialized_end=1494, -) - - -_GCSSOURCE = _descriptor.Descriptor( - name="GcsSource", - full_name="google.cloud.automl.v1beta1.GcsSource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uris", - full_name="google.cloud.automl.v1beta1.GcsSource.input_uris", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1496, - serialized_end=1527, -) - - -_BIGQUERYSOURCE = _descriptor.Descriptor( - name="BigQuerySource", - full_name="google.cloud.automl.v1beta1.BigQuerySource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.automl.v1beta1.BigQuerySource.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1529, - serialized_end=1564, -) - - -_GCSDESTINATION = _descriptor.Descriptor( - name="GcsDestination", - full_name="google.cloud.automl.v1beta1.GcsDestination", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="output_uri_prefix", - full_name="google.cloud.automl.v1beta1.GcsDestination.output_uri_prefix", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1566, - serialized_end=1609, -) - - -_BIGQUERYDESTINATION = _descriptor.Descriptor( - name="BigQueryDestination", - full_name="google.cloud.automl.v1beta1.BigQueryDestination", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="output_uri", - full_name="google.cloud.automl.v1beta1.BigQueryDestination.output_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1611, - serialized_end=1652, -) - - -_GCRDESTINATION = _descriptor.Descriptor( - name="GcrDestination", - full_name="google.cloud.automl.v1beta1.GcrDestination", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="output_uri", - full_name="google.cloud.automl.v1beta1.GcrDestination.output_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1654, - serialized_end=1690, -) - -_INPUTCONFIG_PARAMSENTRY.containing_type = _INPUTCONFIG -_INPUTCONFIG.fields_by_name["gcs_source"].message_type = _GCSSOURCE -_INPUTCONFIG.fields_by_name["bigquery_source"].message_type = _BIGQUERYSOURCE -_INPUTCONFIG.fields_by_name["params"].message_type = _INPUTCONFIG_PARAMSENTRY -_INPUTCONFIG.oneofs_by_name["source"].fields.append( - _INPUTCONFIG.fields_by_name["gcs_source"] -) -_INPUTCONFIG.fields_by_name[ - "gcs_source" -].containing_oneof = _INPUTCONFIG.oneofs_by_name["source"] -_INPUTCONFIG.oneofs_by_name["source"].fields.append( - _INPUTCONFIG.fields_by_name["bigquery_source"] -) -_INPUTCONFIG.fields_by_name[ - "bigquery_source" -].containing_oneof = _INPUTCONFIG.oneofs_by_name["source"] -_BATCHPREDICTINPUTCONFIG.fields_by_name["gcs_source"].message_type = _GCSSOURCE -_BATCHPREDICTINPUTCONFIG.fields_by_name[ - "bigquery_source" -].message_type = _BIGQUERYSOURCE -_BATCHPREDICTINPUTCONFIG.oneofs_by_name["source"].fields.append( - _BATCHPREDICTINPUTCONFIG.fields_by_name["gcs_source"] -) -_BATCHPREDICTINPUTCONFIG.fields_by_name[ - "gcs_source" -].containing_oneof = _BATCHPREDICTINPUTCONFIG.oneofs_by_name["source"] -_BATCHPREDICTINPUTCONFIG.oneofs_by_name["source"].fields.append( - _BATCHPREDICTINPUTCONFIG.fields_by_name["bigquery_source"] -) -_BATCHPREDICTINPUTCONFIG.fields_by_name[ - "bigquery_source" -].containing_oneof = _BATCHPREDICTINPUTCONFIG.oneofs_by_name["source"] -_DOCUMENTINPUTCONFIG.fields_by_name["gcs_source"].message_type = _GCSSOURCE -_OUTPUTCONFIG.fields_by_name["gcs_destination"].message_type = _GCSDESTINATION -_OUTPUTCONFIG.fields_by_name["bigquery_destination"].message_type = _BIGQUERYDESTINATION -_OUTPUTCONFIG.oneofs_by_name["destination"].fields.append( - _OUTPUTCONFIG.fields_by_name["gcs_destination"] -) -_OUTPUTCONFIG.fields_by_name[ - "gcs_destination" -].containing_oneof = _OUTPUTCONFIG.oneofs_by_name["destination"] -_OUTPUTCONFIG.oneofs_by_name["destination"].fields.append( - _OUTPUTCONFIG.fields_by_name["bigquery_destination"] -) -_OUTPUTCONFIG.fields_by_name[ - "bigquery_destination" -].containing_oneof = _OUTPUTCONFIG.oneofs_by_name["destination"] -_BATCHPREDICTOUTPUTCONFIG.fields_by_name[ - "gcs_destination" -].message_type = _GCSDESTINATION -_BATCHPREDICTOUTPUTCONFIG.fields_by_name[ - "bigquery_destination" -].message_type = _BIGQUERYDESTINATION -_BATCHPREDICTOUTPUTCONFIG.oneofs_by_name["destination"].fields.append( - _BATCHPREDICTOUTPUTCONFIG.fields_by_name["gcs_destination"] -) -_BATCHPREDICTOUTPUTCONFIG.fields_by_name[ - "gcs_destination" -].containing_oneof = _BATCHPREDICTOUTPUTCONFIG.oneofs_by_name["destination"] -_BATCHPREDICTOUTPUTCONFIG.oneofs_by_name["destination"].fields.append( - _BATCHPREDICTOUTPUTCONFIG.fields_by_name["bigquery_destination"] -) -_BATCHPREDICTOUTPUTCONFIG.fields_by_name[ - "bigquery_destination" -].containing_oneof = _BATCHPREDICTOUTPUTCONFIG.oneofs_by_name["destination"] -_MODELEXPORTOUTPUTCONFIG_PARAMSENTRY.containing_type = _MODELEXPORTOUTPUTCONFIG -_MODELEXPORTOUTPUTCONFIG.fields_by_name[ - "gcs_destination" -].message_type = _GCSDESTINATION -_MODELEXPORTOUTPUTCONFIG.fields_by_name[ - "gcr_destination" -].message_type = _GCRDESTINATION -_MODELEXPORTOUTPUTCONFIG.fields_by_name[ - "params" -].message_type = _MODELEXPORTOUTPUTCONFIG_PARAMSENTRY -_MODELEXPORTOUTPUTCONFIG.oneofs_by_name["destination"].fields.append( - _MODELEXPORTOUTPUTCONFIG.fields_by_name["gcs_destination"] -) -_MODELEXPORTOUTPUTCONFIG.fields_by_name[ - "gcs_destination" -].containing_oneof = _MODELEXPORTOUTPUTCONFIG.oneofs_by_name["destination"] -_MODELEXPORTOUTPUTCONFIG.oneofs_by_name["destination"].fields.append( - _MODELEXPORTOUTPUTCONFIG.fields_by_name["gcr_destination"] -) -_MODELEXPORTOUTPUTCONFIG.fields_by_name[ - "gcr_destination" -].containing_oneof = _MODELEXPORTOUTPUTCONFIG.oneofs_by_name["destination"] -_EXPORTEVALUATEDEXAMPLESOUTPUTCONFIG.fields_by_name[ - "bigquery_destination" -].message_type = _BIGQUERYDESTINATION -_EXPORTEVALUATEDEXAMPLESOUTPUTCONFIG.oneofs_by_name["destination"].fields.append( - _EXPORTEVALUATEDEXAMPLESOUTPUTCONFIG.fields_by_name["bigquery_destination"] -) -_EXPORTEVALUATEDEXAMPLESOUTPUTCONFIG.fields_by_name[ - "bigquery_destination" -].containing_oneof = _EXPORTEVALUATEDEXAMPLESOUTPUTCONFIG.oneofs_by_name["destination"] -DESCRIPTOR.message_types_by_name["InputConfig"] = _INPUTCONFIG -DESCRIPTOR.message_types_by_name["BatchPredictInputConfig"] = _BATCHPREDICTINPUTCONFIG -DESCRIPTOR.message_types_by_name["DocumentInputConfig"] = _DOCUMENTINPUTCONFIG -DESCRIPTOR.message_types_by_name["OutputConfig"] = _OUTPUTCONFIG -DESCRIPTOR.message_types_by_name["BatchPredictOutputConfig"] = _BATCHPREDICTOUTPUTCONFIG -DESCRIPTOR.message_types_by_name["ModelExportOutputConfig"] = _MODELEXPORTOUTPUTCONFIG -DESCRIPTOR.message_types_by_name[ - "ExportEvaluatedExamplesOutputConfig" -] = _EXPORTEVALUATEDEXAMPLESOUTPUTCONFIG -DESCRIPTOR.message_types_by_name["GcsSource"] = _GCSSOURCE -DESCRIPTOR.message_types_by_name["BigQuerySource"] = _BIGQUERYSOURCE -DESCRIPTOR.message_types_by_name["GcsDestination"] = _GCSDESTINATION -DESCRIPTOR.message_types_by_name["BigQueryDestination"] = _BIGQUERYDESTINATION -DESCRIPTOR.message_types_by_name["GcrDestination"] = _GCRDESTINATION -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -InputConfig = _reflection.GeneratedProtocolMessageType( - "InputConfig", - (_message.Message,), - dict( - ParamsEntry=_reflection.GeneratedProtocolMessageType( - "ParamsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_INPUTCONFIG_PARAMSENTRY, - __module__="google.cloud.automl_v1beta1.proto.io_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.InputConfig.ParamsEntry) - ), - ), - DESCRIPTOR=_INPUTCONFIG, - __module__="google.cloud.automl_v1beta1.proto.io_pb2", - __doc__="""Input configuration for ImportData Action. - - The format of input depends on dataset\_metadata the Dataset into which - the import is happening has. As input source the - [gcs\_source][google.cloud.automl.v1beta1.InputConfig.gcs\_source] is - expected, unless specified otherwise. Additionally any input .CSV file - by itself must be 100MB or smaller, unless specified otherwise. If an - "example" file (that is, image, video etc.) with identical content (even - if it had different GCS\_FILE\_PATH) is mentioned multiple times, then - its label, bounding boxes etc. are appended. The same file should be - always provided with the same ML\_USE and GCS\_FILE\_PATH, if it is not, - then these values are nondeterministically selected from the given ones. - - The formats are represented in EBNF with commas being literal and with - non-terminal symbols defined near the end of this comment. The formats - are: - - - For Image Classification: CSV file(s) with each line in format: - ML\_USE,GCS\_FILE\_PATH,LABEL,LABEL,... GCS\_FILE\_PATH leads to - image of up to 30MB in size. Supported extensions: .JPEG, .GIF, .PNG, - .WEBP, .BMP, .TIFF, .ICO For MULTICLASS classification type, at most - one LABEL is allowed per image. If an image has not yet been labeled, - then it should be mentioned just once with no LABEL. Some sample - rows: TRAIN,gs://folder/image1.jpg,daisy - TEST,gs://folder/image2.jpg,dandelion,tulip,rose - UNASSIGNED,gs://folder/image3.jpg,daisy - UNASSIGNED,gs://folder/image4.jpg - - - For Image Object Detection: CSV file(s) with each line in format: - ML\_USE,GCS\_FILE\_PATH,(LABEL,BOUNDING\_BOX \| ,,,,,,,) - GCS\_FILE\_PATH leads to image of up to 30MB in size. Supported - extensions: .JPEG, .GIF, .PNG. Each image is assumed to be - exhaustively labeled. The minimum allowed BOUNDING\_BOX edge length - is 0.01, and no more than 500 BOUNDING\_BOX-es per image are allowed - (one BOUNDING\_BOX is defined per line). If an image has not yet been - labeled, then it should be mentioned just once with no LABEL and the - ",,,,,,," in place of the BOUNDING\_BOX. For images which are known - to not contain any bounding boxes, they should be labelled explictly - as "NEGATIVE\_IMAGE", followed by ",,,,,,," in place of the - BOUNDING\_BOX. Sample rows: - TRAIN,gs://folder/image1.png,car,0.1,0.1,,,0.3,0.3,, - TRAIN,gs://folder/image1.png,bike,.7,.6,,,.8,.9,, - UNASSIGNED,gs://folder/im2.png,car,0.1,0.1,0.2,0.1,0.2,0.3,0.1,0.3 - TEST,gs://folder/im3.png,,,,,,,,, - TRAIN,gs://folder/im4.png,NEGATIVE\_IMAGE,,,,,,,,, - - - For Video Classification: CSV file(s) with each line in format: - ML\_USE,GCS\_FILE\_PATH where ML\_USE VALIDATE value should not be - used. The GCS\_FILE\_PATH should lead to another .csv file which - describes examples that have 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 end has to be after the start. 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 shuold - 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,,, - - - For Video Object Tracking: CSV file(s) with each line in format: - ML\_USE,GCS\_FILE\_PATH where ML\_USE VALIDATE value should not be - used. The GCS\_FILE\_PATH should lead to another .csv file which - describes examples that have given ML\_USE, using one of 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\_IDs 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,,,,,,,,,,, - - For Text Extraction: CSV file(s) with each line in format: - ML\_USE,GCS\_FILE\_PATH GCS\_FILE\_PATH leads to a .JSONL (that is, - JSON Lines) file which either imports text in-line or as documents. - Any given .JSONL file must be 100MB or smaller. The in-line .JSONL - file contains, per line, a proto that wraps a TextSnippet proto (in - json representation) followed by one or more AnnotationPayload protos - (called annotations), which have display\_name and text\_extraction - detail populated. The given text is expected to be annotated - exhaustively, for example, if you look for animals and text contains - "dolphin" that is not labeled, then "dolphin" is assumed to not be an - animal. Any given text snippet content must be 10KB or smaller, and - also be UTF-8 NFC encoded (ASCII already is). The document .JSONL - file contains, per line, a proto that wraps a Document proto. The - Document proto must have either document\_text or input\_config set. - In document\_text case, the Document proto may also contain the - spatial information of the document, including layout, document - dimension and page number. In input\_config case, only PDF documents - are supported now, and each document may be up to 2MB large. - Currently, annotations on documents cannot be specified at import. - Three sample CSV rows: TRAIN,gs://folder/file1.jsonl - VALIDATE,gs://folder/file2.jsonl TEST,gs://folder/file3.jsonl - - - For Text Classification: CSV file(s) with each line in format: - ML\_USE,(TEXT\_SNIPPET \| GCS\_FILE\_PATH),LABEL,LABEL,... - TEXT\_SNIPPET and GCS\_FILE\_PATH are distinguished by a pattern. If - the column content is a valid gcs file path, i.e. prefixed by - "gs://", it will be treated as a GCS\_FILE\_PATH, else if the content - is enclosed within double quotes (""), it is treated as a - TEXT\_SNIPPET. In the GCS\_FILE\_PATH case, the path must lead to a - .txt file with UTF-8 encoding, for example, - "gs://folder/content.txt", and the content in it is extracted as a - text snippet. In TEXT\_SNIPPET case, the column content excluding - quotes is treated as to be imported text snippet. In both cases, the - text snippet/file size must be within 128kB. Maximum 100 unique - labels are allowed per CSV row. Sample rows: TRAIN,"They have bad - food and very rude",RudeService,BadFood - TRAIN,gs://folder/content.txt,SlowService TEST,"Typically always bad - service there.",RudeService VALIDATE,"Stomach ache to go.",BadFood - - - For Text Sentiment: CSV file(s) with each line in format: - ML\_USE,(TEXT\_SNIPPET \| GCS\_FILE\_PATH),SENTIMENT TEXT\_SNIPPET - and GCS\_FILE\_PATH are distinguished by a pattern. If the column - content is a valid gcs file path, that is, prefixed by "gs://", it is - treated as a GCS\_FILE\_PATH, otherwise it is treated as a - TEXT\_SNIPPET. In the GCS\_FILE\_PATH case, the path must lead to a - .txt file with UTF-8 encoding, for example, - "gs://folder/content.txt", and the content in it is extracted as a - text snippet. In TEXT\_SNIPPET case, the column content itself is - treated as to be imported text snippet. In both cases, the text - snippet must be up to 500 characters long. Sample rows: - TRAIN,"@freewrytin this is way too good for your product",2 TRAIN,"I - need this product so bad",3 TEST,"Thank you for this product.",4 - VALIDATE,gs://folder/content.txt,2 - - - For Tables: Either - [gcs\_source][google.cloud.automl.v1beta1.InputConfig.gcs\_source] or - - [bigquery\_source][google.cloud.automl.v1beta1.InputConfig.bigquery\_source] - can be used. All inputs is concatenated into a single - - [primary\_table][google.cloud.automl.v1beta1.TablesDatasetMetadata.primary\_table\_name] - 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. - 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 = A path to file on GCS, e.g. "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 an 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 = A content of a text snippet, UTF-8 encoded, enclosed - within double quotes (""). 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 huge. - - 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. - - - Attributes: - source: - The source of the input. - gcs_source: - The Google Cloud Storage location for the input content. In - ImportData, the gcs\_source points to a csv with structure - described in the comment. - bigquery_source: - The BigQuery location for the input content. - params: - Additional domain-specific parameters describing the semantic - of the imported data, any string must be up to 25000 - characters long. - For Tables: ``schema_inference_version`` - - (integer) Required. The version of the algorithm that - should be used for the initial inference of the schema - (columns' DataTypes) of the table the data is being - imported into. Allowed values: "1". - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.InputConfig) - ), -) -_sym_db.RegisterMessage(InputConfig) -_sym_db.RegisterMessage(InputConfig.ParamsEntry) - -BatchPredictInputConfig = _reflection.GeneratedProtocolMessageType( - "BatchPredictInputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHPREDICTINPUTCONFIG, - __module__="google.cloud.automl_v1beta1.proto.io_pb2", - __doc__="""Input configuration for BatchPredict Action. - - The format of input depends on the ML problem of the model used for - prediction. As input source the - [gcs\_source][google.cloud.automl.v1beta1.InputConfig.gcs\_source] is - expected, unless specified otherwise. - - The formats are represented in EBNF with commas being literal and with - non-terminal symbols defined near the end of this comment. The formats - are: - - - For Image Classification: CSV file(s) with each line having just a - single column: GCS\_FILE\_PATH which leads to image of up to 30MB in - size. Supported extensions: .JPEG, .GIF, .PNG. This path is treated - as the ID in the Batch predict output. Three sample rows: - gs://folder/image1.jpeg gs://folder/image2.gif gs://folder/image3.png - - - For Image Object Detection: CSV file(s) with each line having just a - single column: GCS\_FILE\_PATH which leads to image of up to 30MB in - size. Supported extensions: .JPEG, .GIF, .PNG. This path is treated - as the ID in the Batch predict output. Three sample rows: - gs://folder/image1.jpeg gs://folder/image2.gif gs://folder/image3.png - - For Video Classification: CSV file(s) with each line in format: - GCS\_FILE\_PATH,TIME\_SEGMENT\_START,TIME\_SEGMENT\_END - GCS\_FILE\_PATH leads to 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 end has to be after the start. Three sample rows: - gs://folder/video1.mp4,10,40 gs://folder/video1.mp4,20,60 - gs://folder/vid2.mov,0,inf - - - For Video Object Tracking: CSV file(s) with each line in format: - GCS\_FILE\_PATH,TIME\_SEGMENT\_START,TIME\_SEGMENT\_END - GCS\_FILE\_PATH leads to 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 end has to be after the start. Three sample rows: - gs://folder/video1.mp4,10,240 gs://folder/video1.mp4,300,360 - gs://folder/vid2.mov,0,inf - - For Text Classification: CSV file(s) with each line having just a - single column: GCS\_FILE\_PATH \| TEXT\_SNIPPET Any given text file - can have size upto 128kB. Any given text snippet content must have - 60,000 characters or less. Three sample rows: gs://folder/text1.txt - "Some text content to predict" gs://folder/text3.pdf Supported file - extensions: .txt, .pdf - - - For Text Sentiment: CSV file(s) with each line having just a single - column: GCS\_FILE\_PATH \| TEXT\_SNIPPET Any given text file can have - size upto 128kB. Any given text snippet content must have 500 - characters or less. Three sample rows: gs://folder/text1.txt "Some - text content to predict" gs://folder/text3.pdf Supported file - extensions: .txt, .pdf - - - For Text Extraction .JSONL (i.e. JSON Lines) file(s) which either - provide text in-line or as documents (for a single BatchPredict call - only one of the these formats may be used). The in-line .JSONL - file(s) contain per line a proto that wraps a temporary user-assigned - TextSnippet ID (string up to 2000 characters long) called "id", a - TextSnippet proto (in json representation) and zero or more - TextFeature protos. Any given text snippet content must have 30,000 - characters or less, and also be UTF-8 NFC encoded (ASCII already is). - The IDs provided should be unique. The document .JSONL file(s) - contain, per line, a proto that wraps a Document proto with - input\_config set. Only PDF documents are supported now, and each - document must be up to 2MB large. Any given .JSONL file must be 100MB - or smaller, and no more than 20 files may be given. - - - For Tables: Either - [gcs\_source][google.cloud.automl.v1beta1.InputConfig.gcs\_source] or - - [bigquery\_source][google.cloud.automl.v1beta1.InputConfig.bigquery\_source]. - GCS case: CSV file(s), each by itself 10GB or smaller and total size - must be 100GB or smaller, where first file must have a header containing - 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. The column names must contain the - model's - - [input\_feature\_column\_specs'][google.cloud.automl.v1beta1.TablesModelMetadata.input\_feature\_column\_specs] - - [display\_name-s][google.cloud.automl.v1beta1.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, i.e. the CSV lines, will - be attempted. For FORECASTING - - [prediction\_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction\_type]: - all columns having - - [TIME\_SERIES\_AVAILABLE\_PAST\_ONLY][google.cloud.automl.v1beta1.ColumnSpec.ForecastingMetadata.ColumnType] - type will be ignored. First three sample rows of a CSV file: "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"}]} - BigQuery case: An 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.v1beta1.TablesModelMetadata.input\_feature\_column\_specs] - - [display\_name-s][google.cloud.automl.v1beta1.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. For FORECASTING - - [prediction\_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction\_type]: - all columns having - - [TIME\_SERIES\_AVAILABLE\_PAST\_ONLY][google.cloud.automl.v1beta1.ColumnSpec.ForecastingMetadata.ColumnType] - type will be ignored. - - Definitions: GCS\_FILE\_PATH = A path to file on GCS, e.g. - "gs://folder/video.avi". TEXT\_SNIPPET = A content of a text snippet, - UTF-8 encoded, enclosed within double quotes ("") 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 an - 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. - - - Attributes: - source: - Required. The source of the input. - gcs_source: - The Google Cloud Storage location for the input content. - bigquery_source: - The BigQuery location for the input content. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.BatchPredictInputConfig) - ), -) -_sym_db.RegisterMessage(BatchPredictInputConfig) - -DocumentInputConfig = _reflection.GeneratedProtocolMessageType( - "DocumentInputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENTINPUTCONFIG, - __module__="google.cloud.automl_v1beta1.proto.io_pb2", - __doc__="""Input configuration of a - [Document][google.cloud.automl.v1beta1.Document]. - - - Attributes: - 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. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.DocumentInputConfig) - ), -) -_sym_db.RegisterMessage(DocumentInputConfig) - -OutputConfig = _reflection.GeneratedProtocolMessageType( - "OutputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_OUTPUTCONFIG, - __module__="google.cloud.automl_v1beta1.proto.io_pb2", - __doc__="""\* For Translation: CSV file ``translation.csv``, with - each line in format: ML\_USE,GCS\_FILE\_PATH GCS\_FILE\_PATH leads to a - .TSV file which describes examples that have given ML\_USE, using the - following row format per line: TEXT\_SNIPPET (in source language) - \\tTEXT\_SNIPPET (in target language) - - - For Tables: Output depends on whether the dataset was imported from - GCS or BigQuery. GCS case: - - [gcs\_destination][google.cloud.automl.v1beta1.OutputConfig.gcs\_destination] - must be set. Exported are CSV file(s) ``tables_1.csv``, - ``tables_2.csv``,...,\ ``tables_N.csv`` with each having as header line - the table's column names, and all other lines contain values for the - header columns. BigQuery case: - - [bigquery\_destination][google.cloud.automl.v1beta1.OutputConfig.bigquery\_destination] - pointing to a BigQuery project must be set. In the given project a new - dataset will be created with name - - ``export_data__`` - 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. - - - Attributes: - destination: - Required. The destination of the output. - gcs_destination: - 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. - bigquery_destination: - The BigQuery location where the output is to be written to. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.OutputConfig) - ), -) -_sym_db.RegisterMessage(OutputConfig) - -BatchPredictOutputConfig = _reflection.GeneratedProtocolMessageType( - "BatchPredictOutputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHPREDICTOUTPUTCONFIG, - __module__="google.cloud.automl_v1beta1.proto.io_pb2", - __doc__="""Output configuration for BatchPredict Action. - - As destination the - - [gcs\_destination][google.cloud.automl.v1beta1.BatchPredictOutputConfig.gcs\_destination] - must be set unless specified otherwise for a domain. If gcs\_destination - is set then in the given directory a new directory is created. Its name - will be "prediction--", 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`` `__ - 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`` `__ - 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 snippet or input text file and a list of - zero or more AnnotationPayload protos (called annotations), which - have classification detail populated. A single text snippet or file - will be listed only once with all its annotations, and its - annotations will never be split across files. - - If prediction for any text snippet or file 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 text snippet or input text file followed by - exactly one - - ```google.rpc.Status`` `__ - 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 snippet or input text file and a list of - zero or more AnnotationPayload protos (called annotations), which - have text_sentiment detail populated. A single text snippet or file - will be listed only once with all its annotations, and its - annotations will never be split across files. - - If prediction for any text snippet or file 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 text snippet or input text file followed by - exactly one - - ```google.rpc.Status`` `__ - 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`` `__ - containing only ``code`` and ``message``. - - - For Tables: Output depends on whether - - [gcs\_destination][google.cloud.automl.v1beta1.BatchPredictOutputConfig.gcs\_destination] - or - - [bigquery\_destination][google.cloud.automl.v1beta1.BatchPredictOutputConfig.bigquery\_destination] - is set (either is allowed). GCS 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.v1beta1.TablesModelMetadata.prediction\_type]: - Each .csv file will contain a header, listing all columns' - - [display\_name-s][google.cloud.automl.v1beta1.ColumnSpec.display\_name] - given on input followed by M target column names in the format of - - "<[target\_column\_specs][google.cloud.automl.v1beta1.TablesModelMetadata.target\_column\_spec] - - [display\_name][google.cloud.automl.v1beta1.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.v1beta1.TablesAnnotation.score]. For - REGRESSION and FORECASTING - - [prediction\_type-s][google.cloud.automl.v1beta1.TablesModelMetadata.prediction\_type]: - Each .csv file will contain a header, listing all columns' - [display\_name-s][google.cloud.automl.v1beta1.display\_name] given on - input followed by the predicted target column with name in the format of - - "predicted\_<[target\_column\_specs][google.cloud.automl.v1beta1.TablesModelMetadata.target\_column\_spec] - - [display\_name][google.cloud.automl.v1beta1.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`` `__ - represented as a JSON string, and containing only ``code`` and - ``message``. BigQuery case: - - [bigquery\_destination][google.cloud.automl.v1beta1.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.v1beta1.ColumnSpec.display\_name] - followed by the target column with name in the format of - - "predicted\_<[target\_column\_specs][google.cloud.automl.v1beta1.TablesModelMetadata.target\_column\_spec] - - [display\_name][google.cloud.automl.v1beta1.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.v1beta1.AnnotationPayload], - represented as STRUCT-s, containing - [TablesAnnotation][google.cloud.automl.v1beta1.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.v1beta1.TablesModelMetadata.target\_column\_spec] - - [display\_name][google.cloud.automl.v1beta1.ColumnSpec.display\_name]>", - and as a value has - - ```google.rpc.Status`` `__ - represented as a STRUCT, and containing only ``code`` and ``message``. - - - Attributes: - destination: - Required. The destination of the output. - gcs_destination: - The Google Cloud Storage location of the directory where the - output is to be written to. - bigquery_destination: - The BigQuery location where the output is to be written to. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.BatchPredictOutputConfig) - ), -) -_sym_db.RegisterMessage(BatchPredictOutputConfig) - -ModelExportOutputConfig = _reflection.GeneratedProtocolMessageType( - "ModelExportOutputConfig", - (_message.Message,), - dict( - ParamsEntry=_reflection.GeneratedProtocolMessageType( - "ParamsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_MODELEXPORTOUTPUTCONFIG_PARAMSENTRY, - __module__="google.cloud.automl_v1beta1.proto.io_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ModelExportOutputConfig.ParamsEntry) - ), - ), - DESCRIPTOR=_MODELEXPORTOUTPUTCONFIG, - __module__="google.cloud.automl_v1beta1.proto.io_pb2", - __doc__="""Output configuration for ModelExport Action. - - - Attributes: - destination: - Required. The destination of the output. - gcs_destination: - 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. - gcr_destination: - The GCR location where model image is to be pushed to. This - location may only be set for the following model formats: - "docker". The model image will be created under the given - URI. - 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). Formats description: - tflite - Used for Android - mobile devices. - edgetpu\_tflite - Used for `Edge TPU - `__ devices. - - tf\_saved\_model - A tensorflow model in SavedModel format. - - tf\_js - A `TensorFlow.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. - 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". - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ModelExportOutputConfig) - ), -) -_sym_db.RegisterMessage(ModelExportOutputConfig) -_sym_db.RegisterMessage(ModelExportOutputConfig.ParamsEntry) - -ExportEvaluatedExamplesOutputConfig = _reflection.GeneratedProtocolMessageType( - "ExportEvaluatedExamplesOutputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_EXPORTEVALUATEDEXAMPLESOUTPUTCONFIG, - __module__="google.cloud.automl_v1beta1.proto.io_pb2", - __doc__="""Output configuration for ExportEvaluatedExamples Action. - Note that this call is available only for 30 days since the moment the - model was evaluated. The output depends on the domain, as follows (note - that only examples from the TEST set are exported): - - - For Tables: - - [bigquery\_destination][google.cloud.automl.v1beta1.OutputConfig.bigquery\_destination] - pointing to a BigQuery project must be set. In the given project a new - dataset will be created with name - - ``export_evaluated_examples__`` - 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 - an ``evaluated_examples`` table will be created. It will have all the - same columns as the - - [primary\_table][google.cloud.automl.v1beta1.TablesDatasetMetadata.primary\_table\_spec\_id] - of the [dataset][google.cloud.automl.v1beta1.Model.dataset\_id] from - which the model was created, as they were at the moment of model's - evaluation (this includes the target column with its ground truth), - followed by a column called "predicted\_". That last column will contain - the model's prediction result for each respective row, given as ARRAY of - [AnnotationPayloads][google.cloud.automl.v1beta1.AnnotationPayload], - represented as STRUCT-s, containing - [TablesAnnotation][google.cloud.automl.v1beta1.TablesAnnotation]. - - - Attributes: - destination: - Required. The destination of the output. - bigquery_destination: - The BigQuery location where the output is to be written to. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig) - ), -) -_sym_db.RegisterMessage(ExportEvaluatedExamplesOutputConfig) - -GcsSource = _reflection.GeneratedProtocolMessageType( - "GcsSource", - (_message.Message,), - dict( - DESCRIPTOR=_GCSSOURCE, - __module__="google.cloud.automl_v1beta1.proto.io_pb2", - __doc__="""The Google Cloud Storage location for the input content. - - - Attributes: - 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 - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.GcsSource) - ), -) -_sym_db.RegisterMessage(GcsSource) - -BigQuerySource = _reflection.GeneratedProtocolMessageType( - "BigQuerySource", - (_message.Message,), - dict( - DESCRIPTOR=_BIGQUERYSOURCE, - __module__="google.cloud.automl_v1beta1.proto.io_pb2", - __doc__="""The BigQuery location for the input content. - - - Attributes: - input_uri: - Required. BigQuery URI to a table, up to 2000 characters long. - Accepted forms: \* BigQuery path e.g. - bq://projectId.bqDatasetId.bqTableId - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.BigQuerySource) - ), -) -_sym_db.RegisterMessage(BigQuerySource) - -GcsDestination = _reflection.GeneratedProtocolMessageType( - "GcsDestination", - (_message.Message,), - dict( - DESCRIPTOR=_GCSDESTINATION, - __module__="google.cloud.automl_v1beta1.proto.io_pb2", - __doc__="""The Google Cloud Storage location where the output is to - be written to. - - - Attributes: - 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. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.GcsDestination) - ), -) -_sym_db.RegisterMessage(GcsDestination) - -BigQueryDestination = _reflection.GeneratedProtocolMessageType( - "BigQueryDestination", - (_message.Message,), - dict( - DESCRIPTOR=_BIGQUERYDESTINATION, - __module__="google.cloud.automl_v1beta1.proto.io_pb2", - __doc__="""The BigQuery location for the output content. - - - Attributes: - output_uri: - Required. BigQuery URI to a project, up to 2000 characters - long. Accepted forms: \* BigQuery path e.g. bq://projectId - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.BigQueryDestination) - ), -) -_sym_db.RegisterMessage(BigQueryDestination) - -GcrDestination = _reflection.GeneratedProtocolMessageType( - "GcrDestination", - (_message.Message,), - dict( - DESCRIPTOR=_GCRDESTINATION, - __module__="google.cloud.automl_v1beta1.proto.io_pb2", - __doc__="""The GCR location where the image must be pushed to. - - - Attributes: - output_uri: - Required. Google Contained Registry URI of the new image, up - to 2000 characters long. See https: - //cloud.google.com/container-registry/do // cs/pushing-and- - pulling#pushing\_an\_image\_to\_a\_registry Accepted forms: \* - [HOSTNAME]/[PROJECT-ID]/[IMAGE] \* [HOSTNAME]/[PROJECT- - ID]/[IMAGE]:[TAG] The requesting user must have permission to - push images the project. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.GcrDestination) - ), -) -_sym_db.RegisterMessage(GcrDestination) - - -DESCRIPTOR._options = None -_INPUTCONFIG_PARAMSENTRY._options = None -_MODELEXPORTOUTPUTCONFIG_PARAMSENTRY._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/io_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/io_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/io_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/model.proto b/automl/google/cloud/automl_v1beta1/proto/model.proto deleted file mode 100644 index 8c53d9b5832f..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/model.proto +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/cloud/automl/v1beta1/image.proto"; -import "google/cloud/automl/v1beta1/tables.proto"; -import "google/cloud/automl/v1beta1/text.proto"; -import "google/cloud/automl/v1beta1/translation.proto"; -import "google/cloud/automl/v1beta1/video.proto"; -import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// API proto representing a trained machine learning model. -message Model { - // Deployment state of the model. - enum DeploymentState { - // Should not be used, an un-set enum has this value by default. - DEPLOYMENT_STATE_UNSPECIFIED = 0; - - // Model is deployed. - DEPLOYED = 1; - - // Model is not deployed. - UNDEPLOYED = 2; - } - - // Required. - // The model metadata that is specific to the problem type. - // Must match the metadata type of the dataset used to train the model. - oneof model_metadata { - // Metadata for translation models. - TranslationModelMetadata translation_model_metadata = 15; - - // Metadata for image classification models. - ImageClassificationModelMetadata image_classification_model_metadata = 13; - - // Metadata for text classification models. - TextClassificationModelMetadata text_classification_model_metadata = 14; - - // Metadata for image object detection models. - ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; - - // Metadata for video classification models. - VideoClassificationModelMetadata video_classification_model_metadata = 23; - - // Metadata for video object tracking models. - VideoObjectTrackingModelMetadata video_object_tracking_model_metadata = 21; - - // Metadata for text extraction models. - TextExtractionModelMetadata text_extraction_model_metadata = 19; - - // Metadata for Tables models. - TablesModelMetadata tables_model_metadata = 24; - - // Metadata for text sentiment models. - TextSentimentModelMetadata text_sentiment_model_metadata = 22; - } - - // Output only. Resource name of the model. - // Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` - string name = 1; - - // 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. - string display_name = 2; - - // Required. The resource ID of the dataset used to create the model. The dataset must - // come from the same ancestor project and location. - string dataset_id = 3; - - // Output only. Timestamp when the model training finished and can be used for prediction. - google.protobuf.Timestamp create_time = 7; - - // Output only. Timestamp when this model was last updated. - google.protobuf.Timestamp update_time = 11; - - // Output only. Deployment state of the model. A model can only serve - // prediction requests after it gets deployed. - DeploymentState deployment_state = 8; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/model_evaluation.proto b/automl/google/cloud/automl_v1beta1/proto/model_evaluation.proto deleted file mode 100644 index ce2db614a182..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/model_evaluation.proto +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/cloud/automl/v1beta1/classification.proto"; -import "google/cloud/automl/v1beta1/detection.proto"; -import "google/cloud/automl/v1beta1/regression.proto"; -import "google/cloud/automl/v1beta1/tables.proto"; -import "google/cloud/automl/v1beta1/text_extraction.proto"; -import "google/cloud/automl/v1beta1/text_sentiment.proto"; -import "google/cloud/automl/v1beta1/translation.proto"; -import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// Evaluation results of a model. -message ModelEvaluation { - // Output only. Problem type specific evaluation metrics. - oneof metrics { - // Model evaluation metrics for image, text, video and tables - // classification. - // Tables problem is considered a classification when the target column - // is CATEGORY DataType. - ClassificationEvaluationMetrics classification_evaluation_metrics = 8; - - // Model evaluation metrics for Tables regression. - // Tables problem is considered a regression when the target column - // has FLOAT64 DataType. - RegressionEvaluationMetrics regression_evaluation_metrics = 24; - - // Model evaluation metrics for translation. - TranslationEvaluationMetrics translation_evaluation_metrics = 9; - - // Model evaluation metrics for image object detection. - ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; - - // Model evaluation metrics for video object tracking. - VideoObjectTrackingEvaluationMetrics video_object_tracking_evaluation_metrics = 14; - - // Evaluation metrics for text sentiment models. - TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; - - // Evaluation metrics for text extraction models. - TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; - } - - // Output only. Resource name of the model evaluation. - // Format: - // - // `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}` - string name = 1; - - // 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.v1beta1.TablesModelMetadata.prediction_type] - // the - // [display_name][google.cloud.automl.v1beta1.ModelEvaluation.display_name] - // field is used. - string annotation_spec_id = 2; - - // Output only. The value of - // [display_name][google.cloud.automl.v1beta1.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.v1beta1.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. - string display_name = 15; - - // Output only. Timestamp when this model evaluation was created. - google.protobuf.Timestamp create_time = 5; - - // 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.v1beta1.ModelEvaluation.annotation_spec_id]. - int32 evaluated_example_count = 6; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/model_evaluation_pb2.py b/automl/google/cloud/automl_v1beta1/proto/model_evaluation_pb2.py deleted file mode 100644 index 681a2663a1d0..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/model_evaluation_pb2.py +++ /dev/null @@ -1,469 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/model_evaluation.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.cloud.automl_v1beta1.proto import ( - classification_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - detection_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_detection__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - regression_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_regression__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - tables_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_tables__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - text_extraction_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__extraction__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - text_sentiment_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__sentiment__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - translation_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_translation__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/model_evaluation.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1P\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n8google/cloud/automl_v1beta1/proto/model_evaluation.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x36google/cloud/automl_v1beta1/proto/classification.proto\x1a\x31google/cloud/automl_v1beta1/proto/detection.proto\x1a\x32google/cloud/automl_v1beta1/proto/regression.proto\x1a.google/cloud/automl_v1beta1/proto/tables.proto\x1a\x37google/cloud/automl_v1beta1/proto/text_extraction.proto\x1a\x36google/cloud/automl_v1beta1/proto/text_sentiment.proto\x1a\x33google/cloud/automl_v1beta1/proto/translation.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto"\xa7\x07\n\x0fModelEvaluation\x12i\n!classification_evaluation_metrics\x18\x08 \x01(\x0b\x32<.google.cloud.automl.v1beta1.ClassificationEvaluationMetricsH\x00\x12\x61\n\x1dregression_evaluation_metrics\x18\x18 \x01(\x0b\x32\x38.google.cloud.automl.v1beta1.RegressionEvaluationMetricsH\x00\x12\x63\n\x1etranslation_evaluation_metrics\x18\t \x01(\x0b\x32\x39.google.cloud.automl.v1beta1.TranslationEvaluationMetricsH\x00\x12w\n)image_object_detection_evaluation_metrics\x18\x0c \x01(\x0b\x32\x42.google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetricsH\x00\x12u\n(video_object_tracking_evaluation_metrics\x18\x0e \x01(\x0b\x32\x41.google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetricsH\x00\x12h\n!text_sentiment_evaluation_metrics\x18\x0b \x01(\x0b\x32;.google.cloud.automl.v1beta1.TextSentimentEvaluationMetricsH\x00\x12j\n"text_extraction_evaluation_metrics\x18\r \x01(\x0b\x32<.google.cloud.automl.v1beta1.TextExtractionEvaluationMetricsH\x00\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1a\n\x12\x61nnotation_spec_id\x18\x02 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x0f \x01(\t\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1f\n\x17\x65valuated_example_count\x18\x06 \x01(\x05\x42\t\n\x07metricsB\xa5\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_detection__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_regression__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_tables__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__extraction__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__sentiment__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_translation__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_MODELEVALUATION = _descriptor.Descriptor( - name="ModelEvaluation", - full_name="google.cloud.automl.v1beta1.ModelEvaluation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="classification_evaluation_metrics", - full_name="google.cloud.automl.v1beta1.ModelEvaluation.classification_evaluation_metrics", - index=0, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="regression_evaluation_metrics", - full_name="google.cloud.automl.v1beta1.ModelEvaluation.regression_evaluation_metrics", - index=1, - number=24, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="translation_evaluation_metrics", - full_name="google.cloud.automl.v1beta1.ModelEvaluation.translation_evaluation_metrics", - index=2, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_object_detection_evaluation_metrics", - full_name="google.cloud.automl.v1beta1.ModelEvaluation.image_object_detection_evaluation_metrics", - index=3, - number=12, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_object_tracking_evaluation_metrics", - full_name="google.cloud.automl.v1beta1.ModelEvaluation.video_object_tracking_evaluation_metrics", - index=4, - number=14, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_sentiment_evaluation_metrics", - full_name="google.cloud.automl.v1beta1.ModelEvaluation.text_sentiment_evaluation_metrics", - index=5, - number=11, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_extraction_evaluation_metrics", - full_name="google.cloud.automl.v1beta1.ModelEvaluation.text_extraction_evaluation_metrics", - index=6, - number=13, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.ModelEvaluation.name", - index=7, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_spec_id", - full_name="google.cloud.automl.v1beta1.ModelEvaluation.annotation_spec_id", - index=8, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.automl.v1beta1.ModelEvaluation.display_name", - index=9, - number=15, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.automl.v1beta1.ModelEvaluation.create_time", - index=10, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="evaluated_example_count", - full_name="google.cloud.automl.v1beta1.ModelEvaluation.evaluated_example_count", - index=11, - number=6, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="metrics", - full_name="google.cloud.automl.v1beta1.ModelEvaluation.metrics", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=526, - serialized_end=1461, -) - -_MODELEVALUATION.fields_by_name[ - "classification_evaluation_metrics" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2._CLASSIFICATIONEVALUATIONMETRICS -) -_MODELEVALUATION.fields_by_name[ - "regression_evaluation_metrics" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_regression__pb2._REGRESSIONEVALUATIONMETRICS -) -_MODELEVALUATION.fields_by_name[ - "translation_evaluation_metrics" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_translation__pb2._TRANSLATIONEVALUATIONMETRICS -) -_MODELEVALUATION.fields_by_name[ - "image_object_detection_evaluation_metrics" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_detection__pb2._IMAGEOBJECTDETECTIONEVALUATIONMETRICS -) -_MODELEVALUATION.fields_by_name[ - "video_object_tracking_evaluation_metrics" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_detection__pb2._VIDEOOBJECTTRACKINGEVALUATIONMETRICS -) -_MODELEVALUATION.fields_by_name[ - "text_sentiment_evaluation_metrics" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__sentiment__pb2._TEXTSENTIMENTEVALUATIONMETRICS -) -_MODELEVALUATION.fields_by_name[ - "text_extraction_evaluation_metrics" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__extraction__pb2._TEXTEXTRACTIONEVALUATIONMETRICS -) -_MODELEVALUATION.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_MODELEVALUATION.oneofs_by_name["metrics"].fields.append( - _MODELEVALUATION.fields_by_name["classification_evaluation_metrics"] -) -_MODELEVALUATION.fields_by_name[ - "classification_evaluation_metrics" -].containing_oneof = _MODELEVALUATION.oneofs_by_name["metrics"] -_MODELEVALUATION.oneofs_by_name["metrics"].fields.append( - _MODELEVALUATION.fields_by_name["regression_evaluation_metrics"] -) -_MODELEVALUATION.fields_by_name[ - "regression_evaluation_metrics" -].containing_oneof = _MODELEVALUATION.oneofs_by_name["metrics"] -_MODELEVALUATION.oneofs_by_name["metrics"].fields.append( - _MODELEVALUATION.fields_by_name["translation_evaluation_metrics"] -) -_MODELEVALUATION.fields_by_name[ - "translation_evaluation_metrics" -].containing_oneof = _MODELEVALUATION.oneofs_by_name["metrics"] -_MODELEVALUATION.oneofs_by_name["metrics"].fields.append( - _MODELEVALUATION.fields_by_name["image_object_detection_evaluation_metrics"] -) -_MODELEVALUATION.fields_by_name[ - "image_object_detection_evaluation_metrics" -].containing_oneof = _MODELEVALUATION.oneofs_by_name["metrics"] -_MODELEVALUATION.oneofs_by_name["metrics"].fields.append( - _MODELEVALUATION.fields_by_name["video_object_tracking_evaluation_metrics"] -) -_MODELEVALUATION.fields_by_name[ - "video_object_tracking_evaluation_metrics" -].containing_oneof = _MODELEVALUATION.oneofs_by_name["metrics"] -_MODELEVALUATION.oneofs_by_name["metrics"].fields.append( - _MODELEVALUATION.fields_by_name["text_sentiment_evaluation_metrics"] -) -_MODELEVALUATION.fields_by_name[ - "text_sentiment_evaluation_metrics" -].containing_oneof = _MODELEVALUATION.oneofs_by_name["metrics"] -_MODELEVALUATION.oneofs_by_name["metrics"].fields.append( - _MODELEVALUATION.fields_by_name["text_extraction_evaluation_metrics"] -) -_MODELEVALUATION.fields_by_name[ - "text_extraction_evaluation_metrics" -].containing_oneof = _MODELEVALUATION.oneofs_by_name["metrics"] -DESCRIPTOR.message_types_by_name["ModelEvaluation"] = _MODELEVALUATION -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ModelEvaluation = _reflection.GeneratedProtocolMessageType( - "ModelEvaluation", - (_message.Message,), - dict( - DESCRIPTOR=_MODELEVALUATION, - __module__="google.cloud.automl_v1beta1.proto.model_evaluation_pb2", - __doc__="""Evaluation results of a model. - - - Attributes: - metrics: - Output only. Problem type specific evaluation metrics. - 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. - regression_evaluation_metrics: - Model evaluation metrics for Tables regression. Tables problem - is considered a regression when the target column has FLOAT64 - DataType. - translation_evaluation_metrics: - Model evaluation metrics for translation. - image_object_detection_evaluation_metrics: - Model evaluation metrics for image object detection. - video_object_tracking_evaluation_metrics: - Model evaluation metrics for video object tracking. - text_sentiment_evaluation_metrics: - Evaluation metrics for text sentiment models. - text_extraction_evaluation_metrics: - Evaluation metrics for text extraction models. - name: - Output only. Resource name of the model evaluation. Format: ` - `projects/{project_id}/locations/{location_id}/models/{model_i - d}/modelEvaluations/{model_evaluation_id}`` - 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.v1bet - a1.TablesModelMetadata.prediction\_type] the [display\_name][g - oogle.cloud.automl.v1beta1.ModelEvaluation.display\_name] - field is used. - display_name: - Output only. The value of [display\_name][google.cloud.automl. - v1beta1.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.v1bet - a1.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. - create_time: - Output only. Timestamp when this model evaluation was created. - 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.v1beta1.ModelE - valuation.annotation\_spec\_id]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ModelEvaluation) - ), -) -_sym_db.RegisterMessage(ModelEvaluation) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/model_evaluation_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/model_evaluation_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/model_evaluation_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/model_pb2.py b/automl/google/cloud/automl_v1beta1/proto/model_pb2.py deleted file mode 100644 index f669af2061e7..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/model_pb2.py +++ /dev/null @@ -1,555 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/model.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.cloud.automl_v1beta1.proto import ( - image_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_image__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - tables_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_tables__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - text_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - translation_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_translation__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - video_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_video__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/model.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1P\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n-google/cloud/automl_v1beta1/proto/model.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a-google/cloud/automl_v1beta1/proto/image.proto\x1a.google/cloud/automl_v1beta1/proto/tables.proto\x1a,google/cloud/automl_v1beta1/proto/text.proto\x1a\x33google/cloud/automl_v1beta1/proto/translation.proto\x1a-google/cloud/automl_v1beta1/proto/video.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto"\xf2\t\n\x05Model\x12[\n\x1atranslation_model_metadata\x18\x0f \x01(\x0b\x32\x35.google.cloud.automl.v1beta1.TranslationModelMetadataH\x00\x12l\n#image_classification_model_metadata\x18\r \x01(\x0b\x32=.google.cloud.automl.v1beta1.ImageClassificationModelMetadataH\x00\x12j\n"text_classification_model_metadata\x18\x0e \x01(\x0b\x32<.google.cloud.automl.v1beta1.TextClassificationModelMetadataH\x00\x12o\n%image_object_detection_model_metadata\x18\x14 \x01(\x0b\x32>.google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadataH\x00\x12l\n#video_classification_model_metadata\x18\x17 \x01(\x0b\x32=.google.cloud.automl.v1beta1.VideoClassificationModelMetadataH\x00\x12m\n$video_object_tracking_model_metadata\x18\x15 \x01(\x0b\x32=.google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadataH\x00\x12\x62\n\x1etext_extraction_model_metadata\x18\x13 \x01(\x0b\x32\x38.google.cloud.automl.v1beta1.TextExtractionModelMetadataH\x00\x12Q\n\x15tables_model_metadata\x18\x18 \x01(\x0b\x32\x30.google.cloud.automl.v1beta1.TablesModelMetadataH\x00\x12`\n\x1dtext_sentiment_model_metadata\x18\x16 \x01(\x0b\x32\x37.google.cloud.automl.v1beta1.TextSentimentModelMetadataH\x00\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x12\n\ndataset_id\x18\x03 \x01(\t\x12/\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12L\n\x10\x64\x65ployment_state\x18\x08 \x01(\x0e\x32\x32.google.cloud.automl.v1beta1.Model.DeploymentState"Q\n\x0f\x44\x65ploymentState\x12 \n\x1c\x44\x45PLOYMENT_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44\x45PLOYED\x10\x01\x12\x0e\n\nUNDEPLOYED\x10\x02\x42\x10\n\x0emodel_metadataB\xa5\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_image__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_tables__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_translation__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_video__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_MODEL_DEPLOYMENTSTATE = _descriptor.EnumDescriptor( - name="DeploymentState", - full_name="google.cloud.automl.v1beta1.Model.DeploymentState", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="DEPLOYMENT_STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="DEPLOYED", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UNDEPLOYED", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1550, - serialized_end=1631, -) -_sym_db.RegisterEnumDescriptor(_MODEL_DEPLOYMENTSTATE) - - -_MODEL = _descriptor.Descriptor( - name="Model", - full_name="google.cloud.automl.v1beta1.Model", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="translation_model_metadata", - full_name="google.cloud.automl.v1beta1.Model.translation_model_metadata", - index=0, - number=15, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_classification_model_metadata", - full_name="google.cloud.automl.v1beta1.Model.image_classification_model_metadata", - index=1, - number=13, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_classification_model_metadata", - full_name="google.cloud.automl.v1beta1.Model.text_classification_model_metadata", - index=2, - number=14, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_object_detection_model_metadata", - full_name="google.cloud.automl.v1beta1.Model.image_object_detection_model_metadata", - index=3, - number=20, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_classification_model_metadata", - full_name="google.cloud.automl.v1beta1.Model.video_classification_model_metadata", - index=4, - number=23, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_object_tracking_model_metadata", - full_name="google.cloud.automl.v1beta1.Model.video_object_tracking_model_metadata", - index=5, - number=21, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_extraction_model_metadata", - full_name="google.cloud.automl.v1beta1.Model.text_extraction_model_metadata", - index=6, - number=19, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tables_model_metadata", - full_name="google.cloud.automl.v1beta1.Model.tables_model_metadata", - index=7, - number=24, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_sentiment_model_metadata", - full_name="google.cloud.automl.v1beta1.Model.text_sentiment_model_metadata", - index=8, - number=22, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.Model.name", - index=9, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.automl.v1beta1.Model.display_name", - index=10, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="dataset_id", - full_name="google.cloud.automl.v1beta1.Model.dataset_id", - index=11, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.automl.v1beta1.Model.create_time", - index=12, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_time", - full_name="google.cloud.automl.v1beta1.Model.update_time", - index=13, - number=11, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="deployment_state", - full_name="google.cloud.automl.v1beta1.Model.deployment_state", - index=14, - number=8, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_MODEL_DEPLOYMENTSTATE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="model_metadata", - full_name="google.cloud.automl.v1beta1.Model.model_metadata", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=383, - serialized_end=1649, -) - -_MODEL.fields_by_name[ - "translation_model_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_translation__pb2._TRANSLATIONMODELMETADATA -) -_MODEL.fields_by_name[ - "image_classification_model_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_image__pb2._IMAGECLASSIFICATIONMODELMETADATA -) -_MODEL.fields_by_name[ - "text_classification_model_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__pb2._TEXTCLASSIFICATIONMODELMETADATA -) -_MODEL.fields_by_name[ - "image_object_detection_model_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_image__pb2._IMAGEOBJECTDETECTIONMODELMETADATA -) -_MODEL.fields_by_name[ - "video_classification_model_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_video__pb2._VIDEOCLASSIFICATIONMODELMETADATA -) -_MODEL.fields_by_name[ - "video_object_tracking_model_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_video__pb2._VIDEOOBJECTTRACKINGMODELMETADATA -) -_MODEL.fields_by_name[ - "text_extraction_model_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__pb2._TEXTEXTRACTIONMODELMETADATA -) -_MODEL.fields_by_name[ - "tables_model_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_tables__pb2._TABLESMODELMETADATA -) -_MODEL.fields_by_name[ - "text_sentiment_model_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__pb2._TEXTSENTIMENTMODELMETADATA -) -_MODEL.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_MODEL.fields_by_name[ - "update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_MODEL.fields_by_name["deployment_state"].enum_type = _MODEL_DEPLOYMENTSTATE -_MODEL_DEPLOYMENTSTATE.containing_type = _MODEL -_MODEL.oneofs_by_name["model_metadata"].fields.append( - _MODEL.fields_by_name["translation_model_metadata"] -) -_MODEL.fields_by_name[ - "translation_model_metadata" -].containing_oneof = _MODEL.oneofs_by_name["model_metadata"] -_MODEL.oneofs_by_name["model_metadata"].fields.append( - _MODEL.fields_by_name["image_classification_model_metadata"] -) -_MODEL.fields_by_name[ - "image_classification_model_metadata" -].containing_oneof = _MODEL.oneofs_by_name["model_metadata"] -_MODEL.oneofs_by_name["model_metadata"].fields.append( - _MODEL.fields_by_name["text_classification_model_metadata"] -) -_MODEL.fields_by_name[ - "text_classification_model_metadata" -].containing_oneof = _MODEL.oneofs_by_name["model_metadata"] -_MODEL.oneofs_by_name["model_metadata"].fields.append( - _MODEL.fields_by_name["image_object_detection_model_metadata"] -) -_MODEL.fields_by_name[ - "image_object_detection_model_metadata" -].containing_oneof = _MODEL.oneofs_by_name["model_metadata"] -_MODEL.oneofs_by_name["model_metadata"].fields.append( - _MODEL.fields_by_name["video_classification_model_metadata"] -) -_MODEL.fields_by_name[ - "video_classification_model_metadata" -].containing_oneof = _MODEL.oneofs_by_name["model_metadata"] -_MODEL.oneofs_by_name["model_metadata"].fields.append( - _MODEL.fields_by_name["video_object_tracking_model_metadata"] -) -_MODEL.fields_by_name[ - "video_object_tracking_model_metadata" -].containing_oneof = _MODEL.oneofs_by_name["model_metadata"] -_MODEL.oneofs_by_name["model_metadata"].fields.append( - _MODEL.fields_by_name["text_extraction_model_metadata"] -) -_MODEL.fields_by_name[ - "text_extraction_model_metadata" -].containing_oneof = _MODEL.oneofs_by_name["model_metadata"] -_MODEL.oneofs_by_name["model_metadata"].fields.append( - _MODEL.fields_by_name["tables_model_metadata"] -) -_MODEL.fields_by_name["tables_model_metadata"].containing_oneof = _MODEL.oneofs_by_name[ - "model_metadata" -] -_MODEL.oneofs_by_name["model_metadata"].fields.append( - _MODEL.fields_by_name["text_sentiment_model_metadata"] -) -_MODEL.fields_by_name[ - "text_sentiment_model_metadata" -].containing_oneof = _MODEL.oneofs_by_name["model_metadata"] -DESCRIPTOR.message_types_by_name["Model"] = _MODEL -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Model = _reflection.GeneratedProtocolMessageType( - "Model", - (_message.Message,), - dict( - DESCRIPTOR=_MODEL, - __module__="google.cloud.automl_v1beta1.proto.model_pb2", - __doc__="""API proto representing a trained machine learning model. - - - Attributes: - model_metadata: - Required. The model metadata that is specific to the problem - type. Must match the metadata type of the dataset used to - train the model. - translation_model_metadata: - Metadata for translation models. - image_classification_model_metadata: - Metadata for image classification models. - text_classification_model_metadata: - Metadata for text classification models. - image_object_detection_model_metadata: - Metadata for image object detection models. - video_classification_model_metadata: - Metadata for video classification models. - video_object_tracking_model_metadata: - Metadata for video object tracking models. - text_extraction_model_metadata: - Metadata for text extraction models. - tables_model_metadata: - Metadata for Tables models. - text_sentiment_model_metadata: - Metadata for text sentiment models. - name: - Output only. Resource name of the model. Format: ``projects/{p - roject_id}/locations/{location_id}/models/{model_id}`` - 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. - 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. - create_time: - Output only. Timestamp when the model training finished and - can be used for prediction. - update_time: - Output only. Timestamp when this model was last updated. - deployment_state: - Output only. Deployment state of the model. A model can only - serve prediction requests after it gets deployed. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.Model) - ), -) -_sym_db.RegisterMessage(Model) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/model_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/model_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/model_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/operations.proto b/automl/google/cloud/automl_v1beta1/proto/operations.proto deleted file mode 100644 index 460321ccc460..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/operations.proto +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/api/annotations.proto"; -import "google/cloud/automl/v1beta1/io.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// Metadata used across all long running operations returned by AutoML API. -message OperationMetadata { - // Ouptut only. Details of specific operation. Even if this field is empty, - // the presence allows to distinguish different types of operations. - oneof details { - // Details of a Delete operation. - DeleteOperationMetadata delete_details = 8; - - // Details of a DeployModel operation. - DeployModelOperationMetadata deploy_model_details = 24; - - // Details of an UndeployModel operation. - UndeployModelOperationMetadata undeploy_model_details = 25; - - // Details of CreateModel operation. - CreateModelOperationMetadata create_model_details = 10; - - // Details of ImportData operation. - ImportDataOperationMetadata import_data_details = 15; - - // Details of BatchPredict operation. - BatchPredictOperationMetadata batch_predict_details = 16; - - // Details of ExportData operation. - ExportDataOperationMetadata export_data_details = 21; - - // Details of ExportModel operation. - ExportModelOperationMetadata export_model_details = 22; - - // Details of ExportEvaluatedExamples operation. - ExportEvaluatedExamplesOperationMetadata export_evaluated_examples_details = - 26; - } - - // Output only. Progress of operation. Range: [0, 100]. - // Not used currently. - int32 progress_percent = 13; - - // 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. - repeated google.rpc.Status partial_failures = 2; - - // Output only. Time when the operation was created. - google.protobuf.Timestamp create_time = 3; - - // Output only. Time when the operation was updated for the last time. - google.protobuf.Timestamp update_time = 4; -} - -// Details of operations that perform deletes of any entities. -message DeleteOperationMetadata {} - -// Details of DeployModel operation. -message DeployModelOperationMetadata {} - -// Details of UndeployModel operation. -message UndeployModelOperationMetadata {} - -// Details of CreateModel operation. -message CreateModelOperationMetadata {} - -// Details of ImportData operation. -message ImportDataOperationMetadata {} - -// Details of ExportData operation. -message ExportDataOperationMetadata { - // Further describes this export data's output. - // Supplements - // [OutputConfig][google.cloud.automl.v1beta1.OutputConfig]. - message ExportDataOutputInfo { - // The output location to which the exported data is written. - oneof output_location { - // The full path of the Google Cloud Storage directory created, into which - // the exported data is written. - string gcs_output_directory = 1; - - // The path of the BigQuery dataset created, in bq://projectId.bqDatasetId - // format, into which the exported data is written. - string bigquery_output_dataset = 2; - } - } - - // Output only. Information further describing this export data's output. - ExportDataOutputInfo output_info = 1; -} - -// Details of BatchPredict operation. -message BatchPredictOperationMetadata { - // Further describes this batch predict's output. - // Supplements - // - // [BatchPredictOutputConfig][google.cloud.automl.v1beta1.BatchPredictOutputConfig]. - message BatchPredictOutputInfo { - // The output location into which prediction output is written. - oneof output_location { - // The full path of the Google Cloud Storage directory created, into which - // the prediction output is written. - string gcs_output_directory = 1; - - // The path of the BigQuery dataset created, in bq://projectId.bqDatasetId - // format, into which the prediction output is written. - string bigquery_output_dataset = 2; - } - } - - // Output only. The input config that was given upon starting this - // batch predict operation. - BatchPredictInputConfig input_config = 1; - - // Output only. Information further describing this batch predict's output. - BatchPredictOutputInfo output_info = 2; -} - -// Details of ExportModel operation. -message ExportModelOperationMetadata { - // Further describes the output of model export. - // Supplements - // - // [ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. - message ExportModelOutputInfo { - // The full path of the Google Cloud Storage directory created, into which - // the model will be exported. - string gcs_output_directory = 1; - } - - // Output only. Information further describing the output of this model - // export. - ExportModelOutputInfo output_info = 2; -} - -// Details of EvaluatedExamples operation. -message ExportEvaluatedExamplesOperationMetadata { - // Further describes the output of the evaluated examples export. - // Supplements - // - // [ExportEvaluatedExamplesOutputConfig][google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig]. - message ExportEvaluatedExamplesOutputInfo { - // The path of the BigQuery dataset created, in bq://projectId.bqDatasetId - // format, into which the output of export evaluated examples is written. - string bigquery_output_dataset = 2; - } - - // Output only. Information further describing the output of this evaluated - // examples export. - ExportEvaluatedExamplesOutputInfo output_info = 2; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/operations_pb2.py b/automl/google/cloud/automl_v1beta1/proto/operations_pb2.py deleted file mode 100644 index d1b132333336..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/operations_pb2.py +++ /dev/null @@ -1,1283 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/operations.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.cloud.automl_v1beta1.proto import ( - io_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_io__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/operations.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1P\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n2google/cloud/automl_v1beta1/proto/operations.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a*google/cloud/automl_v1beta1/proto/io.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto"\x8b\x08\n\x11OperationMetadata\x12N\n\x0e\x64\x65lete_details\x18\x08 \x01(\x0b\x32\x34.google.cloud.automl.v1beta1.DeleteOperationMetadataH\x00\x12Y\n\x14\x64\x65ploy_model_details\x18\x18 \x01(\x0b\x32\x39.google.cloud.automl.v1beta1.DeployModelOperationMetadataH\x00\x12]\n\x16undeploy_model_details\x18\x19 \x01(\x0b\x32;.google.cloud.automl.v1beta1.UndeployModelOperationMetadataH\x00\x12Y\n\x14\x63reate_model_details\x18\n \x01(\x0b\x32\x39.google.cloud.automl.v1beta1.CreateModelOperationMetadataH\x00\x12W\n\x13import_data_details\x18\x0f \x01(\x0b\x32\x38.google.cloud.automl.v1beta1.ImportDataOperationMetadataH\x00\x12[\n\x15\x62\x61tch_predict_details\x18\x10 \x01(\x0b\x32:.google.cloud.automl.v1beta1.BatchPredictOperationMetadataH\x00\x12W\n\x13\x65xport_data_details\x18\x15 \x01(\x0b\x32\x38.google.cloud.automl.v1beta1.ExportDataOperationMetadataH\x00\x12Y\n\x14\x65xport_model_details\x18\x16 \x01(\x0b\x32\x39.google.cloud.automl.v1beta1.ExportModelOperationMetadataH\x00\x12r\n!export_evaluated_examples_details\x18\x1a \x01(\x0b\x32\x45.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadataH\x00\x12\x18\n\x10progress_percent\x18\r \x01(\x05\x12,\n\x10partial_failures\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\t\n\x07\x64\x65tails"\x19\n\x17\x44\x65leteOperationMetadata"\x1e\n\x1c\x44\x65ployModelOperationMetadata" \n\x1eUndeployModelOperationMetadata"\x1e\n\x1c\x43reateModelOperationMetadata"\x1d\n\x1bImportDataOperationMetadata"\xef\x01\n\x1b\x45xportDataOperationMetadata\x12\x62\n\x0boutput_info\x18\x01 \x01(\x0b\x32M.google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo\x1al\n\x14\x45xportDataOutputInfo\x12\x1e\n\x14gcs_output_directory\x18\x01 \x01(\tH\x00\x12!\n\x17\x62igquery_output_dataset\x18\x02 \x01(\tH\x00\x42\x11\n\x0foutput_location"\xc3\x02\n\x1d\x42\x61tchPredictOperationMetadata\x12J\n\x0cinput_config\x18\x01 \x01(\x0b\x32\x34.google.cloud.automl.v1beta1.BatchPredictInputConfig\x12\x66\n\x0boutput_info\x18\x02 \x01(\x0b\x32Q.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo\x1an\n\x16\x42\x61tchPredictOutputInfo\x12\x1e\n\x14gcs_output_directory\x18\x01 \x01(\tH\x00\x12!\n\x17\x62igquery_output_dataset\x18\x02 \x01(\tH\x00\x42\x11\n\x0foutput_location"\xbb\x01\n\x1c\x45xportModelOperationMetadata\x12\x64\n\x0boutput_info\x18\x02 \x01(\x0b\x32O.google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo\x1a\x35\n\x15\x45xportModelOutputInfo\x12\x1c\n\x14gcs_output_directory\x18\x01 \x01(\t"\xee\x01\n(ExportEvaluatedExamplesOperationMetadata\x12|\n\x0boutput_info\x18\x02 \x01(\x0b\x32g.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo\x1a\x44\n!ExportEvaluatedExamplesOutputInfo\x12\x1f\n\x17\x62igquery_output_dataset\x18\x02 \x01(\tB\xa5\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_io__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - ], -) - - -_OPERATIONMETADATA = _descriptor.Descriptor( - name="OperationMetadata", - full_name="google.cloud.automl.v1beta1.OperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="delete_details", - full_name="google.cloud.automl.v1beta1.OperationMetadata.delete_details", - index=0, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="deploy_model_details", - full_name="google.cloud.automl.v1beta1.OperationMetadata.deploy_model_details", - index=1, - number=24, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="undeploy_model_details", - full_name="google.cloud.automl.v1beta1.OperationMetadata.undeploy_model_details", - index=2, - number=25, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_model_details", - full_name="google.cloud.automl.v1beta1.OperationMetadata.create_model_details", - index=3, - number=10, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="import_data_details", - full_name="google.cloud.automl.v1beta1.OperationMetadata.import_data_details", - index=4, - number=15, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="batch_predict_details", - full_name="google.cloud.automl.v1beta1.OperationMetadata.batch_predict_details", - index=5, - number=16, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="export_data_details", - full_name="google.cloud.automl.v1beta1.OperationMetadata.export_data_details", - index=6, - number=21, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="export_model_details", - full_name="google.cloud.automl.v1beta1.OperationMetadata.export_model_details", - index=7, - number=22, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="export_evaluated_examples_details", - full_name="google.cloud.automl.v1beta1.OperationMetadata.export_evaluated_examples_details", - index=8, - number=26, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="progress_percent", - full_name="google.cloud.automl.v1beta1.OperationMetadata.progress_percent", - index=9, - number=13, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="partial_failures", - full_name="google.cloud.automl.v1beta1.OperationMetadata.partial_failures", - index=10, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.automl.v1beta1.OperationMetadata.create_time", - index=11, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_time", - full_name="google.cloud.automl.v1beta1.OperationMetadata.update_time", - index=12, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="details", - full_name="google.cloud.automl.v1beta1.OperationMetadata.details", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=216, - serialized_end=1251, -) - - -_DELETEOPERATIONMETADATA = _descriptor.Descriptor( - name="DeleteOperationMetadata", - full_name="google.cloud.automl.v1beta1.DeleteOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1253, - serialized_end=1278, -) - - -_DEPLOYMODELOPERATIONMETADATA = _descriptor.Descriptor( - name="DeployModelOperationMetadata", - full_name="google.cloud.automl.v1beta1.DeployModelOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1280, - serialized_end=1310, -) - - -_UNDEPLOYMODELOPERATIONMETADATA = _descriptor.Descriptor( - name="UndeployModelOperationMetadata", - full_name="google.cloud.automl.v1beta1.UndeployModelOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1312, - serialized_end=1344, -) - - -_CREATEMODELOPERATIONMETADATA = _descriptor.Descriptor( - name="CreateModelOperationMetadata", - full_name="google.cloud.automl.v1beta1.CreateModelOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1346, - serialized_end=1376, -) - - -_IMPORTDATAOPERATIONMETADATA = _descriptor.Descriptor( - name="ImportDataOperationMetadata", - full_name="google.cloud.automl.v1beta1.ImportDataOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1378, - serialized_end=1407, -) - - -_EXPORTDATAOPERATIONMETADATA_EXPORTDATAOUTPUTINFO = _descriptor.Descriptor( - name="ExportDataOutputInfo", - full_name="google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_output_directory", - full_name="google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.gcs_output_directory", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bigquery_output_dataset", - full_name="google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.bigquery_output_dataset", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="output_location", - full_name="google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.output_location", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1541, - serialized_end=1649, -) - -_EXPORTDATAOPERATIONMETADATA = _descriptor.Descriptor( - name="ExportDataOperationMetadata", - full_name="google.cloud.automl.v1beta1.ExportDataOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="output_info", - full_name="google.cloud.automl.v1beta1.ExportDataOperationMetadata.output_info", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[_EXPORTDATAOPERATIONMETADATA_EXPORTDATAOUTPUTINFO], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1410, - serialized_end=1649, -) - - -_BATCHPREDICTOPERATIONMETADATA_BATCHPREDICTOUTPUTINFO = _descriptor.Descriptor( - name="BatchPredictOutputInfo", - full_name="google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_output_directory", - full_name="google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.gcs_output_directory", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bigquery_output_dataset", - full_name="google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.bigquery_output_dataset", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="output_location", - full_name="google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.output_location", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1865, - serialized_end=1975, -) - -_BATCHPREDICTOPERATIONMETADATA = _descriptor.Descriptor( - name="BatchPredictOperationMetadata", - full_name="google.cloud.automl.v1beta1.BatchPredictOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_config", - full_name="google.cloud.automl.v1beta1.BatchPredictOperationMetadata.input_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="output_info", - full_name="google.cloud.automl.v1beta1.BatchPredictOperationMetadata.output_info", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_BATCHPREDICTOPERATIONMETADATA_BATCHPREDICTOUTPUTINFO], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1652, - serialized_end=1975, -) - - -_EXPORTMODELOPERATIONMETADATA_EXPORTMODELOUTPUTINFO = _descriptor.Descriptor( - name="ExportModelOutputInfo", - full_name="google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_output_directory", - full_name="google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo.gcs_output_directory", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2112, - serialized_end=2165, -) - -_EXPORTMODELOPERATIONMETADATA = _descriptor.Descriptor( - name="ExportModelOperationMetadata", - full_name="google.cloud.automl.v1beta1.ExportModelOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="output_info", - full_name="google.cloud.automl.v1beta1.ExportModelOperationMetadata.output_info", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[_EXPORTMODELOPERATIONMETADATA_EXPORTMODELOUTPUTINFO], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1978, - serialized_end=2165, -) - - -_EXPORTEVALUATEDEXAMPLESOPERATIONMETADATA_EXPORTEVALUATEDEXAMPLESOUTPUTINFO = _descriptor.Descriptor( - name="ExportEvaluatedExamplesOutputInfo", - full_name="google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bigquery_output_dataset", - full_name="google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo.bigquery_output_dataset", - index=0, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2338, - serialized_end=2406, -) - -_EXPORTEVALUATEDEXAMPLESOPERATIONMETADATA = _descriptor.Descriptor( - name="ExportEvaluatedExamplesOperationMetadata", - full_name="google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="output_info", - full_name="google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.output_info", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[ - _EXPORTEVALUATEDEXAMPLESOPERATIONMETADATA_EXPORTEVALUATEDEXAMPLESOUTPUTINFO - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2168, - serialized_end=2406, -) - -_OPERATIONMETADATA.fields_by_name[ - "delete_details" -].message_type = _DELETEOPERATIONMETADATA -_OPERATIONMETADATA.fields_by_name[ - "deploy_model_details" -].message_type = _DEPLOYMODELOPERATIONMETADATA -_OPERATIONMETADATA.fields_by_name[ - "undeploy_model_details" -].message_type = _UNDEPLOYMODELOPERATIONMETADATA -_OPERATIONMETADATA.fields_by_name[ - "create_model_details" -].message_type = _CREATEMODELOPERATIONMETADATA -_OPERATIONMETADATA.fields_by_name[ - "import_data_details" -].message_type = _IMPORTDATAOPERATIONMETADATA -_OPERATIONMETADATA.fields_by_name[ - "batch_predict_details" -].message_type = _BATCHPREDICTOPERATIONMETADATA -_OPERATIONMETADATA.fields_by_name[ - "export_data_details" -].message_type = _EXPORTDATAOPERATIONMETADATA -_OPERATIONMETADATA.fields_by_name[ - "export_model_details" -].message_type = _EXPORTMODELOPERATIONMETADATA -_OPERATIONMETADATA.fields_by_name[ - "export_evaluated_examples_details" -].message_type = _EXPORTEVALUATEDEXAMPLESOPERATIONMETADATA -_OPERATIONMETADATA.fields_by_name[ - "partial_failures" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_OPERATIONMETADATA.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_OPERATIONMETADATA.fields_by_name[ - "update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_OPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _OPERATIONMETADATA.fields_by_name["delete_details"] -) -_OPERATIONMETADATA.fields_by_name[ - "delete_details" -].containing_oneof = _OPERATIONMETADATA.oneofs_by_name["details"] -_OPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _OPERATIONMETADATA.fields_by_name["deploy_model_details"] -) -_OPERATIONMETADATA.fields_by_name[ - "deploy_model_details" -].containing_oneof = _OPERATIONMETADATA.oneofs_by_name["details"] -_OPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _OPERATIONMETADATA.fields_by_name["undeploy_model_details"] -) -_OPERATIONMETADATA.fields_by_name[ - "undeploy_model_details" -].containing_oneof = _OPERATIONMETADATA.oneofs_by_name["details"] -_OPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _OPERATIONMETADATA.fields_by_name["create_model_details"] -) -_OPERATIONMETADATA.fields_by_name[ - "create_model_details" -].containing_oneof = _OPERATIONMETADATA.oneofs_by_name["details"] -_OPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _OPERATIONMETADATA.fields_by_name["import_data_details"] -) -_OPERATIONMETADATA.fields_by_name[ - "import_data_details" -].containing_oneof = _OPERATIONMETADATA.oneofs_by_name["details"] -_OPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _OPERATIONMETADATA.fields_by_name["batch_predict_details"] -) -_OPERATIONMETADATA.fields_by_name[ - "batch_predict_details" -].containing_oneof = _OPERATIONMETADATA.oneofs_by_name["details"] -_OPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _OPERATIONMETADATA.fields_by_name["export_data_details"] -) -_OPERATIONMETADATA.fields_by_name[ - "export_data_details" -].containing_oneof = _OPERATIONMETADATA.oneofs_by_name["details"] -_OPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _OPERATIONMETADATA.fields_by_name["export_model_details"] -) -_OPERATIONMETADATA.fields_by_name[ - "export_model_details" -].containing_oneof = _OPERATIONMETADATA.oneofs_by_name["details"] -_OPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _OPERATIONMETADATA.fields_by_name["export_evaluated_examples_details"] -) -_OPERATIONMETADATA.fields_by_name[ - "export_evaluated_examples_details" -].containing_oneof = _OPERATIONMETADATA.oneofs_by_name["details"] -_EXPORTDATAOPERATIONMETADATA_EXPORTDATAOUTPUTINFO.containing_type = ( - _EXPORTDATAOPERATIONMETADATA -) -_EXPORTDATAOPERATIONMETADATA_EXPORTDATAOUTPUTINFO.oneofs_by_name[ - "output_location" -].fields.append( - _EXPORTDATAOPERATIONMETADATA_EXPORTDATAOUTPUTINFO.fields_by_name[ - "gcs_output_directory" - ] -) -_EXPORTDATAOPERATIONMETADATA_EXPORTDATAOUTPUTINFO.fields_by_name[ - "gcs_output_directory" -].containing_oneof = _EXPORTDATAOPERATIONMETADATA_EXPORTDATAOUTPUTINFO.oneofs_by_name[ - "output_location" -] -_EXPORTDATAOPERATIONMETADATA_EXPORTDATAOUTPUTINFO.oneofs_by_name[ - "output_location" -].fields.append( - _EXPORTDATAOPERATIONMETADATA_EXPORTDATAOUTPUTINFO.fields_by_name[ - "bigquery_output_dataset" - ] -) -_EXPORTDATAOPERATIONMETADATA_EXPORTDATAOUTPUTINFO.fields_by_name[ - "bigquery_output_dataset" -].containing_oneof = _EXPORTDATAOPERATIONMETADATA_EXPORTDATAOUTPUTINFO.oneofs_by_name[ - "output_location" -] -_EXPORTDATAOPERATIONMETADATA.fields_by_name[ - "output_info" -].message_type = _EXPORTDATAOPERATIONMETADATA_EXPORTDATAOUTPUTINFO -_BATCHPREDICTOPERATIONMETADATA_BATCHPREDICTOUTPUTINFO.containing_type = ( - _BATCHPREDICTOPERATIONMETADATA -) -_BATCHPREDICTOPERATIONMETADATA_BATCHPREDICTOUTPUTINFO.oneofs_by_name[ - "output_location" -].fields.append( - _BATCHPREDICTOPERATIONMETADATA_BATCHPREDICTOUTPUTINFO.fields_by_name[ - "gcs_output_directory" - ] -) -_BATCHPREDICTOPERATIONMETADATA_BATCHPREDICTOUTPUTINFO.fields_by_name[ - "gcs_output_directory" -].containing_oneof = _BATCHPREDICTOPERATIONMETADATA_BATCHPREDICTOUTPUTINFO.oneofs_by_name[ - "output_location" -] -_BATCHPREDICTOPERATIONMETADATA_BATCHPREDICTOUTPUTINFO.oneofs_by_name[ - "output_location" -].fields.append( - _BATCHPREDICTOPERATIONMETADATA_BATCHPREDICTOUTPUTINFO.fields_by_name[ - "bigquery_output_dataset" - ] -) -_BATCHPREDICTOPERATIONMETADATA_BATCHPREDICTOUTPUTINFO.fields_by_name[ - "bigquery_output_dataset" -].containing_oneof = _BATCHPREDICTOPERATIONMETADATA_BATCHPREDICTOUTPUTINFO.oneofs_by_name[ - "output_location" -] -_BATCHPREDICTOPERATIONMETADATA.fields_by_name[ - "input_config" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_io__pb2._BATCHPREDICTINPUTCONFIG -) -_BATCHPREDICTOPERATIONMETADATA.fields_by_name[ - "output_info" -].message_type = _BATCHPREDICTOPERATIONMETADATA_BATCHPREDICTOUTPUTINFO -_EXPORTMODELOPERATIONMETADATA_EXPORTMODELOUTPUTINFO.containing_type = ( - _EXPORTMODELOPERATIONMETADATA -) -_EXPORTMODELOPERATIONMETADATA.fields_by_name[ - "output_info" -].message_type = _EXPORTMODELOPERATIONMETADATA_EXPORTMODELOUTPUTINFO -_EXPORTEVALUATEDEXAMPLESOPERATIONMETADATA_EXPORTEVALUATEDEXAMPLESOUTPUTINFO.containing_type = ( - _EXPORTEVALUATEDEXAMPLESOPERATIONMETADATA -) -_EXPORTEVALUATEDEXAMPLESOPERATIONMETADATA.fields_by_name[ - "output_info" -].message_type = ( - _EXPORTEVALUATEDEXAMPLESOPERATIONMETADATA_EXPORTEVALUATEDEXAMPLESOUTPUTINFO -) -DESCRIPTOR.message_types_by_name["OperationMetadata"] = _OPERATIONMETADATA -DESCRIPTOR.message_types_by_name["DeleteOperationMetadata"] = _DELETEOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "DeployModelOperationMetadata" -] = _DEPLOYMODELOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "UndeployModelOperationMetadata" -] = _UNDEPLOYMODELOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "CreateModelOperationMetadata" -] = _CREATEMODELOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "ImportDataOperationMetadata" -] = _IMPORTDATAOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "ExportDataOperationMetadata" -] = _EXPORTDATAOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "BatchPredictOperationMetadata" -] = _BATCHPREDICTOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "ExportModelOperationMetadata" -] = _EXPORTMODELOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "ExportEvaluatedExamplesOperationMetadata" -] = _EXPORTEVALUATEDEXAMPLESOPERATIONMETADATA -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -OperationMetadata = _reflection.GeneratedProtocolMessageType( - "OperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_OPERATIONMETADATA, - __module__="google.cloud.automl_v1beta1.proto.operations_pb2", - __doc__="""Metadata used across all long running operations returned - by AutoML API. - - - Attributes: - details: - Ouptut only. Details of specific operation. Even if this field - is empty, the presence allows to distinguish different types - of operations. - delete_details: - Details of a Delete operation. - deploy_model_details: - Details of a DeployModel operation. - undeploy_model_details: - Details of an UndeployModel operation. - create_model_details: - Details of CreateModel operation. - import_data_details: - Details of ImportData operation. - batch_predict_details: - Details of BatchPredict operation. - export_data_details: - Details of ExportData operation. - export_model_details: - Details of ExportModel operation. - export_evaluated_examples_details: - Details of ExportEvaluatedExamples operation. - progress_percent: - Output only. Progress of operation. Range: [0, 100]. Not used - currently. - 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. - create_time: - Output only. Time when the operation was created. - update_time: - Output only. Time when the operation was updated for the last - time. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.OperationMetadata) - ), -) -_sym_db.RegisterMessage(OperationMetadata) - -DeleteOperationMetadata = _reflection.GeneratedProtocolMessageType( - "DeleteOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEOPERATIONMETADATA, - __module__="google.cloud.automl_v1beta1.proto.operations_pb2", - __doc__="""Details of operations that perform deletes of any - entities. - - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.DeleteOperationMetadata) - ), -) -_sym_db.RegisterMessage(DeleteOperationMetadata) - -DeployModelOperationMetadata = _reflection.GeneratedProtocolMessageType( - "DeployModelOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_DEPLOYMODELOPERATIONMETADATA, - __module__="google.cloud.automl_v1beta1.proto.operations_pb2", - __doc__="""Details of DeployModel operation. - - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.DeployModelOperationMetadata) - ), -) -_sym_db.RegisterMessage(DeployModelOperationMetadata) - -UndeployModelOperationMetadata = _reflection.GeneratedProtocolMessageType( - "UndeployModelOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_UNDEPLOYMODELOPERATIONMETADATA, - __module__="google.cloud.automl_v1beta1.proto.operations_pb2", - __doc__="""Details of UndeployModel operation. - - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.UndeployModelOperationMetadata) - ), -) -_sym_db.RegisterMessage(UndeployModelOperationMetadata) - -CreateModelOperationMetadata = _reflection.GeneratedProtocolMessageType( - "CreateModelOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEMODELOPERATIONMETADATA, - __module__="google.cloud.automl_v1beta1.proto.operations_pb2", - __doc__="""Details of CreateModel operation. - - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.CreateModelOperationMetadata) - ), -) -_sym_db.RegisterMessage(CreateModelOperationMetadata) - -ImportDataOperationMetadata = _reflection.GeneratedProtocolMessageType( - "ImportDataOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTDATAOPERATIONMETADATA, - __module__="google.cloud.automl_v1beta1.proto.operations_pb2", - __doc__="""Details of ImportData operation. - - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ImportDataOperationMetadata) - ), -) -_sym_db.RegisterMessage(ImportDataOperationMetadata) - -ExportDataOperationMetadata = _reflection.GeneratedProtocolMessageType( - "ExportDataOperationMetadata", - (_message.Message,), - dict( - ExportDataOutputInfo=_reflection.GeneratedProtocolMessageType( - "ExportDataOutputInfo", - (_message.Message,), - dict( - DESCRIPTOR=_EXPORTDATAOPERATIONMETADATA_EXPORTDATAOUTPUTINFO, - __module__="google.cloud.automl_v1beta1.proto.operations_pb2", - __doc__="""Further describes this export data's output. Supplements - [OutputConfig][google.cloud.automl.v1beta1.OutputConfig]. - - - Attributes: - output_location: - The output location to which the exported data is written. - gcs_output_directory: - The full path of the Google Cloud Storage directory created, - into which the exported data is written. - bigquery_output_dataset: - The path of the BigQuery dataset created, in - bq://projectId.bqDatasetId format, into which the exported - data is written. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo) - ), - ), - DESCRIPTOR=_EXPORTDATAOPERATIONMETADATA, - __module__="google.cloud.automl_v1beta1.proto.operations_pb2", - __doc__="""Details of ExportData operation. - - - Attributes: - output_info: - Output only. Information further describing this export data's - output. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ExportDataOperationMetadata) - ), -) -_sym_db.RegisterMessage(ExportDataOperationMetadata) -_sym_db.RegisterMessage(ExportDataOperationMetadata.ExportDataOutputInfo) - -BatchPredictOperationMetadata = _reflection.GeneratedProtocolMessageType( - "BatchPredictOperationMetadata", - (_message.Message,), - dict( - BatchPredictOutputInfo=_reflection.GeneratedProtocolMessageType( - "BatchPredictOutputInfo", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHPREDICTOPERATIONMETADATA_BATCHPREDICTOUTPUTINFO, - __module__="google.cloud.automl_v1beta1.proto.operations_pb2", - __doc__="""Further describes this batch predict's output. Supplements - - [BatchPredictOutputConfig][google.cloud.automl.v1beta1.BatchPredictOutputConfig]. - - - Attributes: - output_location: - The output location into which prediction output is written. - gcs_output_directory: - The full path of the Google Cloud Storage directory created, - into which the prediction output is written. - bigquery_output_dataset: - The path of the BigQuery dataset created, in - bq://projectId.bqDatasetId format, into which the prediction - output is written. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo) - ), - ), - DESCRIPTOR=_BATCHPREDICTOPERATIONMETADATA, - __module__="google.cloud.automl_v1beta1.proto.operations_pb2", - __doc__="""Details of BatchPredict operation. - - - Attributes: - input_config: - Output only. The input config that was given upon starting - this batch predict operation. - output_info: - Output only. Information further describing this batch - predict's output. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.BatchPredictOperationMetadata) - ), -) -_sym_db.RegisterMessage(BatchPredictOperationMetadata) -_sym_db.RegisterMessage(BatchPredictOperationMetadata.BatchPredictOutputInfo) - -ExportModelOperationMetadata = _reflection.GeneratedProtocolMessageType( - "ExportModelOperationMetadata", - (_message.Message,), - dict( - ExportModelOutputInfo=_reflection.GeneratedProtocolMessageType( - "ExportModelOutputInfo", - (_message.Message,), - dict( - DESCRIPTOR=_EXPORTMODELOPERATIONMETADATA_EXPORTMODELOUTPUTINFO, - __module__="google.cloud.automl_v1beta1.proto.operations_pb2", - __doc__="""Further describes the output of model export. Supplements - - [ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. - - - Attributes: - gcs_output_directory: - The full path of the Google Cloud Storage directory created, - into which the model will be exported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo) - ), - ), - DESCRIPTOR=_EXPORTMODELOPERATIONMETADATA, - __module__="google.cloud.automl_v1beta1.proto.operations_pb2", - __doc__="""Details of ExportModel operation. - - - Attributes: - output_info: - Output only. Information further describing the output of this - model export. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ExportModelOperationMetadata) - ), -) -_sym_db.RegisterMessage(ExportModelOperationMetadata) -_sym_db.RegisterMessage(ExportModelOperationMetadata.ExportModelOutputInfo) - -ExportEvaluatedExamplesOperationMetadata = _reflection.GeneratedProtocolMessageType( - "ExportEvaluatedExamplesOperationMetadata", - (_message.Message,), - dict( - ExportEvaluatedExamplesOutputInfo=_reflection.GeneratedProtocolMessageType( - "ExportEvaluatedExamplesOutputInfo", - (_message.Message,), - dict( - DESCRIPTOR=_EXPORTEVALUATEDEXAMPLESOPERATIONMETADATA_EXPORTEVALUATEDEXAMPLESOUTPUTINFO, - __module__="google.cloud.automl_v1beta1.proto.operations_pb2", - __doc__="""Further describes the output of the evaluated examples - export. Supplements - - [ExportEvaluatedExamplesOutputConfig][google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig]. - - - Attributes: - bigquery_output_dataset: - The path of the BigQuery dataset created, in - bq://projectId.bqDatasetId format, into which the output of - export evaluated examples is written. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo) - ), - ), - DESCRIPTOR=_EXPORTEVALUATEDEXAMPLESOPERATIONMETADATA, - __module__="google.cloud.automl_v1beta1.proto.operations_pb2", - __doc__="""Details of EvaluatedExamples operation. - - - Attributes: - output_info: - Output only. Information further describing the output of this - evaluated examples export. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata) - ), -) -_sym_db.RegisterMessage(ExportEvaluatedExamplesOperationMetadata) -_sym_db.RegisterMessage( - ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo -) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/operations_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/operations_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/operations_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/prediction_service.proto b/automl/google/cloud/automl_v1beta1/proto/prediction_service.proto deleted file mode 100644 index 57f1b794e716..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/prediction_service.proto +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/cloud/automl/v1beta1/annotation_payload.proto"; -import "google/cloud/automl/v1beta1/data_items.proto"; -import "google/cloud/automl/v1beta1/io.proto"; -import "google/cloud/automl/v1beta1/operations.proto"; -import "google/longrunning/operations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_outer_classname = "PredictionServiceProto"; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// AutoML Prediction API. -// -// On any input that is documented to expect a string parameter in -// snake_case or kebab-case, either of those cases is accepted. -service PredictionService { - option (google.api.default_host) = "automl.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Perform an online prediction. The prediction result will be directly - // returned in the response. - // Available for following ML problems, and their expected request payloads: - // * Image Classification - Image in .JPEG, .GIF or .PNG format, image_bytes - // up to 30MB. - // * Image Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes - // up to 30MB. - // * Text Classification - TextSnippet, content up to 60,000 characters, - // UTF-8 encoded. - // * Text Extraction - TextSnippet, content up to 30,000 characters, - // UTF-8 NFC encoded. - // * Translation - TextSnippet, content up to 25,000 characters, UTF-8 - // encoded. - // * Tables - Row, with column values matching the columns of the model, - // up to 5MB. Not available for FORECASTING - // - // [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]. - // * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 - // encoded. - rpc Predict(PredictRequest) returns (PredictResponse) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/models/*}:predict" - body: "*" - }; - } - - // Perform a batch prediction. Unlike the online - // [Predict][google.cloud.automl.v1beta1.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.v1beta1.BatchPredictResult] is - // returned in the [response][google.longrunning.Operation.response] field. - // Available for following ML problems: - // * Image Classification - // * Image Object Detection - // * Video Classification - // * Video Object Tracking * Text Extraction - // * Tables - rpc BatchPredict(BatchPredictRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/models/*}:batchPredict" - body: "*" - }; - } -} - -// Request message for -// [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict]. -message PredictRequest { - // Name of the model requested to serve the prediction. - string name = 1; - - // Required. Payload to perform a prediction on. The payload must match the - // problem type that the model was trained to solve. - ExamplePayload payload = 2; - - // Additional domain-specific parameters, any string must be up to 25000 - // characters long. - // - // * For Image 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. - // - // * For Image 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) No more than this number of bounding - // boxes will be returned in the response. Default is 100, the - // requested value may be limited by server. - // * For Tables: - // `feature_importance` - (boolean) Whether - // - // [feature_importance][[google.cloud.automl.v1beta1.TablesModelColumnInfo.feature_importance] - // should be populated in the returned - // - // [TablesAnnotation(-s)][[google.cloud.automl.v1beta1.TablesAnnotation]. - // The default is false. - map params = 3; -} - -// Response message for -// [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict]. -message PredictResponse { - // Prediction result. - // Translation and Text Sentiment will return precisely one payload. - repeated AnnotationPayload payload = 1; - - // The preprocessed example that AutoML actually makes prediction on. - // Empty if AutoML does not preprocess the input example. - // * For Text Extraction: - // If the input is a .pdf file, the OCR'ed text will be provided in - // [document_text][google.cloud.automl.v1beta1.Document.document_text]. - ExamplePayload preprocessed_input = 3; - - // Additional domain-specific prediction response metadata. - // - // * For Image Object Detection: - // `max_bounding_box_count` - (int64) At most that many bounding boxes per - // image could have been returned. - // - // * For Text Sentiment: - // `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 will be also positive (though - // the least). - // The sentiment_score shouldn't be confused with "score" or "magnitude" - // from the previous Natural Language Sentiment Analysis API. - map metadata = 2; -} - -// Request message for -// [PredictionService.BatchPredict][google.cloud.automl.v1beta1.PredictionService.BatchPredict]. -message BatchPredictRequest { - // Name of the model requested to serve the batch prediction. - string name = 1; - - // Required. The input configuration for batch prediction. - BatchPredictInputConfig input_config = 3; - - // Required. The Configuration specifying where output predictions should - // be written. - BatchPredictOutputConfig output_config = 4; - - // Additional domain-specific parameters for the predictions, any string must - // be up to 25000 characters long. - // - // * For Text 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. - // - // * For Image 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. - // - // * For Image 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) No more than this number of bounding - // boxes will be produced per image. Default is 100, the - // requested value may be limited by server. - // - // * For Video 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. - // 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. The default is "false". - // `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. - // 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. The default is - // "false". - // - // * For Video 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) No more than this number of bounding - // boxes will be returned per frame. Default is 100, the requested - // value may be limited by server. - // `min_bounding_box_size` - (float) Only bounding boxes with shortest edge - // at least that long as a relative value of video frame size will be - // returned. Value in 0 to 1 range. Default is 0. - // - map params = 5; -} - -// Result of the Batch Predict. This message is returned in -// [response][google.longrunning.Operation.response] of the operation returned -// by the -// [PredictionService.BatchPredict][google.cloud.automl.v1beta1.PredictionService.BatchPredict]. -message BatchPredictResult { - // Additional domain-specific prediction response metadata. - // - // * For Image Object Detection: - // `max_bounding_box_count` - (int64) At most that many bounding boxes per - // image could have been returned. - // - // * For Video Object Tracking: - // `max_bounding_box_count` - (int64) At most that many bounding boxes per - // frame could have been returned. - map metadata = 1; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/prediction_service_pb2.py b/automl/google/cloud/automl_v1beta1/proto/prediction_service_pb2.py deleted file mode 100644 index 751f16ef8f5b..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/prediction_service_pb2.py +++ /dev/null @@ -1,880 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/prediction_service.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.cloud.automl_v1beta1.proto import ( - annotation_payload_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_annotation__payload__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - data_items_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_data__items__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - io_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_io__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - operations_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_operations__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/prediction_service.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1B\026PredictionServiceProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n:google/cloud/automl_v1beta1/proto/prediction_service.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a:google/cloud/automl_v1beta1/proto/annotation_payload.proto\x1a\x32google/cloud/automl_v1beta1/proto/data_items.proto\x1a*google/cloud/automl_v1beta1/proto/io.proto\x1a\x32google/cloud/automl_v1beta1/proto/operations.proto\x1a#google/longrunning/operations.proto"\xd4\x01\n\x0ePredictRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12<\n\x07payload\x18\x02 \x01(\x0b\x32+.google.cloud.automl.v1beta1.ExamplePayload\x12G\n\x06params\x18\x03 \x03(\x0b\x32\x37.google.cloud.automl.v1beta1.PredictRequest.ParamsEntry\x1a-\n\x0bParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\x9a\x02\n\x0fPredictResponse\x12?\n\x07payload\x18\x01 \x03(\x0b\x32..google.cloud.automl.v1beta1.AnnotationPayload\x12G\n\x12preprocessed_input\x18\x03 \x01(\x0b\x32+.google.cloud.automl.v1beta1.ExamplePayload\x12L\n\x08metadata\x18\x02 \x03(\x0b\x32:.google.cloud.automl.v1beta1.PredictResponse.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\xba\x02\n\x13\x42\x61tchPredictRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12J\n\x0cinput_config\x18\x03 \x01(\x0b\x32\x34.google.cloud.automl.v1beta1.BatchPredictInputConfig\x12L\n\routput_config\x18\x04 \x01(\x0b\x32\x35.google.cloud.automl.v1beta1.BatchPredictOutputConfig\x12L\n\x06params\x18\x05 \x03(\x0b\x32<.google.cloud.automl.v1beta1.BatchPredictRequest.ParamsEntry\x1a-\n\x0bParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\x96\x01\n\x12\x42\x61tchPredictResult\x12O\n\x08metadata\x18\x01 \x03(\x0b\x32=.google.cloud.automl.v1beta1.BatchPredictResult.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x32\xb4\x03\n\x11PredictionService\x12\xa8\x01\n\x07Predict\x12+.google.cloud.automl.v1beta1.PredictRequest\x1a,.google.cloud.automl.v1beta1.PredictResponse"B\x82\xd3\xe4\x93\x02<"7/v1beta1/{name=projects/*/locations/*/models/*}:predict:\x01*\x12\xa8\x01\n\x0c\x42\x61tchPredict\x12\x30.google.cloud.automl.v1beta1.BatchPredictRequest\x1a\x1d.google.longrunning.Operation"G\x82\xd3\xe4\x93\x02\x41" The dataset has - // translation_dataset_metadata. - string filter = 3; - - // Requested page size. Server may return fewer results than requested. - // If unspecified, server will pick a default size. - int32 page_size = 4; - - // A token identifying a page of results for the server to return - // Typically obtained via - // [ListDatasetsResponse.next_page_token][google.cloud.automl.v1beta1.ListDatasetsResponse.next_page_token] of the previous - // [AutoMl.ListDatasets][google.cloud.automl.v1beta1.AutoMl.ListDatasets] call. - string page_token = 6; -} - -// Response message for [AutoMl.ListDatasets][google.cloud.automl.v1beta1.AutoMl.ListDatasets]. -message ListDatasetsResponse { - // The datasets read. - repeated Dataset datasets = 1; - - // A token to retrieve next page of results. - // Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1beta1.ListDatasetsRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [AutoMl.UpdateDataset][google.cloud.automl.v1beta1.AutoMl.UpdateDataset] -message UpdateDatasetRequest { - // The dataset which replaces the resource on the server. - Dataset dataset = 1; - - // The update mask applies to the resource. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for [AutoMl.DeleteDataset][google.cloud.automl.v1beta1.AutoMl.DeleteDataset]. -message DeleteDatasetRequest { - // The resource name of the dataset to delete. - string name = 1; -} - -// Request message for [AutoMl.ImportData][google.cloud.automl.v1beta1.AutoMl.ImportData]. -message ImportDataRequest { - // Required. Dataset name. Dataset must already exist. All imported - // annotations and examples will be added. - string name = 1; - - // Required. The desired input location and its domain specific semantics, - // if any. - InputConfig input_config = 3; -} - -// Request message for [AutoMl.ExportData][google.cloud.automl.v1beta1.AutoMl.ExportData]. -message ExportDataRequest { - // Required. The resource name of the dataset. - string name = 1; - - // Required. The desired output location. - OutputConfig output_config = 3; -} - -// Request message for [AutoMl.GetAnnotationSpec][google.cloud.automl.v1beta1.AutoMl.GetAnnotationSpec]. -message GetAnnotationSpecRequest { - // The resource name of the annotation spec to retrieve. - string name = 1; -} - -// Request message for [AutoMl.GetTableSpec][google.cloud.automl.v1beta1.AutoMl.GetTableSpec]. -message GetTableSpecRequest { - // The resource name of the table spec to retrieve. - string name = 1; - - // Mask specifying which fields to read. - google.protobuf.FieldMask field_mask = 2; -} - -// Request message for [AutoMl.ListTableSpecs][google.cloud.automl.v1beta1.AutoMl.ListTableSpecs]. -message ListTableSpecsRequest { - // The resource name of the dataset to list table specs from. - string parent = 1; - - // Mask specifying which fields to read. - google.protobuf.FieldMask field_mask = 2; - - // Filter expression, see go/filtering. - string filter = 3; - - // Requested page size. The server can return fewer results than requested. - // If unspecified, the server will pick a default size. - int32 page_size = 4; - - // A token identifying a page of results for the server to return. - // Typically obtained from the - // [ListTableSpecsResponse.next_page_token][google.cloud.automl.v1beta1.ListTableSpecsResponse.next_page_token] field of the previous - // [AutoMl.ListTableSpecs][google.cloud.automl.v1beta1.AutoMl.ListTableSpecs] call. - string page_token = 6; -} - -// Response message for [AutoMl.ListTableSpecs][google.cloud.automl.v1beta1.AutoMl.ListTableSpecs]. -message ListTableSpecsResponse { - // The table specs read. - repeated TableSpec table_specs = 1; - - // A token to retrieve next page of results. - // Pass to [ListTableSpecsRequest.page_token][google.cloud.automl.v1beta1.ListTableSpecsRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [AutoMl.UpdateTableSpec][google.cloud.automl.v1beta1.AutoMl.UpdateTableSpec] -message UpdateTableSpecRequest { - // The table spec which replaces the resource on the server. - TableSpec table_spec = 1; - - // The update mask applies to the resource. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for [AutoMl.GetColumnSpec][google.cloud.automl.v1beta1.AutoMl.GetColumnSpec]. -message GetColumnSpecRequest { - // The resource name of the column spec to retrieve. - string name = 1; - - // Mask specifying which fields to read. - google.protobuf.FieldMask field_mask = 2; -} - -// Request message for [AutoMl.ListColumnSpecs][google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs]. -message ListColumnSpecsRequest { - // The resource name of the table spec to list column specs from. - string parent = 1; - - // Mask specifying which fields to read. - google.protobuf.FieldMask field_mask = 2; - - // Filter expression, see go/filtering. - string filter = 3; - - // Requested page size. The server can return fewer results than requested. - // If unspecified, the server will pick a default size. - int32 page_size = 4; - - // A token identifying a page of results for the server to return. - // Typically obtained from the - // [ListColumnSpecsResponse.next_page_token][google.cloud.automl.v1beta1.ListColumnSpecsResponse.next_page_token] field of the previous - // [AutoMl.ListColumnSpecs][google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs] call. - string page_token = 6; -} - -// Response message for [AutoMl.ListColumnSpecs][google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs]. -message ListColumnSpecsResponse { - // The column specs read. - repeated ColumnSpec column_specs = 1; - - // A token to retrieve next page of results. - // Pass to [ListColumnSpecsRequest.page_token][google.cloud.automl.v1beta1.ListColumnSpecsRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [AutoMl.UpdateColumnSpec][google.cloud.automl.v1beta1.AutoMl.UpdateColumnSpec] -message UpdateColumnSpecRequest { - // The column spec which replaces the resource on the server. - ColumnSpec column_spec = 1; - - // The update mask applies to the resource. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for [AutoMl.CreateModel][google.cloud.automl.v1beta1.AutoMl.CreateModel]. -message CreateModelRequest { - // Resource name of the parent project where the model is being created. - string parent = 1; - - // The model to create. - Model model = 4; -} - -// Request message for [AutoMl.GetModel][google.cloud.automl.v1beta1.AutoMl.GetModel]. -message GetModelRequest { - // Resource name of the model. - string name = 1; -} - -// Request message for [AutoMl.ListModels][google.cloud.automl.v1beta1.AutoMl.ListModels]. -message ListModelsRequest { - // Resource name of the project, from which to list the models. - string parent = 1; - - // 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. - string filter = 3; - - // Requested page size. - int32 page_size = 4; - - // A token identifying a page of results for the server to return - // Typically obtained via - // [ListModelsResponse.next_page_token][google.cloud.automl.v1beta1.ListModelsResponse.next_page_token] of the previous - // [AutoMl.ListModels][google.cloud.automl.v1beta1.AutoMl.ListModels] call. - string page_token = 6; -} - -// Response message for [AutoMl.ListModels][google.cloud.automl.v1beta1.AutoMl.ListModels]. -message ListModelsResponse { - // List of models in the requested page. - repeated Model model = 1; - - // A token to retrieve next page of results. - // Pass to [ListModelsRequest.page_token][google.cloud.automl.v1beta1.ListModelsRequest.page_token] to obtain that page. - string next_page_token = 2; -} - -// Request message for [AutoMl.DeleteModel][google.cloud.automl.v1beta1.AutoMl.DeleteModel]. -message DeleteModelRequest { - // Resource name of the model being deleted. - string name = 1; -} - -// Request message for [AutoMl.DeployModel][google.cloud.automl.v1beta1.AutoMl.DeployModel]. -message DeployModelRequest { - // The per-domain specific deployment parameters. - oneof model_deployment_metadata { - // Model deployment metadata specific to Image Object Detection. - ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; - // Model deployment metadata specific to Image Classification. - ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; - } - - // Resource name of the model to deploy. - string name = 1; -} - -// Request message for [AutoMl.UndeployModel][google.cloud.automl.v1beta1.AutoMl.UndeployModel]. -message UndeployModelRequest { - // Resource name of the model to undeploy. - string name = 1; -} - -// Request message for [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]. -// Models need to be enabled for exporting, otherwise an error code will be -// returned. -message ExportModelRequest { - // Required. The resource name of the model to export. - string name = 1; - - // Required. The desired output location and configuration. - ModelExportOutputConfig output_config = 3; -} - -// Request message for [AutoMl.ExportEvaluatedExamples][google.cloud.automl.v1beta1.AutoMl.ExportEvaluatedExamples]. -message ExportEvaluatedExamplesRequest { - // Required. The resource name of the model whose evaluated examples are to - // be exported. - string name = 1; - - // Required. The desired output location and configuration. - ExportEvaluatedExamplesOutputConfig output_config = 3; -} - -// Request message for [AutoMl.GetModelEvaluation][google.cloud.automl.v1beta1.AutoMl.GetModelEvaluation]. -message GetModelEvaluationRequest { - // Resource name for the model evaluation. - string name = 1; -} - -// Request message for [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations]. -message ListModelEvaluationsRequest { - // 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. - string parent = 1; - - // 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. - string filter = 3; - - // Requested page size. - int32 page_size = 4; - - // A token identifying a page of results for the server to return. - // Typically obtained via - // [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1beta1.ListModelEvaluationsResponse.next_page_token] of the previous - // [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations] call. - string page_token = 6; -} - -// Response message for [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations]. -message ListModelEvaluationsResponse { - // List of model evaluations in the requested page. - repeated ModelEvaluation model_evaluation = 1; - - // A token to retrieve next page of results. - // Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1beta1.ListModelEvaluationsRequest.page_token] field of a new - // [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations] request to obtain that page. - string next_page_token = 2; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/service_pb2.py b/automl/google/cloud/automl_v1beta1/proto/service_pb2.py deleted file mode 100644 index 5c963ee30897..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/service_pb2.py +++ /dev/null @@ -1,2973 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/service.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.cloud.automl_v1beta1.proto import ( - annotation_payload_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_annotation__payload__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - annotation_spec_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_annotation__spec__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - column_spec_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_column__spec__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - dataset_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_dataset__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - image_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_image__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - io_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_io__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - model_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_model__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - model_evaluation_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_model__evaluation__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - operations_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_operations__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - table_spec_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_table__spec__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/service.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1B\013AutoMlProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n/google/cloud/automl_v1beta1/proto/service.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a:google/cloud/automl_v1beta1/proto/annotation_payload.proto\x1a\x37google/cloud/automl_v1beta1/proto/annotation_spec.proto\x1a\x33google/cloud/automl_v1beta1/proto/column_spec.proto\x1a/google/cloud/automl_v1beta1/proto/dataset.proto\x1a-google/cloud/automl_v1beta1/proto/image.proto\x1a*google/cloud/automl_v1beta1/proto/io.proto\x1a-google/cloud/automl_v1beta1/proto/model.proto\x1a\x38google/cloud/automl_v1beta1/proto/model_evaluation.proto\x1a\x32google/cloud/automl_v1beta1/proto/operations.proto\x1a\x32google/cloud/automl_v1beta1/proto/table_spec.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/api/client.proto"]\n\x14\x43reateDatasetRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x35\n\x07\x64\x61taset\x18\x02 \x01(\x0b\x32$.google.cloud.automl.v1beta1.Dataset"!\n\x11GetDatasetRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"\\\n\x13ListDatasetsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\t"g\n\x14ListDatasetsResponse\x12\x36\n\x08\x64\x61tasets\x18\x01 \x03(\x0b\x32$.google.cloud.automl.v1beta1.Dataset\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"~\n\x14UpdateDatasetRequest\x12\x35\n\x07\x64\x61taset\x18\x01 \x01(\x0b\x32$.google.cloud.automl.v1beta1.Dataset\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"$\n\x14\x44\x65leteDatasetRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"a\n\x11ImportDataRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12>\n\x0cinput_config\x18\x03 \x01(\x0b\x32(.google.cloud.automl.v1beta1.InputConfig"c\n\x11\x45xportDataRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12@\n\routput_config\x18\x03 \x01(\x0b\x32).google.cloud.automl.v1beta1.OutputConfig"(\n\x18GetAnnotationSpecRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"S\n\x13GetTableSpecRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12.\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"\x8e\x01\n\x15ListTableSpecsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12.\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x0e\n\x06\x66ilter\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\t"n\n\x16ListTableSpecsResponse\x12;\n\x0btable_specs\x18\x01 \x03(\x0b\x32&.google.cloud.automl.v1beta1.TableSpec\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\x85\x01\n\x16UpdateTableSpecRequest\x12:\n\ntable_spec\x18\x01 \x01(\x0b\x32&.google.cloud.automl.v1beta1.TableSpec\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"T\n\x14GetColumnSpecRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12.\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"\x8f\x01\n\x16ListColumnSpecsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12.\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x0e\n\x06\x66ilter\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\t"q\n\x17ListColumnSpecsResponse\x12=\n\x0c\x63olumn_specs\x18\x01 \x03(\x0b\x32\'.google.cloud.automl.v1beta1.ColumnSpec\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\x88\x01\n\x17UpdateColumnSpecRequest\x12<\n\x0b\x63olumn_spec\x18\x01 \x01(\x0b\x32\'.google.cloud.automl.v1beta1.ColumnSpec\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"W\n\x12\x43reateModelRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x31\n\x05model\x18\x04 \x01(\x0b\x32".google.cloud.automl.v1beta1.Model"\x1f\n\x0fGetModelRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"Z\n\x11ListModelsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\t"`\n\x12ListModelsResponse\x12\x31\n\x05model\x18\x01 \x03(\x0b\x32".google.cloud.automl.v1beta1.Model\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t""\n\x12\x44\x65leteModelRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"\xca\x02\n\x12\x44\x65ployModelRequest\x12\x84\x01\n0image_object_detection_model_deployment_metadata\x18\x02 \x01(\x0b\x32H.google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadataH\x00\x12\x81\x01\n.image_classification_model_deployment_metadata\x18\x04 \x01(\x0b\x32G.google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadataH\x00\x12\x0c\n\x04name\x18\x01 \x01(\tB\x1b\n\x19model_deployment_metadata"$\n\x14UndeployModelRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"o\n\x12\x45xportModelRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12K\n\routput_config\x18\x03 \x01(\x0b\x32\x34.google.cloud.automl.v1beta1.ModelExportOutputConfig"\x87\x01\n\x1e\x45xportEvaluatedExamplesRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12W\n\routput_config\x18\x03 \x01(\x0b\x32@.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig")\n\x19GetModelEvaluationRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"d\n\x1bListModelEvaluationsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\t"\x7f\n\x1cListModelEvaluationsResponse\x12\x46\n\x10model_evaluation\x18\x01 \x03(\x0b\x32,.google.cloud.automl.v1beta1.ModelEvaluation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xd9"\n\x06\x41utoMl\x12\xac\x01\n\rCreateDataset\x12\x31.google.cloud.automl.v1beta1.CreateDatasetRequest\x1a$.google.cloud.automl.v1beta1.Dataset"B\x82\xd3\xe4\x93\x02<"1/v1beta1/{parent=projects/*/locations/*}/datasets:\x07\x64\x61taset\x12\x9d\x01\n\nGetDataset\x12..google.cloud.automl.v1beta1.GetDatasetRequest\x1a$.google.cloud.automl.v1beta1.Dataset"9\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta1/{name=projects/*/locations/*/datasets/*}\x12\xae\x01\n\x0cListDatasets\x12\x30.google.cloud.automl.v1beta1.ListDatasetsRequest\x1a\x31.google.cloud.automl.v1beta1.ListDatasetsResponse"9\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta1/{parent=projects/*/locations/*}/datasets\x12\xb4\x01\n\rUpdateDataset\x12\x31.google.cloud.automl.v1beta1.UpdateDatasetRequest\x1a$.google.cloud.automl.v1beta1.Dataset"J\x82\xd3\xe4\x93\x02\x44\x32\x39/v1beta1/{dataset.name=projects/*/locations/*/datasets/*}:\x07\x64\x61taset\x12\x9c\x01\n\rDeleteDataset\x12\x31.google.cloud.automl.v1beta1.DeleteDatasetRequest\x1a\x1d.google.longrunning.Operation"9\x82\xd3\xe4\x93\x02\x33*1/v1beta1/{name=projects/*/locations/*/datasets/*}\x12\xa4\x01\n\nImportData\x12..google.cloud.automl.v1beta1.ImportDataRequest\x1a\x1d.google.longrunning.Operation"G\x82\xd3\xe4\x93\x02\x41"/v1beta1/{name=projects/*/locations/*/datasets/*/tableSpecs/*}\x12\xc1\x01\n\x0eListTableSpecs\x12\x32.google.cloud.automl.v1beta1.ListTableSpecsRequest\x1a\x33.google.cloud.automl.v1beta1.ListTableSpecsResponse"F\x82\xd3\xe4\x93\x02@\x12>/v1beta1/{parent=projects/*/locations/*/datasets/*}/tableSpecs\x12\xcd\x01\n\x0fUpdateTableSpec\x12\x33.google.cloud.automl.v1beta1.UpdateTableSpecRequest\x1a&.google.cloud.automl.v1beta1.TableSpec"]\x82\xd3\xe4\x93\x02W2I/v1beta1/{table_spec.name=projects/*/locations/*/datasets/*/tableSpecs/*}:\ntable_spec\x12\xc1\x01\n\rGetColumnSpec\x12\x31.google.cloud.automl.v1beta1.GetColumnSpecRequest\x1a\'.google.cloud.automl.v1beta1.ColumnSpec"T\x82\xd3\xe4\x93\x02N\x12L/v1beta1/{name=projects/*/locations/*/datasets/*/tableSpecs/*/columnSpecs/*}\x12\xd2\x01\n\x0fListColumnSpecs\x12\x33.google.cloud.automl.v1beta1.ListColumnSpecsRequest\x1a\x34.google.cloud.automl.v1beta1.ListColumnSpecsResponse"T\x82\xd3\xe4\x93\x02N\x12L/v1beta1/{parent=projects/*/locations/*/datasets/*/tableSpecs/*}/columnSpecs\x12\xe0\x01\n\x10UpdateColumnSpec\x12\x34.google.cloud.automl.v1beta1.UpdateColumnSpecRequest\x1a\'.google.cloud.automl.v1beta1.ColumnSpec"m\x82\xd3\xe4\x93\x02g2X/v1beta1/{column_spec.name=projects/*/locations/*/datasets/*/tableSpecs/*/columnSpecs/*}:\x0b\x63olumn_spec\x12\x9d\x01\n\x0b\x43reateModel\x12/.google.cloud.automl.v1beta1.CreateModelRequest\x1a\x1d.google.longrunning.Operation">\x82\xd3\xe4\x93\x02\x38"//v1beta1/{parent=projects/*/locations/*}/models:\x05model\x12\x95\x01\n\x08GetModel\x12,.google.cloud.automl.v1beta1.GetModelRequest\x1a".google.cloud.automl.v1beta1.Model"7\x82\xd3\xe4\x93\x02\x31\x12//v1beta1/{name=projects/*/locations/*/models/*}\x12\xa6\x01\n\nListModels\x12..google.cloud.automl.v1beta1.ListModelsRequest\x1a/.google.cloud.automl.v1beta1.ListModelsResponse"7\x82\xd3\xe4\x93\x02\x31\x12//v1beta1/{parent=projects/*/locations/*}/models\x12\x96\x01\n\x0b\x44\x65leteModel\x12/.google.cloud.automl.v1beta1.DeleteModelRequest\x1a\x1d.google.longrunning.Operation"7\x82\xd3\xe4\x93\x02\x31*//v1beta1/{name=projects/*/locations/*/models/*}\x12\xa0\x01\n\x0b\x44\x65ployModel\x12/.google.cloud.automl.v1beta1.DeployModelRequest\x1a\x1d.google.longrunning.Operation"A\x82\xd3\xe4\x93\x02;"6/v1beta1/{name=projects/*/locations/*/models/*}:deploy:\x01*\x12\xa6\x01\n\rUndeployModel\x12\x31.google.cloud.automl.v1beta1.UndeployModelRequest\x1a\x1d.google.longrunning.Operation"C\x82\xd3\xe4\x93\x02="8/v1beta1/{name=projects/*/locations/*/models/*}:undeploy:\x01*\x12\xa0\x01\n\x0b\x45xportModel\x12/.google.cloud.automl.v1beta1.ExportModelRequest\x1a\x1d.google.longrunning.Operation"A\x82\xd3\xe4\x93\x02;"6/v1beta1/{name=projects/*/locations/*/models/*}:export:\x01*\x12\xc9\x01\n\x17\x45xportEvaluatedExamples\x12;.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest\x1a\x1d.google.longrunning.Operation"R\x82\xd3\xe4\x93\x02L"G/v1beta1/{name=projects/*/locations/*/models/*}:exportEvaluatedExamples:\x01*\x12\xc6\x01\n\x12GetModelEvaluation\x12\x36.google.cloud.automl.v1beta1.GetModelEvaluationRequest\x1a,.google.cloud.automl.v1beta1.ModelEvaluation"J\x82\xd3\xe4\x93\x02\x44\x12\x42/v1beta1/{name=projects/*/locations/*/models/*/modelEvaluations/*}\x12\xd7\x01\n\x14ListModelEvaluations\x12\x38.google.cloud.automl.v1beta1.ListModelEvaluationsRequest\x1a\x39.google.cloud.automl.v1beta1.ListModelEvaluationsResponse"J\x82\xd3\xe4\x93\x02\x44\x12\x42/v1beta1/{parent=projects/*/locations/*/models/*}/modelEvaluations\x1aI\xca\x41\x15\x61utoml.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb2\x01\n\x1f\x63om.google.cloud.automl.v1beta1B\x0b\x41utoMlProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_annotation__payload__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_annotation__spec__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_column__spec__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_dataset__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_image__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_io__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_model__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_model__evaluation__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_operations__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_table__spec__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - ], -) - - -_CREATEDATASETREQUEST = _descriptor.Descriptor( - name="CreateDatasetRequest", - full_name="google.cloud.automl.v1beta1.CreateDatasetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.automl.v1beta1.CreateDatasetRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="dataset", - full_name="google.cloud.automl.v1beta1.CreateDatasetRequest.dataset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=725, - serialized_end=818, -) - - -_GETDATASETREQUEST = _descriptor.Descriptor( - name="GetDatasetRequest", - full_name="google.cloud.automl.v1beta1.GetDatasetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.GetDatasetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=820, - serialized_end=853, -) - - -_LISTDATASETSREQUEST = _descriptor.Descriptor( - name="ListDatasetsRequest", - full_name="google.cloud.automl.v1beta1.ListDatasetsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.automl.v1beta1.ListDatasetsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.automl.v1beta1.ListDatasetsRequest.filter", - index=1, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.automl.v1beta1.ListDatasetsRequest.page_size", - index=2, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.automl.v1beta1.ListDatasetsRequest.page_token", - index=3, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=855, - serialized_end=947, -) - - -_LISTDATASETSRESPONSE = _descriptor.Descriptor( - name="ListDatasetsResponse", - full_name="google.cloud.automl.v1beta1.ListDatasetsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="datasets", - full_name="google.cloud.automl.v1beta1.ListDatasetsResponse.datasets", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.automl.v1beta1.ListDatasetsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=949, - serialized_end=1052, -) - - -_UPDATEDATASETREQUEST = _descriptor.Descriptor( - name="UpdateDatasetRequest", - full_name="google.cloud.automl.v1beta1.UpdateDatasetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="dataset", - full_name="google.cloud.automl.v1beta1.UpdateDatasetRequest.dataset", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.automl.v1beta1.UpdateDatasetRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1054, - serialized_end=1180, -) - - -_DELETEDATASETREQUEST = _descriptor.Descriptor( - name="DeleteDatasetRequest", - full_name="google.cloud.automl.v1beta1.DeleteDatasetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.DeleteDatasetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1182, - serialized_end=1218, -) - - -_IMPORTDATAREQUEST = _descriptor.Descriptor( - name="ImportDataRequest", - full_name="google.cloud.automl.v1beta1.ImportDataRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.ImportDataRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="input_config", - full_name="google.cloud.automl.v1beta1.ImportDataRequest.input_config", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1220, - serialized_end=1317, -) - - -_EXPORTDATAREQUEST = _descriptor.Descriptor( - name="ExportDataRequest", - full_name="google.cloud.automl.v1beta1.ExportDataRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.ExportDataRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="output_config", - full_name="google.cloud.automl.v1beta1.ExportDataRequest.output_config", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1319, - serialized_end=1418, -) - - -_GETANNOTATIONSPECREQUEST = _descriptor.Descriptor( - name="GetAnnotationSpecRequest", - full_name="google.cloud.automl.v1beta1.GetAnnotationSpecRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.GetAnnotationSpecRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1420, - serialized_end=1460, -) - - -_GETTABLESPECREQUEST = _descriptor.Descriptor( - name="GetTableSpecRequest", - full_name="google.cloud.automl.v1beta1.GetTableSpecRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.GetTableSpecRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="field_mask", - full_name="google.cloud.automl.v1beta1.GetTableSpecRequest.field_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1462, - serialized_end=1545, -) - - -_LISTTABLESPECSREQUEST = _descriptor.Descriptor( - name="ListTableSpecsRequest", - full_name="google.cloud.automl.v1beta1.ListTableSpecsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.automl.v1beta1.ListTableSpecsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="field_mask", - full_name="google.cloud.automl.v1beta1.ListTableSpecsRequest.field_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.automl.v1beta1.ListTableSpecsRequest.filter", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.automl.v1beta1.ListTableSpecsRequest.page_size", - index=3, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.automl.v1beta1.ListTableSpecsRequest.page_token", - index=4, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1548, - serialized_end=1690, -) - - -_LISTTABLESPECSRESPONSE = _descriptor.Descriptor( - name="ListTableSpecsResponse", - full_name="google.cloud.automl.v1beta1.ListTableSpecsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="table_specs", - full_name="google.cloud.automl.v1beta1.ListTableSpecsResponse.table_specs", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.automl.v1beta1.ListTableSpecsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1692, - serialized_end=1802, -) - - -_UPDATETABLESPECREQUEST = _descriptor.Descriptor( - name="UpdateTableSpecRequest", - full_name="google.cloud.automl.v1beta1.UpdateTableSpecRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="table_spec", - full_name="google.cloud.automl.v1beta1.UpdateTableSpecRequest.table_spec", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.automl.v1beta1.UpdateTableSpecRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1805, - serialized_end=1938, -) - - -_GETCOLUMNSPECREQUEST = _descriptor.Descriptor( - name="GetColumnSpecRequest", - full_name="google.cloud.automl.v1beta1.GetColumnSpecRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.GetColumnSpecRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="field_mask", - full_name="google.cloud.automl.v1beta1.GetColumnSpecRequest.field_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1940, - serialized_end=2024, -) - - -_LISTCOLUMNSPECSREQUEST = _descriptor.Descriptor( - name="ListColumnSpecsRequest", - full_name="google.cloud.automl.v1beta1.ListColumnSpecsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.automl.v1beta1.ListColumnSpecsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="field_mask", - full_name="google.cloud.automl.v1beta1.ListColumnSpecsRequest.field_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.automl.v1beta1.ListColumnSpecsRequest.filter", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.automl.v1beta1.ListColumnSpecsRequest.page_size", - index=3, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.automl.v1beta1.ListColumnSpecsRequest.page_token", - index=4, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2027, - serialized_end=2170, -) - - -_LISTCOLUMNSPECSRESPONSE = _descriptor.Descriptor( - name="ListColumnSpecsResponse", - full_name="google.cloud.automl.v1beta1.ListColumnSpecsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="column_specs", - full_name="google.cloud.automl.v1beta1.ListColumnSpecsResponse.column_specs", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.automl.v1beta1.ListColumnSpecsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2172, - serialized_end=2285, -) - - -_UPDATECOLUMNSPECREQUEST = _descriptor.Descriptor( - name="UpdateColumnSpecRequest", - full_name="google.cloud.automl.v1beta1.UpdateColumnSpecRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="column_spec", - full_name="google.cloud.automl.v1beta1.UpdateColumnSpecRequest.column_spec", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.automl.v1beta1.UpdateColumnSpecRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2288, - serialized_end=2424, -) - - -_CREATEMODELREQUEST = _descriptor.Descriptor( - name="CreateModelRequest", - full_name="google.cloud.automl.v1beta1.CreateModelRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.automl.v1beta1.CreateModelRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.automl.v1beta1.CreateModelRequest.model", - index=1, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2426, - serialized_end=2513, -) - - -_GETMODELREQUEST = _descriptor.Descriptor( - name="GetModelRequest", - full_name="google.cloud.automl.v1beta1.GetModelRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.GetModelRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2515, - serialized_end=2546, -) - - -_LISTMODELSREQUEST = _descriptor.Descriptor( - name="ListModelsRequest", - full_name="google.cloud.automl.v1beta1.ListModelsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.automl.v1beta1.ListModelsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.automl.v1beta1.ListModelsRequest.filter", - index=1, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.automl.v1beta1.ListModelsRequest.page_size", - index=2, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.automl.v1beta1.ListModelsRequest.page_token", - index=3, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2548, - serialized_end=2638, -) - - -_LISTMODELSRESPONSE = _descriptor.Descriptor( - name="ListModelsResponse", - full_name="google.cloud.automl.v1beta1.ListModelsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.automl.v1beta1.ListModelsResponse.model", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.automl.v1beta1.ListModelsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2640, - serialized_end=2736, -) - - -_DELETEMODELREQUEST = _descriptor.Descriptor( - name="DeleteModelRequest", - full_name="google.cloud.automl.v1beta1.DeleteModelRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.DeleteModelRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2738, - serialized_end=2772, -) - - -_DEPLOYMODELREQUEST = _descriptor.Descriptor( - name="DeployModelRequest", - full_name="google.cloud.automl.v1beta1.DeployModelRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="image_object_detection_model_deployment_metadata", - full_name="google.cloud.automl.v1beta1.DeployModelRequest.image_object_detection_model_deployment_metadata", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_classification_model_deployment_metadata", - full_name="google.cloud.automl.v1beta1.DeployModelRequest.image_classification_model_deployment_metadata", - index=1, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.DeployModelRequest.name", - index=2, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="model_deployment_metadata", - full_name="google.cloud.automl.v1beta1.DeployModelRequest.model_deployment_metadata", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=2775, - serialized_end=3105, -) - - -_UNDEPLOYMODELREQUEST = _descriptor.Descriptor( - name="UndeployModelRequest", - full_name="google.cloud.automl.v1beta1.UndeployModelRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.UndeployModelRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3107, - serialized_end=3143, -) - - -_EXPORTMODELREQUEST = _descriptor.Descriptor( - name="ExportModelRequest", - full_name="google.cloud.automl.v1beta1.ExportModelRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.ExportModelRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="output_config", - full_name="google.cloud.automl.v1beta1.ExportModelRequest.output_config", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3145, - serialized_end=3256, -) - - -_EXPORTEVALUATEDEXAMPLESREQUEST = _descriptor.Descriptor( - name="ExportEvaluatedExamplesRequest", - full_name="google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="output_config", - full_name="google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest.output_config", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3259, - serialized_end=3394, -) - - -_GETMODELEVALUATIONREQUEST = _descriptor.Descriptor( - name="GetModelEvaluationRequest", - full_name="google.cloud.automl.v1beta1.GetModelEvaluationRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.GetModelEvaluationRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3396, - serialized_end=3437, -) - - -_LISTMODELEVALUATIONSREQUEST = _descriptor.Descriptor( - name="ListModelEvaluationsRequest", - full_name="google.cloud.automl.v1beta1.ListModelEvaluationsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.automl.v1beta1.ListModelEvaluationsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.automl.v1beta1.ListModelEvaluationsRequest.filter", - index=1, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.automl.v1beta1.ListModelEvaluationsRequest.page_size", - index=2, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.automl.v1beta1.ListModelEvaluationsRequest.page_token", - index=3, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3439, - serialized_end=3539, -) - - -_LISTMODELEVALUATIONSRESPONSE = _descriptor.Descriptor( - name="ListModelEvaluationsResponse", - full_name="google.cloud.automl.v1beta1.ListModelEvaluationsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="model_evaluation", - full_name="google.cloud.automl.v1beta1.ListModelEvaluationsResponse.model_evaluation", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.automl.v1beta1.ListModelEvaluationsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3541, - serialized_end=3668, -) - -_CREATEDATASETREQUEST.fields_by_name[ - "dataset" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_dataset__pb2._DATASET -) -_LISTDATASETSRESPONSE.fields_by_name[ - "datasets" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_dataset__pb2._DATASET -) -_UPDATEDATASETREQUEST.fields_by_name[ - "dataset" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_dataset__pb2._DATASET -) -_UPDATEDATASETREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_IMPORTDATAREQUEST.fields_by_name[ - "input_config" -].message_type = google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_io__pb2._INPUTCONFIG -_EXPORTDATAREQUEST.fields_by_name[ - "output_config" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_io__pb2._OUTPUTCONFIG -) -_GETTABLESPECREQUEST.fields_by_name[ - "field_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_LISTTABLESPECSREQUEST.fields_by_name[ - "field_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_LISTTABLESPECSRESPONSE.fields_by_name[ - "table_specs" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_table__spec__pb2._TABLESPEC -) -_UPDATETABLESPECREQUEST.fields_by_name[ - "table_spec" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_table__spec__pb2._TABLESPEC -) -_UPDATETABLESPECREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_GETCOLUMNSPECREQUEST.fields_by_name[ - "field_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_LISTCOLUMNSPECSREQUEST.fields_by_name[ - "field_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_LISTCOLUMNSPECSRESPONSE.fields_by_name[ - "column_specs" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_column__spec__pb2._COLUMNSPEC -) -_UPDATECOLUMNSPECREQUEST.fields_by_name[ - "column_spec" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_column__spec__pb2._COLUMNSPEC -) -_UPDATECOLUMNSPECREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_CREATEMODELREQUEST.fields_by_name[ - "model" -].message_type = google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_model__pb2._MODEL -_LISTMODELSRESPONSE.fields_by_name[ - "model" -].message_type = google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_model__pb2._MODEL -_DEPLOYMODELREQUEST.fields_by_name[ - "image_object_detection_model_deployment_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_image__pb2._IMAGEOBJECTDETECTIONMODELDEPLOYMENTMETADATA -) -_DEPLOYMODELREQUEST.fields_by_name[ - "image_classification_model_deployment_metadata" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_image__pb2._IMAGECLASSIFICATIONMODELDEPLOYMENTMETADATA -) -_DEPLOYMODELREQUEST.oneofs_by_name["model_deployment_metadata"].fields.append( - _DEPLOYMODELREQUEST.fields_by_name[ - "image_object_detection_model_deployment_metadata" - ] -) -_DEPLOYMODELREQUEST.fields_by_name[ - "image_object_detection_model_deployment_metadata" -].containing_oneof = _DEPLOYMODELREQUEST.oneofs_by_name["model_deployment_metadata"] -_DEPLOYMODELREQUEST.oneofs_by_name["model_deployment_metadata"].fields.append( - _DEPLOYMODELREQUEST.fields_by_name["image_classification_model_deployment_metadata"] -) -_DEPLOYMODELREQUEST.fields_by_name[ - "image_classification_model_deployment_metadata" -].containing_oneof = _DEPLOYMODELREQUEST.oneofs_by_name["model_deployment_metadata"] -_EXPORTMODELREQUEST.fields_by_name[ - "output_config" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_io__pb2._MODELEXPORTOUTPUTCONFIG -) -_EXPORTEVALUATEDEXAMPLESREQUEST.fields_by_name[ - "output_config" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_io__pb2._EXPORTEVALUATEDEXAMPLESOUTPUTCONFIG -) -_LISTMODELEVALUATIONSRESPONSE.fields_by_name[ - "model_evaluation" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_model__evaluation__pb2._MODELEVALUATION -) -DESCRIPTOR.message_types_by_name["CreateDatasetRequest"] = _CREATEDATASETREQUEST -DESCRIPTOR.message_types_by_name["GetDatasetRequest"] = _GETDATASETREQUEST -DESCRIPTOR.message_types_by_name["ListDatasetsRequest"] = _LISTDATASETSREQUEST -DESCRIPTOR.message_types_by_name["ListDatasetsResponse"] = _LISTDATASETSRESPONSE -DESCRIPTOR.message_types_by_name["UpdateDatasetRequest"] = _UPDATEDATASETREQUEST -DESCRIPTOR.message_types_by_name["DeleteDatasetRequest"] = _DELETEDATASETREQUEST -DESCRIPTOR.message_types_by_name["ImportDataRequest"] = _IMPORTDATAREQUEST -DESCRIPTOR.message_types_by_name["ExportDataRequest"] = _EXPORTDATAREQUEST -DESCRIPTOR.message_types_by_name["GetAnnotationSpecRequest"] = _GETANNOTATIONSPECREQUEST -DESCRIPTOR.message_types_by_name["GetTableSpecRequest"] = _GETTABLESPECREQUEST -DESCRIPTOR.message_types_by_name["ListTableSpecsRequest"] = _LISTTABLESPECSREQUEST -DESCRIPTOR.message_types_by_name["ListTableSpecsResponse"] = _LISTTABLESPECSRESPONSE -DESCRIPTOR.message_types_by_name["UpdateTableSpecRequest"] = _UPDATETABLESPECREQUEST -DESCRIPTOR.message_types_by_name["GetColumnSpecRequest"] = _GETCOLUMNSPECREQUEST -DESCRIPTOR.message_types_by_name["ListColumnSpecsRequest"] = _LISTCOLUMNSPECSREQUEST -DESCRIPTOR.message_types_by_name["ListColumnSpecsResponse"] = _LISTCOLUMNSPECSRESPONSE -DESCRIPTOR.message_types_by_name["UpdateColumnSpecRequest"] = _UPDATECOLUMNSPECREQUEST -DESCRIPTOR.message_types_by_name["CreateModelRequest"] = _CREATEMODELREQUEST -DESCRIPTOR.message_types_by_name["GetModelRequest"] = _GETMODELREQUEST -DESCRIPTOR.message_types_by_name["ListModelsRequest"] = _LISTMODELSREQUEST -DESCRIPTOR.message_types_by_name["ListModelsResponse"] = _LISTMODELSRESPONSE -DESCRIPTOR.message_types_by_name["DeleteModelRequest"] = _DELETEMODELREQUEST -DESCRIPTOR.message_types_by_name["DeployModelRequest"] = _DEPLOYMODELREQUEST -DESCRIPTOR.message_types_by_name["UndeployModelRequest"] = _UNDEPLOYMODELREQUEST -DESCRIPTOR.message_types_by_name["ExportModelRequest"] = _EXPORTMODELREQUEST -DESCRIPTOR.message_types_by_name[ - "ExportEvaluatedExamplesRequest" -] = _EXPORTEVALUATEDEXAMPLESREQUEST -DESCRIPTOR.message_types_by_name[ - "GetModelEvaluationRequest" -] = _GETMODELEVALUATIONREQUEST -DESCRIPTOR.message_types_by_name[ - "ListModelEvaluationsRequest" -] = _LISTMODELEVALUATIONSREQUEST -DESCRIPTOR.message_types_by_name[ - "ListModelEvaluationsResponse" -] = _LISTMODELEVALUATIONSRESPONSE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -CreateDatasetRequest = _reflection.GeneratedProtocolMessageType( - "CreateDatasetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEDATASETREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.CreateDataset][google.cloud.automl.v1beta1.AutoMl.CreateDataset]. - - - Attributes: - parent: - The resource name of the project to create the dataset for. - dataset: - The dataset to create. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.CreateDatasetRequest) - ), -) -_sym_db.RegisterMessage(CreateDatasetRequest) - -GetDatasetRequest = _reflection.GeneratedProtocolMessageType( - "GetDatasetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETDATASETREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.GetDataset][google.cloud.automl.v1beta1.AutoMl.GetDataset]. - - - Attributes: - name: - The resource name of the dataset to retrieve. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.GetDatasetRequest) - ), -) -_sym_db.RegisterMessage(GetDatasetRequest) - -ListDatasetsRequest = _reflection.GeneratedProtocolMessageType( - "ListDatasetsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTDATASETSREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.ListDatasets][google.cloud.automl.v1beta1.AutoMl.ListDatasets]. - - - Attributes: - parent: - The resource name of the project from which to list datasets. - 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. - page_size: - Requested page size. Server may return fewer results than - requested. If unspecified, server will pick a default size. - page_token: - A token identifying a page of results for the server to return - Typically obtained via [ListDatasetsResponse.next\_page\_token - ][google.cloud.automl.v1beta1.ListDatasetsResponse.next\_page\ - _token] of the previous [AutoMl.ListDatasets][google.cloud.aut - oml.v1beta1.AutoMl.ListDatasets] call. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ListDatasetsRequest) - ), -) -_sym_db.RegisterMessage(ListDatasetsRequest) - -ListDatasetsResponse = _reflection.GeneratedProtocolMessageType( - "ListDatasetsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTDATASETSRESPONSE, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Response message for - [AutoMl.ListDatasets][google.cloud.automl.v1beta1.AutoMl.ListDatasets]. - - - Attributes: - datasets: - The datasets read. - next_page_token: - A token to retrieve next page of results. Pass to [ListDataset - sRequest.page\_token][google.cloud.automl.v1beta1.ListDatasets - Request.page\_token] to obtain that page. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ListDatasetsResponse) - ), -) -_sym_db.RegisterMessage(ListDatasetsResponse) - -UpdateDatasetRequest = _reflection.GeneratedProtocolMessageType( - "UpdateDatasetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEDATASETREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.UpdateDataset][google.cloud.automl.v1beta1.AutoMl.UpdateDataset] - - - Attributes: - dataset: - The dataset which replaces the resource on the server. - update_mask: - The update mask applies to the resource. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.UpdateDatasetRequest) - ), -) -_sym_db.RegisterMessage(UpdateDatasetRequest) - -DeleteDatasetRequest = _reflection.GeneratedProtocolMessageType( - "DeleteDatasetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEDATASETREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.DeleteDataset][google.cloud.automl.v1beta1.AutoMl.DeleteDataset]. - - - Attributes: - name: - The resource name of the dataset to delete. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.DeleteDatasetRequest) - ), -) -_sym_db.RegisterMessage(DeleteDatasetRequest) - -ImportDataRequest = _reflection.GeneratedProtocolMessageType( - "ImportDataRequest", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTDATAREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.ImportData][google.cloud.automl.v1beta1.AutoMl.ImportData]. - - - Attributes: - name: - Required. Dataset name. Dataset must already exist. All - imported annotations and examples will be added. - input_config: - Required. The desired input location and its domain specific - semantics, if any. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ImportDataRequest) - ), -) -_sym_db.RegisterMessage(ImportDataRequest) - -ExportDataRequest = _reflection.GeneratedProtocolMessageType( - "ExportDataRequest", - (_message.Message,), - dict( - DESCRIPTOR=_EXPORTDATAREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.ExportData][google.cloud.automl.v1beta1.AutoMl.ExportData]. - - - Attributes: - name: - Required. The resource name of the dataset. - output_config: - Required. The desired output location. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ExportDataRequest) - ), -) -_sym_db.RegisterMessage(ExportDataRequest) - -GetAnnotationSpecRequest = _reflection.GeneratedProtocolMessageType( - "GetAnnotationSpecRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETANNOTATIONSPECREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.GetAnnotationSpec][google.cloud.automl.v1beta1.AutoMl.GetAnnotationSpec]. - - - Attributes: - name: - The resource name of the annotation spec to retrieve. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.GetAnnotationSpecRequest) - ), -) -_sym_db.RegisterMessage(GetAnnotationSpecRequest) - -GetTableSpecRequest = _reflection.GeneratedProtocolMessageType( - "GetTableSpecRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETTABLESPECREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.GetTableSpec][google.cloud.automl.v1beta1.AutoMl.GetTableSpec]. - - - Attributes: - name: - The resource name of the table spec to retrieve. - field_mask: - Mask specifying which fields to read. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.GetTableSpecRequest) - ), -) -_sym_db.RegisterMessage(GetTableSpecRequest) - -ListTableSpecsRequest = _reflection.GeneratedProtocolMessageType( - "ListTableSpecsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTTABLESPECSREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.ListTableSpecs][google.cloud.automl.v1beta1.AutoMl.ListTableSpecs]. - - - Attributes: - parent: - The resource name of the dataset to list table specs from. - field_mask: - Mask specifying which fields to read. - filter: - Filter expression, see go/filtering. - page_size: - Requested page size. The server can return fewer results than - requested. If unspecified, the server will pick a default - size. - page_token: - A token identifying a page of results for the server to - return. Typically obtained from the [ListTableSpecsResponse.ne - xt\_page\_token][google.cloud.automl.v1beta1.ListTableSpecsRes - ponse.next\_page\_token] field of the previous [AutoMl.ListTab - leSpecs][google.cloud.automl.v1beta1.AutoMl.ListTableSpecs] - call. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ListTableSpecsRequest) - ), -) -_sym_db.RegisterMessage(ListTableSpecsRequest) - -ListTableSpecsResponse = _reflection.GeneratedProtocolMessageType( - "ListTableSpecsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTTABLESPECSRESPONSE, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Response message for - [AutoMl.ListTableSpecs][google.cloud.automl.v1beta1.AutoMl.ListTableSpecs]. - - - Attributes: - table_specs: - The table specs read. - next_page_token: - A token to retrieve next page of results. Pass to [ListTableSp - ecsRequest.page\_token][google.cloud.automl.v1beta1.ListTableS - pecsRequest.page\_token] to obtain that page. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ListTableSpecsResponse) - ), -) -_sym_db.RegisterMessage(ListTableSpecsResponse) - -UpdateTableSpecRequest = _reflection.GeneratedProtocolMessageType( - "UpdateTableSpecRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATETABLESPECREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.UpdateTableSpec][google.cloud.automl.v1beta1.AutoMl.UpdateTableSpec] - - - Attributes: - table_spec: - The table spec which replaces the resource on the server. - update_mask: - The update mask applies to the resource. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.UpdateTableSpecRequest) - ), -) -_sym_db.RegisterMessage(UpdateTableSpecRequest) - -GetColumnSpecRequest = _reflection.GeneratedProtocolMessageType( - "GetColumnSpecRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETCOLUMNSPECREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.GetColumnSpec][google.cloud.automl.v1beta1.AutoMl.GetColumnSpec]. - - - Attributes: - name: - The resource name of the column spec to retrieve. - field_mask: - Mask specifying which fields to read. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.GetColumnSpecRequest) - ), -) -_sym_db.RegisterMessage(GetColumnSpecRequest) - -ListColumnSpecsRequest = _reflection.GeneratedProtocolMessageType( - "ListColumnSpecsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTCOLUMNSPECSREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.ListColumnSpecs][google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs]. - - - Attributes: - parent: - The resource name of the table spec to list column specs from. - field_mask: - Mask specifying which fields to read. - filter: - Filter expression, see go/filtering. - page_size: - Requested page size. The server can return fewer results than - requested. If unspecified, the server will pick a default - size. - page_token: - A token identifying a page of results for the server to - return. Typically obtained from the [ListColumnSpecsResponse.n - ext\_page\_token][google.cloud.automl.v1beta1.ListColumnSpecsR - esponse.next\_page\_token] field of the previous [AutoMl.ListC - olumnSpecs][google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs - ] call. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ListColumnSpecsRequest) - ), -) -_sym_db.RegisterMessage(ListColumnSpecsRequest) - -ListColumnSpecsResponse = _reflection.GeneratedProtocolMessageType( - "ListColumnSpecsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTCOLUMNSPECSRESPONSE, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Response message for - [AutoMl.ListColumnSpecs][google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs]. - - - Attributes: - column_specs: - The column specs read. - next_page_token: - A token to retrieve next page of results. Pass to [ListColumnS - pecsRequest.page\_token][google.cloud.automl.v1beta1.ListColum - nSpecsRequest.page\_token] to obtain that page. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ListColumnSpecsResponse) - ), -) -_sym_db.RegisterMessage(ListColumnSpecsResponse) - -UpdateColumnSpecRequest = _reflection.GeneratedProtocolMessageType( - "UpdateColumnSpecRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATECOLUMNSPECREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.UpdateColumnSpec][google.cloud.automl.v1beta1.AutoMl.UpdateColumnSpec] - - - Attributes: - column_spec: - The column spec which replaces the resource on the server. - update_mask: - The update mask applies to the resource. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.UpdateColumnSpecRequest) - ), -) -_sym_db.RegisterMessage(UpdateColumnSpecRequest) - -CreateModelRequest = _reflection.GeneratedProtocolMessageType( - "CreateModelRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEMODELREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.CreateModel][google.cloud.automl.v1beta1.AutoMl.CreateModel]. - - - Attributes: - parent: - Resource name of the parent project where the model is being - created. - model: - The model to create. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.CreateModelRequest) - ), -) -_sym_db.RegisterMessage(CreateModelRequest) - -GetModelRequest = _reflection.GeneratedProtocolMessageType( - "GetModelRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETMODELREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.GetModel][google.cloud.automl.v1beta1.AutoMl.GetModel]. - - - Attributes: - name: - Resource name of the model. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.GetModelRequest) - ), -) -_sym_db.RegisterMessage(GetModelRequest) - -ListModelsRequest = _reflection.GeneratedProtocolMessageType( - "ListModelsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTMODELSREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.ListModels][google.cloud.automl.v1beta1.AutoMl.ListModels]. - - - Attributes: - parent: - Resource name of the project, from which to list the models. - 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. - page_size: - Requested page size. - page_token: - A token identifying a page of results for the server to return - Typically obtained via [ListModelsResponse.next\_page\_token][ - google.cloud.automl.v1beta1.ListModelsResponse.next\_page\_tok - en] of the previous [AutoMl.ListModels][google.cloud.automl.v1 - beta1.AutoMl.ListModels] call. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ListModelsRequest) - ), -) -_sym_db.RegisterMessage(ListModelsRequest) - -ListModelsResponse = _reflection.GeneratedProtocolMessageType( - "ListModelsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTMODELSRESPONSE, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Response message for - [AutoMl.ListModels][google.cloud.automl.v1beta1.AutoMl.ListModels]. - - - Attributes: - model: - List of models in the requested page. - next_page_token: - A token to retrieve next page of results. Pass to [ListModelsR - equest.page\_token][google.cloud.automl.v1beta1.ListModelsRequ - est.page\_token] to obtain that page. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ListModelsResponse) - ), -) -_sym_db.RegisterMessage(ListModelsResponse) - -DeleteModelRequest = _reflection.GeneratedProtocolMessageType( - "DeleteModelRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEMODELREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.DeleteModel][google.cloud.automl.v1beta1.AutoMl.DeleteModel]. - - - Attributes: - name: - Resource name of the model being deleted. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.DeleteModelRequest) - ), -) -_sym_db.RegisterMessage(DeleteModelRequest) - -DeployModelRequest = _reflection.GeneratedProtocolMessageType( - "DeployModelRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DEPLOYMODELREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.DeployModel][google.cloud.automl.v1beta1.AutoMl.DeployModel]. - - - Attributes: - model_deployment_metadata: - The per-domain specific deployment parameters. - image_object_detection_model_deployment_metadata: - Model deployment metadata specific to Image Object Detection. - image_classification_model_deployment_metadata: - Model deployment metadata specific to Image Classification. - name: - Resource name of the model to deploy. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.DeployModelRequest) - ), -) -_sym_db.RegisterMessage(DeployModelRequest) - -UndeployModelRequest = _reflection.GeneratedProtocolMessageType( - "UndeployModelRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UNDEPLOYMODELREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.UndeployModel][google.cloud.automl.v1beta1.AutoMl.UndeployModel]. - - - Attributes: - name: - Resource name of the model to undeploy. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.UndeployModelRequest) - ), -) -_sym_db.RegisterMessage(UndeployModelRequest) - -ExportModelRequest = _reflection.GeneratedProtocolMessageType( - "ExportModelRequest", - (_message.Message,), - dict( - DESCRIPTOR=_EXPORTMODELREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]. - Models need to be enabled for exporting, otherwise an error code will be - returned. - - - Attributes: - name: - Required. The resource name of the model to export. - output_config: - Required. The desired output location and configuration. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ExportModelRequest) - ), -) -_sym_db.RegisterMessage(ExportModelRequest) - -ExportEvaluatedExamplesRequest = _reflection.GeneratedProtocolMessageType( - "ExportEvaluatedExamplesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_EXPORTEVALUATEDEXAMPLESREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.ExportEvaluatedExamples][google.cloud.automl.v1beta1.AutoMl.ExportEvaluatedExamples]. - - - Attributes: - name: - Required. The resource name of the model whose evaluated - examples are to be exported. - output_config: - Required. The desired output location and configuration. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest) - ), -) -_sym_db.RegisterMessage(ExportEvaluatedExamplesRequest) - -GetModelEvaluationRequest = _reflection.GeneratedProtocolMessageType( - "GetModelEvaluationRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETMODELEVALUATIONREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.GetModelEvaluation][google.cloud.automl.v1beta1.AutoMl.GetModelEvaluation]. - - - Attributes: - name: - Resource name for the model evaluation. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.GetModelEvaluationRequest) - ), -) -_sym_db.RegisterMessage(GetModelEvaluationRequest) - -ListModelEvaluationsRequest = _reflection.GeneratedProtocolMessageType( - "ListModelEvaluationsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTMODELEVALUATIONSREQUEST, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Request message for - [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations]. - - - Attributes: - parent: - 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. - filter: - 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. - page_size: - Requested page size. - page_token: - A token identifying a page of results for the server to - return. Typically obtained via [ListModelEvaluationsResponse.n - ext\_page\_token][google.cloud.automl.v1beta1.ListModelEvaluat - ionsResponse.next\_page\_token] of the previous [AutoMl.ListMo - delEvaluations][google.cloud.automl.v1beta1.AutoMl.ListModelEv - aluations] call. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ListModelEvaluationsRequest) - ), -) -_sym_db.RegisterMessage(ListModelEvaluationsRequest) - -ListModelEvaluationsResponse = _reflection.GeneratedProtocolMessageType( - "ListModelEvaluationsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTMODELEVALUATIONSRESPONSE, - __module__="google.cloud.automl_v1beta1.proto.service_pb2", - __doc__="""Response message for - [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations]. - - - Attributes: - model_evaluation: - List of model evaluations in the requested page. - next_page_token: - A token to retrieve next page of results. Pass to the [ListMod - elEvaluationsRequest.page\_token][google.cloud.automl.v1beta1. - ListModelEvaluationsRequest.page\_token] field of a new [AutoM - l.ListModelEvaluations][google.cloud.automl.v1beta1.AutoMl.Lis - tModelEvaluations] request to obtain that page. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.ListModelEvaluationsResponse) - ), -) -_sym_db.RegisterMessage(ListModelEvaluationsResponse) - - -DESCRIPTOR._options = None - -_AUTOML = _descriptor.ServiceDescriptor( - name="AutoMl", - full_name="google.cloud.automl.v1beta1.AutoMl", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\025automl.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=3671, - serialized_end=8112, - methods=[ - _descriptor.MethodDescriptor( - name="CreateDataset", - full_name="google.cloud.automl.v1beta1.AutoMl.CreateDataset", - index=0, - containing_service=None, - input_type=_CREATEDATASETREQUEST, - output_type=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_dataset__pb2._DATASET, - serialized_options=_b( - '\202\323\344\223\002<"1/v1beta1/{parent=projects/*/locations/*}/datasets:\007dataset' - ), - ), - _descriptor.MethodDescriptor( - name="GetDataset", - full_name="google.cloud.automl.v1beta1.AutoMl.GetDataset", - index=1, - containing_service=None, - input_type=_GETDATASETREQUEST, - output_type=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_dataset__pb2._DATASET, - serialized_options=_b( - "\202\323\344\223\0023\0221/v1beta1/{name=projects/*/locations/*/datasets/*}" - ), - ), - _descriptor.MethodDescriptor( - name="ListDatasets", - full_name="google.cloud.automl.v1beta1.AutoMl.ListDatasets", - index=2, - containing_service=None, - input_type=_LISTDATASETSREQUEST, - output_type=_LISTDATASETSRESPONSE, - serialized_options=_b( - "\202\323\344\223\0023\0221/v1beta1/{parent=projects/*/locations/*}/datasets" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateDataset", - full_name="google.cloud.automl.v1beta1.AutoMl.UpdateDataset", - index=3, - containing_service=None, - input_type=_UPDATEDATASETREQUEST, - output_type=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_dataset__pb2._DATASET, - serialized_options=_b( - "\202\323\344\223\002D29/v1beta1/{dataset.name=projects/*/locations/*/datasets/*}:\007dataset" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteDataset", - full_name="google.cloud.automl.v1beta1.AutoMl.DeleteDataset", - index=4, - containing_service=None, - input_type=_DELETEDATASETREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - "\202\323\344\223\0023*1/v1beta1/{name=projects/*/locations/*/datasets/*}" - ), - ), - _descriptor.MethodDescriptor( - name="ImportData", - full_name="google.cloud.automl.v1beta1.AutoMl.ImportData", - index=5, - containing_service=None, - input_type=_IMPORTDATAREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002A"/v1beta1/{name=projects/*/locations/*/datasets/*/tableSpecs/*}" - ), - ), - _descriptor.MethodDescriptor( - name="ListTableSpecs", - full_name="google.cloud.automl.v1beta1.AutoMl.ListTableSpecs", - index=9, - containing_service=None, - input_type=_LISTTABLESPECSREQUEST, - output_type=_LISTTABLESPECSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002@\022>/v1beta1/{parent=projects/*/locations/*/datasets/*}/tableSpecs" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateTableSpec", - full_name="google.cloud.automl.v1beta1.AutoMl.UpdateTableSpec", - index=10, - containing_service=None, - input_type=_UPDATETABLESPECREQUEST, - output_type=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_table__spec__pb2._TABLESPEC, - serialized_options=_b( - "\202\323\344\223\002W2I/v1beta1/{table_spec.name=projects/*/locations/*/datasets/*/tableSpecs/*}:\ntable_spec" - ), - ), - _descriptor.MethodDescriptor( - name="GetColumnSpec", - full_name="google.cloud.automl.v1beta1.AutoMl.GetColumnSpec", - index=11, - containing_service=None, - input_type=_GETCOLUMNSPECREQUEST, - output_type=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_column__spec__pb2._COLUMNSPEC, - serialized_options=_b( - "\202\323\344\223\002N\022L/v1beta1/{name=projects/*/locations/*/datasets/*/tableSpecs/*/columnSpecs/*}" - ), - ), - _descriptor.MethodDescriptor( - name="ListColumnSpecs", - full_name="google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs", - index=12, - containing_service=None, - input_type=_LISTCOLUMNSPECSREQUEST, - output_type=_LISTCOLUMNSPECSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002N\022L/v1beta1/{parent=projects/*/locations/*/datasets/*/tableSpecs/*}/columnSpecs" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateColumnSpec", - full_name="google.cloud.automl.v1beta1.AutoMl.UpdateColumnSpec", - index=13, - containing_service=None, - input_type=_UPDATECOLUMNSPECREQUEST, - output_type=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_column__spec__pb2._COLUMNSPEC, - serialized_options=_b( - "\202\323\344\223\002g2X/v1beta1/{column_spec.name=projects/*/locations/*/datasets/*/tableSpecs/*/columnSpecs/*}:\013column_spec" - ), - ), - _descriptor.MethodDescriptor( - name="CreateModel", - full_name="google.cloud.automl.v1beta1.AutoMl.CreateModel", - index=14, - containing_service=None, - input_type=_CREATEMODELREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\0028"//v1beta1/{parent=projects/*/locations/*}/models:\005model' - ), - ), - _descriptor.MethodDescriptor( - name="GetModel", - full_name="google.cloud.automl.v1beta1.AutoMl.GetModel", - index=15, - containing_service=None, - input_type=_GETMODELREQUEST, - output_type=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_model__pb2._MODEL, - serialized_options=_b( - "\202\323\344\223\0021\022//v1beta1/{name=projects/*/locations/*/models/*}" - ), - ), - _descriptor.MethodDescriptor( - name="ListModels", - full_name="google.cloud.automl.v1beta1.AutoMl.ListModels", - index=16, - containing_service=None, - input_type=_LISTMODELSREQUEST, - output_type=_LISTMODELSRESPONSE, - serialized_options=_b( - "\202\323\344\223\0021\022//v1beta1/{parent=projects/*/locations/*}/models" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteModel", - full_name="google.cloud.automl.v1beta1.AutoMl.DeleteModel", - index=17, - containing_service=None, - input_type=_DELETEMODELREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - "\202\323\344\223\0021*//v1beta1/{name=projects/*/locations/*/models/*}" - ), - ), - _descriptor.MethodDescriptor( - name="DeployModel", - full_name="google.cloud.automl.v1beta1.AutoMl.DeployModel", - index=18, - containing_service=None, - input_type=_DEPLOYMODELREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002;"6/v1beta1/{name=projects/*/locations/*/models/*}:deploy:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="UndeployModel", - full_name="google.cloud.automl.v1beta1.AutoMl.UndeployModel", - index=19, - containing_service=None, - input_type=_UNDEPLOYMODELREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002="8/v1beta1/{name=projects/*/locations/*/models/*}:undeploy:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="ExportModel", - full_name="google.cloud.automl.v1beta1.AutoMl.ExportModel", - index=20, - containing_service=None, - input_type=_EXPORTMODELREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002;"6/v1beta1/{name=projects/*/locations/*/models/*}:export:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="ExportEvaluatedExamples", - full_name="google.cloud.automl.v1beta1.AutoMl.ExportEvaluatedExamples", - index=21, - containing_service=None, - input_type=_EXPORTEVALUATEDEXAMPLESREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002L"G/v1beta1/{name=projects/*/locations/*/models/*}:exportEvaluatedExamples:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="GetModelEvaluation", - full_name="google.cloud.automl.v1beta1.AutoMl.GetModelEvaluation", - index=22, - containing_service=None, - input_type=_GETMODELEVALUATIONREQUEST, - output_type=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_model__evaluation__pb2._MODELEVALUATION, - serialized_options=_b( - "\202\323\344\223\002D\022B/v1beta1/{name=projects/*/locations/*/models/*/modelEvaluations/*}" - ), - ), - _descriptor.MethodDescriptor( - name="ListModelEvaluations", - full_name="google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations", - index=23, - containing_service=None, - input_type=_LISTMODELEVALUATIONSREQUEST, - output_type=_LISTMODELEVALUATIONSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002D\022B/v1beta1/{parent=projects/*/locations/*/models/*}/modelEvaluations" - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_AUTOML) - -DESCRIPTOR.services_by_name["AutoMl"] = _AUTOML - -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/service_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/service_pb2_grpc.py deleted file mode 100644 index eb049c207ee7..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/service_pb2_grpc.py +++ /dev/null @@ -1,545 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.automl_v1beta1.proto import ( - annotation_spec_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_annotation__spec__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - column_spec_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_column__spec__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - dataset_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_dataset__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - model_evaluation_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_model__evaluation__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - model_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_model__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - service_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - table_spec_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_table__spec__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -class AutoMlStub(object): - """AutoML Server API. - - The resource names are assigned by the server. - The server never reuses names that it has created after the resources with - those names are deleted. - - An ID of a resource is the last element of the item's resource name. For - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then - the id for the item is `{dataset_id}`. - - Currently the only supported `location_id` is "us-central1". - - On any input that is documented to expect a string parameter in - snake_case or kebab-case, either of those cases is accepted. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateDataset = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/CreateDataset", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.CreateDatasetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_dataset__pb2.Dataset.FromString, - ) - self.GetDataset = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/GetDataset", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.GetDatasetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_dataset__pb2.Dataset.FromString, - ) - self.ListDatasets = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/ListDatasets", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListDatasetsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListDatasetsResponse.FromString, - ) - self.UpdateDataset = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/UpdateDataset", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.UpdateDatasetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_dataset__pb2.Dataset.FromString, - ) - self.DeleteDataset = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/DeleteDataset", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.DeleteDatasetRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.ImportData = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/ImportData", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ImportDataRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.ExportData = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/ExportData", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ExportDataRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.GetAnnotationSpec = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/GetAnnotationSpec", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.GetAnnotationSpecRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_annotation__spec__pb2.AnnotationSpec.FromString, - ) - self.GetTableSpec = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/GetTableSpec", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.GetTableSpecRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_table__spec__pb2.TableSpec.FromString, - ) - self.ListTableSpecs = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/ListTableSpecs", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListTableSpecsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListTableSpecsResponse.FromString, - ) - self.UpdateTableSpec = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/UpdateTableSpec", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.UpdateTableSpecRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_table__spec__pb2.TableSpec.FromString, - ) - self.GetColumnSpec = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/GetColumnSpec", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.GetColumnSpecRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_column__spec__pb2.ColumnSpec.FromString, - ) - self.ListColumnSpecs = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/ListColumnSpecs", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListColumnSpecsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListColumnSpecsResponse.FromString, - ) - self.UpdateColumnSpec = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/UpdateColumnSpec", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.UpdateColumnSpecRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_column__spec__pb2.ColumnSpec.FromString, - ) - self.CreateModel = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/CreateModel", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.CreateModelRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.GetModel = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/GetModel", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.GetModelRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_model__pb2.Model.FromString, - ) - self.ListModels = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/ListModels", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListModelsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListModelsResponse.FromString, - ) - self.DeleteModel = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/DeleteModel", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.DeleteModelRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.DeployModel = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/DeployModel", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.DeployModelRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.UndeployModel = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/UndeployModel", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.UndeployModelRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.ExportModel = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/ExportModel", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ExportModelRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.ExportEvaluatedExamples = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/ExportEvaluatedExamples", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ExportEvaluatedExamplesRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.GetModelEvaluation = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/GetModelEvaluation", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.GetModelEvaluationRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_model__evaluation__pb2.ModelEvaluation.FromString, - ) - self.ListModelEvaluations = channel.unary_unary( - "/google.cloud.automl.v1beta1.AutoMl/ListModelEvaluations", - request_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListModelEvaluationsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListModelEvaluationsResponse.FromString, - ) - - -class AutoMlServicer(object): - """AutoML Server API. - - The resource names are assigned by the server. - The server never reuses names that it has created after the resources with - those names are deleted. - - An ID of a resource is the last element of the item's resource name. For - `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then - the id for the item is `{dataset_id}`. - - Currently the only supported `location_id` is "us-central1". - - On any input that is documented to expect a string parameter in - snake_case or kebab-case, either of those cases is accepted. - """ - - def CreateDataset(self, request, context): - """Creates a dataset. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetDataset(self, request, context): - """Gets a dataset. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListDatasets(self, request, context): - """Lists datasets in a project. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateDataset(self, request, context): - """Updates a dataset. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteDataset(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ImportData(self, request, context): - """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.v1beta1.InputConfig.params] - parameter must be explicitly set. - Returns an empty response in the - [response][google.longrunning.Operation.response] field when it completes. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ExportData(self, request, context): - """Exports dataset's data to the provided output location. - Returns an empty response in the - [response][google.longrunning.Operation.response] field when it completes. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetAnnotationSpec(self, request, context): - """Gets an annotation spec. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetTableSpec(self, request, context): - """Gets a table spec. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListTableSpecs(self, request, context): - """Lists table specs in a dataset. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateTableSpec(self, request, context): - """Updates a table spec. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetColumnSpec(self, request, context): - """Gets a column spec. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListColumnSpecs(self, request, context): - """Lists column specs in a table spec. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateColumnSpec(self, request, context): - """Updates a column spec. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateModel(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetModel(self, request, context): - """Gets a model. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListModels(self, request, context): - """Lists models. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteModel(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeployModel(self, request, context): - """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.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) - will reset the deployment state without pausing the model's availability. - - 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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UndeployModel(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ExportModel(self, request, context): - """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.v1beta1.ModelExportOutputConfig]. - - Returns an empty response in the - [response][google.longrunning.Operation.response] field when it completes. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ExportEvaluatedExamples(self, request, context): - """Exports examples on which the model was evaluated (i.e. which were in the - TEST set of the dataset the model was created from), together with their - ground truth annotations and the annotations created (predicted) by the - model. - The examples, ground truth and predictions are exported in the state - they were at the moment the model was evaluated. - - This export is available only for 30 days since the model evaluation is - created. - - Currently only available for Tables. - - Returns an empty response in the - [response][google.longrunning.Operation.response] field when it completes. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetModelEvaluation(self, request, context): - """Gets a model evaluation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListModelEvaluations(self, request, context): - """Lists model evaluations. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_AutoMlServicer_to_server(servicer, server): - rpc_method_handlers = { - "CreateDataset": grpc.unary_unary_rpc_method_handler( - servicer.CreateDataset, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.CreateDatasetRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_dataset__pb2.Dataset.SerializeToString, - ), - "GetDataset": grpc.unary_unary_rpc_method_handler( - servicer.GetDataset, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.GetDatasetRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_dataset__pb2.Dataset.SerializeToString, - ), - "ListDatasets": grpc.unary_unary_rpc_method_handler( - servicer.ListDatasets, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListDatasetsRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListDatasetsResponse.SerializeToString, - ), - "UpdateDataset": grpc.unary_unary_rpc_method_handler( - servicer.UpdateDataset, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.UpdateDatasetRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_dataset__pb2.Dataset.SerializeToString, - ), - "DeleteDataset": grpc.unary_unary_rpc_method_handler( - servicer.DeleteDataset, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.DeleteDatasetRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "ImportData": grpc.unary_unary_rpc_method_handler( - servicer.ImportData, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ImportDataRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "ExportData": grpc.unary_unary_rpc_method_handler( - servicer.ExportData, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ExportDataRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "GetAnnotationSpec": grpc.unary_unary_rpc_method_handler( - servicer.GetAnnotationSpec, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.GetAnnotationSpecRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_annotation__spec__pb2.AnnotationSpec.SerializeToString, - ), - "GetTableSpec": grpc.unary_unary_rpc_method_handler( - servicer.GetTableSpec, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.GetTableSpecRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_table__spec__pb2.TableSpec.SerializeToString, - ), - "ListTableSpecs": grpc.unary_unary_rpc_method_handler( - servicer.ListTableSpecs, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListTableSpecsRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListTableSpecsResponse.SerializeToString, - ), - "UpdateTableSpec": grpc.unary_unary_rpc_method_handler( - servicer.UpdateTableSpec, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.UpdateTableSpecRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_table__spec__pb2.TableSpec.SerializeToString, - ), - "GetColumnSpec": grpc.unary_unary_rpc_method_handler( - servicer.GetColumnSpec, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.GetColumnSpecRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_column__spec__pb2.ColumnSpec.SerializeToString, - ), - "ListColumnSpecs": grpc.unary_unary_rpc_method_handler( - servicer.ListColumnSpecs, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListColumnSpecsRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListColumnSpecsResponse.SerializeToString, - ), - "UpdateColumnSpec": grpc.unary_unary_rpc_method_handler( - servicer.UpdateColumnSpec, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.UpdateColumnSpecRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_column__spec__pb2.ColumnSpec.SerializeToString, - ), - "CreateModel": grpc.unary_unary_rpc_method_handler( - servicer.CreateModel, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.CreateModelRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "GetModel": grpc.unary_unary_rpc_method_handler( - servicer.GetModel, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.GetModelRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_model__pb2.Model.SerializeToString, - ), - "ListModels": grpc.unary_unary_rpc_method_handler( - servicer.ListModels, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListModelsRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListModelsResponse.SerializeToString, - ), - "DeleteModel": grpc.unary_unary_rpc_method_handler( - servicer.DeleteModel, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.DeleteModelRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "DeployModel": grpc.unary_unary_rpc_method_handler( - servicer.DeployModel, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.DeployModelRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "UndeployModel": grpc.unary_unary_rpc_method_handler( - servicer.UndeployModel, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.UndeployModelRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "ExportModel": grpc.unary_unary_rpc_method_handler( - servicer.ExportModel, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ExportModelRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "ExportEvaluatedExamples": grpc.unary_unary_rpc_method_handler( - servicer.ExportEvaluatedExamples, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ExportEvaluatedExamplesRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "GetModelEvaluation": grpc.unary_unary_rpc_method_handler( - servicer.GetModelEvaluation, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.GetModelEvaluationRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_model__evaluation__pb2.ModelEvaluation.SerializeToString, - ), - "ListModelEvaluations": grpc.unary_unary_rpc_method_handler( - servicer.ListModelEvaluations, - request_deserializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListModelEvaluationsRequest.FromString, - response_serializer=google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_service__pb2.ListModelEvaluationsResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.automl.v1beta1.AutoMl", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/automl/google/cloud/automl_v1beta1/proto/table_spec.proto b/automl/google/cloud/automl_v1beta1/proto/table_spec.proto deleted file mode 100644 index 4475617ae275..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/table_spec.proto +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/cloud/automl/v1beta1/io.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// A specification of a relational table. -// The table's schema is represented via its child column specs. It is -// pre-populated as part of ImportData by schema inference algorithm, the -// version of which is a required parameter of ImportData InputConfig. -// Note: While working with a table, at times the schema may be -// inconsistent with the data in the table (e.g. string in a FLOAT64 column). -// The consistency validation is done upon creation of a model. -// Used by: -// * Tables -message TableSpec { - // Output only. The resource name of the table spec. - // Form: - // - // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/tableSpecs/{table_spec_id}` - string name = 1; - - // column_spec_id of the time column. Only used if the parent dataset's - // ml_use_column_spec_id is not set. Used to split rows into TRAIN, VALIDATE - // and TEST sets such that oldest rows go to TRAIN set, newest to TEST, and - // those in between to VALIDATE. - // Required type: TIMESTAMP. - // If both this column and ml_use_column are not set, then ML use of all rows - // will be assigned by AutoML. NOTE: Updates of this field will instantly - // affect any other users concurrently working with the dataset. - string time_column_spec_id = 2; - - // Output only. The number of rows (i.e. examples) in the table. - int64 row_count = 3; - - // Output only. The number of valid rows (i.e. without values that don't match - // DataType-s of their columns). - int64 valid_row_count = 4; - - // Output only. The number of columns of the table. That is, the number of - // child ColumnSpec-s. - int64 column_count = 7; - - // Output only. Input configs via which data currently residing in the table - // had been imported. - repeated InputConfig input_configs = 5; - - // Used to perform consistent read-modify-write updates. If not set, a blind - // "overwrite" update happens. - string etag = 6; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/table_spec_pb2.py b/automl/google/cloud/automl_v1beta1/proto/table_spec_pb2.py deleted file mode 100644 index 48aa9178278a..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/table_spec_pb2.py +++ /dev/null @@ -1,244 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/table_spec.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.cloud.automl_v1beta1.proto import ( - io_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_io__pb2, -) -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/table_spec.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1P\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n2google/cloud/automl_v1beta1/proto/table_spec.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a*google/cloud/automl_v1beta1/proto/io.proto\x1a\x1cgoogle/api/annotations.proto"\xc7\x01\n\tTableSpec\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1b\n\x13time_column_spec_id\x18\x02 \x01(\t\x12\x11\n\trow_count\x18\x03 \x01(\x03\x12\x17\n\x0fvalid_row_count\x18\x04 \x01(\x03\x12\x14\n\x0c\x63olumn_count\x18\x07 \x01(\x03\x12?\n\rinput_configs\x18\x05 \x03(\x0b\x32(.google.cloud.automl.v1beta1.InputConfig\x12\x0c\n\x04\x65tag\x18\x06 \x01(\tB\xa5\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_io__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_TABLESPEC = _descriptor.Descriptor( - name="TableSpec", - full_name="google.cloud.automl.v1beta1.TableSpec", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.automl.v1beta1.TableSpec.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_column_spec_id", - full_name="google.cloud.automl.v1beta1.TableSpec.time_column_spec_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="row_count", - full_name="google.cloud.automl.v1beta1.TableSpec.row_count", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="valid_row_count", - full_name="google.cloud.automl.v1beta1.TableSpec.valid_row_count", - index=3, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="column_count", - full_name="google.cloud.automl.v1beta1.TableSpec.column_count", - index=4, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="input_configs", - full_name="google.cloud.automl.v1beta1.TableSpec.input_configs", - index=5, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="etag", - full_name="google.cloud.automl.v1beta1.TableSpec.etag", - index=6, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=158, - serialized_end=357, -) - -_TABLESPEC.fields_by_name[ - "input_configs" -].message_type = google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_io__pb2._INPUTCONFIG -DESCRIPTOR.message_types_by_name["TableSpec"] = _TABLESPEC -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -TableSpec = _reflection.GeneratedProtocolMessageType( - "TableSpec", - (_message.Message,), - dict( - DESCRIPTOR=_TABLESPEC, - __module__="google.cloud.automl_v1beta1.proto.table_spec_pb2", - __doc__="""A specification of a relational table. The table's schema - is represented via its child column specs. It is pre-populated as part - of ImportData by schema inference algorithm, the version of which is a - required parameter of ImportData InputConfig. Note: While working with a - table, at times the schema may be inconsistent with the data in the - table (e.g. string in a FLOAT64 column). The consistency validation is - done upon creation of a model. Used by: \* Tables - - - Attributes: - name: - Output only. The resource name of the table spec. Form: ``pro - jects/{project_id}/locations/{location_id}/datasets/{dataset_i - d}/tableSpecs/{table_spec_id}`` - time_column_spec_id: - column\_spec\_id of the time column. Only used if the parent - dataset's ml\_use\_column\_spec\_id is not set. Used to split - rows into TRAIN, VALIDATE and TEST sets such that oldest rows - go to TRAIN set, newest to TEST, and those in between to - VALIDATE. Required type: TIMESTAMP. If both this column and - ml\_use\_column are not set, then ML use of all rows will be - assigned by AutoML. NOTE: Updates of this field will instantly - affect any other users concurrently working with the dataset. - row_count: - Output only. The number of rows (i.e. examples) in the table. - valid_row_count: - Output only. The number of valid rows (i.e. without values - that don't match DataType-s of their columns). - column_count: - Output only. The number of columns of the table. That is, the - number of child ColumnSpec-s. - input_configs: - Output only. Input configs via which data currently residing - in the table had been imported. - etag: - Used to perform consistent read-modify-write updates. If not - set, a blind "overwrite" update happens. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TableSpec) - ), -) -_sym_db.RegisterMessage(TableSpec) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/table_spec_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/table_spec_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/table_spec_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/tables.proto b/automl/google/cloud/automl_v1beta1/proto/tables.proto deleted file mode 100644 index 5b786c9f1515..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/tables.proto +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/api/annotations.proto"; -import "google/cloud/automl/v1beta1/classification.proto"; -import "google/cloud/automl/v1beta1/column_spec.proto"; -import "google/cloud/automl/v1beta1/data_items.proto"; -import "google/cloud/automl/v1beta1/data_stats.proto"; -import "google/cloud/automl/v1beta1/ranges.proto"; -import "google/cloud/automl/v1beta1/temporal.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// Metadata for a dataset used for AutoML Tables. -message TablesDatasetMetadata { - // Output only. The table_spec_id of the primary table of this dataset. - string primary_table_spec_id = 1; - - // column_spec_id of the primary table's column that should be used as the - // training & prediction target. - // This column must be non-nullable and have one of following data types - // (otherwise model creation will error): - // - // * CATEGORY - // - // * FLOAT64 - // - // If the type is CATEGORY , only up to - // 100 unique values may exist in that column across all rows. - // - // NOTE: Updates of this field will instantly affect any other users - // concurrently working with the dataset. - string target_column_spec_id = 2; - - // column_spec_id of the primary table's column that should be used as the - // weight column, i.e. the higher the value the more important the row will be - // during model training. - // Required type: FLOAT64. - // Allowed values: 0 to 10000, inclusive on both ends; 0 means the row is - // ignored for training. - // If not set all rows are assumed to have equal weight of 1. - // NOTE: Updates of this field will instantly affect any other users - // concurrently working with the dataset. - string weight_column_spec_id = 3; - - // column_spec_id of the primary table column which specifies a possible ML - // use of the row, i.e. the column will be used to split the rows into TRAIN, - // VALIDATE and TEST sets. - // Required type: STRING. - // This column, if set, must either have all of `TRAIN`, `VALIDATE`, `TEST` - // among its values, or only have `TEST`, `UNASSIGNED` values. In the latter - // case the rows with `UNASSIGNED` value will be assigned by AutoML. Note - // that if a given ml use distribution makes it impossible to create a "good" - // model, that call will error describing the issue. - // If both this column_spec_id and primary table's time_column_spec_id are not - // set, then all rows are treated as `UNASSIGNED`. - // NOTE: Updates of this field will instantly affect any other users - // concurrently working with the dataset. - string ml_use_column_spec_id = 4; - - // Output only. Correlations between - // - // [TablesDatasetMetadata.target_column_spec_id][google.cloud.automl.v1beta1.TablesDatasetMetadata.target_column_spec_id], - // and other columns of the - // - // [TablesDatasetMetadataprimary_table][google.cloud.automl.v1beta1.TablesDatasetMetadata.primary_table_spec_id]. - // Only set if the target column is set. Mapping from other column spec id to - // its CorrelationStats with the target column. - // This field may be stale, see the stats_update_time field for - // for the timestamp at which these stats were last updated. - map target_column_correlations = 6; - - // Output only. The most recent timestamp when target_column_correlations - // field and all descendant ColumnSpec.data_stats and - // ColumnSpec.top_correlated_columns fields were last (re-)generated. Any - // changes that happened to the dataset afterwards are not reflected in these - // fields values. The regeneration happens in the background on a best effort - // basis. - google.protobuf.Timestamp stats_update_time = 7; -} - -// Model metadata specific to AutoML Tables. -message TablesModelMetadata { - // Additional optimization objective configuration. Required for - // `MAXIMIZE_PRECISION_AT_RECALL` and `MAXIMIZE_RECALL_AT_PRECISION`, - // otherwise unused. - oneof additional_optimization_objective_config { - // Required when optimization_objective is "MAXIMIZE_PRECISION_AT_RECALL". - // Must be between 0 and 1, inclusive. - float optimization_objective_recall_value = 17; - - // Required when optimization_objective is "MAXIMIZE_RECALL_AT_PRECISION". - // Must be between 0 and 1, inclusive. - float optimization_objective_precision_value = 18; - } - - // Column spec of the dataset's primary table's column the model is - // predicting. Snapshotted when model creation started. - // Only 3 fields are used: - // name - May be set on CreateModel, if it's not then the ColumnSpec - // corresponding to the current target_column_spec_id of the dataset - // the model is trained from is used. - // If neither is set, CreateModel will error. - // display_name - Output only. - // data_type - Output only. - ColumnSpec target_column_spec = 2; - - // Column specs of the dataset's primary table's columns, on which - // the model is trained and which are used as the input for predictions. - // The - // - // [target_column][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] - // as well as, according to dataset's state upon model creation, - // - // [weight_column][google.cloud.automl.v1beta1.TablesDatasetMetadata.weight_column_spec_id], - // and - // - // [ml_use_column][google.cloud.automl.v1beta1.TablesDatasetMetadata.ml_use_column_spec_id] - // must never be included here. - // - // Only 3 fields are used: - // - // * name - May be set on CreateModel, if set only the columns specified are - // used, otherwise all primary table's columns (except the ones listed - // above) are used for the training and prediction input. - // - // * display_name - Output only. - // - // * data_type - Output only. - repeated ColumnSpec input_feature_column_specs = 3; - - // Objective function the model is optimizing towards. The training process - // creates a model that maximizes/minimizes the value of the objective - // function over the validation set. - // - // The supported optimization objectives depend on the prediction type. - // If the field is not set, a default objective function is used. - // - // CLASSIFICATION_BINARY: - // "MAXIMIZE_AU_ROC" (default) - Maximize the area under the receiver - // operating characteristic (ROC) curve. - // "MINIMIZE_LOG_LOSS" - Minimize log loss. - // "MAXIMIZE_AU_PRC" - Maximize the area under the precision-recall curve. - // "MAXIMIZE_PRECISION_AT_RECALL" - Maximize precision for a specified - // recall value. - // "MAXIMIZE_RECALL_AT_PRECISION" - Maximize recall for a specified - // precision value. - // - // CLASSIFICATION_MULTI_CLASS : - // "MINIMIZE_LOG_LOSS" (default) - Minimize log loss. - // - // - // REGRESSION: - // "MINIMIZE_RMSE" (default) - Minimize root-mean-squared error (RMSE). - // "MINIMIZE_MAE" - Minimize mean-absolute error (MAE). - // "MINIMIZE_RMSLE" - Minimize root-mean-squared log error (RMSLE). - string optimization_objective = 4; - - // Output only. Auxiliary information for each of the - // input_feature_column_specs with respect to this particular model. - repeated TablesModelColumnInfo tables_model_column_info = 5; - - // Required. 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 training cost of the model will not exceed this budget. The final cost - // will be attempted to be close to the budget, though may end up being (even) - // noticeably smaller - at the backend's discretion. This especially may - // happen when further model training ceases to provide any improvements. - // - // If the budget is set to a value known to be insufficient to train a - // model for the given dataset, the training won't be attempted and - // will error. - // - // The train budget must be between 1,000 and 72,000 milli node hours, - // inclusive. - int64 train_budget_milli_node_hours = 6; - - // Output only. The actual training cost of the 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. - int64 train_cost_milli_node_hours = 7; - - // Use the entire training budget. This disables the early stopping feature. - // By default, the early stopping feature is enabled, which means that AutoML - // Tables might stop training before the entire training budget has been used. - bool disable_early_stopping = 12; -} - -// Contains annotation details specific to Tables. -message TablesAnnotation { - // Output only. A confidence estimate between 0.0 and 1.0, inclusive. A higher - // value means greater confidence in the returned value. - // For - // - // [target_column_spec][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] - // of FLOAT64 data type the score is not populated. - float score = 1; - - // Output only. Only populated when - // - // [target_column_spec][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] - // has FLOAT64 data type. An interval in which the exactly correct target - // value has 95% chance to be in. - DoubleRange prediction_interval = 4; - - // The predicted value of the row's - // - // [target_column][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec]. - // The value depends on the column's DataType: - // - // * CATEGORY - the predicted (with the above confidence `score`) CATEGORY - // value. - // - // * FLOAT64 - the predicted (with above `prediction_interval`) FLOAT64 value. - google.protobuf.Value value = 2; - - // Output only. Auxiliary information for each of the model's - // - // [input_feature_column_specs][google.cloud.automl.v1beta1.TablesModelMetadata.input_feature_column_specs] - // with respect to this particular prediction. - // If no other fields than - // - // [column_spec_name][google.cloud.automl.v1beta1.TablesModelColumnInfo.column_spec_name] - // and - // - // [column_display_name][google.cloud.automl.v1beta1.TablesModelColumnInfo.column_display_name] - // would be populated, then this whole field is not. - repeated TablesModelColumnInfo tables_model_column_info = 3; -} - -// An information specific to given column and Tables Model, in context -// of the Model and the predictions created by it. -message TablesModelColumnInfo { - // Output only. The name of the ColumnSpec describing the column. Not - // populated when this proto is outputted to BigQuery. - string column_spec_name = 1; - - // Output only. The display name of the column (same as the display_name of - // its ColumnSpec). - string column_display_name = 2; - - // Output only. When given as part of a Model (always populated): - // Measurement of how much model predictions correctness on the TEST data - // depend on values in this column. A value between 0 and 1, higher means - // higher influence. These values are normalized - for all input feature - // columns of a given model they add to 1. - // - // When given back by Predict (populated iff - // [feature_importance - // param][google.cloud.automl.v1beta1.PredictRequest.params] is set) or Batch - // Predict (populated iff - // [feature_importance][google.cloud.automl.v1beta1.PredictRequest.params] - // param is set): - // Measurement of how impactful for the prediction returned for the given row - // the value in this column was. Specifically, the feature importance - // specifies the marginal contribution that the feature made to the prediction - // score compared to the baseline score. These values are computed using the - // Sampled Shapley method. - float feature_importance = 3; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/tables_pb2.py b/automl/google/cloud/automl_v1beta1/proto/tables_pb2.py deleted file mode 100644 index 4659aa8d343f..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/tables_pb2.py +++ /dev/null @@ -1,932 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/tables.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.cloud.automl_v1beta1.proto import ( - classification_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - column_spec_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_column__spec__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - data_items_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_data__items__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - data_stats_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_data__stats__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - ranges_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_ranges__pb2, -) -from google.cloud.automl_v1beta1.proto import ( - temporal_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_temporal__pb2, -) -from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/tables.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1P\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n.google/cloud/automl_v1beta1/proto/tables.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x36google/cloud/automl_v1beta1/proto/classification.proto\x1a\x33google/cloud/automl_v1beta1/proto/column_spec.proto\x1a\x32google/cloud/automl_v1beta1/proto/data_items.proto\x1a\x32google/cloud/automl_v1beta1/proto/data_stats.proto\x1a.google/cloud/automl_v1beta1/proto/ranges.proto\x1a\x30google/cloud/automl_v1beta1/proto/temporal.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xb0\x03\n\x15TablesDatasetMetadata\x12\x1d\n\x15primary_table_spec_id\x18\x01 \x01(\t\x12\x1d\n\x15target_column_spec_id\x18\x02 \x01(\t\x12\x1d\n\x15weight_column_spec_id\x18\x03 \x01(\t\x12\x1d\n\x15ml_use_column_spec_id\x18\x04 \x01(\t\x12t\n\x1atarget_column_correlations\x18\x06 \x03(\x0b\x32P.google.cloud.automl.v1beta1.TablesDatasetMetadata.TargetColumnCorrelationsEntry\x12\x35\n\x11stats_update_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1an\n\x1dTargetColumnCorrelationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12<\n\x05value\x18\x02 \x01(\x0b\x32-.google.cloud.automl.v1beta1.CorrelationStats:\x02\x38\x01"\x96\x04\n\x13TablesModelMetadata\x12-\n#optimization_objective_recall_value\x18\x11 \x01(\x02H\x00\x12\x30\n&optimization_objective_precision_value\x18\x12 \x01(\x02H\x00\x12\x43\n\x12target_column_spec\x18\x02 \x01(\x0b\x32\'.google.cloud.automl.v1beta1.ColumnSpec\x12K\n\x1ainput_feature_column_specs\x18\x03 \x03(\x0b\x32\'.google.cloud.automl.v1beta1.ColumnSpec\x12\x1e\n\x16optimization_objective\x18\x04 \x01(\t\x12T\n\x18tables_model_column_info\x18\x05 \x03(\x0b\x32\x32.google.cloud.automl.v1beta1.TablesModelColumnInfo\x12%\n\x1dtrain_budget_milli_node_hours\x18\x06 \x01(\x03\x12#\n\x1btrain_cost_milli_node_hours\x18\x07 \x01(\x03\x12\x1e\n\x16\x64isable_early_stopping\x18\x0c \x01(\x08\x42*\n(additional_optimization_objective_config"\xe5\x01\n\x10TablesAnnotation\x12\r\n\x05score\x18\x01 \x01(\x02\x12\x45\n\x13prediction_interval\x18\x04 \x01(\x0b\x32(.google.cloud.automl.v1beta1.DoubleRange\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value\x12T\n\x18tables_model_column_info\x18\x03 \x03(\x0b\x32\x32.google.cloud.automl.v1beta1.TablesModelColumnInfo"j\n\x15TablesModelColumnInfo\x12\x18\n\x10\x63olumn_spec_name\x18\x01 \x01(\t\x12\x1b\n\x13\x63olumn_display_name\x18\x02 \x01(\t\x12\x1a\n\x12\x66\x65\x61ture_importance\x18\x03 \x01(\x02\x42\xa5\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_column__spec__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_data__items__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_data__stats__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_ranges__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_temporal__pb2.DESCRIPTOR, - google_dot_protobuf_dot_struct__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_TABLESDATASETMETADATA_TARGETCOLUMNCORRELATIONSENTRY = _descriptor.Descriptor( - name="TargetColumnCorrelationsEntry", - full_name="google.cloud.automl.v1beta1.TablesDatasetMetadata.TargetColumnCorrelationsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.automl.v1beta1.TablesDatasetMetadata.TargetColumnCorrelationsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.automl.v1beta1.TablesDatasetMetadata.TargetColumnCorrelationsEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=806, - serialized_end=916, -) - -_TABLESDATASETMETADATA = _descriptor.Descriptor( - name="TablesDatasetMetadata", - full_name="google.cloud.automl.v1beta1.TablesDatasetMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="primary_table_spec_id", - full_name="google.cloud.automl.v1beta1.TablesDatasetMetadata.primary_table_spec_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="target_column_spec_id", - full_name="google.cloud.automl.v1beta1.TablesDatasetMetadata.target_column_spec_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="weight_column_spec_id", - full_name="google.cloud.automl.v1beta1.TablesDatasetMetadata.weight_column_spec_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ml_use_column_spec_id", - full_name="google.cloud.automl.v1beta1.TablesDatasetMetadata.ml_use_column_spec_id", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="target_column_correlations", - full_name="google.cloud.automl.v1beta1.TablesDatasetMetadata.target_column_correlations", - index=4, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="stats_update_time", - full_name="google.cloud.automl.v1beta1.TablesDatasetMetadata.stats_update_time", - index=5, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_TABLESDATASETMETADATA_TARGETCOLUMNCORRELATIONSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=484, - serialized_end=916, -) - - -_TABLESMODELMETADATA = _descriptor.Descriptor( - name="TablesModelMetadata", - full_name="google.cloud.automl.v1beta1.TablesModelMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="optimization_objective_recall_value", - full_name="google.cloud.automl.v1beta1.TablesModelMetadata.optimization_objective_recall_value", - index=0, - number=17, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="optimization_objective_precision_value", - full_name="google.cloud.automl.v1beta1.TablesModelMetadata.optimization_objective_precision_value", - index=1, - number=18, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="target_column_spec", - full_name="google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec", - index=2, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="input_feature_column_specs", - full_name="google.cloud.automl.v1beta1.TablesModelMetadata.input_feature_column_specs", - index=3, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="optimization_objective", - full_name="google.cloud.automl.v1beta1.TablesModelMetadata.optimization_objective", - index=4, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tables_model_column_info", - full_name="google.cloud.automl.v1beta1.TablesModelMetadata.tables_model_column_info", - index=5, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="train_budget_milli_node_hours", - full_name="google.cloud.automl.v1beta1.TablesModelMetadata.train_budget_milli_node_hours", - index=6, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="train_cost_milli_node_hours", - full_name="google.cloud.automl.v1beta1.TablesModelMetadata.train_cost_milli_node_hours", - index=7, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="disable_early_stopping", - full_name="google.cloud.automl.v1beta1.TablesModelMetadata.disable_early_stopping", - index=8, - number=12, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="additional_optimization_objective_config", - full_name="google.cloud.automl.v1beta1.TablesModelMetadata.additional_optimization_objective_config", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=919, - serialized_end=1453, -) - - -_TABLESANNOTATION = _descriptor.Descriptor( - name="TablesAnnotation", - full_name="google.cloud.automl.v1beta1.TablesAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.automl.v1beta1.TablesAnnotation.score", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="prediction_interval", - full_name="google.cloud.automl.v1beta1.TablesAnnotation.prediction_interval", - index=1, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.automl.v1beta1.TablesAnnotation.value", - index=2, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tables_model_column_info", - full_name="google.cloud.automl.v1beta1.TablesAnnotation.tables_model_column_info", - index=3, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1456, - serialized_end=1685, -) - - -_TABLESMODELCOLUMNINFO = _descriptor.Descriptor( - name="TablesModelColumnInfo", - full_name="google.cloud.automl.v1beta1.TablesModelColumnInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="column_spec_name", - full_name="google.cloud.automl.v1beta1.TablesModelColumnInfo.column_spec_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="column_display_name", - full_name="google.cloud.automl.v1beta1.TablesModelColumnInfo.column_display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="feature_importance", - full_name="google.cloud.automl.v1beta1.TablesModelColumnInfo.feature_importance", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1687, - serialized_end=1793, -) - -_TABLESDATASETMETADATA_TARGETCOLUMNCORRELATIONSENTRY.fields_by_name[ - "value" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_data__stats__pb2._CORRELATIONSTATS -) -_TABLESDATASETMETADATA_TARGETCOLUMNCORRELATIONSENTRY.containing_type = ( - _TABLESDATASETMETADATA -) -_TABLESDATASETMETADATA.fields_by_name[ - "target_column_correlations" -].message_type = _TABLESDATASETMETADATA_TARGETCOLUMNCORRELATIONSENTRY -_TABLESDATASETMETADATA.fields_by_name[ - "stats_update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_TABLESMODELMETADATA.fields_by_name[ - "target_column_spec" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_column__spec__pb2._COLUMNSPEC -) -_TABLESMODELMETADATA.fields_by_name[ - "input_feature_column_specs" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_column__spec__pb2._COLUMNSPEC -) -_TABLESMODELMETADATA.fields_by_name[ - "tables_model_column_info" -].message_type = _TABLESMODELCOLUMNINFO -_TABLESMODELMETADATA.oneofs_by_name[ - "additional_optimization_objective_config" -].fields.append( - _TABLESMODELMETADATA.fields_by_name["optimization_objective_recall_value"] -) -_TABLESMODELMETADATA.fields_by_name[ - "optimization_objective_recall_value" -].containing_oneof = _TABLESMODELMETADATA.oneofs_by_name[ - "additional_optimization_objective_config" -] -_TABLESMODELMETADATA.oneofs_by_name[ - "additional_optimization_objective_config" -].fields.append( - _TABLESMODELMETADATA.fields_by_name["optimization_objective_precision_value"] -) -_TABLESMODELMETADATA.fields_by_name[ - "optimization_objective_precision_value" -].containing_oneof = _TABLESMODELMETADATA.oneofs_by_name[ - "additional_optimization_objective_config" -] -_TABLESANNOTATION.fields_by_name[ - "prediction_interval" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_ranges__pb2._DOUBLERANGE -) -_TABLESANNOTATION.fields_by_name[ - "value" -].message_type = google_dot_protobuf_dot_struct__pb2._VALUE -_TABLESANNOTATION.fields_by_name[ - "tables_model_column_info" -].message_type = _TABLESMODELCOLUMNINFO -DESCRIPTOR.message_types_by_name["TablesDatasetMetadata"] = _TABLESDATASETMETADATA -DESCRIPTOR.message_types_by_name["TablesModelMetadata"] = _TABLESMODELMETADATA -DESCRIPTOR.message_types_by_name["TablesAnnotation"] = _TABLESANNOTATION -DESCRIPTOR.message_types_by_name["TablesModelColumnInfo"] = _TABLESMODELCOLUMNINFO -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -TablesDatasetMetadata = _reflection.GeneratedProtocolMessageType( - "TablesDatasetMetadata", - (_message.Message,), - dict( - TargetColumnCorrelationsEntry=_reflection.GeneratedProtocolMessageType( - "TargetColumnCorrelationsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_TABLESDATASETMETADATA_TARGETCOLUMNCORRELATIONSENTRY, - __module__="google.cloud.automl_v1beta1.proto.tables_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TablesDatasetMetadata.TargetColumnCorrelationsEntry) - ), - ), - DESCRIPTOR=_TABLESDATASETMETADATA, - __module__="google.cloud.automl_v1beta1.proto.tables_pb2", - __doc__="""Metadata for a dataset used for AutoML Tables. - - - Attributes: - primary_table_spec_id: - Output only. The table\_spec\_id of the primary table of this - dataset. - target_column_spec_id: - column\_spec\_id of the primary table's column that should be - used as the training & prediction target. This column must be - non-nullable and have one of following data types (otherwise - model creation will error): - CATEGORY - FLOAT64 If the - type is CATEGORY , only up to 100 unique values may exist in - that column across all rows. NOTE: Updates of this field will - instantly affect any other users concurrently working with the - dataset. - weight_column_spec_id: - column\_spec\_id of the primary table's column that should be - used as the weight column, i.e. the higher the value the more - important the row will be during model training. Required - type: FLOAT64. Allowed values: 0 to 10000, inclusive on both - ends; 0 means the row is ignored for training. If not set all - rows are assumed to have equal weight of 1. NOTE: Updates of - this field will instantly affect any other users concurrently - working with the dataset. - ml_use_column_spec_id: - column\_spec\_id of the primary table column which specifies a - possible ML use of the row, i.e. the column will be used to - split the rows into TRAIN, VALIDATE and TEST sets. Required - type: STRING. This column, if set, must either have all of - ``TRAIN``, ``VALIDATE``, ``TEST`` among its values, or only - have ``TEST``, ``UNASSIGNED`` values. In the latter case the - rows with ``UNASSIGNED`` value will be assigned by AutoML. - Note that if a given ml use distribution makes it impossible - to create a "good" model, that call will error describing the - issue. If both this column\_spec\_id and primary table's - time\_column\_spec\_id are not set, then all rows are treated - as ``UNASSIGNED``. NOTE: Updates of this field will instantly - affect any other users concurrently working with the dataset. - target_column_correlations: - Output only. Correlations between [TablesDatasetMetadata.targ - et\_column\_spec\_id][google.cloud.automl.v1beta1.TablesDatase - tMetadata.target\_column\_spec\_id], and other columns of the - [TablesDatasetMetadataprimary\_table][google.cloud.automl.v1be - ta1.TablesDatasetMetadata.primary\_table\_spec\_id]. Only set - if the target column is set. Mapping from other column spec id - to its CorrelationStats with the target column. This field may - be stale, see the stats\_update\_time field for for the - timestamp at which these stats were last updated. - stats_update_time: - Output only. The most recent timestamp when - target\_column\_correlations field and all descendant - ColumnSpec.data\_stats and ColumnSpec.top\_correlated\_columns - fields were last (re-)generated. Any changes that happened to - the dataset afterwards are not reflected in these fields - values. The regeneration happens in the background on a best - effort basis. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TablesDatasetMetadata) - ), -) -_sym_db.RegisterMessage(TablesDatasetMetadata) -_sym_db.RegisterMessage(TablesDatasetMetadata.TargetColumnCorrelationsEntry) - -TablesModelMetadata = _reflection.GeneratedProtocolMessageType( - "TablesModelMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_TABLESMODELMETADATA, - __module__="google.cloud.automl_v1beta1.proto.tables_pb2", - __doc__="""Model metadata specific to AutoML Tables. - - - Attributes: - additional_optimization_objective_config: - Additional optimization objective configuration. Required for - ``MAXIMIZE_PRECISION_AT_RECALL`` and - ``MAXIMIZE_RECALL_AT_PRECISION``, otherwise unused. - optimization_objective_recall_value: - Required when optimization\_objective is - "MAXIMIZE\_PRECISION\_AT\_RECALL". Must be between 0 and 1, - inclusive. - optimization_objective_precision_value: - Required when optimization\_objective is - "MAXIMIZE\_RECALL\_AT\_PRECISION". Must be between 0 and 1, - inclusive. - target_column_spec: - Column spec of the dataset's primary table's column the model - is predicting. Snapshotted when model creation started. Only 3 - fields are used: name - May be set on CreateModel, if it's not - then the ColumnSpec corresponding to the current - target\_column\_spec\_id of the dataset the model is trained - from is used. If neither is set, CreateModel will error. - display\_name - Output only. data\_type - Output only. - input_feature_column_specs: - Column specs of the dataset's primary table's columns, on - which the model is trained and which are used as the input for - predictions. The [target\_column][google.cloud.automl.v1beta1 - .TablesModelMetadata.target\_column\_spec] as well as, - according to dataset's state upon model creation, [weight\_co - lumn][google.cloud.automl.v1beta1.TablesDatasetMetadata.weight - \_column\_spec\_id], and [ml\_use\_column][google.cloud.autom - l.v1beta1.TablesDatasetMetadata.ml\_use\_column\_spec\_id] - must never be included here. Only 3 fields are used: - name - - May be set on CreateModel, if set only the columns specified - are used, otherwise all primary table's columns (except the - ones listed above) are used for the training and prediction - input. - display\_name - Output only. - data\_type - - Output only. - optimization_objective: - Objective function the model is optimizing towards. The - training process creates a model that maximizes/minimizes the - value of the objective function over the validation set. The - supported optimization objectives depend on the prediction - type. If the field is not set, a default objective function is - used. CLASSIFICATION\_BINARY: "MAXIMIZE\_AU\_ROC" (default) - - Maximize the area under the receiver operating characteristic - (ROC) curve. "MINIMIZE\_LOG\_LOSS" - Minimize log loss. - "MAXIMIZE\_AU\_PRC" - Maximize the area under the precision- - recall curve. "MAXIMIZE\_PRECISION\_AT\_RECALL" - Maximize - precision for a specified recall value. - "MAXIMIZE\_RECALL\_AT\_PRECISION" - Maximize recall for a - specified precision value. CLASSIFICATION\_MULTI\_CLASS : - "MINIMIZE\_LOG\_LOSS" (default) - Minimize log loss. - REGRESSION: "MINIMIZE\_RMSE" (default) - Minimize root-mean- - squared error (RMSE). "MINIMIZE\_MAE" - Minimize mean-absolute - error (MAE). "MINIMIZE\_RMSLE" - Minimize root-mean-squared - log error (RMSLE). - tables_model_column_info: - Output only. Auxiliary information for each of the - input\_feature\_column\_specs with respect to this particular - model. - train_budget_milli_node_hours: - Required. 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 training cost of the model will not exceed - this budget. The final cost will be attempted to be close to - the budget, though may end up being (even) noticeably smaller - - at the backend's discretion. This especially may happen when - further model training ceases to provide any improvements. If - the budget is set to a value known to be insufficient to train - a model for the given dataset, the training won't be attempted - and will error. The train budget must be between 1,000 and - 72,000 milli node hours, inclusive. - train_cost_milli_node_hours: - Output only. The actual training cost of the 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. - disable_early_stopping: - Use the entire training budget. This disables the early - stopping feature. By default, the early stopping feature is - enabled, which means that AutoML Tables might stop training - before the entire training budget has been used. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TablesModelMetadata) - ), -) -_sym_db.RegisterMessage(TablesModelMetadata) - -TablesAnnotation = _reflection.GeneratedProtocolMessageType( - "TablesAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_TABLESANNOTATION, - __module__="google.cloud.automl_v1beta1.proto.tables_pb2", - __doc__="""Contains annotation details specific to Tables. - - - Attributes: - score: - Output only. A confidence estimate between 0.0 and 1.0, - inclusive. A higher value means greater confidence in the - returned value. For [target\_column\_spec][google.cloud.autom - l.v1beta1.TablesModelMetadata.target\_column\_spec] of FLOAT64 - data type the score is not populated. - prediction_interval: - Output only. Only populated when [target\_column\_spec][googl - e.cloud.automl.v1beta1.TablesModelMetadata.target\_column\_spe - c] has FLOAT64 data type. An interval in which the exactly - correct target value has 95% chance to be in. - value: - The predicted value of the row's [target\_column][google.clou - d.automl.v1beta1.TablesModelMetadata.target\_column\_spec]. - The value depends on the column's DataType: - CATEGORY - the - predicted (with the above confidence ``score``) CATEGORY - value. - FLOAT64 - the predicted (with above - ``prediction_interval``) FLOAT64 value. - tables_model_column_info: - Output only. Auxiliary information for each of the model's [i - nput\_feature\_column\_specs][google.cloud.automl.v1beta1.Tabl - esModelMetadata.input\_feature\_column\_specs] with respect to - this particular prediction. If no other fields than [column\_ - spec\_name][google.cloud.automl.v1beta1.TablesModelColumnInfo. - column\_spec\_name] and [column\_display\_name][google.cloud. - automl.v1beta1.TablesModelColumnInfo.column\_display\_name] - would be populated, then this whole field is not. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TablesAnnotation) - ), -) -_sym_db.RegisterMessage(TablesAnnotation) - -TablesModelColumnInfo = _reflection.GeneratedProtocolMessageType( - "TablesModelColumnInfo", - (_message.Message,), - dict( - DESCRIPTOR=_TABLESMODELCOLUMNINFO, - __module__="google.cloud.automl_v1beta1.proto.tables_pb2", - __doc__="""An information specific to given column and Tables Model, - in context of the Model and the predictions created by it. - - - Attributes: - column_spec_name: - Output only. The name of the ColumnSpec describing the column. - Not populated when this proto is outputted to BigQuery. - column_display_name: - Output only. The display name of the column (same as the - display\_name of its ColumnSpec). - feature_importance: - Output only. When given as part of a Model (always populated): - Measurement of how much model predictions correctness on the - TEST data depend on values in this column. A value between 0 - and 1, higher means higher influence. These values are - normalized - for all input feature columns of a given model - they add to 1. When given back by Predict (populated iff - [feature\_importance - param][google.cloud.automl.v1beta1.PredictRequest.params] is - set) or Batch Predict (populated iff [feature\_importance][goo - gle.cloud.automl.v1beta1.PredictRequest.params] param is set): - Measurement of how impactful for the prediction returned for - the given row the value in this column was. Specifically, the - feature importance specifies the marginal contribution that - the feature made to the prediction score compared to the - baseline score. These values are computed using the Sampled - Shapley method. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TablesModelColumnInfo) - ), -) -_sym_db.RegisterMessage(TablesModelColumnInfo) - - -DESCRIPTOR._options = None -_TABLESDATASETMETADATA_TARGETCOLUMNCORRELATIONSENTRY._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/tables_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/tables_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/tables_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/temporal.proto b/automl/google/cloud/automl_v1beta1/proto/temporal.proto deleted file mode 100644 index 84874d99fa06..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/temporal.proto +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/protobuf/duration.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// A time period inside of an example that has a time dimension (e.g. video). -message TimeSegment { - // Start of the time segment (inclusive), represented as the duration since - // the example start. - google.protobuf.Duration start_time_offset = 1; - - // End of the time segment (exclusive), represented as the duration since the - // example start. - google.protobuf.Duration end_time_offset = 2; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/temporal_pb2.py b/automl/google/cloud/automl_v1beta1/proto/temporal_pb2.py deleted file mode 100644 index a8e53db85ebd..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/temporal_pb2.py +++ /dev/null @@ -1,129 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/temporal.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/temporal.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1P\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n0google/cloud/automl_v1beta1/proto/temporal.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/api/annotations.proto"w\n\x0bTimeSegment\x12\x34\n\x11start_time_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x32\n\x0f\x65nd_time_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\xa5\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_TIMESEGMENT = _descriptor.Descriptor( - name="TimeSegment", - full_name="google.cloud.automl.v1beta1.TimeSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_time_offset", - full_name="google.cloud.automl.v1beta1.TimeSegment.start_time_offset", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time_offset", - full_name="google.cloud.automl.v1beta1.TimeSegment.end_time_offset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=143, - serialized_end=262, -) - -_TIMESEGMENT.fields_by_name[ - "start_time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_TIMESEGMENT.fields_by_name[ - "end_time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -DESCRIPTOR.message_types_by_name["TimeSegment"] = _TIMESEGMENT -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -TimeSegment = _reflection.GeneratedProtocolMessageType( - "TimeSegment", - (_message.Message,), - dict( - DESCRIPTOR=_TIMESEGMENT, - __module__="google.cloud.automl_v1beta1.proto.temporal_pb2", - __doc__="""A time period inside of an example that has a time - dimension (e.g. video). - - - Attributes: - start_time_offset: - Start of the time segment (inclusive), represented as the - duration since the example start. - end_time_offset: - End of the time segment (exclusive), represented as the - duration since the example start. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TimeSegment) - ), -) -_sym_db.RegisterMessage(TimeSegment) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/temporal_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/temporal_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/temporal_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/text.proto b/automl/google/cloud/automl_v1beta1/proto/text.proto deleted file mode 100644 index ca722e07c96b..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/text.proto +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/api/annotations.proto"; -import "google/cloud/automl/v1beta1/classification.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_outer_classname = "TextProto"; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// Dataset metadata for classification. -message TextClassificationDatasetMetadata { - // Required. Type of the classification problem. - ClassificationType classification_type = 1; -} - -// Model metadata that is specific to text classification. -message TextClassificationModelMetadata { - // Output only. Classification type of the dataset used to train this model. - ClassificationType classification_type = 3; -} - -// Dataset metadata that is specific to text extraction -message TextExtractionDatasetMetadata {} - -// Model metadata that is specific to text extraction. -message TextExtractionModelMetadata {} - -// Dataset metadata for text sentiment. -message TextSentimentDatasetMetadata { - // 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). - int32 sentiment_max = 1; -} - -// Model metadata that is specific to text sentiment. -message TextSentimentModelMetadata {} diff --git a/automl/google/cloud/automl_v1beta1/proto/text_extraction.proto b/automl/google/cloud/automl_v1beta1/proto/text_extraction.proto deleted file mode 100644 index 07f0dda8169f..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/text_extraction.proto +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/cloud/automl/v1beta1/text_segment.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// Annotation for identifying spans of text. -message TextExtractionAnnotation { - // Required. Text extraction annotations can either be a text segment or a - // text relation. - oneof annotation { - // An entity annotation will set this, which is the part of the original - // text to which the annotation pertains. - TextSegment text_segment = 3; - } - - // Output only. A confidence estimate between 0.0 and 1.0. A higher value - // means greater confidence in correctness of the annotation. - float score = 1; -} - -// Model evaluation metrics for text extraction problems. -message TextExtractionEvaluationMetrics { - // Metrics for a single confidence threshold. - message ConfidenceMetricsEntry { - // 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. - float confidence_threshold = 1; - - // Output only. Recall under the given confidence threshold. - float recall = 3; - - // Output only. Precision under the given confidence threshold. - float precision = 4; - - // Output only. The harmonic mean of recall and precision. - float f1_score = 5; - } - - // Output only. The Area under precision recall curve metric. - float au_prc = 1; - - // Output only. Metrics that have confidence thresholds. - // Precision-recall curve can be derived from it. - repeated ConfidenceMetricsEntry confidence_metrics_entries = 2; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/text_extraction_pb2.py b/automl/google/cloud/automl_v1beta1/proto/text_extraction_pb2.py deleted file mode 100644 index 04dc759c3f02..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/text_extraction_pb2.py +++ /dev/null @@ -1,351 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/text_extraction.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.cloud.automl_v1beta1.proto import ( - text_segment_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__segment__pb2, -) -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/text_extraction.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1P\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n7google/cloud/automl_v1beta1/proto/text_extraction.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x34google/cloud/automl_v1beta1/proto/text_segment.proto\x1a\x1cgoogle/api/annotations.proto"y\n\x18TextExtractionAnnotation\x12@\n\x0ctext_segment\x18\x03 \x01(\x0b\x32(.google.cloud.automl.v1beta1.TextSegmentH\x00\x12\r\n\x05score\x18\x01 \x01(\x02\x42\x0c\n\nannotation"\x97\x02\n\x1fTextExtractionEvaluationMetrics\x12\x0e\n\x06\x61u_prc\x18\x01 \x01(\x02\x12w\n\x1a\x63onfidence_metrics_entries\x18\x02 \x03(\x0b\x32S.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry\x1ak\n\x16\x43onfidenceMetricsEntry\x12\x1c\n\x14\x63onfidence_threshold\x18\x01 \x01(\x02\x12\x0e\n\x06recall\x18\x03 \x01(\x02\x12\x11\n\tprecision\x18\x04 \x01(\x02\x12\x10\n\x08\x66\x31_score\x18\x05 \x01(\x02\x42\xa5\x01\n\x1f\x63om.google.cloud.automl.v1beta1P\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__segment__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_TEXTEXTRACTIONANNOTATION = _descriptor.Descriptor( - name="TextExtractionAnnotation", - full_name="google.cloud.automl.v1beta1.TextExtractionAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="text_segment", - full_name="google.cloud.automl.v1beta1.TextExtractionAnnotation.text_segment", - index=0, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.automl.v1beta1.TextExtractionAnnotation.score", - index=1, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="annotation", - full_name="google.cloud.automl.v1beta1.TextExtractionAnnotation.annotation", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=172, - serialized_end=293, -) - - -_TEXTEXTRACTIONEVALUATIONMETRICS_CONFIDENCEMETRICSENTRY = _descriptor.Descriptor( - name="ConfidenceMetricsEntry", - full_name="google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="confidence_threshold", - full_name="google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.confidence_threshold", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="recall", - full_name="google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.recall", - index=1, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="precision", - full_name="google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.precision", - index=2, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="f1_score", - full_name="google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.f1_score", - index=3, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=468, - serialized_end=575, -) - -_TEXTEXTRACTIONEVALUATIONMETRICS = _descriptor.Descriptor( - name="TextExtractionEvaluationMetrics", - full_name="google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="au_prc", - full_name="google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.au_prc", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence_metrics_entries", - full_name="google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.confidence_metrics_entries", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_TEXTEXTRACTIONEVALUATIONMETRICS_CONFIDENCEMETRICSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=296, - serialized_end=575, -) - -_TEXTEXTRACTIONANNOTATION.fields_by_name[ - "text_segment" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_text__segment__pb2._TEXTSEGMENT -) -_TEXTEXTRACTIONANNOTATION.oneofs_by_name["annotation"].fields.append( - _TEXTEXTRACTIONANNOTATION.fields_by_name["text_segment"] -) -_TEXTEXTRACTIONANNOTATION.fields_by_name[ - "text_segment" -].containing_oneof = _TEXTEXTRACTIONANNOTATION.oneofs_by_name["annotation"] -_TEXTEXTRACTIONEVALUATIONMETRICS_CONFIDENCEMETRICSENTRY.containing_type = ( - _TEXTEXTRACTIONEVALUATIONMETRICS -) -_TEXTEXTRACTIONEVALUATIONMETRICS.fields_by_name[ - "confidence_metrics_entries" -].message_type = _TEXTEXTRACTIONEVALUATIONMETRICS_CONFIDENCEMETRICSENTRY -DESCRIPTOR.message_types_by_name["TextExtractionAnnotation"] = _TEXTEXTRACTIONANNOTATION -DESCRIPTOR.message_types_by_name[ - "TextExtractionEvaluationMetrics" -] = _TEXTEXTRACTIONEVALUATIONMETRICS -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -TextExtractionAnnotation = _reflection.GeneratedProtocolMessageType( - "TextExtractionAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTEXTRACTIONANNOTATION, - __module__="google.cloud.automl_v1beta1.proto.text_extraction_pb2", - __doc__="""Annotation for identifying spans of text. - - - Attributes: - annotation: - Required. Text extraction annotations can either be a text - segment or a text relation. - text_segment: - An entity annotation will set this, which is the part of the - original text to which the annotation pertains. - score: - Output only. A confidence estimate between 0.0 and 1.0. A - higher value means greater confidence in correctness of the - annotation. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TextExtractionAnnotation) - ), -) -_sym_db.RegisterMessage(TextExtractionAnnotation) - -TextExtractionEvaluationMetrics = _reflection.GeneratedProtocolMessageType( - "TextExtractionEvaluationMetrics", - (_message.Message,), - dict( - ConfidenceMetricsEntry=_reflection.GeneratedProtocolMessageType( - "ConfidenceMetricsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTEXTRACTIONEVALUATIONMETRICS_CONFIDENCEMETRICSENTRY, - __module__="google.cloud.automl_v1beta1.proto.text_extraction_pb2", - __doc__="""Metrics for a single confidence threshold. - - - Attributes: - 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. - recall: - Output only. Recall under the given confidence threshold. - precision: - Output only. Precision under the given confidence threshold. - f1_score: - Output only. The harmonic mean of recall and precision. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry) - ), - ), - DESCRIPTOR=_TEXTEXTRACTIONEVALUATIONMETRICS, - __module__="google.cloud.automl_v1beta1.proto.text_extraction_pb2", - __doc__="""Model evaluation metrics for text extraction problems. - - - Attributes: - au_prc: - Output only. The Area under precision recall curve metric. - confidence_metrics_entries: - Output only. Metrics that have confidence thresholds. - Precision-recall curve can be derived from it. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics) - ), -) -_sym_db.RegisterMessage(TextExtractionEvaluationMetrics) -_sym_db.RegisterMessage(TextExtractionEvaluationMetrics.ConfidenceMetricsEntry) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/text_extraction_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/text_extraction_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/text_extraction_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/text_pb2.py b/automl/google/cloud/automl_v1beta1/proto/text_pb2.py deleted file mode 100644 index ea8fef3f9623..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/text_pb2.py +++ /dev/null @@ -1,352 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/text.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.cloud.automl_v1beta1.proto import ( - classification_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2, -) - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/text.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1B\tTextProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n,google/cloud/automl_v1beta1/proto/text.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x36google/cloud/automl_v1beta1/proto/classification.proto"q\n!TextClassificationDatasetMetadata\x12L\n\x13\x63lassification_type\x18\x01 \x01(\x0e\x32/.google.cloud.automl.v1beta1.ClassificationType"o\n\x1fTextClassificationModelMetadata\x12L\n\x13\x63lassification_type\x18\x03 \x01(\x0e\x32/.google.cloud.automl.v1beta1.ClassificationType"\x1f\n\x1dTextExtractionDatasetMetadata"\x1d\n\x1bTextExtractionModelMetadata"5\n\x1cTextSentimentDatasetMetadata\x12\x15\n\rsentiment_max\x18\x01 \x01(\x05"\x1c\n\x1aTextSentimentModelMetadataB\xb0\x01\n\x1f\x63om.google.cloud.automl.v1beta1B\tTextProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2.DESCRIPTOR, - ], -) - - -_TEXTCLASSIFICATIONDATASETMETADATA = _descriptor.Descriptor( - name="TextClassificationDatasetMetadata", - full_name="google.cloud.automl.v1beta1.TextClassificationDatasetMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="classification_type", - full_name="google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.classification_type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=163, - serialized_end=276, -) - - -_TEXTCLASSIFICATIONMODELMETADATA = _descriptor.Descriptor( - name="TextClassificationModelMetadata", - full_name="google.cloud.automl.v1beta1.TextClassificationModelMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="classification_type", - full_name="google.cloud.automl.v1beta1.TextClassificationModelMetadata.classification_type", - index=0, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=278, - serialized_end=389, -) - - -_TEXTEXTRACTIONDATASETMETADATA = _descriptor.Descriptor( - name="TextExtractionDatasetMetadata", - full_name="google.cloud.automl.v1beta1.TextExtractionDatasetMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=391, - serialized_end=422, -) - - -_TEXTEXTRACTIONMODELMETADATA = _descriptor.Descriptor( - name="TextExtractionModelMetadata", - full_name="google.cloud.automl.v1beta1.TextExtractionModelMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=424, - serialized_end=453, -) - - -_TEXTSENTIMENTDATASETMETADATA = _descriptor.Descriptor( - name="TextSentimentDatasetMetadata", - full_name="google.cloud.automl.v1beta1.TextSentimentDatasetMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="sentiment_max", - full_name="google.cloud.automl.v1beta1.TextSentimentDatasetMetadata.sentiment_max", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=455, - serialized_end=508, -) - - -_TEXTSENTIMENTMODELMETADATA = _descriptor.Descriptor( - name="TextSentimentModelMetadata", - full_name="google.cloud.automl.v1beta1.TextSentimentModelMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=510, - serialized_end=538, -) - -_TEXTCLASSIFICATIONDATASETMETADATA.fields_by_name[ - "classification_type" -].enum_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2._CLASSIFICATIONTYPE -) -_TEXTCLASSIFICATIONMODELMETADATA.fields_by_name[ - "classification_type" -].enum_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2._CLASSIFICATIONTYPE -) -DESCRIPTOR.message_types_by_name[ - "TextClassificationDatasetMetadata" -] = _TEXTCLASSIFICATIONDATASETMETADATA -DESCRIPTOR.message_types_by_name[ - "TextClassificationModelMetadata" -] = _TEXTCLASSIFICATIONMODELMETADATA -DESCRIPTOR.message_types_by_name[ - "TextExtractionDatasetMetadata" -] = _TEXTEXTRACTIONDATASETMETADATA -DESCRIPTOR.message_types_by_name[ - "TextExtractionModelMetadata" -] = _TEXTEXTRACTIONMODELMETADATA -DESCRIPTOR.message_types_by_name[ - "TextSentimentDatasetMetadata" -] = _TEXTSENTIMENTDATASETMETADATA -DESCRIPTOR.message_types_by_name[ - "TextSentimentModelMetadata" -] = _TEXTSENTIMENTMODELMETADATA -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -TextClassificationDatasetMetadata = _reflection.GeneratedProtocolMessageType( - "TextClassificationDatasetMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTCLASSIFICATIONDATASETMETADATA, - __module__="google.cloud.automl_v1beta1.proto.text_pb2", - __doc__="""Dataset metadata for classification. - - - Attributes: - classification_type: - Required. Type of the classification problem. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) - ), -) -_sym_db.RegisterMessage(TextClassificationDatasetMetadata) - -TextClassificationModelMetadata = _reflection.GeneratedProtocolMessageType( - "TextClassificationModelMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTCLASSIFICATIONMODELMETADATA, - __module__="google.cloud.automl_v1beta1.proto.text_pb2", - __doc__="""Model metadata that is specific to text classification. - - - Attributes: - classification_type: - Output only. Classification type of the dataset used to train - this model. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TextClassificationModelMetadata) - ), -) -_sym_db.RegisterMessage(TextClassificationModelMetadata) - -TextExtractionDatasetMetadata = _reflection.GeneratedProtocolMessageType( - "TextExtractionDatasetMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTEXTRACTIONDATASETMETADATA, - __module__="google.cloud.automl_v1beta1.proto.text_pb2", - __doc__="""Dataset metadata that is specific to text extraction - - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TextExtractionDatasetMetadata) - ), -) -_sym_db.RegisterMessage(TextExtractionDatasetMetadata) - -TextExtractionModelMetadata = _reflection.GeneratedProtocolMessageType( - "TextExtractionModelMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTEXTRACTIONMODELMETADATA, - __module__="google.cloud.automl_v1beta1.proto.text_pb2", - __doc__="""Model metadata that is specific to text extraction. - - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TextExtractionModelMetadata) - ), -) -_sym_db.RegisterMessage(TextExtractionModelMetadata) - -TextSentimentDatasetMetadata = _reflection.GeneratedProtocolMessageType( - "TextSentimentDatasetMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTSENTIMENTDATASETMETADATA, - __module__="google.cloud.automl_v1beta1.proto.text_pb2", - __doc__="""Dataset metadata for text sentiment. - - - Attributes: - 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). - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TextSentimentDatasetMetadata) - ), -) -_sym_db.RegisterMessage(TextSentimentDatasetMetadata) - -TextSentimentModelMetadata = _reflection.GeneratedProtocolMessageType( - "TextSentimentModelMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTSENTIMENTMODELMETADATA, - __module__="google.cloud.automl_v1beta1.proto.text_pb2", - __doc__="""Model metadata that is specific to text sentiment. - - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TextSentimentModelMetadata) - ), -) -_sym_db.RegisterMessage(TextSentimentModelMetadata) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/text_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/text_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/text_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/text_segment.proto b/automl/google/cloud/automl_v1beta1/proto/text_segment.proto deleted file mode 100644 index 41b8be1cca00..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/text_segment.proto +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_outer_classname = "TextSegmentProto"; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// A contiguous part of a text (string), assuming it has an UTF-8 NFC encoding. -message TextSegment { - // Output only. The content of the TextSegment. - string content = 3; - - // Required. Zero-based character index of the first character of the text - // segment (counting characters from the beginning of the text). - int64 start_offset = 1; - - // 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. - int64 end_offset = 2; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/text_segment_pb2.py b/automl/google/cloud/automl_v1beta1/proto/text_segment_pb2.py deleted file mode 100644 index e896211ed7a4..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/text_segment_pb2.py +++ /dev/null @@ -1,142 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/text_segment.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/text_segment.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1B\020TextSegmentProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n4google/cloud/automl_v1beta1/proto/text_segment.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x1cgoogle/api/annotations.proto"H\n\x0bTextSegment\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\t\x12\x14\n\x0cstart_offset\x18\x01 \x01(\x03\x12\x12\n\nend_offset\x18\x02 \x01(\x03\x42\xb7\x01\n\x1f\x63om.google.cloud.automl.v1beta1B\x10TextSegmentProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], -) - - -_TEXTSEGMENT = _descriptor.Descriptor( - name="TextSegment", - full_name="google.cloud.automl.v1beta1.TextSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="content", - full_name="google.cloud.automl.v1beta1.TextSegment.content", - index=0, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="start_offset", - full_name="google.cloud.automl.v1beta1.TextSegment.start_offset", - index=1, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_offset", - full_name="google.cloud.automl.v1beta1.TextSegment.end_offset", - index=2, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=115, - serialized_end=187, -) - -DESCRIPTOR.message_types_by_name["TextSegment"] = _TEXTSEGMENT -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -TextSegment = _reflection.GeneratedProtocolMessageType( - "TextSegment", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTSEGMENT, - __module__="google.cloud.automl_v1beta1.proto.text_segment_pb2", - __doc__="""A contiguous part of a text (string), assuming it has an - UTF-8 NFC encoding. - - - Attributes: - content: - Output only. The content of the TextSegment. - start_offset: - Required. Zero-based character index of the first character of - the text segment (counting characters from the beginning of - the text). - 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. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TextSegment) - ), -) -_sym_db.RegisterMessage(TextSegment) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/text_segment_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/text_segment_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/text_segment_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/text_sentiment.proto b/automl/google/cloud/automl_v1beta1/proto/text_sentiment.proto deleted file mode 100644 index 978acb0f97c6..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/text_sentiment.proto +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/cloud/automl/v1beta1/classification.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_outer_classname = "TextSentimentProto"; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// Contains annotation details specific to text sentiment. -message TextSentimentAnnotation { - // Output only. The sentiment with the semantic, as given to the - // [AutoMl.ImportData][google.cloud.automl.v1beta1.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. - int32 sentiment = 1; -} - -// Model evaluation metrics for text sentiment problems. -message TextSentimentEvaluationMetrics { - // Output only. Precision. - float precision = 1; - - // Output only. Recall. - float recall = 2; - - // Output only. The harmonic mean of recall and precision. - float f1_score = 3; - - // Output only. Mean absolute error. Only set for the overall model - // evaluation, not for evaluation of a single annotation spec. - float mean_absolute_error = 4; - - // Output only. Mean squared error. Only set for the overall model - // evaluation, not for evaluation of a single annotation spec. - float mean_squared_error = 5; - - // Output only. Linear weighted kappa. Only set for the overall model - // evaluation, not for evaluation of a single annotation spec. - float linear_kappa = 6; - - // Output only. Quadratic weighted kappa. Only set for the overall model - // evaluation, not for evaluation of a single annotation spec. - float quadratic_kappa = 7; - - // Output only. Confusion matrix of the evaluation. - // Only set for the overall model evaluation, not for evaluation of a single - // annotation spec. - ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; - - // Output only. The annotation spec ids used for this evaluation. - // Deprecated . - repeated string annotation_spec_id = 9 [deprecated = true]; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/text_sentiment_pb2.py b/automl/google/cloud/automl_v1beta1/proto/text_sentiment_pb2.py deleted file mode 100644 index c55c9979bb83..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/text_sentiment_pb2.py +++ /dev/null @@ -1,353 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/text_sentiment.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.cloud.automl_v1beta1.proto import ( - classification_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2, -) -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/text_sentiment.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1B\022TextSentimentProtoZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n6google/cloud/automl_v1beta1/proto/text_sentiment.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x36google/cloud/automl_v1beta1/proto/classification.proto\x1a\x1cgoogle/api/annotations.proto",\n\x17TextSentimentAnnotation\x12\x11\n\tsentiment\x18\x01 \x01(\x05"\xc5\x02\n\x1eTextSentimentEvaluationMetrics\x12\x11\n\tprecision\x18\x01 \x01(\x02\x12\x0e\n\x06recall\x18\x02 \x01(\x02\x12\x10\n\x08\x66\x31_score\x18\x03 \x01(\x02\x12\x1b\n\x13mean_absolute_error\x18\x04 \x01(\x02\x12\x1a\n\x12mean_squared_error\x18\x05 \x01(\x02\x12\x14\n\x0clinear_kappa\x18\x06 \x01(\x02\x12\x17\n\x0fquadratic_kappa\x18\x07 \x01(\x02\x12\x66\n\x10\x63onfusion_matrix\x18\x08 \x01(\x0b\x32L.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix\x12\x1e\n\x12\x61nnotation_spec_id\x18\t \x03(\tB\x02\x18\x01\x42\xb7\x01\n\x1f\x63om.google.cloud.automl.v1beta1B\x12TextSentimentProtoZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_TEXTSENTIMENTANNOTATION = _descriptor.Descriptor( - name="TextSentimentAnnotation", - full_name="google.cloud.automl.v1beta1.TextSentimentAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="sentiment", - full_name="google.cloud.automl.v1beta1.TextSentimentAnnotation.sentiment", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=173, - serialized_end=217, -) - - -_TEXTSENTIMENTEVALUATIONMETRICS = _descriptor.Descriptor( - name="TextSentimentEvaluationMetrics", - full_name="google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="precision", - full_name="google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.precision", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="recall", - full_name="google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.recall", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="f1_score", - full_name="google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.f1_score", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mean_absolute_error", - full_name="google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.mean_absolute_error", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mean_squared_error", - full_name="google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.mean_squared_error", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="linear_kappa", - full_name="google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.linear_kappa", - index=5, - number=6, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="quadratic_kappa", - full_name="google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.quadratic_kappa", - index=6, - number=7, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confusion_matrix", - full_name="google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.confusion_matrix", - index=7, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_spec_id", - full_name="google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.annotation_spec_id", - index=8, - number=9, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=220, - serialized_end=545, -) - -_TEXTSENTIMENTEVALUATIONMETRICS.fields_by_name[ - "confusion_matrix" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2._CLASSIFICATIONEVALUATIONMETRICS_CONFUSIONMATRIX -) -DESCRIPTOR.message_types_by_name["TextSentimentAnnotation"] = _TEXTSENTIMENTANNOTATION -DESCRIPTOR.message_types_by_name[ - "TextSentimentEvaluationMetrics" -] = _TEXTSENTIMENTEVALUATIONMETRICS -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -TextSentimentAnnotation = _reflection.GeneratedProtocolMessageType( - "TextSentimentAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTSENTIMENTANNOTATION, - __module__="google.cloud.automl_v1beta1.proto.text_sentiment_pb2", - __doc__="""Contains annotation details specific to text sentiment. - - - Attributes: - sentiment: - Output only. The sentiment with the semantic, as given to the - [AutoMl.ImportData][google.cloud.automl.v1beta1.AutoMl.ImportD - ata] 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. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TextSentimentAnnotation) - ), -) -_sym_db.RegisterMessage(TextSentimentAnnotation) - -TextSentimentEvaluationMetrics = _reflection.GeneratedProtocolMessageType( - "TextSentimentEvaluationMetrics", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTSENTIMENTEVALUATIONMETRICS, - __module__="google.cloud.automl_v1beta1.proto.text_sentiment_pb2", - __doc__="""Model evaluation metrics for text sentiment problems. - - - Attributes: - precision: - Output only. Precision. - recall: - Output only. Recall. - f1_score: - Output only. The harmonic mean of recall and precision. - mean_absolute_error: - Output only. Mean absolute error. Only set for the overall - model evaluation, not for evaluation of a single annotation - spec. - mean_squared_error: - Output only. Mean squared error. Only set for the overall - model evaluation, not for evaluation of a single annotation - spec. - linear_kappa: - Output only. Linear weighted kappa. Only set for the overall - model evaluation, not for evaluation of a single annotation - spec. - quadratic_kappa: - Output only. Quadratic weighted kappa. Only set for the - overall model evaluation, not for evaluation of a single - annotation spec. - confusion_matrix: - Output only. Confusion matrix of the evaluation. Only set for - the overall model evaluation, not for evaluation of a single - annotation spec. - annotation_spec_id: - Output only. The annotation spec ids used for this evaluation. - Deprecated . - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics) - ), -) -_sym_db.RegisterMessage(TextSentimentEvaluationMetrics) - - -DESCRIPTOR._options = None -_TEXTSENTIMENTEVALUATIONMETRICS.fields_by_name["annotation_spec_id"]._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/text_sentiment_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/text_sentiment_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/text_sentiment_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/translation.proto b/automl/google/cloud/automl_v1beta1/proto/translation.proto deleted file mode 100644 index ed02b2af5fd6..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/translation.proto +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/cloud/automl/v1beta1/data_items.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_outer_classname = "TranslationProto"; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// Dataset metadata that is specific to translation. -message TranslationDatasetMetadata { - // Required. The BCP-47 language code of the source language. - string source_language_code = 1; - - // Required. The BCP-47 language code of the target language. - string target_language_code = 2; -} - -// Evaluation metrics for the dataset. -message TranslationEvaluationMetrics { - // Output only. BLEU score. - double bleu_score = 1; - - // Output only. BLEU score for base model. - double base_bleu_score = 2; -} - -// Model metadata that is specific to translation. -message TranslationModelMetadata { - // 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}` - string base_model = 1; - - // Output only. Inferred from the dataset. - // The source languge (The BCP-47 language code) that is used for training. - string source_language_code = 2; - - // Output only. The target languge (The BCP-47 language code) that is used for - // training. - string target_language_code = 3; -} - -// Annotation details specific to translation. -message TranslationAnnotation { - // Output only . The translated content. - TextSnippet translated_content = 1; -} diff --git a/automl/google/cloud/automl_v1beta1/proto/translation_pb2.py b/automl/google/cloud/automl_v1beta1/proto/translation_pb2.py deleted file mode 100644 index 15a081761c0f..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/translation_pb2.py +++ /dev/null @@ -1,370 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/translation.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.cloud.automl_v1beta1.proto import ( - data_items_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_data__items__pb2, -) -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/translation.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1B\020TranslationProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n3google/cloud/automl_v1beta1/proto/translation.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x32google/cloud/automl_v1beta1/proto/data_items.proto\x1a\x1cgoogle/api/annotations.proto"X\n\x1aTranslationDatasetMetadata\x12\x1c\n\x14source_language_code\x18\x01 \x01(\t\x12\x1c\n\x14target_language_code\x18\x02 \x01(\t"K\n\x1cTranslationEvaluationMetrics\x12\x12\n\nbleu_score\x18\x01 \x01(\x01\x12\x17\n\x0f\x62\x61se_bleu_score\x18\x02 \x01(\x01"j\n\x18TranslationModelMetadata\x12\x12\n\nbase_model\x18\x01 \x01(\t\x12\x1c\n\x14source_language_code\x18\x02 \x01(\t\x12\x1c\n\x14target_language_code\x18\x03 \x01(\t"]\n\x15TranslationAnnotation\x12\x44\n\x12translated_content\x18\x01 \x01(\x0b\x32(.google.cloud.automl.v1beta1.TextSnippetB\xb7\x01\n\x1f\x63om.google.cloud.automl.v1beta1B\x10TranslationProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_data__items__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_TRANSLATIONDATASETMETADATA = _descriptor.Descriptor( - name="TranslationDatasetMetadata", - full_name="google.cloud.automl.v1beta1.TranslationDatasetMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="source_language_code", - full_name="google.cloud.automl.v1beta1.TranslationDatasetMetadata.source_language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="target_language_code", - full_name="google.cloud.automl.v1beta1.TranslationDatasetMetadata.target_language_code", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=166, - serialized_end=254, -) - - -_TRANSLATIONEVALUATIONMETRICS = _descriptor.Descriptor( - name="TranslationEvaluationMetrics", - full_name="google.cloud.automl.v1beta1.TranslationEvaluationMetrics", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bleu_score", - full_name="google.cloud.automl.v1beta1.TranslationEvaluationMetrics.bleu_score", - index=0, - number=1, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="base_bleu_score", - full_name="google.cloud.automl.v1beta1.TranslationEvaluationMetrics.base_bleu_score", - index=1, - number=2, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=256, - serialized_end=331, -) - - -_TRANSLATIONMODELMETADATA = _descriptor.Descriptor( - name="TranslationModelMetadata", - full_name="google.cloud.automl.v1beta1.TranslationModelMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="base_model", - full_name="google.cloud.automl.v1beta1.TranslationModelMetadata.base_model", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="source_language_code", - full_name="google.cloud.automl.v1beta1.TranslationModelMetadata.source_language_code", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="target_language_code", - full_name="google.cloud.automl.v1beta1.TranslationModelMetadata.target_language_code", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=333, - serialized_end=439, -) - - -_TRANSLATIONANNOTATION = _descriptor.Descriptor( - name="TranslationAnnotation", - full_name="google.cloud.automl.v1beta1.TranslationAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="translated_content", - full_name="google.cloud.automl.v1beta1.TranslationAnnotation.translated_content", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=441, - serialized_end=534, -) - -_TRANSLATIONANNOTATION.fields_by_name[ - "translated_content" -].message_type = ( - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_data__items__pb2._TEXTSNIPPET -) -DESCRIPTOR.message_types_by_name[ - "TranslationDatasetMetadata" -] = _TRANSLATIONDATASETMETADATA -DESCRIPTOR.message_types_by_name[ - "TranslationEvaluationMetrics" -] = _TRANSLATIONEVALUATIONMETRICS -DESCRIPTOR.message_types_by_name["TranslationModelMetadata"] = _TRANSLATIONMODELMETADATA -DESCRIPTOR.message_types_by_name["TranslationAnnotation"] = _TRANSLATIONANNOTATION -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -TranslationDatasetMetadata = _reflection.GeneratedProtocolMessageType( - "TranslationDatasetMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_TRANSLATIONDATASETMETADATA, - __module__="google.cloud.automl_v1beta1.proto.translation_pb2", - __doc__="""Dataset metadata that is specific to translation. - - - Attributes: - source_language_code: - Required. The BCP-47 language code of the source language. - target_language_code: - Required. The BCP-47 language code of the target language. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TranslationDatasetMetadata) - ), -) -_sym_db.RegisterMessage(TranslationDatasetMetadata) - -TranslationEvaluationMetrics = _reflection.GeneratedProtocolMessageType( - "TranslationEvaluationMetrics", - (_message.Message,), - dict( - DESCRIPTOR=_TRANSLATIONEVALUATIONMETRICS, - __module__="google.cloud.automl_v1beta1.proto.translation_pb2", - __doc__="""Evaluation metrics for the dataset. - - - Attributes: - bleu_score: - Output only. BLEU score. - base_bleu_score: - Output only. BLEU score for base model. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TranslationEvaluationMetrics) - ), -) -_sym_db.RegisterMessage(TranslationEvaluationMetrics) - -TranslationModelMetadata = _reflection.GeneratedProtocolMessageType( - "TranslationModelMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_TRANSLATIONMODELMETADATA, - __module__="google.cloud.automl_v1beta1.proto.translation_pb2", - __doc__="""Model metadata that is specific to translation. - - - Attributes: - 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}`` - source_language_code: - Output only. Inferred from the dataset. The source languge - (The BCP-47 language code) that is used for training. - target_language_code: - Output only. The target languge (The BCP-47 language code) - that is used for training. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TranslationModelMetadata) - ), -) -_sym_db.RegisterMessage(TranslationModelMetadata) - -TranslationAnnotation = _reflection.GeneratedProtocolMessageType( - "TranslationAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_TRANSLATIONANNOTATION, - __module__="google.cloud.automl_v1beta1.proto.translation_pb2", - __doc__="""Annotation details specific to translation. - - - Attributes: - translated_content: - Output only . The translated content. - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.TranslationAnnotation) - ), -) -_sym_db.RegisterMessage(TranslationAnnotation) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/translation_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/translation_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/translation_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/proto/video.proto b/automl/google/cloud/automl_v1beta1/proto/video.proto deleted file mode 100644 index b7c7325bc2f1..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/video.proto +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.automl.v1beta1; - -import "google/cloud/automl/v1beta1/classification.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; -option java_multiple_files = true; -option java_outer_classname = "VideoProto"; -option java_package = "com.google.cloud.automl.v1beta1"; -option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; -option ruby_package = "Google::Cloud::AutoML::V1beta1"; - -// Dataset metadata specific to video classification. -// All Video Classification datasets are treated as multi label. -message VideoClassificationDatasetMetadata { - -} - -// Dataset metadata specific to video object tracking. -message VideoObjectTrackingDatasetMetadata { - -} - -// Model metadata specific to video classification. -message VideoClassificationModelMetadata { - -} - -// Model metadata specific to video object tracking. -message VideoObjectTrackingModelMetadata { - -} diff --git a/automl/google/cloud/automl_v1beta1/proto/video_pb2.py b/automl/google/cloud/automl_v1beta1/proto/video_pb2.py deleted file mode 100644 index 1481681a9814..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/video_pb2.py +++ /dev/null @@ -1,193 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/automl_v1beta1/proto/video.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.cloud.automl_v1beta1.proto import ( - classification_pb2 as google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2, -) -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/automl_v1beta1/proto/video.proto", - package="google.cloud.automl.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.automl.v1beta1B\nVideoProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\312\002\033Google\\Cloud\\AutoMl\\V1beta1\352\002\036Google::Cloud::AutoML::V1beta1" - ), - serialized_pb=_b( - '\n-google/cloud/automl_v1beta1/proto/video.proto\x12\x1bgoogle.cloud.automl.v1beta1\x1a\x36google/cloud/automl_v1beta1/proto/classification.proto\x1a\x1cgoogle/api/annotations.proto"$\n"VideoClassificationDatasetMetadata"$\n"VideoObjectTrackingDatasetMetadata""\n VideoClassificationModelMetadata""\n VideoObjectTrackingModelMetadataB\xb1\x01\n\x1f\x63om.google.cloud.automl.v1beta1B\nVideoProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl\xca\x02\x1bGoogle\\Cloud\\AutoMl\\V1beta1\xea\x02\x1eGoogle::Cloud::AutoML::V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_cloud_dot_automl__v1beta1_dot_proto_dot_classification__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_VIDEOCLASSIFICATIONDATASETMETADATA = _descriptor.Descriptor( - name="VideoClassificationDatasetMetadata", - full_name="google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=164, - serialized_end=200, -) - - -_VIDEOOBJECTTRACKINGDATASETMETADATA = _descriptor.Descriptor( - name="VideoObjectTrackingDatasetMetadata", - full_name="google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=202, - serialized_end=238, -) - - -_VIDEOCLASSIFICATIONMODELMETADATA = _descriptor.Descriptor( - name="VideoClassificationModelMetadata", - full_name="google.cloud.automl.v1beta1.VideoClassificationModelMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=240, - serialized_end=274, -) - - -_VIDEOOBJECTTRACKINGMODELMETADATA = _descriptor.Descriptor( - name="VideoObjectTrackingModelMetadata", - full_name="google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=276, - serialized_end=310, -) - -DESCRIPTOR.message_types_by_name[ - "VideoClassificationDatasetMetadata" -] = _VIDEOCLASSIFICATIONDATASETMETADATA -DESCRIPTOR.message_types_by_name[ - "VideoObjectTrackingDatasetMetadata" -] = _VIDEOOBJECTTRACKINGDATASETMETADATA -DESCRIPTOR.message_types_by_name[ - "VideoClassificationModelMetadata" -] = _VIDEOCLASSIFICATIONMODELMETADATA -DESCRIPTOR.message_types_by_name[ - "VideoObjectTrackingModelMetadata" -] = _VIDEOOBJECTTRACKINGMODELMETADATA -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -VideoClassificationDatasetMetadata = _reflection.GeneratedProtocolMessageType( - "VideoClassificationDatasetMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOCLASSIFICATIONDATASETMETADATA, - __module__="google.cloud.automl_v1beta1.proto.video_pb2", - __doc__="""Dataset metadata specific to video classification. All - Video Classification datasets are treated as multi label. - - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata) - ), -) -_sym_db.RegisterMessage(VideoClassificationDatasetMetadata) - -VideoObjectTrackingDatasetMetadata = _reflection.GeneratedProtocolMessageType( - "VideoObjectTrackingDatasetMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOOBJECTTRACKINGDATASETMETADATA, - __module__="google.cloud.automl_v1beta1.proto.video_pb2", - __doc__="""Dataset metadata specific to video object tracking. - - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata) - ), -) -_sym_db.RegisterMessage(VideoObjectTrackingDatasetMetadata) - -VideoClassificationModelMetadata = _reflection.GeneratedProtocolMessageType( - "VideoClassificationModelMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOCLASSIFICATIONMODELMETADATA, - __module__="google.cloud.automl_v1beta1.proto.video_pb2", - __doc__="""Model metadata specific to video classification. - - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.VideoClassificationModelMetadata) - ), -) -_sym_db.RegisterMessage(VideoClassificationModelMetadata) - -VideoObjectTrackingModelMetadata = _reflection.GeneratedProtocolMessageType( - "VideoObjectTrackingModelMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOOBJECTTRACKINGMODELMETADATA, - __module__="google.cloud.automl_v1beta1.proto.video_pb2", - __doc__="""Model metadata specific to video object tracking. - - """, - # @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata) - ), -) -_sym_db.RegisterMessage(VideoObjectTrackingModelMetadata) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/automl/google/cloud/automl_v1beta1/proto/video_pb2_grpc.py b/automl/google/cloud/automl_v1beta1/proto/video_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/automl/google/cloud/automl_v1beta1/proto/video_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/automl/google/cloud/automl_v1beta1/tables/__init__.py b/automl/google/cloud/automl_v1beta1/tables/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/automl/google/cloud/automl_v1beta1/tables/gcs_client.py b/automl/google/cloud/automl_v1beta1/tables/gcs_client.py deleted file mode 100644 index 99d40da2867c..000000000000 --- a/automl/google/cloud/automl_v1beta1/tables/gcs_client.py +++ /dev/null @@ -1,146 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Wraps the Google Cloud Storage client library for use in tables helper.""" - -import logging -import time - -from google.api_core import exceptions - -try: - import pandas -except ImportError: # pragma: NO COVER - pandas = None - -try: - from google.cloud import storage -except ImportError: # pragma: NO COVER - storage = None - -_LOGGER = logging.getLogger(__name__) -_PANDAS_REQUIRED = "pandas is required to verify type DataFrame." -_STORAGE_REQUIRED = ( - "google-cloud-storage is required to create a Google Cloud Storage client." -) - - -class GcsClient(object): - """Uploads Pandas DataFrame to a bucket in Google Cloud Storage.""" - - def __init__(self, bucket_name=None, client=None, credentials=None, project=None): - """Constructor. - - Args: - bucket_name (Optional[str]): The name of Google Cloud Storage - bucket for this client to send requests to. - client (Optional[storage.Client]): A Google Cloud Storage Client - instance. - credentials (Optional[google.auth.credentials.Credentials]): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - project (Optional[str]): The project ID of the GCP project to - attach to the underlying storage client. If none is specified, - the client will attempt to ascertain the credentials from the - environment. - """ - if storage is None: - raise ImportError(_STORAGE_REQUIRED) - - if client is not None: - self.client = client - elif credentials is not None: - self.client = storage.Client(credentials=credentials, project=project) - else: - self.client = storage.Client() - - self.bucket_name = bucket_name - - def ensure_bucket_exists(self, project, region): - """Checks if a bucket named '{project}-automl-tables-staging' exists. - - If this bucket doesn't exist, creates one. - If this bucket already exists in `project`, do nothing. - If this bucket exists in a different project that we don't have - access to, creates a bucket named - '{project}-automl-tables-staging-{create_timestamp}' because bucket's - name must be globally unique. - Save the created bucket's name and reuse this for future requests. - - Args: - project (str): The ID of the project that stores the bucket. - region (str): The region of the bucket. - - Returns: - A string representing the created bucket name. - """ - if self.bucket_name is None: - self.bucket_name = "{}-automl-tables-staging".format(project) - - try: - self.client.get_bucket(self.bucket_name) - except (exceptions.Forbidden, exceptions.NotFound) as e: - if isinstance(e, exceptions.Forbidden): - used_bucket_name = self.bucket_name - self.bucket_name = used_bucket_name + "-{}".format(int(time.time())) - _LOGGER.warning( - "Created a bucket named {} because a bucket named {} already exists in a different project.".format( - self.bucket_name, used_bucket_name - ) - ) - - bucket = self.client.bucket(self.bucket_name) - bucket.create(project=project, location=region) - - return self.bucket_name - - def upload_pandas_dataframe(self, dataframe, uploaded_csv_name=None): - """Uploads a Pandas DataFrame as CSV to the bucket. - - Args: - dataframe (pandas.DataFrame): The Pandas Dataframe to be uploaded. - uploaded_csv_name (Optional[str]): The name for the uploaded CSV. - - Returns: - A string representing the GCS URI of the uploaded CSV. - """ - if pandas is None: - raise ImportError(_PANDAS_REQUIRED) - - if not isinstance(dataframe, pandas.DataFrame): - raise ValueError("'dataframe' must be a pandas.DataFrame instance.") - - if self.bucket_name is None: - raise ValueError("Must ensure a bucket exists before uploading data.") - - if uploaded_csv_name is None: - uploaded_csv_name = "automl-tables-dataframe-{}.csv".format( - int(time.time()) - ) - - # Setting index to False to ignore exporting the data index: - # 1. The resulting column name for the index column is empty, AutoML - # Tables does not allow empty column name - # 2. The index is not an useful training information - csv_string = dataframe.to_csv(index=False) - - bucket = self.client.get_bucket(self.bucket_name) - blob = bucket.blob(uploaded_csv_name) - blob.upload_from_string(csv_string) - - return "gs://{}/{}".format(self.bucket_name, uploaded_csv_name) diff --git a/automl/google/cloud/automl_v1beta1/tables/tables_client.py b/automl/google/cloud/automl_v1beta1/tables/tables_client.py deleted file mode 100644 index 32137db2c0cc..000000000000 --- a/automl/google/cloud/automl_v1beta1/tables/tables_client.py +++ /dev/null @@ -1,2870 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""A tables helper for the google.cloud.automl_v1beta1 AutoML API""" - -import pkg_resources -import logging - -from google.api_core.gapic_v1 import client_info -from google.api_core import exceptions -from google.cloud.automl_v1beta1 import gapic -from google.cloud.automl_v1beta1.proto import data_types_pb2, data_items_pb2 -from google.cloud.automl_v1beta1.tables import gcs_client -from google.protobuf import struct_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-automl").version -_LOGGER = logging.getLogger(__name__) - - -class TablesClient(object): - """ - AutoML Tables API helper. - - This is intended to simplify usage of the auto-generated python client, - in particular for the `AutoML Tables product - `_. - """ - - def __init__( - self, - project=None, - region="us-central1", - credentials=None, - client=None, - prediction_client=None, - gcs_client=None, - **kwargs - ): - """Constructor. - - Example for US region: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - - Example for EU region: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client_options = {'api_endpoint': 'eu-automl.googleapis.com:443'} - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='eu', client_options=client_options) - ... - - Args: - project (Optional[str]): The project ID of the GCP project all - future calls will default to. Most methods take `project` as an - optional parameter, and can override your choice of `project` - supplied here. - region (Optional[str]): The region all future calls will - default to. Most methods take `region` as an optional - parameter, and can override your choice of `region` supplied - here. Note, only `us-central1` is supported to-date. - transport (Union[~.AutoMlGrpcTransport, Callable[[~.Credentials, type], ~.AutoMlGrpcTransport]): - A transport instance, responsible for actually making the API - calls. The default transport uses the gRPC protocol. This - argument may also be a callable which returns a transport - instance. Callables will be sent the credentials as the first - argument and the default transport class as the second - argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - version = _GAPIC_LIBRARY_VERSION - user_agent = "automl-tables-wrapper/{}".format(version) - - client_info_ = kwargs.get("client_info") - if client_info_ is None: - client_info_ = client_info.ClientInfo( - user_agent=user_agent, gapic_version=version - ) - else: - client_info_.user_agent = user_agent - client_info_.gapic_version = version - kwargs.pop("client_info", None) - - if client is None: - self.auto_ml_client = gapic.auto_ml_client.AutoMlClient( - credentials=credentials, client_info=client_info_, **kwargs - ) - else: - self.auto_ml_client = client - - if prediction_client is None: - self.prediction_client = gapic.prediction_service_client.PredictionServiceClient( - credentials=credentials, client_info=client_info_, **kwargs - ) - else: - self.prediction_client = prediction_client - - self.project = project - self.region = region - self.credentials = credentials - self.gcs_client = gcs_client - - def __lookup_by_display_name(self, object_type, items, display_name): - relevant_items = [i for i in items if i.display_name == display_name] - if len(relevant_items) == 0: - raise exceptions.NotFound( - "The {} with display_name='{}' was not found.".format( - object_type, display_name - ) - ) - elif len(relevant_items) == 1: - return relevant_items[0] - else: - raise ValueError( - ( - "Multiple {}s match display_name='{}': {}\n\n" - "Please use the `.name` (unique identifier) field instead" - ).format( - object_type, - display_name, - ", ".join([str(i) for i in relevant_items]), - ) - ) - - def __location_path(self, project=None, region=None): - if project is None: - if self.project is None: - raise ValueError( - "Either initialize your client with a value " - "for 'project', or provide 'project' as a " - "parameter for this method." - ) - project = self.project - - if region is None: - if self.region is None: - raise ValueError( - "Either initialize your client with a value " - "for 'region', or provide 'region' as a " - "parameter for this method." - ) - region = self.region - - return self.auto_ml_client.location_path(project, region) - - # the returned metadata object doesn't allow for updating fields, so - # we need to manually copy user-updated fields over - def __update_metadata(self, metadata, k, v): - new_metadata = {} - new_metadata["ml_use_column_spec_id"] = metadata.ml_use_column_spec_id - new_metadata["weight_column_spec_id"] = metadata.weight_column_spec_id - new_metadata["target_column_spec_id"] = metadata.target_column_spec_id - new_metadata[k] = v - - return new_metadata - - def __dataset_from_args( - self, - dataset=None, - dataset_display_name=None, - dataset_name=None, - project=None, - region=None, - **kwargs - ): - if dataset is None and dataset_display_name is None and dataset_name is None: - raise ValueError( - "One of 'dataset', 'dataset_name' or " - "'dataset_display_name' must be set." - ) - # we prefer to make a live call here in the case that the - # dataset object is out-of-date - if dataset is not None: - dataset_name = dataset.name - - return self.get_dataset( - dataset_display_name=dataset_display_name, - dataset_name=dataset_name, - project=project, - region=region, - **kwargs - ) - - def __model_from_args( - self, - model=None, - model_display_name=None, - model_name=None, - project=None, - region=None, - **kwargs - ): - if model is None and model_display_name is None and model_name is None: - raise ValueError( - "One of 'model', 'model_name' or " "'model_display_name' must be set." - ) - # we prefer to make a live call here in the case that the - # model object is out-of-date - if model is not None: - model_name = model.name - - return self.get_model( - model_display_name=model_display_name, - model_name=model_name, - project=project, - region=region, - **kwargs - ) - - def __dataset_name_from_args( - self, - dataset=None, - dataset_display_name=None, - dataset_name=None, - project=None, - region=None, - **kwargs - ): - if dataset is None and dataset_display_name is None and dataset_name is None: - raise ValueError( - "One of 'dataset', 'dataset_name' or " - "'dataset_display_name' must be set." - ) - - if dataset_name is None: - if dataset is None: - dataset = self.get_dataset( - dataset_display_name=dataset_display_name, - project=project, - region=region, - **kwargs - ) - - dataset_name = dataset.name - else: - # we do this to force a NotFound error when needed - self.get_dataset( - dataset_name=dataset_name, project=project, region=region, **kwargs - ) - return dataset_name - - def __table_spec_name_from_args( - self, - table_spec_index=0, - dataset=None, - dataset_display_name=None, - dataset_name=None, - project=None, - region=None, - **kwargs - ): - dataset_name = self.__dataset_name_from_args( - dataset=dataset, - dataset_name=dataset_name, - dataset_display_name=dataset_display_name, - project=project, - region=region, - **kwargs - ) - - table_specs = [ - t for t in self.list_table_specs(dataset_name=dataset_name, **kwargs) - ] - - table_spec_full_id = table_specs[table_spec_index].name - return table_spec_full_id - - def __model_name_from_args( - self, - model=None, - model_display_name=None, - model_name=None, - project=None, - region=None, - **kwargs - ): - if model is None and model_display_name is None and model_name is None: - raise ValueError( - "One of 'model', 'model_name' or " "'model_display_name' must be set." - ) - - if model_name is None: - if model is None: - model = self.get_model( - model_display_name=model_display_name, - project=project, - region=region, - **kwargs - ) - model_name = model.name - else: - # we do this to force a NotFound error when needed - self.get_model( - model_name=model_name, project=project, region=region, **kwargs - ) - return model_name - - def __log_operation_info(self, message, op): - name = "UNKNOWN" - try: - if ( - op is not None - and op.operation is not None - and op.operation.name is not None - ): - name = op.operation.name - except AttributeError: - pass - _LOGGER.info( - ( - "Operation '{}' is running in the background. The returned " - "Operation '{}' can be used to query or block on the status " - "of this operation. Ending your python session will _not_ " - "cancel this operation. Read the documentation here:\n\n" - "\thttps://googleapis.dev/python/google-api-core/latest/operation.html\n\n" - "for more information on the Operation class." - ).format(message, name) - ) - return op - - def __column_spec_name_from_args( - self, - dataset=None, - dataset_display_name=None, - dataset_name=None, - table_spec_name=None, - table_spec_index=0, - column_spec_name=None, - column_spec_display_name=None, - project=None, - region=None, - **kwargs - ): - column_specs = self.list_column_specs( - dataset=dataset, - dataset_display_name=dataset_display_name, - dataset_name=dataset_name, - table_spec_name=table_spec_name, - table_spec_index=table_spec_index, - project=project, - region=region, - **kwargs - ) - if column_spec_display_name is not None: - column_specs = {s.display_name: s for s in column_specs} - if column_specs.get(column_spec_display_name) is None: - raise exceptions.NotFound( - "No column with " - + "column_spec_display_name: '{}' found".format( - column_spec_display_name - ) - ) - column_spec_name = column_specs[column_spec_display_name].name - elif column_spec_name is not None: - column_specs = {s.name: s for s in column_specs} - if column_specs.get(column_spec_name) is None: - raise exceptions.NotFound( - "No column with " - + "column_spec_name: '{}' found".format(column_spec_name) - ) - else: - raise ValueError( - "Either supply 'column_spec_name' or " - "'column_spec_display_name' for the column to update" - ) - - return column_spec_name - - def __data_type_to_proto_value(self, data_type, value): - type_code = data_type.type_code - if value is None: - return struct_pb2.Value(null_value=struct_pb2.NullValue.NULL_VALUE) - elif type_code == data_types_pb2.FLOAT64: - return struct_pb2.Value(number_value=value) - elif ( - type_code == data_types_pb2.TIMESTAMP - or type_code == data_types_pb2.STRING - or type_code == data_types_pb2.CATEGORY - ): - return struct_pb2.Value(string_value=value) - elif type_code == data_types_pb2.ARRAY: - if isinstance(value, struct_pb2.ListValue): - # in case the user passed in a ListValue. - return struct_pb2.Value(list_value=value) - array = [] - for item in value: - array.append( - self.__data_type_to_proto_value(data_type.list_element_type, item) - ) - return struct_pb2.Value(list_value=struct_pb2.ListValue(values=array)) - elif type_code == data_types_pb2.STRUCT: - if isinstance(value, struct_pb2.Struct): - # in case the user passed in a Struct. - return struct_pb2.Value(struct_value=value) - struct_value = struct_pb2.Struct() - for k, v in value.items(): - field_value = self.__data_type_to_proto_value( - data_type.struct_type.fields[k], v - ) - struct_value.fields[k].CopyFrom(field_value) - return struct_pb2.Value(struct_value=struct_value) - else: - raise ValueError("Unknown type_code: {}".format(type_code)) - - def __ensure_gcs_client_is_initialized(self, credentials, project): - """Checks if GCS client is initialized. Initializes it if not. - - Args: - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - project (str): The ID of the project to use with the GCS - client. If none is specified, the client will attempt to - ascertain the credentials from the environment. - """ - if self.gcs_client is None: - self.gcs_client = gcs_client.GcsClient( - project=project, credentials=credentials - ) - - def list_datasets(self, project=None, region=None, **kwargs): - """List all datasets in a particular project and region. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> ds = client.list_datasets() - >>> - >>> for d in ds: - ... # do something - ... pass - ... - - Args: - project (Optional[str]): The ID of the project that owns the - datasets. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.automl_v1beta1.types.Dataset` - instances. You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - return self.auto_ml_client.list_datasets( - self.__location_path(project=project, region=region), **kwargs - ) - - def get_dataset( - self, - project=None, - region=None, - dataset_name=None, - dataset_display_name=None, - **kwargs - ): - """Gets a single dataset in a particular project and region. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> d = client.get_dataset(dataset_display_name='my_dataset') - >>> - - Args: - project (Optional[str]): The ID of the project that owns the - dataset. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - dataset_name (Optional[str]): - This is the fully-qualified name generated by the AutoML API - for this dataset. This is not to be confused with the - human-assigned `dataset_display_name` that is provided when - creating a dataset. Either `dataset_name` or - `dataset_display_name` must be provided. - dataset_display_name (Optional[str]): - This is the name you provided for the dataset when first - creating it. Either `dataset_name` or `dataset_display_name` - must be provided. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.Dataset` instance if - found, `None` otherwise. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - if dataset_name is None and dataset_display_name is None: - raise ValueError( - "One of 'dataset_name' or " "'dataset_display_name' must be set." - ) - - if dataset_name is not None: - return self.auto_ml_client.get_dataset(dataset_name, **kwargs) - - return self.__lookup_by_display_name( - "dataset", - self.list_datasets(project, region, **kwargs), - dataset_display_name, - ) - - def create_dataset( - self, dataset_display_name, metadata={}, project=None, region=None, **kwargs - ): - """Create a dataset. Keep in mind, importing data is a separate step. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> d = client.create_dataset(dataset_display_name='my_dataset') - >>> - - Args: - project (Optional[str]): The ID of the project that will own the - dataset. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - dataset_display_name (str): - A human-readable name to refer to this dataset by. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.Dataset` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - return self.auto_ml_client.create_dataset( - self.__location_path(project, region), - {"display_name": dataset_display_name, "tables_dataset_metadata": metadata}, - **kwargs - ) - - def delete_dataset( - self, - dataset=None, - dataset_display_name=None, - dataset_name=None, - project=None, - region=None, - **kwargs - ): - """Deletes a dataset. This does not delete any models trained on - this dataset. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> op = client.delete_dataset(dataset_display_name='my_dataset') - >>> - >>> op.result() # blocks on delete request - >>> - - Args: - project (Optional[str]): The ID of the project that owns the - dataset. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - dataset_display_name (Optional[str]): - The human-readable name given to the dataset you want to - delete. This must be supplied if `dataset` or `dataset_name` - are not supplied. - dataset_name (Optional[str]): - The AutoML-assigned name given to the dataset you want to - delete. This must be supplied if `dataset_display_name` or - `dataset` are not supplied. - dataset (Optional[Dataset]): - The `Dataset` instance you want to delete. This must be - supplied if `dataset_display_name` or `dataset_name` are not - supplied. - - Returns: - google.api_core.operation.Operation: - An operation future that can be used to check for - completion synchronously or asynchronously. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - try: - dataset_name = self.__dataset_name_from_args( - dataset=dataset, - dataset_name=dataset_name, - dataset_display_name=dataset_display_name, - project=project, - region=region, - **kwargs - ) - # delete is idempotent - except exceptions.NotFound: - return None - - op = self.auto_ml_client.delete_dataset(dataset_name, **kwargs) - self.__log_operation_info("Delete dataset", op) - return op - - def import_data( - self, - dataset=None, - dataset_display_name=None, - dataset_name=None, - pandas_dataframe=None, - gcs_input_uris=None, - bigquery_input_uri=None, - project=None, - region=None, - credentials=None, - **kwargs - ): - """Imports data into a dataset. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> d = client.create_dataset(dataset_display_name='my_dataset') - >>> - >>> response = client.import_data(dataset=d, - ... gcs_input_uris='gs://cloud-ml-tables-data/bank-marketing.csv') - ... - >>> def callback(operation_future): - ... result = operation_future.result() - ... - >>> response.add_done_callback(callback) - >>> - - Args: - project (Optional[str]): The ID of the project that owns the - dataset. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - credentials (Optional[google.auth.credentials.Credentials]): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - dataset_display_name (Optional[str]): - The human-readable name given to the dataset you want to import - data into. This must be supplied if `dataset` or `dataset_name` - are not supplied. - dataset_name (Optional[str]): - The AutoML-assigned name given to the dataset you want to - import data into. This must be supplied if - `dataset_display_name` or `dataset` are not supplied. - dataset (Optional[Dataset]): - The `Dataset` instance you want to import data into. This must - be supplied if `dataset_display_name` or `dataset_name` are not - supplied. - pandas_dataframe (Optional[pandas.DataFrame]): - A Pandas Dataframe object containing the data to import. The data - will be converted to CSV, and this CSV will be staged to GCS in - `gs://{project}-automl-tables-staging/{uploaded_csv_name}` - This parameter must be supplied if neither `gcs_input_uris` nor - `bigquery_input_uri` is supplied. - gcs_input_uris (Optional[Union[str, Sequence[str]]]): - Either a single `gs://..` prefixed URI, or a list of URIs - referring to GCS-hosted CSV files containing the data to - import. This must be supplied if neither `bigquery_input_uri` - nor `pandas_dataframe` is supplied. - bigquery_input_uri (Optional[str]): - A URI pointing to the BigQuery table containing the data to - import. This must be supplied if neither `gcs_input_uris` nor - `pandas_dataframe` is supplied. - - Returns: - google.api_core.operation.Operation: - An operation future that can be used to check for - completion synchronously or asynchronously. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - dataset_name = self.__dataset_name_from_args( - dataset=dataset, - dataset_name=dataset_name, - dataset_display_name=dataset_display_name, - project=project, - region=region, - **kwargs - ) - - request = {} - - if pandas_dataframe is not None: - project = project or self.project - region = region or self.region - credentials = credentials or self.credentials - self.__ensure_gcs_client_is_initialized(credentials, project) - self.gcs_client.ensure_bucket_exists(project, region) - gcs_input_uri = self.gcs_client.upload_pandas_dataframe(pandas_dataframe) - request = {"gcs_source": {"input_uris": [gcs_input_uri]}} - elif gcs_input_uris is not None: - if type(gcs_input_uris) != list: - gcs_input_uris = [gcs_input_uris] - request = {"gcs_source": {"input_uris": gcs_input_uris}} - elif bigquery_input_uri is not None: - request = {"bigquery_source": {"input_uri": bigquery_input_uri}} - else: - raise ValueError( - "One of 'gcs_input_uris', or 'bigquery_input_uri', or 'pandas_dataframe' must be set." - ) - - op = self.auto_ml_client.import_data(dataset_name, request, **kwargs) - self.__log_operation_info("Data import", op) - return op - - def export_data( - self, - dataset=None, - dataset_display_name=None, - dataset_name=None, - gcs_output_uri_prefix=None, - bigquery_output_uri=None, - project=None, - region=None, - **kwargs - ): - """Exports data from a dataset. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> d = client.create_dataset(dataset_display_name='my_dataset') - >>> - >>> response = client.export_data(dataset=d, - ... gcs_output_uri_prefix='gs://cloud-ml-tables-data/bank-marketing.csv') - ... - >>> def callback(operation_future): - ... result = operation_future.result() - ... - >>> response.add_done_callback(callback) - >>> - - Args: - project (Optional[str]): The ID of the project that owns the - dataset. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - dataset_display_name (Optional[str]): - The human-readable name given to the dataset you want to export - data from. This must be supplied if `dataset` or `dataset_name` - are not supplied. - dataset_name (Optional[str]): - The AutoML-assigned name given to the dataset you want to - export data from. This must be supplied if - `dataset_display_name` or `dataset` are not supplied. - dataset (Optional[Dataset]): - The `Dataset` instance you want to export data from. This must - be supplied if `dataset_display_name` or `dataset_name` are not - supplied. - gcs_output_uri_prefix (Optional[Union[str, Sequence[str]]]): - A single `gs://..` prefixed URI to export to. This must be - supplied if `bigquery_output_uri` is not. - bigquery_output_uri (Optional[str]): - A URI pointing to the BigQuery table containing the data to - export. This must be supplied if `gcs_output_uri_prefix` is not. - - Returns: - google.api_core.operation.Operation: - An operation future that can be used to check for - completion synchronously or asynchronously. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - dataset_name = self.__dataset_name_from_args( - dataset=dataset, - dataset_name=dataset_name, - dataset_display_name=dataset_display_name, - project=project, - region=region, - **kwargs - ) - - request = {} - if gcs_output_uri_prefix is not None: - request = {"gcs_destination": {"output_uri_prefix": gcs_output_uri_prefix}} - elif bigquery_output_uri is not None: - request = {"bigquery_destination": {"output_uri": bigquery_output_uri}} - else: - raise ValueError( - "One of 'gcs_output_uri_prefix', or 'bigquery_output_uri' must be set." - ) - - op = self.auto_ml_client.export_data(dataset_name, request, **kwargs) - self.__log_operation_info("Export data", op) - return op - - def get_table_spec(self, table_spec_name, project=None, region=None, **kwargs): - """Gets a single table spec in a particular project and region. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> d = client.get_table_spec('my_table_spec') - >>> - - Args: - table_spec_name (str): - This is the fully-qualified name generated by the AutoML API - for this table spec. - project (Optional[str]): The ID of the project that owns the - table. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.TableSpec` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - return self.auto_ml_client.get_table_spec(table_spec_name, **kwargs) - - def list_table_specs( - self, - dataset=None, - dataset_display_name=None, - dataset_name=None, - project=None, - region=None, - **kwargs - ): - """Lists table specs. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> for s in client.list_table_specs(dataset_display_name='my_dataset') - ... # process the spec - ... pass - ... - - Args: - project (Optional[str]): The ID of the project that owns the - dataset. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - dataset_display_name (Optional[str]): - The human-readable name given to the dataset you want to read - specs from. This must be supplied if `dataset` or - `dataset_name` are not supplied. - dataset_name (Optional[str]): - The AutoML-assigned name given to the dataset you want to read - specs from. This must be supplied if `dataset_display_name` or - `dataset` are not supplied. - dataset (Optional[Dataset]): - The `Dataset` instance you want to read specs from. This must - be supplied if `dataset_display_name` or `dataset_name` are not - supplied. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of - :class:`~google.cloud.automl_v1beta1.types.TableSpec` instances. - You can also iterate over the pages of the response using its - `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - dataset_name = self.__dataset_name_from_args( - dataset=dataset, - dataset_name=dataset_name, - dataset_display_name=dataset_display_name, - project=project, - region=region, - **kwargs - ) - - return self.auto_ml_client.list_table_specs(dataset_name, **kwargs) - - def get_column_spec(self, column_spec_name, project=None, region=None, **kwargs): - """Gets a single column spec in a particular project and region. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> d = client.get_column_spec('my_column_spec') - >>> - - Args: - column_spec_name (str): - This is the fully-qualified name generated by the AutoML API - for this column spec. - project (Optional[str]): The ID of the project that owns the - column. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.ColumnSpec` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - return self.auto_ml_client.get_column_spec(column_spec_name, **kwargs) - - def list_column_specs( - self, - dataset=None, - dataset_display_name=None, - dataset_name=None, - table_spec_name=None, - table_spec_index=0, - project=None, - region=None, - **kwargs - ): - """Lists column specs. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> for s in client.list_column_specs(dataset_display_name='my_dataset') - ... # process the spec - ... pass - ... - - Args: - project (Optional[str]): The ID of the project that owns the - columns. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - table_spec_name (Optional[str]): - The AutoML-assigned name for the table whose specs you want to - read. If not supplied, the client can determine this name from - a source `Dataset` object. - table_spec_index (Optional[int]): - If no `table_spec_name` was provided, we use this index to - determine which table to read column specs from. - dataset_display_name (Optional[str]): - The human-readable name given to the dataset you want to read - specs from. If no `table_spec_name` is supplied, this will be - used together with `table_spec_index` to infer the name of - table to read specs from. This must be supplied if - `table_spec_name`, `dataset` or `dataset_name` are not - supplied. - dataset_name (Optional[str]): - The AutoML-assigned name given to the dataset you want to read - specs from. If no `table_spec_name` is supplied, this will be - used together with `table_spec_index` to infer the name of - table to read specs from. This must be supplied if - `table_spec_name`, `dataset` or `dataset_display_name` are not - supplied. - dataset (Optional[Dataset]): - The `Dataset` instance you want to read specs from. If no - `table_spec_name` is supplied, this will be used together with - `table_spec_index` to infer the name of table to read specs - from. This must be supplied if `table_spec_name`, - `dataset_name` or `dataset_display_name` are not supplied. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of - :class:`~google.cloud.automl_v1beta1.types.ColumnSpec` instances. - You can also iterate over the pages of the response using its - `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - if table_spec_name is None: - table_specs = [ - t - for t in self.list_table_specs( - dataset=dataset, - dataset_display_name=dataset_display_name, - dataset_name=dataset_name, - project=project, - region=region, - **kwargs - ) - ] - - table_spec_name = table_specs[table_spec_index].name - - return self.auto_ml_client.list_column_specs(table_spec_name, **kwargs) - - def update_column_spec( - self, - dataset=None, - dataset_display_name=None, - dataset_name=None, - table_spec_name=None, - table_spec_index=0, - column_spec_name=None, - column_spec_display_name=None, - type_code=None, - nullable=None, - project=None, - region=None, - **kwargs - ): - """Updates a column's specs. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> client.update_column_specs(dataset_display_name='my_dataset', - ... column_spec_display_name='Outcome', type_code='CATEGORY') - ... - - Args: - dataset (Optional[Dataset]): - The `Dataset` instance you want to update specs on. If no - `table_spec_name` is supplied, this will be used together with - `table_spec_index` to infer the name of table to update specs - on. This must be supplied if `table_spec_name`, `dataset_name` - or `dataset_display_name` are not supplied. - dataset_display_name (Optional[str]): - The human-readable name given to the dataset you want to update - specs on. If no `table_spec_name` is supplied, this will be - used together with `table_spec_index` to infer the name of - table to update specs on. This must be supplied if - `table_spec_name`, `dataset` or `dataset_name` are not - supplied. - dataset_name (Optional[str]): - The AutoML-assigned name given to the dataset you want to - update specs one. If no `table_spec_name` is supplied, this - will be used together with `table_spec_index` to infer the name - of table to update specs on. This must be supplied if - `table_spec_name`, `dataset` or `dataset_display_name` are not - supplied. - table_spec_name (Optional[str]): - The AutoML-assigned name for the table whose specs you want to - update. If not supplied, the client can determine this name - from a source `Dataset` object. - table_spec_index (Optional[int]): - If no `table_spec_name` was provided, we use this index to - determine which table to update column specs on. - column_spec_name (Optional[str]): - The name AutoML-assigned name for the column you want to - update. - column_spec_display_name (Optional[str]): - The human-readable name of the column you want to update. If - this is supplied in place of `column_spec_name`, you also need - to provide either a way to lookup the source dataset (using one - of the `dataset*` kwargs), or the `table_spec_name` of the - table this column belongs to. - type_code (Optional[str]): - The desired 'type_code' of the column. For more information - on the available types, please see the documentation: - https://cloud.google.com/automl-tables/docs/reference/rpc/google.cloud.automl.v1beta1#typecode - nullable (Optional[bool]): - Set to `True` or `False` to specify if this column's value - must expected to be present in all rows or not. - project (Optional[str]): The ID of the project that owns the - columns. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.ColumnSpec` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - column_spec_name = self.__column_spec_name_from_args( - dataset=dataset, - dataset_display_name=dataset_display_name, - dataset_name=dataset_name, - table_spec_name=table_spec_name, - table_spec_index=table_spec_index, - column_spec_name=column_spec_name, - column_spec_display_name=column_spec_display_name, - project=project, - region=region, - **kwargs - ) - - # type code must always be set - if type_code is None: - # this index is safe, we would have already thrown a NotFound - # had the column_spec_name not existed - type_code = { - s.name: s - for s in self.list_column_specs( - dataset=dataset, - dataset_display_name=dataset_display_name, - dataset_name=dataset_name, - table_spec_name=table_spec_name, - table_spec_index=table_spec_index, - project=project, - region=region, - **kwargs - ) - }[column_spec_name].data_type.type_code - - data_type = {} - if nullable is not None: - data_type["nullable"] = nullable - - data_type["type_code"] = type_code - - request = {"name": column_spec_name, "data_type": data_type} - - return self.auto_ml_client.update_column_spec(request, **kwargs) - - def set_target_column( - self, - dataset=None, - dataset_display_name=None, - dataset_name=None, - table_spec_name=None, - table_spec_index=0, - column_spec_name=None, - column_spec_display_name=None, - project=None, - region=None, - **kwargs - ): - """Sets the target column for a given table. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> client.set_target_column(dataset_display_name='my_dataset', - ... column_spec_display_name='Income') - ... - - Args: - project (Optional[str]): The ID of the project that owns the - table. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - column_spec_name (Optional[str]): - The name AutoML-assigned name for the column you want to set as - the target column. - column_spec_display_name (Optional[str]): - The human-readable name of the column you want to set as the - target column. If this is supplied in place of - `column_spec_name`, you also need to provide either a way to - lookup the source dataset (using one of the `dataset*` kwargs), - or the `table_spec_name` of the table this column belongs to. - table_spec_name (Optional[str]): - The AutoML-assigned name for the table whose target column you - want to set . If not supplied, the client can determine this - name from a source `Dataset` object. - table_spec_index (Optional[int]): - If no `table_spec_name` or `column_spec_name` was provided, we - use this index to determine which table to set the target - column on. - dataset_display_name (Optional[str]): - The human-readable name given to the dataset you want to update - the target column of. If no `table_spec_name` is supplied, this - will be used together with `table_spec_index` to infer the name - of table to update the target column of. This must be supplied - if `table_spec_name`, `dataset` or `dataset_name` are not - supplied. - dataset_name (Optional[str]): - The AutoML-assigned name given to the dataset you want to - update the target column of. If no `table_spec_name` is - supplied, this will be used together with `table_spec_index` to - infer the name of table to update the target column of. This - must be supplied if `table_spec_name`, `dataset` or - `dataset_display_name` are not supplied. - dataset (Optional[Dataset]): - The `Dataset` instance you want to update the target column of. - If no `table_spec_name` is supplied, this will be used together - with `table_spec_index` to infer the name of table to update - the target column of. This must be supplied if - `table_spec_name`, `dataset_name` or `dataset_display_name` are - not supplied. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.Dataset` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - column_spec_name = self.__column_spec_name_from_args( - dataset=dataset, - dataset_display_name=dataset_display_name, - dataset_name=dataset_name, - table_spec_name=table_spec_name, - table_spec_index=table_spec_index, - column_spec_name=column_spec_name, - column_spec_display_name=column_spec_display_name, - project=project, - region=region, - **kwargs - ) - column_spec_id = column_spec_name.rsplit("/", 1)[-1] - - dataset = self.__dataset_from_args( - dataset=dataset, - dataset_name=dataset_name, - dataset_display_name=dataset_display_name, - project=project, - region=region, - **kwargs - ) - metadata = dataset.tables_dataset_metadata - metadata = self.__update_metadata( - metadata, "target_column_spec_id", column_spec_id - ) - - request = {"name": dataset.name, "tables_dataset_metadata": metadata} - - return self.auto_ml_client.update_dataset(request, **kwargs) - - def set_time_column( - self, - dataset=None, - dataset_display_name=None, - dataset_name=None, - table_spec_name=None, - table_spec_index=0, - column_spec_name=None, - column_spec_display_name=None, - project=None, - region=None, - **kwargs - ): - """Sets the time column which designates which data will be of type - timestamp and will be used for the timeseries data. - This column must be of type timestamp. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> client.set_time_column(dataset_display_name='my_dataset', - ... column_spec_display_name='Unix Time') - ... - - Args: - project (Optional[str]): The ID of the project that owns the - table. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - column_spec_name (Optional[str]): - The name AutoML-assigned name for the column you want to set as - the time column. - column_spec_display_name (Optional[str]): - The human-readable name of the column you want to set as the - time column. If this is supplied in place of - `column_spec_name`, you also need to provide either a way to - lookup the source dataset (using one of the `dataset*` kwargs), - or the `table_spec_name` of the table this column belongs to. - table_spec_name (Optional[str]): - The AutoML-assigned name for the table whose time column - you want to set . If not supplied, the client can determine - this name from a source `Dataset` object. - table_spec_index (Optional[int]): - If no `table_spec_name` or `column_spec_name` was provided, we - use this index to determine which table to set the time - column on. - dataset_display_name (Optional[str]): - The human-readable name given to the dataset you want to update - the time column of. If no `table_spec_name` is supplied, - this will be used together with `table_spec_index` to infer the - name of table to update the time column of. This must be - supplied if `table_spec_name`, `dataset` or `dataset_name` are - not supplied. - dataset_name (Optional[str]): - The AutoML-assigned name given to the dataset you want to - update the time column of. If no `table_spec_name` is - supplied, this will be used together with `table_spec_index` to - infer the name of table to update the time column of. - This must be supplied if `table_spec_name`, `dataset` or - `dataset_display_name` are not supplied. - dataset (Optional[Dataset]): - The `Dataset` instance you want to update the time column - of. If no `table_spec_name` is supplied, this will be used - together with `table_spec_index` to infer the name of table to - update the time column of. This must be supplied if - `table_spec_name`, `dataset_name` or `dataset_display_name` are - not supplied. - Returns: - A :class:`~google.cloud.automl_v1beta1.types.TableSpec` instance. - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - column_spec_name = self.__column_spec_name_from_args( - dataset=dataset, - dataset_display_name=dataset_display_name, - dataset_name=dataset_name, - table_spec_name=table_spec_name, - table_spec_index=table_spec_index, - column_spec_name=column_spec_name, - column_spec_display_name=column_spec_display_name, - project=project, - region=region, - **kwargs - ) - column_spec_id = column_spec_name.rsplit("/", 1)[-1] - - dataset_name = self.__dataset_name_from_args( - dataset=dataset, - dataset_name=dataset_name, - dataset_display_name=dataset_display_name, - project=project, - region=region, - **kwargs - ) - - table_spec_full_id = self.__table_spec_name_from_args( - dataset_name=dataset_name, **kwargs - ) - - my_table_spec = { - "name": table_spec_full_id, - "time_column_spec_id": column_spec_id, - } - - return self.auto_ml_client.update_table_spec(my_table_spec, **kwargs) - - def clear_time_column( - self, - dataset=None, - dataset_display_name=None, - dataset_name=None, - project=None, - region=None, - **kwargs - ): - """Clears the time column which designates which data will be of type - timestamp and will be used for the timeseries data. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> client.clear_time_column(dataset_display_name='my_dataset') - >>> - - Args: - project (Optional[str]): The ID of the project that owns the - table. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - dataset_display_name (Optional[str]): - The human-readable name given to the dataset you want to update - the time column of. If no `table_spec_name` is supplied, - this will be used together with `table_spec_index` to infer the - name of table to update the time column of. This must be - supplied if `table_spec_name`, `dataset` or `dataset_name` are - not supplied. - dataset_name (Optional[str]): - The AutoML-assigned name given to the dataset you want to - update the time column of. If no `table_spec_name` is - supplied, this will be used together with `table_spec_index` to - infer the name of table to update the time column of. - This must be supplied if `table_spec_name`, `dataset` or - `dataset_display_name` are not supplied. - dataset (Optional[Dataset]): - The `Dataset` instance you want to update the time column - of. If no `table_spec_name` is supplied, this will be used - together with `table_spec_index` to infer the name of table to - update the time column of. This must be supplied if - `table_spec_name`, `dataset_name` or `dataset_display_name` are - not supplied. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.TableSpec` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - dataset_name = self.__dataset_name_from_args( - dataset=dataset, - dataset_name=dataset_name, - dataset_display_name=dataset_display_name, - project=project, - region=region, - **kwargs - ) - - table_spec_full_id = self.__table_spec_name_from_args( - dataset_name=dataset_name, **kwargs - ) - - my_table_spec = {"name": table_spec_full_id, "time_column_spec_id": None} - - return self.auto_ml_client.update_table_spec(my_table_spec, **kwargs) - - def set_weight_column( - self, - dataset=None, - dataset_display_name=None, - dataset_name=None, - table_spec_name=None, - table_spec_index=0, - column_spec_name=None, - column_spec_display_name=None, - project=None, - region=None, - **kwargs - ): - """Sets the weight column for a given table. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> client.set_weight_column(dataset_display_name='my_dataset', - ... column_spec_display_name='Income') - ... - - Args: - project (Optional[str]): The ID of the project that owns the - table. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - column_spec_name (Optional[str]): - The name AutoML-assigned name for the column you want to - set as the weight column. - column_spec_display_name (Optional[str]): - The human-readable name of the column you want to set as the - weight column. If this is supplied in place of - `column_spec_name`, you also need to provide either a way to - lookup the source dataset (using one of the `dataset*` kwargs), - or the `table_spec_name` of the table this column belongs to. - table_spec_name (Optional[str]): - The AutoML-assigned name for the table whose weight column you - want to set . If not supplied, the client can determine this - name from a source `Dataset` object. - table_spec_index (Optional[int]): - If no `table_spec_name` or `column_spec_name` was provided, we - use this index to determine which table to set the weight - column on. - dataset_display_name (Optional[str]): - The human-readable name given to the dataset you want to update - the weight column of. If no `table_spec_name` is supplied, this - will be used together with `table_spec_index` to infer the name - of table to update the weight column of. This must be supplied - if `table_spec_name`, `dataset` or `dataset_name` are not - supplied. - dataset_name (Optional[str]): - The AutoML-assigned name given to the dataset you want to - update the weight column of. If no `table_spec_name` is - supplied, this will be used together with `table_spec_index` to - infer the name of table to update the weight column of. This - must be supplied if `table_spec_name`, `dataset` or - `dataset_display_name` are not supplied. - dataset (Optional[Dataset]): - The `Dataset` instance you want to update the weight column of. - If no `table_spec_name` is supplied, this will be used together - with `table_spec_index` to infer the name of table to update - the weight column of. This must be supplied if - `table_spec_name`, `dataset_name` or `dataset_display_name` are - not supplied. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.Dataset` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - column_spec_name = self.__column_spec_name_from_args( - dataset=dataset, - dataset_display_name=dataset_display_name, - dataset_name=dataset_name, - table_spec_name=table_spec_name, - table_spec_index=table_spec_index, - column_spec_name=column_spec_name, - column_spec_display_name=column_spec_display_name, - project=project, - region=region, - **kwargs - ) - column_spec_id = column_spec_name.rsplit("/", 1)[-1] - - dataset = self.__dataset_from_args( - dataset=dataset, - dataset_name=dataset_name, - dataset_display_name=dataset_display_name, - project=project, - region=region, - **kwargs - ) - metadata = dataset.tables_dataset_metadata - metadata = self.__update_metadata( - metadata, "weight_column_spec_id", column_spec_id - ) - - request = {"name": dataset.name, "tables_dataset_metadata": metadata} - - return self.auto_ml_client.update_dataset(request, **kwargs) - - def clear_weight_column( - self, - dataset=None, - dataset_display_name=None, - dataset_name=None, - project=None, - region=None, - **kwargs - ): - """Clears the weight column for a given dataset. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> client.clear_weight_column(dataset_display_name='my_dataset') - >>> - - Args: - project (Optional[str]): The ID of the project that owns the - table. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - dataset_display_name (Optional[str]): - The human-readable name given to the dataset you want to update - the weight column of. If no `table_spec_name` is supplied, this - will be used together with `table_spec_index` to infer the name - of table to update the weight column of. This must be supplied - if `table_spec_name`, `dataset` or `dataset_name` are not - supplied. - dataset_name (Optional[str]): - The AutoML-assigned name given to the dataset you want to - update the weight column of. If no `table_spec_name` is - supplied, this will be used together with `table_spec_index` to - infer the name of table to update the weight column of. This - must be supplied if `table_spec_name`, `dataset` or - `dataset_display_name` are not supplied. - dataset (Optional[Dataset]): - The `Dataset` instance you want to update the weight column of. - If no `table_spec_name` is supplied, this will be used together - with `table_spec_index` to infer the name of table to update - the weight column of. This must be supplied if - `table_spec_name`, `dataset_name` or `dataset_display_name` are - not supplied. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.Dataset` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - dataset = self.__dataset_from_args( - dataset=dataset, - dataset_name=dataset_name, - dataset_display_name=dataset_display_name, - project=project, - region=region, - **kwargs - ) - metadata = dataset.tables_dataset_metadata - metadata = self.__update_metadata(metadata, "weight_column_spec_id", None) - - request = {"name": dataset.name, "tables_dataset_metadata": metadata} - - return self.auto_ml_client.update_dataset(request, **kwargs) - - def set_test_train_column( - self, - dataset=None, - dataset_display_name=None, - dataset_name=None, - table_spec_name=None, - table_spec_index=0, - column_spec_name=None, - column_spec_display_name=None, - project=None, - region=None, - **kwargs - ): - """Sets the test/train (ml_use) column which designates which data - belongs to the test and train sets. This column must be categorical. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> client.set_test_train_column(dataset_display_name='my_dataset', - ... column_spec_display_name='TestSplit') - ... - - Args: - project (Optional[str]): The ID of the project that owns the - table. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - column_spec_name (Optional[str]): - The name AutoML-assigned name for the column you want to set as - the test/train column. - column_spec_display_name (Optional[str]): - The human-readable name of the column you want to set as the - test/train column. If this is supplied in place of - `column_spec_name`, you also need to provide either a way to - lookup the source dataset (using one of the `dataset*` kwargs), - or the `table_spec_name` of the table this column belongs to. - table_spec_name (Optional[str]): - The AutoML-assigned name for the table whose test/train column - you want to set . If not supplied, the client can determine - this name from a source `Dataset` object. - table_spec_index (Optional[int]): - If no `table_spec_name` or `column_spec_name` was provided, we - use this index to determine which table to set the test/train - column on. - dataset_display_name (Optional[str]): - The human-readable name given to the dataset you want to update - the test/train column of. If no `table_spec_name` is supplied, - this will be used together with `table_spec_index` to infer the - name of table to update the test/train column of. This must be - supplied if `table_spec_name`, `dataset` or `dataset_name` are - not supplied. - dataset_name (Optional[str]): - The AutoML-assigned name given to the dataset you want to - update the test/train column of. If no `table_spec_name` is - supplied, this will be used together with `table_spec_index` to - infer the name of table to update the test/train column of. - This must be supplied if `table_spec_name`, `dataset` or - `dataset_display_name` are not supplied. - dataset (Optional[Dataset]): - The `Dataset` instance you want to update the test/train column - of. If no `table_spec_name` is supplied, this will be used - together with `table_spec_index` to infer the name of table to - update the test/train column of. This must be supplied if - `table_spec_name`, `dataset_name` or `dataset_display_name` are - not supplied. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.Dataset` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - column_spec_name = self.__column_spec_name_from_args( - dataset=dataset, - dataset_display_name=dataset_display_name, - dataset_name=dataset_name, - table_spec_name=table_spec_name, - table_spec_index=table_spec_index, - column_spec_name=column_spec_name, - column_spec_display_name=column_spec_display_name, - project=project, - region=region, - **kwargs - ) - column_spec_id = column_spec_name.rsplit("/", 1)[-1] - - dataset = self.__dataset_from_args( - dataset=dataset, - dataset_name=dataset_name, - dataset_display_name=dataset_display_name, - project=project, - region=region, - **kwargs - ) - metadata = dataset.tables_dataset_metadata - metadata = self.__update_metadata( - metadata, "ml_use_column_spec_id", column_spec_id - ) - - request = {"name": dataset.name, "tables_dataset_metadata": metadata} - - return self.auto_ml_client.update_dataset(request, **kwargs) - - def clear_test_train_column( - self, - dataset=None, - dataset_display_name=None, - dataset_name=None, - project=None, - region=None, - **kwargs - ): - """Clears the test/train (ml_use) column which designates which data - belongs to the test and train sets. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> client.clear_test_train_column(dataset_display_name='my_dataset') - >>> - - Args: - project (Optional[str]): The ID of the project that owns the - table. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - dataset_display_name (Optional[str]): - The human-readable name given to the dataset you want to update - the test/train column of. If no `table_spec_name` is supplied, - this will be used together with `table_spec_index` to infer the - name of table to update the test/train column of. This must be - supplied if `table_spec_name`, `dataset` or `dataset_name` are - not supplied. - dataset_name (Optional[str]): - The AutoML-assigned name given to the dataset you want to - update the test/train column of. If no `table_spec_name` is - supplied, this will be used together with `table_spec_index` to - infer the name of table to update the test/train column of. - This must be supplied if `table_spec_name`, `dataset` or - `dataset_display_name` are not supplied. - dataset (Optional[Dataset]): - The `Dataset` instance you want to update the test/train column - of. If no `table_spec_name` is supplied, this will be used - together with `table_spec_index` to infer the name of table to - update the test/train column of. This must be supplied if - `table_spec_name`, `dataset_name` or `dataset_display_name` are - not supplied. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.Dataset` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - dataset = self.__dataset_from_args( - dataset=dataset, - dataset_name=dataset_name, - dataset_display_name=dataset_display_name, - project=project, - region=region, - **kwargs - ) - metadata = dataset.tables_dataset_metadata - metadata = self.__update_metadata(metadata, "ml_use_column_spec_id", None) - - request = {"name": dataset.name, "tables_dataset_metadata": metadata} - - return self.auto_ml_client.update_dataset(request, **kwargs) - - def list_models(self, project=None, region=None, **kwargs): - """List all models in a particular project and region. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> ms = client.list_models() - >>> - >>> for m in ms: - ... # do something - ... pass - ... - - Args: - project (Optional[str]): The ID of the project that owns the - models. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.automl_v1beta1.types.Model` - instances. You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - return self.auto_ml_client.list_models( - self.__location_path(project=project, region=region), **kwargs - ) - - def list_model_evaluations( - self, - project=None, - region=None, - model=None, - model_display_name=None, - model_name=None, - **kwargs - ): - """List all model evaluations for a given model. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> ms = client.list_model_evaluations(model_display_name='my_model') - >>> - >>> for m in ms: - ... # do something - ... pass - ... - - Args: - project (Optional[str]): The ID of the project that owns the - model. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - model_display_name (Optional[str]): - The human-readable name given to the model you want to list - evaluations for. This must be supplied if `model` or - `model_name` are not supplied. - model_name (Optional[str]): - The AutoML-assigned name given to the model you want to list - evaluations for. This must be supplied if `model_display_name` - or `model` are not supplied. - model (Optional[model]): - The `model` instance you want to list evaluations for. This - must be supplied if `model_display_name` or `model_name` are - not supplied. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of - :class:`~google.cloud.automl_v1beta1.types.ModelEvaluation` - instances. You can also iterate over the pages of the response - using its `pages` property. - - For a regression model, there will only be one evaluation. For a - classification model there will be on for each classification - label, as well as one for micro-averaged metrics. See more - documentation here: - https://cloud.google.com/automl-tables/docs/evaluate#automl-tables-list-model-evaluations-cli-curl:w - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - model_name = self.__model_name_from_args( - model=model, - model_name=model_name, - model_display_name=model_display_name, - project=project, - region=region, - **kwargs - ) - - return self.auto_ml_client.list_model_evaluations(model_name, **kwargs) - - def create_model( - self, - model_display_name, - dataset=None, - dataset_display_name=None, - dataset_name=None, - train_budget_milli_node_hours=None, - optimization_objective=None, - project=None, - region=None, - model_metadata=None, - include_column_spec_names=None, - exclude_column_spec_names=None, - disable_early_stopping=False, - **kwargs - ): - """Create a model. This will train your model on the given dataset. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> m = client.create_model( - ... 'my_model', - ... dataset_display_name='my_dataset', - ... train_budget_milli_node_hours=1000 - ... ) - >>> - >>> m.result() # blocks on result - >>> - - Args: - project (Optional[str]): The ID of the project that will own the - model. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - model_display_name (str): - A human-readable name to refer to this model by. - train_budget_milli_node_hours (int): - The amount of time (in thousandths of an hour) to spend - training. This value must be between 1,000 and 72,000 inclusive - (between 1 and 72 hours). - optimization_objective (str): - The metric AutoML tables should optimize for. - dataset_display_name (Optional[str]): - The human-readable name given to the dataset you want to train - your model on. This must be supplied if `dataset` or - `dataset_name` are not supplied. - dataset_name (Optional[str]): - The AutoML-assigned name given to the dataset you want to train - your model on. This must be supplied if `dataset_display_name` - or `dataset` are not supplied. - dataset (Optional[Dataset]): - The `Dataset` instance you want to train your model on. This - must be supplied if `dataset_display_name` or `dataset_name` - are not supplied. - model_metadata (Optional[Dict]): - Optional model metadata to supply to the client. - include_column_spec_names(Optional[str]): - The list of the names of the columns you want to include to train - your model on. - exclude_column_spec_names(Optional[str]): - The list of the names of the columns you want to exclude and - not train your model on. - disable_early_stopping(Optional[bool]): - True if disable early stopping. By default, the early stopping - feature is enabled, which means that AutoML Tables might stop - training before the entire training budget has been used. - Returns: - google.api_core.operation.Operation: - An operation future that can be used to check for - completion synchronously or asynchronously. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - if model_metadata is None: - model_metadata = {} - - if ( - train_budget_milli_node_hours is None - or train_budget_milli_node_hours < 1000 - or train_budget_milli_node_hours > 72000 - ): - raise ValueError( - "'train_budget_milli_node_hours' must be a " - "value between 1,000 and 72,000 inclusive" - ) - - if exclude_column_spec_names not in [ - None, - [], - ] and include_column_spec_names not in [None, []]: - raise ValueError( - "Cannot set both " - "'exclude_column_spec_names' and " - "'include_column_spec_names'" - ) - - dataset_name = self.__dataset_name_from_args( - dataset=dataset, - dataset_name=dataset_name, - dataset_display_name=dataset_display_name, - project=project, - region=region, - **kwargs - ) - - model_metadata["train_budget_milli_node_hours"] = train_budget_milli_node_hours - if optimization_objective is not None: - model_metadata["optimization_objective"] = optimization_objective - if disable_early_stopping: - model_metadata["disable_early_stopping"] = True - - dataset_id = dataset_name.rsplit("/", 1)[-1] - columns = [ - s - for s in self.list_column_specs( - dataset=dataset, - dataset_name=dataset_name, - dataset_display_name=dataset_display_name, - **kwargs - ) - ] - - final_columns = [] - if include_column_spec_names: - for c in columns: - if c.display_name in include_column_spec_names: - final_columns.append(c) - - model_metadata["input_feature_column_specs"] = final_columns - elif exclude_column_spec_names: - for a in columns: - if a.display_name not in exclude_column_spec_names: - final_columns.append(a) - - model_metadata["input_feature_column_specs"] = final_columns - - request = { - "display_name": model_display_name, - "dataset_id": dataset_id, - "tables_model_metadata": model_metadata, - } - - op = self.auto_ml_client.create_model( - self.__location_path(project=project, region=region), request, **kwargs - ) - self.__log_operation_info("Model creation", op) - return op - - def delete_model( - self, - model=None, - model_display_name=None, - model_name=None, - project=None, - region=None, - **kwargs - ): - """Deletes a model. Note this will not delete any datasets associated - with this model. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> op = client.delete_model(model_display_name='my_model') - >>> - >>> op.result() # blocks on delete request - >>> - - Args: - project (Optional[str]): The ID of the project that owns the - model. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - model_display_name (Optional[str]): - The human-readable name given to the model you want to - delete. This must be supplied if `model` or `model_name` - are not supplied. - model_name (Optional[str]): - The AutoML-assigned name given to the model you want to - delete. This must be supplied if `model_display_name` or - `model` are not supplied. - model (Optional[model]): - The `model` instance you want to delete. This must be - supplied if `model_display_name` or `model_name` are not - supplied. - - Returns: - google.api_core.operation.Operation: - An operation future that can be used to check for - completion synchronously or asynchronously. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - try: - model_name = self.__model_name_from_args( - model=model, - model_name=model_name, - model_display_name=model_display_name, - project=project, - region=region, - **kwargs - ) - # delete is idempotent - except exceptions.NotFound: - return None - - op = self.auto_ml_client.delete_model(model_name, **kwargs) - self.__log_operation_info("Delete model", op) - return op - - def get_model_evaluation( - self, model_evaluation_name, project=None, region=None, **kwargs - ): - """Gets a single evaluation model in a particular project and region. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> d = client.get_model_evaluation('my_model_evaluation') - >>> - - Args: - model_evaluation_name (str): - This is the fully-qualified name generated by the AutoML API - for this model evaluation. - project (Optional[str]): The ID of the project that owns the - model. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.ModelEvaluation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - return self.auto_ml_client.get_model_evaluation(model_evaluation_name, **kwargs) - - def get_model( - self, - project=None, - region=None, - model_name=None, - model_display_name=None, - **kwargs - ): - """Gets a single model in a particular project and region. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> d = client.get_model(model_display_name='my_model') - >>> - - Args: - project (Optional[str]): The ID of the project that owns the - model. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - model_name (Optional[str]): - This is the fully-qualified name generated by the AutoML API - for this model. This is not to be confused with the - human-assigned `model_display_name` that is provided when - creating a model. Either `model_name` or - `model_display_name` must be provided. - model_display_name (Optional[str]): - This is the name you provided for the model when first - creating it. Either `model_name` or `model_display_name` - must be provided. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.Model` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - if model_name is None and model_display_name is None: - raise ValueError( - "One of 'model_name' or " "'model_display_name' must be set." - ) - - if model_name is not None: - return self.auto_ml_client.get_model(model_name, **kwargs) - - return self.__lookup_by_display_name( - "model", self.list_models(project, region, **kwargs), model_display_name - ) - - # TODO(jonathanskim): allow deployment from just model ID - def deploy_model( - self, - model=None, - model_name=None, - model_display_name=None, - project=None, - region=None, - **kwargs - ): - """Deploys a model. This allows you make online predictions using the - model you've deployed. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> op = client.deploy_model(model_display_name='my_model') - >>> - >>> op.result() # blocks on deploy request - >>> - - Args: - project (Optional[str]): The ID of the project that owns the - model. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - model_display_name (Optional[str]): - The human-readable name given to the model you want to - deploy. This must be supplied if `model` or `model_name` - are not supplied. - model_name (Optional[str]): - The AutoML-assigned name given to the model you want to - deploy. This must be supplied if `model_display_name` or - `model` are not supplied. - model (Optional[model]): - The `model` instance you want to deploy. This must be - supplied if `model_display_name` or `model_name` are not - supplied. - - Returns: - google.api_core.operation.Operation: - An operation future that can be used to check for - completion synchronously or asynchronously. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - model_name = self.__model_name_from_args( - model=model, - model_name=model_name, - model_display_name=model_display_name, - project=project, - region=region, - **kwargs - ) - - op = self.auto_ml_client.deploy_model(model_name, **kwargs) - self.__log_operation_info("Deploy model", op) - return op - - def undeploy_model( - self, - model=None, - model_name=None, - model_display_name=None, - project=None, - region=None, - **kwargs - ): - """Undeploys a model. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> op = client.undeploy_model(model_display_name='my_model') - >>> - >>> op.result() # blocks on undeploy request - >>> - - Args: - project (Optional[str]): The ID of the project that owns the - model. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - model_display_name (Optional[str]): - The human-readable name given to the model you want to - undeploy. This must be supplied if `model` or `model_name` - are not supplied. - model_name (Optional[str]): - The AutoML-assigned name given to the model you want to - undeploy. This must be supplied if `model_display_name` or - `model` are not supplied. - model (Optional[model]): - The `model` instance you want to undeploy. This must be - supplied if `model_display_name` or `model_name` are not - supplied. - - Returns: - google.api_core.operation.Operation: - An operation future that can be used to check for - completion synchronously or asynchronously. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - model_name = self.__model_name_from_args( - model=model, - model_name=model_name, - model_display_name=model_display_name, - project=project, - region=region, - **kwargs - ) - - op = self.auto_ml_client.undeploy_model(model_name, **kwargs) - self.__log_operation_info("Undeploy model", op) - return op - - ## TODO(lwander): support pandas DataFrame as input type - def predict( - self, - inputs, - model=None, - model_name=None, - model_display_name=None, - feature_importance=False, - project=None, - region=None, - **kwargs - ): - """Makes a prediction on a deployed model. This will fail if the model - was not deployed. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> client.predict(inputs={'Age': 30, 'Income': 12, 'Category': 'A'} - ... model_display_name='my_model') - ... - >>> client.predict([30, 12, 'A'], model_display_name='my_model') - >>> - - Args: - project (Optional[str]): The ID of the project that owns the - model. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - inputs (Union[List[str], Dict[str, str]]): - Either the sorted list of column values to predict with, or a - key-value map of column display name to value to predict with. - model_display_name (Optional[str]): - The human-readable name given to the model you want to predict - with. This must be supplied if `model` or `model_name` are not - supplied. - model_name (Optional[str]): - The AutoML-assigned name given to the model you want to predict - with. This must be supplied if `model_display_name` or `model` - are not supplied. - model (Optional[model]): - The `model` instance you want to predict with . This must be - supplied if `model_display_name` or `model_name` are not - supplied. - feature_importance (bool): - True if enable feature importance explainability. The default is - False. - - Returns: - A :class:`~google.cloud.automl_v1beta1.types.PredictResponse` - instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - model = self.__model_from_args( - model=model, - model_name=model_name, - model_display_name=model_display_name, - project=project, - region=region, - **kwargs - ) - - column_specs = model.tables_model_metadata.input_feature_column_specs - if type(inputs) == dict: - inputs = [inputs.get(c.display_name, None) for c in column_specs] - - if len(inputs) != len(column_specs): - raise ValueError( - ( - "Dimension mismatch, the number of provided " - "inputs ({}) does not match that of the model " - "({})" - ).format(len(inputs), len(column_specs)) - ) - - values = [] - for i, c in zip(inputs, column_specs): - value_type = self.__data_type_to_proto_value(c.data_type, i) - values.append(value_type) - - row = data_items_pb2.Row(values=values) - payload = data_items_pb2.ExamplePayload(row=row) - - params = None - if feature_importance: - params = {"feature_importance": "true"} - - return self.prediction_client.predict(model.name, payload, params, **kwargs) - - def batch_predict( - self, - pandas_dataframe=None, - bigquery_input_uri=None, - bigquery_output_uri=None, - gcs_input_uris=None, - gcs_output_uri_prefix=None, - model=None, - model_name=None, - model_display_name=None, - project=None, - region=None, - credentials=None, - inputs=None, - **kwargs - ): - """Makes a batch prediction on a model. This does _not_ require the - model to be deployed. - - Example: - >>> from google.cloud import automl_v1beta1 - >>> - >>> from google.oauth2 import service_account - >>> - >>> client = automl_v1beta1.TablesClient( - ... credentials=service_account.Credentials.from_service_account_file('~/.gcp/account.json'), - ... project='my-project', region='us-central1') - ... - >>> client.batch_predict( - ... gcs_input_uris='gs://inputs/input.csv', - ... gcs_output_uri_prefix='gs://outputs/', - ... model_display_name='my_model' - ... ).result() - ... - - Args: - project (Optional[str]): The ID of the project that owns the - model. If you have initialized the client with a value for - `project` it will be used if this parameter is not supplied. - Keep in mind, the service account this client was initialized - with must have access to this project. - region (Optional[str]): - If you have initialized the client with a value for `region` it - will be used if this parameter is not supplied. - credentials (Optional[google.auth.credentials.Credentials]): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - pandas_dataframe (Optional[pandas.DataFrame]): - A Pandas Dataframe object containing the data you want to predict - off of. The data will be converted to CSV, and this CSV will be - staged to GCS in `gs://{project}-automl-tables-staging/{uploaded_csv_name}` - This must be supplied if neither `gcs_input_uris` nor - `bigquery_input_uri` is supplied. - gcs_input_uris (Optional(Union[List[str], str])) - Either a list of or a single GCS URI containing the data you - want to predict off of. This must be supplied if neither - `pandas_dataframe` nor `bigquery_input_uri` is supplied. - gcs_output_uri_prefix (Optional[str]) - The folder in GCS you want to write output to. This must be - supplied if `bigquery_output_uri` is not. - bigquery_input_uri (Optional[str]) - The BigQuery table to input data from. This must be supplied if - neither `pandas_dataframe` nor `gcs_input_uris` is supplied. - bigquery_output_uri (Optional[str]) - The BigQuery table to output data to. This must be supplied if - `gcs_output_uri_prefix` is not. - model_display_name (Optional[str]): - The human-readable name given to the model you want to predict - with. This must be supplied if `model` or `model_name` are not - supplied. - model_name (Optional[str]): - The AutoML-assigned name given to the model you want to predict - with. This must be supplied if `model_display_name` or `model` - are not supplied. - model (Optional[model]): - The `model` instance you want to predict with . This must be - supplied if `model_display_name` or `model_name` are not - supplied. - - Returns: - google.api_core.operation.Operation: - An operation future that can be used to check for - completion synchronously or asynchronously. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If required parameters are missing. - """ - model_name = self.__model_name_from_args( - model=model, - model_name=model_name, - model_display_name=model_display_name, - project=project, - region=region, - **kwargs - ) - - input_request = None - - if pandas_dataframe is not None: - project = project or self.project - region = region or self.region - credentials = credentials or self.credentials - self.__ensure_gcs_client_is_initialized(credentials, project) - self.gcs_client.ensure_bucket_exists(project, region) - gcs_input_uri = self.gcs_client.upload_pandas_dataframe(pandas_dataframe) - input_request = {"gcs_source": {"input_uris": [gcs_input_uri]}} - elif gcs_input_uris is not None: - if type(gcs_input_uris) != list: - gcs_input_uris = [gcs_input_uris] - input_request = {"gcs_source": {"input_uris": gcs_input_uris}} - elif bigquery_input_uri is not None: - input_request = {"bigquery_source": {"input_uri": bigquery_input_uri}} - else: - raise ValueError( - "One of 'gcs_input_uris'/'bigquery_input_uris' must" "be set" - ) - - output_request = None - if gcs_output_uri_prefix is not None: - output_request = { - "gcs_destination": {"output_uri_prefix": gcs_output_uri_prefix} - } - elif bigquery_output_uri is not None: - output_request = { - "bigquery_destination": {"output_uri": bigquery_output_uri} - } - else: - raise ValueError( - "One of 'gcs_output_uri_prefix'/'bigquery_output_uri' must be set" - ) - - op = self.prediction_client.batch_predict( - model_name, input_request, output_request, **kwargs - ) - self.__log_operation_info("Batch predict", op) - return op diff --git a/automl/google/cloud/automl_v1beta1/types.py b/automl/google/cloud/automl_v1beta1/types.py deleted file mode 100644 index 2e9bdd776b12..000000000000 --- a/automl/google/cloud/automl_v1beta1/types.py +++ /dev/null @@ -1,114 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.automl_v1beta1.proto import annotation_payload_pb2 -from google.cloud.automl_v1beta1.proto import annotation_spec_pb2 -from google.cloud.automl_v1beta1.proto import classification_pb2 -from google.cloud.automl_v1beta1.proto import column_spec_pb2 -from google.cloud.automl_v1beta1.proto import data_items_pb2 -from google.cloud.automl_v1beta1.proto import data_stats_pb2 -from google.cloud.automl_v1beta1.proto import data_types_pb2 -from google.cloud.automl_v1beta1.proto import dataset_pb2 -from google.cloud.automl_v1beta1.proto import detection_pb2 -from google.cloud.automl_v1beta1.proto import geometry_pb2 -from google.cloud.automl_v1beta1.proto import image_pb2 -from google.cloud.automl_v1beta1.proto import io_pb2 -from google.cloud.automl_v1beta1.proto import model_evaluation_pb2 -from google.cloud.automl_v1beta1.proto import model_pb2 -from google.cloud.automl_v1beta1.proto import operations_pb2 as proto_operations_pb2 -from google.cloud.automl_v1beta1.proto import prediction_service_pb2 -from google.cloud.automl_v1beta1.proto import ranges_pb2 -from google.cloud.automl_v1beta1.proto import regression_pb2 -from google.cloud.automl_v1beta1.proto import service_pb2 -from google.cloud.automl_v1beta1.proto import table_spec_pb2 -from google.cloud.automl_v1beta1.proto import tables_pb2 -from google.cloud.automl_v1beta1.proto import temporal_pb2 -from google.cloud.automl_v1beta1.proto import text_extraction_pb2 -from google.cloud.automl_v1beta1.proto import text_pb2 -from google.cloud.automl_v1beta1.proto import text_segment_pb2 -from google.cloud.automl_v1beta1.proto import text_sentiment_pb2 -from google.cloud.automl_v1beta1.proto import translation_pb2 -from google.cloud.automl_v1beta1.proto import video_pb2 -from google.longrunning import operations_pb2 as longrunning_operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import duration_pb2 -from google.protobuf import field_mask_pb2 -from google.protobuf import struct_pb2 -from google.protobuf import timestamp_pb2 -from google.rpc import status_pb2 - - -_shared_modules = [ - longrunning_operations_pb2, - any_pb2, - duration_pb2, - field_mask_pb2, - struct_pb2, - timestamp_pb2, - status_pb2, -] - -_local_modules = [ - annotation_payload_pb2, - annotation_spec_pb2, - classification_pb2, - column_spec_pb2, - data_items_pb2, - data_stats_pb2, - data_types_pb2, - dataset_pb2, - detection_pb2, - geometry_pb2, - image_pb2, - io_pb2, - model_evaluation_pb2, - model_pb2, - proto_operations_pb2, - prediction_service_pb2, - ranges_pb2, - regression_pb2, - service_pb2, - table_spec_pb2, - tables_pb2, - temporal_pb2, - text_extraction_pb2, - text_pb2, - text_segment_pb2, - text_sentiment_pb2, - translation_pb2, - video_pb2, -] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.automl_v1beta1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/automl/noxfile.py b/automl/noxfile.py deleted file mode 100644 index f35797a7f3ae..000000000000 --- a/automl/noxfile.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".[pandas,storage]") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".[pandas,storage]") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=83") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".[pandas,storage]") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/automl/setup.cfg b/automl/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/automl/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/automl/setup.py b/automl/setup.py deleted file mode 100644 index 208d1e221158..000000000000 --- a/automl/setup.py +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import io -import os - -import setuptools - -name = "google-cloud-automl" -description = "Cloud AutoML API client library" -version = "0.9.0" -release_status = "Development Status :: 3 - Alpha" -dependencies = [ - "google-api-core[grpc] >= 1.14.0, < 2.0.0dev", - 'enum34; python_version < "3.4"', -] -extras = { - "pandas": ["pandas>=0.17.1"], - "storage": ["google-cloud-storage >= 1.18.0, < 2.0.0dev"], -} - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@oogle.com", - license="Apache 2.0", - url="https://github.com/GoogleCloudPlatform/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - extras_require=extras, - python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", - include_package_data=True, - zip_safe=False, -) diff --git a/automl/synth.metadata b/automl/synth.metadata deleted file mode 100644 index 809e4bd32941..000000000000 --- a/automl/synth.metadata +++ /dev/null @@ -1,655 +0,0 @@ -{ - "updateTime": "2020-01-30T13:13:18.747854Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c1246a29e22b0f98e800a536b5b0da2d933a55f2", - "internalRef": "292310790", - "log": "c1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\n" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "automl", - "apiVersion": "v1beta1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/automl/artman_automl_v1beta1.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "automl", - "apiVersion": "v1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/automl/artman_automl_v1.yaml" - } - } - ], - "newFiles": [ - { - "path": ".coveragerc" - }, - { - "path": ".flake8" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "LICENSE" - }, - { - "path": "MANIFEST.in" - }, - { - "path": "README.rst" - }, - { - "path": "docs/README.rst" - }, - { - "path": "docs/_static/custom.css" - }, - { - "path": "docs/_templates/layout.html" - }, - { - "path": "docs/changelog.md" - }, - { - "path": "docs/conf.py" - }, - { - "path": "docs/gapic/v1/api.rst" - }, - { - "path": "docs/gapic/v1/types.rst" - }, - { - "path": "docs/gapic/v1beta1/api.rst" - }, - { - "path": "docs/gapic/v1beta1/tables.rst" - }, - { - "path": "docs/gapic/v1beta1/types.rst" - }, - { - "path": "docs/index.rst" - }, - { - "path": "google/__init__.py" - }, - { - "path": "google/cloud/__init__.py" - }, - { - "path": "google/cloud/automl.py" - }, - { - "path": "google/cloud/automl_v1/__init__.py" - }, - { - "path": "google/cloud/automl_v1/gapic/__init__.py" - }, - { - "path": "google/cloud/automl_v1/gapic/auto_ml_client.py" - }, - { - "path": "google/cloud/automl_v1/gapic/auto_ml_client_config.py" - }, - { - "path": "google/cloud/automl_v1/gapic/enums.py" - }, - { - "path": "google/cloud/automl_v1/gapic/prediction_service_client.py" - }, - { - "path": "google/cloud/automl_v1/gapic/prediction_service_client_config.py" - }, - { - "path": "google/cloud/automl_v1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/automl_v1/gapic/transports/auto_ml_grpc_transport.py" - }, - { - "path": "google/cloud/automl_v1/gapic/transports/prediction_service_grpc_transport.py" - }, - { - "path": "google/cloud/automl_v1/proto/__init__.py" - }, - { - "path": "google/cloud/automl_v1/proto/annotation_payload.proto" - }, - { - "path": "google/cloud/automl_v1/proto/annotation_payload_pb2.py" - }, - { - "path": "google/cloud/automl_v1/proto/annotation_payload_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1/proto/annotation_spec.proto" - }, - { - "path": "google/cloud/automl_v1/proto/annotation_spec_pb2.py" - }, - { - "path": "google/cloud/automl_v1/proto/annotation_spec_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1/proto/classification.proto" - }, - { - "path": "google/cloud/automl_v1/proto/classification_pb2.py" - }, - { - "path": "google/cloud/automl_v1/proto/classification_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1/proto/data_items.proto" - }, - { - "path": "google/cloud/automl_v1/proto/data_items_pb2.py" - }, - { - "path": "google/cloud/automl_v1/proto/data_items_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1/proto/dataset.proto" - }, - { - "path": "google/cloud/automl_v1/proto/dataset_pb2.py" - }, - { - "path": "google/cloud/automl_v1/proto/dataset_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1/proto/detection.proto" - }, - { - "path": "google/cloud/automl_v1/proto/detection_pb2.py" - }, - { - "path": "google/cloud/automl_v1/proto/detection_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1/proto/geometry.proto" - }, - { - "path": "google/cloud/automl_v1/proto/geometry_pb2.py" - }, - { - "path": "google/cloud/automl_v1/proto/geometry_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1/proto/image.proto" - }, - { - "path": "google/cloud/automl_v1/proto/image_pb2.py" - }, - { - "path": "google/cloud/automl_v1/proto/image_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1/proto/io.proto" - }, - { - "path": "google/cloud/automl_v1/proto/io_pb2.py" - }, - { - "path": "google/cloud/automl_v1/proto/io_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1/proto/model.proto" - }, - { - "path": "google/cloud/automl_v1/proto/model_evaluation.proto" - }, - { - "path": "google/cloud/automl_v1/proto/model_evaluation_pb2.py" - }, - { - "path": "google/cloud/automl_v1/proto/model_evaluation_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1/proto/model_pb2.py" - }, - { - "path": "google/cloud/automl_v1/proto/model_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1/proto/operations.proto" - }, - { - "path": "google/cloud/automl_v1/proto/operations_pb2.py" - }, - { - "path": "google/cloud/automl_v1/proto/operations_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1/proto/prediction_service.proto" - }, - { - "path": "google/cloud/automl_v1/proto/prediction_service_pb2.py" - }, - { - "path": "google/cloud/automl_v1/proto/prediction_service_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1/proto/service.proto" - }, - { - "path": "google/cloud/automl_v1/proto/service_pb2.py" - }, - { - "path": "google/cloud/automl_v1/proto/service_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1/proto/text.proto" - }, - { - "path": "google/cloud/automl_v1/proto/text_extraction.proto" - }, - { - "path": "google/cloud/automl_v1/proto/text_extraction_pb2.py" - }, - { - "path": "google/cloud/automl_v1/proto/text_extraction_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1/proto/text_pb2.py" - }, - { - "path": "google/cloud/automl_v1/proto/text_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1/proto/text_segment.proto" - }, - { - "path": "google/cloud/automl_v1/proto/text_segment_pb2.py" - }, - { - "path": "google/cloud/automl_v1/proto/text_segment_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1/proto/text_sentiment.proto" - }, - { - "path": "google/cloud/automl_v1/proto/text_sentiment_pb2.py" - }, - { - "path": "google/cloud/automl_v1/proto/text_sentiment_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1/proto/translation.proto" - }, - { - "path": "google/cloud/automl_v1/proto/translation_pb2.py" - }, - { - "path": "google/cloud/automl_v1/proto/translation_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1/types.py" - }, - { - "path": "google/cloud/automl_v1beta1/__init__.py" - }, - { - "path": "google/cloud/automl_v1beta1/gapic/__init__.py" - }, - { - "path": "google/cloud/automl_v1beta1/gapic/auto_ml_client.py" - }, - { - "path": "google/cloud/automl_v1beta1/gapic/auto_ml_client_config.py" - }, - { - "path": "google/cloud/automl_v1beta1/gapic/enums.py" - }, - { - "path": "google/cloud/automl_v1beta1/gapic/prediction_service_client.py" - }, - { - "path": "google/cloud/automl_v1beta1/gapic/prediction_service_client_config.py" - }, - { - "path": "google/cloud/automl_v1beta1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/automl_v1beta1/gapic/transports/auto_ml_grpc_transport.py" - }, - { - "path": "google/cloud/automl_v1beta1/gapic/transports/prediction_service_grpc_transport.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/__init__.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/annotation_payload.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/annotation_payload_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/annotation_payload_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/annotation_spec.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/annotation_spec_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/annotation_spec_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/classification.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/classification_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/classification_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/column_spec.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/column_spec_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/column_spec_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/data_items.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/data_items_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/data_items_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/data_stats.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/data_stats_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/data_stats_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/data_types.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/data_types_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/data_types_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/dataset.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/dataset_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/dataset_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/detection.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/detection_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/detection_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/geometry.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/geometry_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/geometry_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/image.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/image_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/image_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/io.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/io_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/io_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/model.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/model_evaluation.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/model_evaluation_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/model_evaluation_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/model_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/model_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/operations.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/operations_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/operations_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/prediction_service.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/prediction_service_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/prediction_service_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/ranges.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/ranges_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/ranges_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/regression.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/regression_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/regression_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/service.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/service_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/service_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/table_spec.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/table_spec_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/table_spec_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/tables.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/tables_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/tables_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/temporal.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/temporal_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/temporal_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/text.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/text_extraction.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/text_extraction_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/text_extraction_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/text_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/text_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/text_segment.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/text_segment_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/text_segment_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/text_sentiment.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/text_sentiment_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/text_sentiment_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/translation.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/translation_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/translation_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/video.proto" - }, - { - "path": "google/cloud/automl_v1beta1/proto/video_pb2.py" - }, - { - "path": "google/cloud/automl_v1beta1/proto/video_pb2_grpc.py" - }, - { - "path": "google/cloud/automl_v1beta1/tables/__init__.py" - }, - { - "path": "google/cloud/automl_v1beta1/tables/gcs_client.py" - }, - { - "path": "google/cloud/automl_v1beta1/tables/tables_client.py" - }, - { - "path": "google/cloud/automl_v1beta1/types.py" - }, - { - "path": "noxfile.py" - }, - { - "path": "setup.cfg" - }, - { - "path": "setup.py" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "tests/system/gapic/v1beta1/test_system_tables_client_v1.py" - }, - { - "path": "tests/unit/gapic/v1/test_auto_ml_client_v1.py" - }, - { - "path": "tests/unit/gapic/v1/test_prediction_service_client_v1.py" - }, - { - "path": "tests/unit/gapic/v1beta1/test_auto_ml_client_v1beta1.py" - }, - { - "path": "tests/unit/gapic/v1beta1/test_gcs_client_v1beta1.py" - }, - { - "path": "tests/unit/gapic/v1beta1/test_prediction_service_client_v1beta1.py" - }, - { - "path": "tests/unit/gapic/v1beta1/test_tables_client_v1beta1.py" - } - ] -} \ No newline at end of file diff --git a/automl/synth.py b/automl/synth.py deleted file mode 100644 index c46ab6f86604..000000000000 --- a/automl/synth.py +++ /dev/null @@ -1,143 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated parts of this library.""" - -import re - -import synthtool as s -from synthtool import gcp - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() -versions = ["v1beta1", "v1"] - - -# ---------------------------------------------------------------------------- -# Generate automl GAPIC layer -# ---------------------------------------------------------------------------- -for version in versions: - library = gapic.py_library("automl", version, include_protos=True) - s.move(library / f"google/cloud/automl_{version}") - s.move(library / f"tests/unit/gapic/{version}") - s.move(library / f"docs/gapic/{version}") - -s.move(library / f"docs/conf.py") - -# Use the highest version library to generate import alias. -s.move(library / "google/cloud/automl.py") - -# Add TablesClient and GcsClient to v1beta1 -s.replace( - f"google/cloud/automl_v1beta1/__init__.py", - f"from google.cloud.automl_v1beta1.gapic import prediction_service_client", - f"from google.cloud.automl_v1beta1.gapic import prediction_service_client\n" - f"from google.cloud.automl_v1beta1.tables import tables_client\n" - f"from google.cloud.automl_v1beta1.tables import gcs_client" - f"\n\n" - f"class TablesClient(tables_client.TablesClient):" - f" __doc__ = tables_client.TablesClient.__doc__" - f"\n\nclass GcsClient(gcs_client.GcsClient):" - f" __doc__ = gcs_client.GcsClient.__doc__" -) - -s.replace( - f"google/cloud/automl_v1beta1/__init__.py", - f"""__all__ = \( - 'enums', - 'types', - 'AutoMlClient', - 'PredictionServiceClient', -\)""", - f'__all__ = ("enums", "types", "AutoMlClient", "PredictionServiceClient", "TablesClient", "GcsClient")', -) - -# Fixup issues in generated code -s.replace( - "**/gapic/*_client.py", - r"metadata_type=operations_pb2.OperationMetadata", - r"metadata_type=proto_operations_pb2.OperationMetadata", -) - -# Fix spacing/'::' issues in docstrings -s.replace( - "google/cloud/automl_v1beta1/gapic/prediction_service_client.py", "^\s+::", "" -) - -s.replace( - "google/cloud/automl_v1beta1/gapic/auto_ml_client.py", - "^(\s+)(::)\n\n\s+?([^\s])", - " \g<1>\g<2>\n \g<1>\g<3>", -) - -# Remove 'raw-latex' sections with sample JSON Lines files -s.replace( - "google/cloud/**/io_pb2.py", - r"""Sample in-line - JSON Lines file.*?\}`\n""", - "\n", - flags=re.DOTALL, -) - -# Remove 'raw-latex' sections with sample JSON Lines files -s.replace( - "google/cloud/**/io_pb2.py", - r"""Sample - in-line JSON Lines.*?(\n\s+-\s+For Text Classification.*\n)""", - "\g<1>", - flags=re.DOTALL, -) - -# Replace docstring with no summary line -s.replace( - "google/cloud/**/io_pb2.py", - r"""__doc__ = \"\"\"- For Translation: CSV file ``translation\.csv``, with each """, - r'''__doc__ = """ -- For Translation: CSV file ``translation.csv``, with each ''', - flags=re.DOTALL, -) - -s.replace("google/cloud/**/io_pb2.py", r":raw-latex:`\\t `", r"\\\\t") - -# Remove html bits that can't be rendered correctly -s.replace("google/cloud/automl_v1/**/io_pb2.py", -r""".. raw:: html.+? - \""", -r"", flags=re.DOTALL) - -# Remove raw-latex wrapping newline -s.replace("google/cloud/automl_v1/**/io_pb2.py", -r""":raw-latex:`\\n`""", -r"``\\\\n``") - -# Make \n visible in JSONL samples -s.replace("google/cloud/**/io_pb2.py", -r"\}\\n", -r"}\\\\n") - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = common.py_library(unit_cov_level=82, cov_level=83) - -s.move(templated_files) - -# install with extras (pandas, storage) -s.replace( - "noxfile.py", - """session\.install\(['"]-e['"], ['"]\.['"]\)""", - """session.install("-e", ".[pandas,storage]")""" -) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/automl/tests/system/gapic/v1beta1/test_system_tables_client_v1.py b/automl/tests/system/gapic/v1beta1/test_system_tables_client_v1.py deleted file mode 100644 index 27f2e884fb79..000000000000 --- a/automl/tests/system/gapic/v1beta1/test_system_tables_client_v1.py +++ /dev/null @@ -1,295 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import pandas -import pytest -import random -import string -import time -import unittest - -from google.cloud import automl_v1beta1 -from google.api_core import exceptions -from google.cloud.automl_v1beta1.gapic import enums - -from test_utils.vpcsc_config import vpcsc_config - -PROJECT = os.environ["PROJECT_ID"] -REGION = "us-central1" -MAX_WAIT_TIME_SECONDS = 30 -MAX_SLEEP_TIME_SECONDS = 5 -STATIC_DATASET = "test_dataset_do_not_delete" -STATIC_MODEL = "test_model_do_not_delete" - -ID = "{rand}_{time}".format( - rand="".join( - [random.choice(string.ascii_letters + string.digits) for n in range(4)] - ), - time=int(time.time()), -) - - -def _id(name): - return "{}_{}".format(name, ID) - - -class TestSystemTablesClient(object): - def cancel_and_wait(self, op): - op.cancel() - start = time.time() - sleep_time = 1 - while time.time() - start < MAX_WAIT_TIME_SECONDS: - if op.cancelled(): - return - time.sleep(sleep_time) - sleep_time = min(sleep_time * 2, MAX_SLEEP_TIME_SECONDS) - assert op.cancelled() - - @vpcsc_config.skip_if_inside_vpcsc - def test_list_datasets(self): - client = automl_v1beta1.TablesClient(project=PROJECT, region=REGION) - dataset = self.ensure_dataset_ready(client) - # will raise if not found - next( - iter( - [d for d in client.list_datasets(timeout=10) if d.name == dataset.name] - ) - ) - - @vpcsc_config.skip_if_inside_vpcsc - def test_list_models(self): - client = automl_v1beta1.TablesClient(project=PROJECT, region=REGION) - model = self.ensure_model_ready(client) - # will raise if not found - next(iter([m for m in client.list_models(timeout=10) if m.name == model.name])) - - def test_create_delete_dataset(self): - client = automl_v1beta1.TablesClient(project=PROJECT, region=REGION) - display_name = _id("t_cr_dl") - dataset = client.create_dataset(display_name) - assert dataset is not None - assert ( - dataset.name == client.get_dataset(dataset_display_name=display_name).name - ) - client.delete_dataset(dataset=dataset) - - @vpcsc_config.skip_if_inside_vpcsc - def test_import_data(self): - client = automl_v1beta1.TablesClient(project=PROJECT, region=REGION) - display_name = _id("t_import") - dataset = client.create_dataset(display_name) - op = client.import_data( - dataset=dataset, - gcs_input_uris="gs://cloud-ml-tables-data/bank-marketing.csv", - ) - self.cancel_and_wait(op) - client.delete_dataset(dataset=dataset) - - @vpcsc_config.skip_if_inside_vpcsc - def test_import_pandas_dataframe(self): - client = automl_v1beta1.TablesClient(project=PROJECT, region=REGION) - display_name = _id("t_import_pandas") - dataset = client.create_dataset(display_name) - dataframe = pandas.DataFrame({"test-col1": [1, 2], "test-col2": [3, 4]}) - op = client.import_data( - project=PROJECT, dataset=dataset, pandas_dataframe=dataframe - ) - self.cancel_and_wait(op) - client.delete_dataset(dataset=dataset) - - def ensure_dataset_ready(self, client): - dataset = None - try: - dataset = client.get_dataset(dataset_display_name=STATIC_DATASET) - except exceptions.NotFound: - dataset = client.create_dataset(STATIC_DATASET) - - if dataset.example_count is None or dataset.example_count == 0: - op = client.import_data( - dataset=dataset, - gcs_input_uris="gs://cloud-ml-tables-data/bank-marketing.csv", - ) - op.result() - dataset = client.get_dataset(dataset_name=dataset.name) - - return dataset - - @vpcsc_config.skip_if_inside_vpcsc - def test_list_column_specs(self): - client = automl_v1beta1.TablesClient(project=PROJECT, region=REGION) - dataset = self.ensure_dataset_ready(client) - # will raise if not found - next( - iter( - [ - d - for d in client.list_column_specs(dataset=dataset) - if d.display_name == "Deposit" - ] - ) - ) - - @vpcsc_config.skip_if_inside_vpcsc - def test_get_column_spec(self): - client = automl_v1beta1.TablesClient(project=PROJECT, region=REGION) - dataset = self.ensure_dataset_ready(client) - name = [d for d in client.list_column_specs(dataset=dataset)][0].name - assert client.get_column_spec(name).name == name - - @vpcsc_config.skip_if_inside_vpcsc - def test_list_table_specs(self): - client = automl_v1beta1.TablesClient(project=PROJECT, region=REGION) - dataset = self.ensure_dataset_ready(client) - name = [d for d in client.list_table_specs(dataset=dataset)][0].name - assert client.get_table_spec(name).name == name - - @vpcsc_config.skip_if_inside_vpcsc - def test_set_column_nullable(self): - client = automl_v1beta1.TablesClient(project=PROJECT, region=REGION) - dataset = self.ensure_dataset_ready(client) - client.update_column_spec( - dataset=dataset, column_spec_display_name="POutcome", nullable=True - ) - columns = {c.display_name: c for c in client.list_column_specs(dataset=dataset)} - assert columns["POutcome"].data_type.nullable == True - - @vpcsc_config.skip_if_inside_vpcsc - def test_set_target_column(self): - client = automl_v1beta1.TablesClient(project=PROJECT, region=REGION) - dataset = self.ensure_dataset_ready(client) - client.set_target_column(dataset=dataset, column_spec_display_name="Age") - columns = {c.display_name: c for c in client.list_column_specs(dataset=dataset)} - dataset = client.get_dataset(dataset_name=dataset.name) - metadata = dataset.tables_dataset_metadata - assert columns["Age"].name.endswith( - "/{}".format(metadata.target_column_spec_id) - ) - - @vpcsc_config.skip_if_inside_vpcsc - def test_set_weight_column(self): - client = automl_v1beta1.TablesClient(project=PROJECT, region=REGION) - dataset = self.ensure_dataset_ready(client) - client.set_weight_column(dataset=dataset, column_spec_display_name="Duration") - columns = {c.display_name: c for c in client.list_column_specs(dataset=dataset)} - dataset = client.get_dataset(dataset_name=dataset.name) - metadata = dataset.tables_dataset_metadata - assert columns["Duration"].name.endswith( - "/{}".format(metadata.weight_column_spec_id) - ) - - @vpcsc_config.skip_if_inside_vpcsc - def test_set_weight_and_target_column(self): - client = automl_v1beta1.TablesClient(project=PROJECT, region=REGION) - dataset = self.ensure_dataset_ready(client) - client.set_weight_column(dataset=dataset, column_spec_display_name="Day") - client.set_target_column(dataset=dataset, column_spec_display_name="Campaign") - columns = {c.display_name: c for c in client.list_column_specs(dataset=dataset)} - dataset = client.get_dataset(dataset_name=dataset.name) - metadata = dataset.tables_dataset_metadata - assert columns["Day"].name.endswith( - "/{}".format(metadata.weight_column_spec_id) - ) - assert columns["Campaign"].name.endswith( - "/{}".format(metadata.target_column_spec_id) - ) - - @vpcsc_config.skip_if_inside_vpcsc - def test_create_delete_model(self): - client = automl_v1beta1.TablesClient(project=PROJECT, region=REGION) - dataset = self.ensure_dataset_ready(client) - client.set_target_column(dataset=dataset, column_spec_display_name="Deposit") - display_name = _id("t_cr_dl") - op = client.create_model( - display_name, dataset=dataset, train_budget_milli_node_hours=1000 - ) - self.cancel_and_wait(op) - client.delete_model(model_display_name=display_name) - - @vpcsc_config.skip_if_inside_vpcsc - def test_list_model_evaluations(self): - client = automl_v1beta1.TablesClient(project=PROJECT, region=REGION) - model = self.ensure_model_online(client) - # will raise if not found - next( - iter( - [ - m - for m in client.list_model_evaluations(model=model) - if m.display_name is not None - ] - ) - ) - - @vpcsc_config.skip_if_inside_vpcsc - def test_get_model_evaluation(self): - client = automl_v1beta1.TablesClient(project=PROJECT, region=REGION) - model = self.ensure_model_online(client) - name = [m for m in client.list_model_evaluations(model=model)][0].name - assert client.get_model_evaluation(model_evaluation_name=name).name == name - - @vpcsc_config.skip_if_inside_vpcsc - def test_online_predict(self): - client = automl_v1beta1.TablesClient(project=PROJECT, region=REGION) - model = self.ensure_model_online(client) - result = client.predict( - inputs={ - "Age": 31, - "Balance": 200, - "Campaign": 2, - "Contact": "cellular", - "Day": 4, - "Default": "no", - "Duration": 12, - "Education": "primary", - "Housing": "yes", - "Job": "blue-collar", - "Loan": "no", - "MaritalStatus": "divorced", - "Month": "jul", - "PDays": 4, - "POutcome": None, - "Previous": 12, - }, - model=model, - ) - assert result is not None - - def ensure_model_online(self, client): - model = self.ensure_model_ready(client) - if model.deployment_state != enums.Model.DeploymentState.DEPLOYED: - client.deploy_model(model=model).result() - - return client.get_model(model_name=model.name) - - def ensure_model_ready(self, client): - try: - return client.get_model(model_display_name=STATIC_MODEL) - except exceptions.NotFound: - pass - - dataset = self.ensure_dataset_ready(client) - client.set_target_column(dataset=dataset, column_spec_display_name="Deposit") - client.clear_weight_column(dataset=dataset) - client.clear_test_train_column(dataset=dataset) - client.update_column_spec( - dataset=dataset, column_spec_display_name="POutcome", nullable=True - ) - op = client.create_model( - STATIC_MODEL, dataset=dataset, train_budget_milli_node_hours=1000 - ) - op.result() - return client.get_model(model_display_name=STATIC_MODEL) diff --git a/automl/tests/unit/gapic/v1/test_auto_ml_client_v1.py b/automl/tests/unit/gapic/v1/test_auto_ml_client_v1.py deleted file mode 100644 index 7a4558d28fe2..000000000000 --- a/automl/tests/unit/gapic/v1/test_auto_ml_client_v1.py +++ /dev/null @@ -1,991 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import automl_v1 -from google.cloud.automl_v1.proto import annotation_spec_pb2 -from google.cloud.automl_v1.proto import dataset_pb2 -from google.cloud.automl_v1.proto import io_pb2 -from google.cloud.automl_v1.proto import model_evaluation_pb2 -from google.cloud.automl_v1.proto import model_pb2 -from google.cloud.automl_v1.proto import service_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestAutoMlClient(object): - def test_create_dataset(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - example_count = 1517063674 - etag = "etag3123477" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - "example_count": example_count, - "etag": etag, - } - expected_response = dataset_pb2.Dataset(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_create_dataset", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - dataset = {} - - response = client.create_dataset(parent, dataset) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = service_pb2.CreateDatasetRequest( - parent=parent, dataset=dataset - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_dataset_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_create_dataset_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - dataset = {} - - response = client.create_dataset(parent, dataset) - exception = response.exception() - assert exception.errors[0] == error - - def test_update_dataset(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - example_count = 1517063674 - etag = "etag3123477" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - "example_count": example_count, - "etag": etag, - } - expected_response = dataset_pb2.Dataset(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - dataset = {} - update_mask = {} - - response = client.update_dataset(dataset, update_mask) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = service_pb2.UpdateDatasetRequest( - dataset=dataset, update_mask=update_mask - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_dataset_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup request - dataset = {} - update_mask = {} - - with pytest.raises(CustomException): - client.update_dataset(dataset, update_mask) - - def test_get_dataset(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - description = "description-1724546052" - example_count = 1517063674 - etag = "etag3123477" - expected_response = { - "name": name_2, - "display_name": display_name, - "description": description, - "example_count": example_count, - "etag": etag, - } - expected_response = dataset_pb2.Dataset(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]") - - response = client.get_dataset(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = service_pb2.GetDatasetRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_dataset_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup request - name = client.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]") - - with pytest.raises(CustomException): - client.get_dataset(name) - - def test_list_datasets(self): - # Setup Expected Response - next_page_token = "" - datasets_element = {} - datasets = [datasets_element] - expected_response = {"next_page_token": next_page_token, "datasets": datasets} - expected_response = service_pb2.ListDatasetsResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_datasets(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.datasets[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = service_pb2.ListDatasetsRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_datasets_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_datasets(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_delete_dataset(self): - # Setup Expected Response - expected_response = {} - expected_response = empty_pb2.Empty(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_delete_dataset", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]") - - response = client.delete_dataset(name) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = service_pb2.DeleteDatasetRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_dataset_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_delete_dataset_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]") - - response = client.delete_dataset(name) - exception = response.exception() - assert exception.errors[0] == error - - def test_import_data(self): - # Setup Expected Response - expected_response = {} - expected_response = empty_pb2.Empty(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_import_data", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]") - input_config = {} - - response = client.import_data(name, input_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = service_pb2.ImportDataRequest( - name=name, input_config=input_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_import_data_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_import_data_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]") - input_config = {} - - response = client.import_data(name, input_config) - exception = response.exception() - assert exception.errors[0] == error - - def test_export_data(self): - # Setup Expected Response - expected_response = {} - expected_response = empty_pb2.Empty(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_export_data", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]") - output_config = {} - - response = client.export_data(name, output_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = service_pb2.ExportDataRequest( - name=name, output_config=output_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_export_data_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_export_data_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]") - output_config = {} - - response = client.export_data(name, output_config) - exception = response.exception() - assert exception.errors[0] == error - - def test_get_annotation_spec(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - example_count = 1517063674 - expected_response = { - "name": name_2, - "display_name": display_name, - "example_count": example_count, - } - expected_response = annotation_spec_pb2.AnnotationSpec(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - name = client.annotation_spec_path( - "[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]" - ) - - response = client.get_annotation_spec(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = service_pb2.GetAnnotationSpecRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_annotation_spec_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup request - name = client.annotation_spec_path( - "[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]" - ) - - with pytest.raises(CustomException): - client.get_annotation_spec(name) - - def test_create_model(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - dataset_id = "datasetId-2115646910" - etag = "etag3123477" - expected_response = { - "name": name, - "display_name": display_name, - "dataset_id": dataset_id, - "etag": etag, - } - expected_response = model_pb2.Model(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_create_model", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - model = {} - - response = client.create_model(parent, model) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = service_pb2.CreateModelRequest(parent=parent, model=model) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_model_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_create_model_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - model = {} - - response = client.create_model(parent, model) - exception = response.exception() - assert exception.errors[0] == error - - def test_get_model(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - dataset_id = "datasetId-2115646910" - etag = "etag3123477" - expected_response = { - "name": name_2, - "display_name": display_name, - "dataset_id": dataset_id, - "etag": etag, - } - expected_response = model_pb2.Model(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - - response = client.get_model(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = service_pb2.GetModelRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_model_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - - with pytest.raises(CustomException): - client.get_model(name) - - def test_update_model(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - dataset_id = "datasetId-2115646910" - etag = "etag3123477" - expected_response = { - "name": name, - "display_name": display_name, - "dataset_id": dataset_id, - "etag": etag, - } - expected_response = model_pb2.Model(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - model = {} - update_mask = {} - - response = client.update_model(model, update_mask) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = service_pb2.UpdateModelRequest( - model=model, update_mask=update_mask - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_model_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup request - model = {} - update_mask = {} - - with pytest.raises(CustomException): - client.update_model(model, update_mask) - - def test_list_models(self): - # Setup Expected Response - next_page_token = "" - model_element = {} - model = [model_element] - expected_response = {"next_page_token": next_page_token, "model": model} - expected_response = service_pb2.ListModelsResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_models(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.model[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = service_pb2.ListModelsRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_models_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_models(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_delete_model(self): - # Setup Expected Response - expected_response = {} - expected_response = empty_pb2.Empty(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_delete_model", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - - response = client.delete_model(name) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = service_pb2.DeleteModelRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_model_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_delete_model_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - - response = client.delete_model(name) - exception = response.exception() - assert exception.errors[0] == error - - def test_deploy_model(self): - # Setup Expected Response - expected_response = {} - expected_response = empty_pb2.Empty(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_deploy_model", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - - response = client.deploy_model(name) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = service_pb2.DeployModelRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_deploy_model_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_deploy_model_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - - response = client.deploy_model(name) - exception = response.exception() - assert exception.errors[0] == error - - def test_undeploy_model(self): - # Setup Expected Response - expected_response = {} - expected_response = empty_pb2.Empty(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_undeploy_model", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - - response = client.undeploy_model(name) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = service_pb2.UndeployModelRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_undeploy_model_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_undeploy_model_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - - response = client.undeploy_model(name) - exception = response.exception() - assert exception.errors[0] == error - - def test_export_model(self): - # Setup Expected Response - expected_response = {} - expected_response = empty_pb2.Empty(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_export_model", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - output_config = {} - - response = client.export_model(name, output_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = service_pb2.ExportModelRequest( - name=name, output_config=output_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_export_model_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_export_model_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - output_config = {} - - response = client.export_model(name, output_config) - exception = response.exception() - assert exception.errors[0] == error - - def test_get_model_evaluation(self): - # Setup Expected Response - name_2 = "name2-1052831874" - annotation_spec_id = "annotationSpecId60690191" - display_name = "displayName1615086568" - evaluated_example_count = 277565350 - expected_response = { - "name": name_2, - "annotation_spec_id": annotation_spec_id, - "display_name": display_name, - "evaluated_example_count": evaluated_example_count, - } - expected_response = model_evaluation_pb2.ModelEvaluation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - name = client.model_evaluation_path( - "[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]" - ) - - response = client.get_model_evaluation(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = service_pb2.GetModelEvaluationRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_model_evaluation_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup request - name = client.model_evaluation_path( - "[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]" - ) - - with pytest.raises(CustomException): - client.get_model_evaluation(name) - - def test_list_model_evaluations(self): - # Setup Expected Response - next_page_token = "" - model_evaluation_element = {} - model_evaluation = [model_evaluation_element] - expected_response = { - "next_page_token": next_page_token, - "model_evaluation": model_evaluation, - } - expected_response = service_pb2.ListModelEvaluationsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup Request - parent = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - filter_ = "filter-1274492040" - - paged_list_response = client.list_model_evaluations(parent, filter_) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.model_evaluation[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = service_pb2.ListModelEvaluationsRequest( - parent=parent, filter=filter_ - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_model_evaluations_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.AutoMlClient() - - # Setup request - parent = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - filter_ = "filter-1274492040" - - paged_list_response = client.list_model_evaluations(parent, filter_) - with pytest.raises(CustomException): - list(paged_list_response) diff --git a/automl/tests/unit/gapic/v1/test_prediction_service_client_v1.py b/automl/tests/unit/gapic/v1/test_prediction_service_client_v1.py deleted file mode 100644 index cd75ea01626f..000000000000 --- a/automl/tests/unit/gapic/v1/test_prediction_service_client_v1.py +++ /dev/null @@ -1,165 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import automl_v1 -from google.cloud.automl_v1.proto import data_items_pb2 -from google.cloud.automl_v1.proto import io_pb2 -from google.cloud.automl_v1.proto import prediction_service_pb2 -from google.longrunning import operations_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestPredictionServiceClient(object): - def test_predict(self): - # Setup Expected Response - expected_response = {} - expected_response = prediction_service_pb2.PredictResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.PredictionServiceClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - payload = {} - - response = client.predict(name, payload) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = prediction_service_pb2.PredictRequest( - name=name, payload=payload - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_predict_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.PredictionServiceClient() - - # Setup request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - payload = {} - - with pytest.raises(CustomException): - client.predict(name, payload) - - def test_batch_predict(self): - # Setup Expected Response - expected_response = {} - expected_response = prediction_service_pb2.BatchPredictResult( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_batch_predict", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.PredictionServiceClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - input_config = {} - output_config = {} - - response = client.batch_predict(name, input_config, output_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = prediction_service_pb2.BatchPredictRequest( - name=name, input_config=input_config, output_config=output_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_batch_predict_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_batch_predict_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1.PredictionServiceClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - input_config = {} - output_config = {} - - response = client.batch_predict(name, input_config, output_config) - exception = response.exception() - assert exception.errors[0] == error diff --git a/automl/tests/unit/gapic/v1beta1/test_auto_ml_client_v1beta1.py b/automl/tests/unit/gapic/v1beta1/test_auto_ml_client_v1beta1.py deleted file mode 100644 index 702a31901401..000000000000 --- a/automl/tests/unit/gapic/v1beta1/test_auto_ml_client_v1beta1.py +++ /dev/null @@ -1,1255 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import automl_v1beta1 -from google.cloud.automl_v1beta1.proto import annotation_spec_pb2 -from google.cloud.automl_v1beta1.proto import column_spec_pb2 -from google.cloud.automl_v1beta1.proto import dataset_pb2 -from google.cloud.automl_v1beta1.proto import io_pb2 -from google.cloud.automl_v1beta1.proto import model_evaluation_pb2 -from google.cloud.automl_v1beta1.proto import model_pb2 -from google.cloud.automl_v1beta1.proto import service_pb2 -from google.cloud.automl_v1beta1.proto import table_spec_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestAutoMlClient(object): - def test_create_dataset(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - example_count = 1517063674 - etag = "etag3123477" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - "example_count": example_count, - "etag": etag, - } - expected_response = dataset_pb2.Dataset(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - dataset = {} - - response = client.create_dataset(parent, dataset) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = service_pb2.CreateDatasetRequest( - parent=parent, dataset=dataset - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_dataset_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - dataset = {} - - with pytest.raises(CustomException): - client.create_dataset(parent, dataset) - - def test_update_dataset(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - example_count = 1517063674 - etag = "etag3123477" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - "example_count": example_count, - "etag": etag, - } - expected_response = dataset_pb2.Dataset(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - dataset = {} - - response = client.update_dataset(dataset) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = service_pb2.UpdateDatasetRequest(dataset=dataset) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_dataset_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup request - dataset = {} - - with pytest.raises(CustomException): - client.update_dataset(dataset) - - def test_get_dataset(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - description = "description-1724546052" - example_count = 1517063674 - etag = "etag3123477" - expected_response = { - "name": name_2, - "display_name": display_name, - "description": description, - "example_count": example_count, - "etag": etag, - } - expected_response = dataset_pb2.Dataset(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]") - - response = client.get_dataset(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = service_pb2.GetDatasetRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_dataset_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup request - name = client.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]") - - with pytest.raises(CustomException): - client.get_dataset(name) - - def test_list_datasets(self): - # Setup Expected Response - next_page_token = "" - datasets_element = {} - datasets = [datasets_element] - expected_response = {"next_page_token": next_page_token, "datasets": datasets} - expected_response = service_pb2.ListDatasetsResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_datasets(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.datasets[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = service_pb2.ListDatasetsRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_datasets_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_datasets(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_delete_dataset(self): - # Setup Expected Response - expected_response = {} - expected_response = empty_pb2.Empty(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_delete_dataset", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]") - - response = client.delete_dataset(name) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = service_pb2.DeleteDatasetRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_dataset_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_delete_dataset_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]") - - response = client.delete_dataset(name) - exception = response.exception() - assert exception.errors[0] == error - - def test_import_data(self): - # Setup Expected Response - expected_response = {} - expected_response = empty_pb2.Empty(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_import_data", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]") - input_config = {} - - response = client.import_data(name, input_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = service_pb2.ImportDataRequest( - name=name, input_config=input_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_import_data_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_import_data_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]") - input_config = {} - - response = client.import_data(name, input_config) - exception = response.exception() - assert exception.errors[0] == error - - def test_export_data(self): - # Setup Expected Response - expected_response = {} - expected_response = empty_pb2.Empty(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_export_data", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]") - output_config = {} - - response = client.export_data(name, output_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = service_pb2.ExportDataRequest( - name=name, output_config=output_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_export_data_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_export_data_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]") - output_config = {} - - response = client.export_data(name, output_config) - exception = response.exception() - assert exception.errors[0] == error - - def test_create_model(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - dataset_id = "datasetId-2115646910" - expected_response = { - "name": name, - "display_name": display_name, - "dataset_id": dataset_id, - } - expected_response = model_pb2.Model(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_create_model", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - model = {} - - response = client.create_model(parent, model) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = service_pb2.CreateModelRequest(parent=parent, model=model) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_model_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_create_model_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - model = {} - - response = client.create_model(parent, model) - exception = response.exception() - assert exception.errors[0] == error - - def test_get_model(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - dataset_id = "datasetId-2115646910" - expected_response = { - "name": name_2, - "display_name": display_name, - "dataset_id": dataset_id, - } - expected_response = model_pb2.Model(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - - response = client.get_model(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = service_pb2.GetModelRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_model_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - - with pytest.raises(CustomException): - client.get_model(name) - - def test_list_models(self): - # Setup Expected Response - next_page_token = "" - model_element = {} - model = [model_element] - expected_response = {"next_page_token": next_page_token, "model": model} - expected_response = service_pb2.ListModelsResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_models(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.model[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = service_pb2.ListModelsRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_models_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_models(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_delete_model(self): - # Setup Expected Response - expected_response = {} - expected_response = empty_pb2.Empty(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_delete_model", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - - response = client.delete_model(name) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = service_pb2.DeleteModelRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_model_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_delete_model_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - - response = client.delete_model(name) - exception = response.exception() - assert exception.errors[0] == error - - def test_deploy_model(self): - # Setup Expected Response - expected_response = {} - expected_response = empty_pb2.Empty(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_deploy_model", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - - response = client.deploy_model(name) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = service_pb2.DeployModelRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_deploy_model_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_deploy_model_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - - response = client.deploy_model(name) - exception = response.exception() - assert exception.errors[0] == error - - def test_undeploy_model(self): - # Setup Expected Response - expected_response = {} - expected_response = empty_pb2.Empty(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_undeploy_model", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - - response = client.undeploy_model(name) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = service_pb2.UndeployModelRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_undeploy_model_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_undeploy_model_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - - response = client.undeploy_model(name) - exception = response.exception() - assert exception.errors[0] == error - - def test_get_model_evaluation(self): - # Setup Expected Response - name_2 = "name2-1052831874" - annotation_spec_id = "annotationSpecId60690191" - display_name = "displayName1615086568" - evaluated_example_count = 277565350 - expected_response = { - "name": name_2, - "annotation_spec_id": annotation_spec_id, - "display_name": display_name, - "evaluated_example_count": evaluated_example_count, - } - expected_response = model_evaluation_pb2.ModelEvaluation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.model_evaluation_path( - "[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]" - ) - - response = client.get_model_evaluation(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = service_pb2.GetModelEvaluationRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_model_evaluation_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup request - name = client.model_evaluation_path( - "[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]" - ) - - with pytest.raises(CustomException): - client.get_model_evaluation(name) - - def test_export_model(self): - # Setup Expected Response - expected_response = {} - expected_response = empty_pb2.Empty(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_export_model", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - output_config = {} - - response = client.export_model(name, output_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = service_pb2.ExportModelRequest( - name=name, output_config=output_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_export_model_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_export_model_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - output_config = {} - - response = client.export_model(name, output_config) - exception = response.exception() - assert exception.errors[0] == error - - def test_export_evaluated_examples(self): - # Setup Expected Response - expected_response = {} - expected_response = empty_pb2.Empty(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_export_evaluated_examples", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - output_config = {} - - response = client.export_evaluated_examples(name, output_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = service_pb2.ExportEvaluatedExamplesRequest( - name=name, output_config=output_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_export_evaluated_examples_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_export_evaluated_examples_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - output_config = {} - - response = client.export_evaluated_examples(name, output_config) - exception = response.exception() - assert exception.errors[0] == error - - def test_list_model_evaluations(self): - # Setup Expected Response - next_page_token = "" - model_evaluation_element = {} - model_evaluation = [model_evaluation_element] - expected_response = { - "next_page_token": next_page_token, - "model_evaluation": model_evaluation, - } - expected_response = service_pb2.ListModelEvaluationsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - parent = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - - paged_list_response = client.list_model_evaluations(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.model_evaluation[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = service_pb2.ListModelEvaluationsRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_model_evaluations_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup request - parent = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - - paged_list_response = client.list_model_evaluations(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_annotation_spec(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - example_count = 1517063674 - expected_response = { - "name": name_2, - "display_name": display_name, - "example_count": example_count, - } - expected_response = annotation_spec_pb2.AnnotationSpec(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.annotation_spec_path( - "[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]" - ) - - response = client.get_annotation_spec(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = service_pb2.GetAnnotationSpecRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_annotation_spec_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup request - name = client.annotation_spec_path( - "[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]" - ) - - with pytest.raises(CustomException): - client.get_annotation_spec(name) - - def test_get_table_spec(self): - # Setup Expected Response - name_2 = "name2-1052831874" - time_column_spec_id = "timeColumnSpecId1558734824" - row_count = 1340416618 - valid_row_count = 406068761 - column_count = 122671386 - etag = "etag3123477" - expected_response = { - "name": name_2, - "time_column_spec_id": time_column_spec_id, - "row_count": row_count, - "valid_row_count": valid_row_count, - "column_count": column_count, - "etag": etag, - } - expected_response = table_spec_pb2.TableSpec(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.table_spec_path( - "[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]" - ) - - response = client.get_table_spec(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = service_pb2.GetTableSpecRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_table_spec_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup request - name = client.table_spec_path( - "[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]" - ) - - with pytest.raises(CustomException): - client.get_table_spec(name) - - def test_list_table_specs(self): - # Setup Expected Response - next_page_token = "" - table_specs_element = {} - table_specs = [table_specs_element] - expected_response = { - "next_page_token": next_page_token, - "table_specs": table_specs, - } - expected_response = service_pb2.ListTableSpecsResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - parent = client.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]") - - paged_list_response = client.list_table_specs(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.table_specs[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = service_pb2.ListTableSpecsRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_table_specs_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup request - parent = client.dataset_path("[PROJECT]", "[LOCATION]", "[DATASET]") - - paged_list_response = client.list_table_specs(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_update_table_spec(self): - # Setup Expected Response - name = "name3373707" - time_column_spec_id = "timeColumnSpecId1558734824" - row_count = 1340416618 - valid_row_count = 406068761 - column_count = 122671386 - etag = "etag3123477" - expected_response = { - "name": name, - "time_column_spec_id": time_column_spec_id, - "row_count": row_count, - "valid_row_count": valid_row_count, - "column_count": column_count, - "etag": etag, - } - expected_response = table_spec_pb2.TableSpec(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - table_spec = {} - - response = client.update_table_spec(table_spec) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = service_pb2.UpdateTableSpecRequest(table_spec=table_spec) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_table_spec_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup request - table_spec = {} - - with pytest.raises(CustomException): - client.update_table_spec(table_spec) - - def test_get_column_spec(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - etag = "etag3123477" - expected_response = {"name": name_2, "display_name": display_name, "etag": etag} - expected_response = column_spec_pb2.ColumnSpec(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - name = client.column_spec_path( - "[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]" - ) - - response = client.get_column_spec(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = service_pb2.GetColumnSpecRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_column_spec_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup request - name = client.column_spec_path( - "[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]", "[COLUMN_SPEC]" - ) - - with pytest.raises(CustomException): - client.get_column_spec(name) - - def test_list_column_specs(self): - # Setup Expected Response - next_page_token = "" - column_specs_element = {} - column_specs = [column_specs_element] - expected_response = { - "next_page_token": next_page_token, - "column_specs": column_specs, - } - expected_response = service_pb2.ListColumnSpecsResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - parent = client.table_spec_path( - "[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]" - ) - - paged_list_response = client.list_column_specs(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.column_specs[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = service_pb2.ListColumnSpecsRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_column_specs_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup request - parent = client.table_spec_path( - "[PROJECT]", "[LOCATION]", "[DATASET]", "[TABLE_SPEC]" - ) - - paged_list_response = client.list_column_specs(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_update_column_spec(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - etag = "etag3123477" - expected_response = {"name": name, "display_name": display_name, "etag": etag} - expected_response = column_spec_pb2.ColumnSpec(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup Request - column_spec = {} - - response = client.update_column_spec(column_spec) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = service_pb2.UpdateColumnSpecRequest(column_spec=column_spec) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_column_spec_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.AutoMlClient() - - # Setup request - column_spec = {} - - with pytest.raises(CustomException): - client.update_column_spec(column_spec) diff --git a/automl/tests/unit/gapic/v1beta1/test_gcs_client_v1beta1.py b/automl/tests/unit/gapic/v1beta1/test_gcs_client_v1beta1.py deleted file mode 100644 index 222fca3244ee..000000000000 --- a/automl/tests/unit/gapic/v1beta1/test_gcs_client_v1beta1.py +++ /dev/null @@ -1,173 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pandas -import pytest -import re - -from google.api_core import exceptions -from google.auth.credentials import AnonymousCredentials -from google.cloud import automl_v1beta1 - -PROJECT = "project" - - -class TestGcsClient(object): - def gcs_client(self, bucket_name=None, client_attrs={}): - client_mock = mock.Mock(**client_attrs) - return automl_v1beta1.tables.gcs_client.GcsClient( - bucket_name=bucket_name, client=client_mock - ) - - def test_init_with_project_and_credentials(self): - # helper for checking that the storage client is initialized with the - # passed in project and credentials. - class FakeStorageClient: - def __init__(self, project=None, credentials=None): - self.project = project - self.credentials = credentials - - patch = mock.patch("google.cloud.storage.Client", new=FakeStorageClient) - with patch: - credentials = AnonymousCredentials() - gcs_client = automl_v1beta1.tables.gcs_client.GcsClient( - project=PROJECT, credentials=credentials - ) - assert isinstance(gcs_client.client, FakeStorageClient) - assert gcs_client.client.project == PROJECT - assert gcs_client.client.credentials == credentials - - def test_ensure_bucket_exists(self): - mock_bucket = mock.Mock() - gcs_client = self.gcs_client( - client_attrs={ - "get_bucket.side_effect": exceptions.NotFound("err"), - "bucket.return_value": mock_bucket, - } - ) - returned_bucket_name = gcs_client.ensure_bucket_exists( - "my-project", "us-central1" - ) - gcs_client.client.get_bucket.assert_called_with( - "my-project-automl-tables-staging" - ) - gcs_client.client.bucket.assert_called_with("my-project-automl-tables-staging") - mock_bucket.create.assert_called_with( - project="my-project", location="us-central1" - ) - assert returned_bucket_name == "my-project-automl-tables-staging" - - def test_ensure_bucket_exists_bucket_already_exists_in_different_project(self): - mock_bucket = mock.Mock() - gcs_client = self.gcs_client( - client_attrs={ - "get_bucket.side_effect": exceptions.Forbidden("err"), - "bucket.return_value": mock_bucket, - } - ) - returned_bucket_name = gcs_client.ensure_bucket_exists( - "my-project", "us-central1" - ) - gcs_client.client.get_bucket.assert_called_with( - "my-project-automl-tables-staging" - ) - gcs_client.client.bucket.assert_called_with(returned_bucket_name) - mock_bucket.create.assert_called_with( - project="my-project", location="us-central1" - ) - - assert re.match( - "^my-project-automl-tables-staging-[0-9]*$", returned_bucket_name - ) - - def test_ensure_bucket_exists_bucket_already_exists_in_current_project(self): - gcs_client = self.gcs_client() - returned_bucket_name = gcs_client.ensure_bucket_exists( - "my-project", "us-central1" - ) - gcs_client.client.get_bucket.assert_called_with( - "my-project-automl-tables-staging" - ) - gcs_client.client.bucket.assert_not_called() - assert returned_bucket_name == "my-project-automl-tables-staging" - - def test_ensure_bucket_exists_custom_bucket_name(self): - mock_bucket = mock.Mock() - gcs_client = self.gcs_client( - bucket_name="my-bucket", - client_attrs={ - "get_bucket.side_effect": exceptions.NotFound("err"), - "bucket.return_value": mock_bucket, - }, - ) - returned_bucket_name = gcs_client.ensure_bucket_exists( - "my-project", "us-central1" - ) - gcs_client.client.get_bucket.assert_called_with("my-bucket") - gcs_client.client.bucket.assert_called_with("my-bucket") - mock_bucket.create.assert_called_with( - project="my-project", location="us-central1" - ) - assert returned_bucket_name == "my-bucket" - - def test_upload_pandas_dataframe(self): - mock_blob = mock.Mock() - mock_bucket = mock.Mock(**{"blob.return_value": mock_blob}) - gcs_client = self.gcs_client( - bucket_name="my-bucket", - client_attrs={"get_bucket.return_value": mock_bucket}, - ) - dataframe = pandas.DataFrame({"col1": [1, 2], "col2": [3, 4]}) - - gcs_uri = gcs_client.upload_pandas_dataframe(dataframe, "my-file.csv") - - gcs_client.client.get_bucket.assert_called_with("my-bucket") - mock_bucket.blob.assert_called_with("my-file.csv") - mock_blob.upload_from_string.assert_called_with("col1,col2\n1,3\n2,4\n") - assert gcs_uri == "gs://my-bucket/my-file.csv" - - def test_upload_pandas_dataframe_no_csv_name(self): - mock_blob = mock.Mock() - mock_bucket = mock.Mock(**{"blob.return_value": mock_blob}) - gcs_client = self.gcs_client( - bucket_name="my-bucket", - client_attrs={"get_bucket.return_value": mock_bucket}, - ) - dataframe = pandas.DataFrame({"col1": [1, 2], "col2": [3, 4]}) - - gcs_uri = gcs_client.upload_pandas_dataframe(dataframe) - generated_csv_name = gcs_uri.split("/")[-1] - - gcs_client.client.get_bucket.assert_called_with("my-bucket") - mock_bucket.blob.assert_called_with(generated_csv_name) - mock_blob.upload_from_string.assert_called_with("col1,col2\n1,3\n2,4\n") - assert re.match("^gs://my-bucket/automl-tables-dataframe-[0-9]*.csv$", gcs_uri) - - def test_upload_pandas_dataframe_not_type_dataframe(self): - gcs_client = self.gcs_client() - with pytest.raises(ValueError): - gcs_client.upload_pandas_dataframe("my-dataframe") - gcs_client.client.upload_pandas_dataframe.assert_not_called() - - def test_upload_pandas_dataframe_bucket_not_exist(self): - gcs_client = self.gcs_client() - dataframe = pandas.DataFrame({}) - with pytest.raises(ValueError): - gcs_client.upload_pandas_dataframe(dataframe) - gcs_client.client.upload_pandas_dataframe.assert_not_called() diff --git a/automl/tests/unit/gapic/v1beta1/test_prediction_service_client_v1beta1.py b/automl/tests/unit/gapic/v1beta1/test_prediction_service_client_v1beta1.py deleted file mode 100644 index 9b510f3a3a00..000000000000 --- a/automl/tests/unit/gapic/v1beta1/test_prediction_service_client_v1beta1.py +++ /dev/null @@ -1,165 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import automl_v1beta1 -from google.cloud.automl_v1beta1.proto import data_items_pb2 -from google.cloud.automl_v1beta1.proto import io_pb2 -from google.cloud.automl_v1beta1.proto import prediction_service_pb2 -from google.longrunning import operations_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestPredictionServiceClient(object): - def test_predict(self): - # Setup Expected Response - expected_response = {} - expected_response = prediction_service_pb2.PredictResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.PredictionServiceClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - payload = {} - - response = client.predict(name, payload) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = prediction_service_pb2.PredictRequest( - name=name, payload=payload - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_predict_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.PredictionServiceClient() - - # Setup request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - payload = {} - - with pytest.raises(CustomException): - client.predict(name, payload) - - def test_batch_predict(self): - # Setup Expected Response - expected_response = {} - expected_response = prediction_service_pb2.BatchPredictResult( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_batch_predict", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.PredictionServiceClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - input_config = {} - output_config = {} - - response = client.batch_predict(name, input_config, output_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = prediction_service_pb2.BatchPredictRequest( - name=name, input_config=input_config, output_config=output_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_batch_predict_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_batch_predict_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = automl_v1beta1.PredictionServiceClient() - - # Setup Request - name = client.model_path("[PROJECT]", "[LOCATION]", "[MODEL]") - input_config = {} - output_config = {} - - response = client.batch_predict(name, input_config, output_config) - exception = response.exception() - assert exception.errors[0] == error diff --git a/automl/tests/unit/gapic/v1beta1/test_tables_client_v1beta1.py b/automl/tests/unit/gapic/v1beta1/test_tables_client_v1beta1.py deleted file mode 100644 index 3566846d6d14..000000000000 --- a/automl/tests/unit/gapic/v1beta1/test_tables_client_v1beta1.py +++ /dev/null @@ -1,1467 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pandas -import pytest - -from google.api_core import exceptions -from google.auth.credentials import AnonymousCredentials -from google.cloud import automl_v1beta1 -from google.cloud.automl_v1beta1.proto import data_types_pb2, data_items_pb2 -from google.protobuf import struct_pb2 - -PROJECT = "project" -REGION = "region" -LOCATION_PATH = "projects/{}/locations/{}".format(PROJECT, REGION) - - -class TestTablesClient(object): - def tables_client( - self, client_attrs={}, prediction_client_attrs={}, gcs_client_attrs={} - ): - client_mock = mock.Mock(**client_attrs) - prediction_client_mock = mock.Mock(**prediction_client_attrs) - gcs_client_mock = mock.Mock(**gcs_client_attrs) - return automl_v1beta1.TablesClient( - client=client_mock, - prediction_client=prediction_client_mock, - gcs_client=gcs_client_mock, - project=PROJECT, - region=REGION, - ) - - def test_list_datasets_empty(self): - client = self.tables_client( - { - "list_datasets.return_value": [], - "location_path.return_value": LOCATION_PATH, - }, - {}, - ) - ds = client.list_datasets() - client.auto_ml_client.location_path.assert_called_with(PROJECT, REGION) - client.auto_ml_client.list_datasets.assert_called_with(LOCATION_PATH) - assert ds == [] - - def test_list_datasets_not_empty(self): - datasets = ["some_dataset"] - client = self.tables_client( - { - "list_datasets.return_value": datasets, - "location_path.return_value": LOCATION_PATH, - }, - {}, - ) - ds = client.list_datasets() - client.auto_ml_client.location_path.assert_called_with(PROJECT, REGION) - client.auto_ml_client.list_datasets.assert_called_with(LOCATION_PATH) - assert len(ds) == 1 - assert ds[0] == "some_dataset" - - def test_get_dataset_no_value(self): - dataset_actual = "dataset" - client = self.tables_client({}, {}) - with pytest.raises(ValueError): - dataset = client.get_dataset() - client.auto_ml_client.get_dataset.assert_not_called() - - def test_get_dataset_name(self): - dataset_actual = "dataset" - client = self.tables_client({"get_dataset.return_value": dataset_actual}, {}) - dataset = client.get_dataset(dataset_name="my_dataset") - client.auto_ml_client.get_dataset.assert_called_with("my_dataset") - assert dataset == dataset_actual - - def test_get_no_dataset(self): - client = self.tables_client( - {"get_dataset.side_effect": exceptions.NotFound("err")}, {} - ) - with pytest.raises(exceptions.NotFound): - client.get_dataset(dataset_name="my_dataset") - client.auto_ml_client.get_dataset.assert_called_with("my_dataset") - - def test_get_dataset_from_empty_list(self): - client = self.tables_client({"list_datasets.return_value": []}, {}) - with pytest.raises(exceptions.NotFound): - client.get_dataset(dataset_display_name="my_dataset") - - def test_get_dataset_from_list_not_found(self): - client = self.tables_client( - {"list_datasets.return_value": [mock.Mock(display_name="not_it")]}, {} - ) - with pytest.raises(exceptions.NotFound): - client.get_dataset(dataset_display_name="my_dataset") - - def test_get_dataset_from_list(self): - client = self.tables_client( - { - "list_datasets.return_value": [ - mock.Mock(display_name="not_it"), - mock.Mock(display_name="my_dataset"), - ] - }, - {}, - ) - dataset = client.get_dataset(dataset_display_name="my_dataset") - assert dataset.display_name == "my_dataset" - - def test_get_dataset_from_list_ambiguous(self): - client = self.tables_client( - { - "list_datasets.return_value": [ - mock.Mock(display_name="my_dataset"), - mock.Mock(display_name="not_my_dataset"), - mock.Mock(display_name="my_dataset"), - ] - }, - {}, - ) - with pytest.raises(ValueError): - client.get_dataset(dataset_display_name="my_dataset") - - def test_create_dataset(self): - client = self.tables_client( - { - "location_path.return_value": LOCATION_PATH, - "create_dataset.return_value": mock.Mock(display_name="name"), - }, - {}, - ) - metadata = {"metadata": "values"} - dataset = client.create_dataset("name", metadata=metadata) - client.auto_ml_client.location_path.assert_called_with(PROJECT, REGION) - client.auto_ml_client.create_dataset.assert_called_with( - LOCATION_PATH, {"display_name": "name", "tables_dataset_metadata": metadata} - ) - assert dataset.display_name == "name" - - def test_delete_dataset(self): - dataset = mock.Mock() - dataset.configure_mock(name="name") - client = self.tables_client({"delete_dataset.return_value": None}, {}) - client.delete_dataset(dataset=dataset) - client.auto_ml_client.delete_dataset.assert_called_with("name") - - def test_delete_dataset_not_found(self): - client = self.tables_client({"list_datasets.return_value": []}, {}) - client.delete_dataset(dataset_display_name="not_found") - client.auto_ml_client.delete_dataset.assert_not_called() - - def test_delete_dataset_name(self): - client = self.tables_client({"delete_dataset.return_value": None}, {}) - client.delete_dataset(dataset_name="name") - client.auto_ml_client.delete_dataset.assert_called_with("name") - - def test_export_not_found(self): - client = self.tables_client({"list_datasets.return_value": []}, {}) - with pytest.raises(exceptions.NotFound): - client.export_data(dataset_display_name="name", gcs_input_uris="uri") - - client.auto_ml_client.export_data.assert_not_called() - - def test_export_gcs_uri(self): - client = self.tables_client({"export_data.return_value": None}, {}) - client.export_data(dataset_name="name", gcs_output_uri_prefix="uri") - client.auto_ml_client.export_data.assert_called_with( - "name", {"gcs_destination": {"output_uri_prefix": "uri"}} - ) - - def test_export_bq_uri(self): - client = self.tables_client({"export_data.return_value": None}, {}) - client.export_data(dataset_name="name", bigquery_output_uri="uri") - client.auto_ml_client.export_data.assert_called_with( - "name", {"bigquery_destination": {"output_uri": "uri"}} - ) - - def test_import_not_found(self): - client = self.tables_client({"list_datasets.return_value": []}, {}) - with pytest.raises(exceptions.NotFound): - client.import_data(dataset_display_name="name", gcs_input_uris="uri") - - client.auto_ml_client.import_data.assert_not_called() - - def test_import_pandas_dataframe(self): - client = self.tables_client( - gcs_client_attrs={ - "bucket_name": "my_bucket", - "upload_pandas_dataframe.return_value": "uri", - } - ) - dataframe = pandas.DataFrame({}) - client.import_data( - project=PROJECT, - region=REGION, - dataset_name="name", - pandas_dataframe=dataframe, - ) - client.gcs_client.ensure_bucket_exists.assert_called_with(PROJECT, REGION) - client.gcs_client.upload_pandas_dataframe.assert_called_with(dataframe) - client.auto_ml_client.import_data.assert_called_with( - "name", {"gcs_source": {"input_uris": ["uri"]}} - ) - - def test_import_pandas_dataframe_init_gcs(self): - client = automl_v1beta1.TablesClient( - client=mock.Mock(), - prediction_client=mock.Mock(), - project=PROJECT, - region=REGION, - credentials=AnonymousCredentials(), - ) - - dataframe = pandas.DataFrame({}) - patch = mock.patch( - "google.cloud.automl_v1beta1.tables.tables_client.gcs_client.GcsClient", - bucket_name="my_bucket", - ) - with patch as MockGcsClient: - mockInstance = MockGcsClient.return_value - mockInstance.upload_pandas_dataframe.return_value = "uri" - - client.import_data(dataset_name="name", pandas_dataframe=dataframe) - - assert client.gcs_client is mockInstance - client.gcs_client.ensure_bucket_exists.assert_called_with(PROJECT, REGION) - client.gcs_client.upload_pandas_dataframe.assert_called_with(dataframe) - client.auto_ml_client.import_data.assert_called_with( - "name", {"gcs_source": {"input_uris": ["uri"]}} - ) - - def test_import_gcs_uri(self): - client = self.tables_client({"import_data.return_value": None}, {}) - client.import_data(dataset_name="name", gcs_input_uris="uri") - client.auto_ml_client.import_data.assert_called_with( - "name", {"gcs_source": {"input_uris": ["uri"]}} - ) - - def test_import_gcs_uris(self): - client = self.tables_client({"import_data.return_value": None}, {}) - client.import_data(dataset_name="name", gcs_input_uris=["uri", "uri"]) - client.auto_ml_client.import_data.assert_called_with( - "name", {"gcs_source": {"input_uris": ["uri", "uri"]}} - ) - - def test_import_bq_uri(self): - client = self.tables_client({"import_data.return_value": None}, {}) - client.import_data(dataset_name="name", bigquery_input_uri="uri") - client.auto_ml_client.import_data.assert_called_with( - "name", {"bigquery_source": {"input_uri": "uri"}} - ) - - def test_list_table_specs(self): - client = self.tables_client({"list_table_specs.return_value": None}, {}) - client.list_table_specs(dataset_name="name") - client.auto_ml_client.list_table_specs.assert_called_with("name") - - def test_list_table_specs_not_found(self): - client = self.tables_client( - {"list_table_specs.side_effect": exceptions.NotFound("not found")}, {} - ) - with pytest.raises(exceptions.NotFound): - client.list_table_specs(dataset_name="name") - client.auto_ml_client.list_table_specs.assert_called_with("name") - - def test_get_table_spec(self): - client = self.tables_client({}, {}) - client.get_table_spec("name") - client.auto_ml_client.get_table_spec.assert_called_with("name") - - def test_get_column_spec(self): - client = self.tables_client({}, {}) - client.get_column_spec("name") - client.auto_ml_client.get_column_spec.assert_called_with("name") - - def test_list_column_specs(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - client = self.tables_client( - { - "list_table_specs.return_value": [table_spec_mock], - "list_column_specs.return_value": [], - }, - {}, - ) - client.list_column_specs(dataset_name="name") - client.auto_ml_client.list_table_specs.assert_called_with("name") - client.auto_ml_client.list_column_specs.assert_called_with("table") - - def test_update_column_spec_not_found(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - column_spec_mock = mock.Mock() - data_type_mock = mock.Mock(type_code="type_code") - column_spec_mock.configure_mock( - name="column", display_name="column", data_type=data_type_mock - ) - client = self.tables_client( - { - "list_table_specs.return_value": [table_spec_mock], - "list_column_specs.return_value": [column_spec_mock], - }, - {}, - ) - with pytest.raises(exceptions.NotFound): - client.update_column_spec(dataset_name="name", column_spec_name="column2") - client.auto_ml_client.list_table_specs.assert_called_with("name") - client.auto_ml_client.list_column_specs.assert_called_with("table") - client.auto_ml_client.update_column_spec.assert_not_called() - - def test_update_column_spec_display_name_not_found(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - column_spec_mock = mock.Mock() - data_type_mock = mock.Mock(type_code="type_code") - column_spec_mock.configure_mock( - name="column", display_name="column", data_type=data_type_mock - ) - client = self.tables_client( - { - "list_table_specs.return_value": [table_spec_mock], - "list_column_specs.return_value": [column_spec_mock], - }, - {}, - ) - with pytest.raises(exceptions.NotFound): - client.update_column_spec( - dataset_name="name", column_spec_display_name="column2" - ) - client.auto_ml_client.list_table_specs.assert_called_with("name") - client.auto_ml_client.list_column_specs.assert_called_with("table") - client.auto_ml_client.update_column_spec.assert_not_called() - - def test_update_column_spec_name_no_args(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - column_spec_mock = mock.Mock() - data_type_mock = mock.Mock(type_code="type_code") - column_spec_mock.configure_mock( - name="column/2", display_name="column", data_type=data_type_mock - ) - client = self.tables_client( - { - "list_table_specs.return_value": [table_spec_mock], - "list_column_specs.return_value": [column_spec_mock], - }, - {}, - ) - client.update_column_spec(dataset_name="name", column_spec_name="column/2") - client.auto_ml_client.list_table_specs.assert_called_with("name") - client.auto_ml_client.list_column_specs.assert_called_with("table") - client.auto_ml_client.update_column_spec.assert_called_with( - {"name": "column/2", "data_type": {"type_code": "type_code"}} - ) - - def test_update_column_spec_no_args(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - column_spec_mock = mock.Mock() - data_type_mock = mock.Mock(type_code="type_code") - column_spec_mock.configure_mock( - name="column", display_name="column", data_type=data_type_mock - ) - client = self.tables_client( - { - "list_table_specs.return_value": [table_spec_mock], - "list_column_specs.return_value": [column_spec_mock], - }, - {}, - ) - client.update_column_spec( - dataset_name="name", column_spec_display_name="column" - ) - client.auto_ml_client.list_table_specs.assert_called_with("name") - client.auto_ml_client.list_column_specs.assert_called_with("table") - client.auto_ml_client.update_column_spec.assert_called_with( - {"name": "column", "data_type": {"type_code": "type_code"}} - ) - - def test_update_column_spec_nullable(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - column_spec_mock = mock.Mock() - data_type_mock = mock.Mock(type_code="type_code") - column_spec_mock.configure_mock( - name="column", display_name="column", data_type=data_type_mock - ) - client = self.tables_client( - { - "list_table_specs.return_value": [table_spec_mock], - "list_column_specs.return_value": [column_spec_mock], - }, - {}, - ) - client.update_column_spec( - dataset_name="name", column_spec_display_name="column", nullable=True - ) - client.auto_ml_client.list_table_specs.assert_called_with("name") - client.auto_ml_client.list_column_specs.assert_called_with("table") - client.auto_ml_client.update_column_spec.assert_called_with( - { - "name": "column", - "data_type": {"type_code": "type_code", "nullable": True}, - } - ) - - def test_update_column_spec_type_code(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - column_spec_mock = mock.Mock() - data_type_mock = mock.Mock(type_code="type_code") - column_spec_mock.configure_mock( - name="column", display_name="column", data_type=data_type_mock - ) - client = self.tables_client( - { - "list_table_specs.return_value": [table_spec_mock], - "list_column_specs.return_value": [column_spec_mock], - }, - {}, - ) - client.update_column_spec( - dataset_name="name", - column_spec_display_name="column", - type_code="type_code2", - ) - client.auto_ml_client.list_table_specs.assert_called_with("name") - client.auto_ml_client.list_column_specs.assert_called_with("table") - client.auto_ml_client.update_column_spec.assert_called_with( - {"name": "column", "data_type": {"type_code": "type_code2"}} - ) - - def test_update_column_spec_type_code_nullable(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - column_spec_mock = mock.Mock() - data_type_mock = mock.Mock(type_code="type_code") - column_spec_mock.configure_mock( - name="column", display_name="column", data_type=data_type_mock - ) - client = self.tables_client( - { - "list_table_specs.return_value": [table_spec_mock], - "list_column_specs.return_value": [column_spec_mock], - }, - {}, - ) - client.update_column_spec( - dataset_name="name", - nullable=True, - column_spec_display_name="column", - type_code="type_code2", - ) - client.auto_ml_client.list_table_specs.assert_called_with("name") - client.auto_ml_client.list_column_specs.assert_called_with("table") - client.auto_ml_client.update_column_spec.assert_called_with( - { - "name": "column", - "data_type": {"type_code": "type_code2", "nullable": True}, - } - ) - - def test_update_column_spec_type_code_nullable_false(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - column_spec_mock = mock.Mock() - data_type_mock = mock.Mock(type_code="type_code") - column_spec_mock.configure_mock( - name="column", display_name="column", data_type=data_type_mock - ) - client = self.tables_client( - { - "list_table_specs.return_value": [table_spec_mock], - "list_column_specs.return_value": [column_spec_mock], - }, - {}, - ) - client.update_column_spec( - dataset_name="name", - nullable=False, - column_spec_display_name="column", - type_code="type_code2", - ) - client.auto_ml_client.list_table_specs.assert_called_with("name") - client.auto_ml_client.list_column_specs.assert_called_with("table") - client.auto_ml_client.update_column_spec.assert_called_with( - { - "name": "column", - "data_type": {"type_code": "type_code2", "nullable": False}, - } - ) - - def test_set_target_column_table_not_found(self): - client = self.tables_client( - {"list_table_specs.side_effect": exceptions.NotFound("err")}, {} - ) - with pytest.raises(exceptions.NotFound): - client.set_target_column( - dataset_name="name", column_spec_display_name="column2" - ) - client.auto_ml_client.list_table_specs.assert_called_with("name") - client.auto_ml_client.list_column_specs.assert_not_called() - client.auto_ml_client.update_dataset.assert_not_called() - - def test_set_target_column_not_found(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - column_spec_mock = mock.Mock() - column_spec_mock.configure_mock(name="column/1", display_name="column") - client = self.tables_client( - { - "list_table_specs.return_value": [table_spec_mock], - "list_column_specs.return_value": [column_spec_mock], - }, - {}, - ) - with pytest.raises(exceptions.NotFound): - client.set_target_column( - dataset_name="name", column_spec_display_name="column2" - ) - client.auto_ml_client.list_table_specs.assert_called_with("name") - client.auto_ml_client.list_column_specs.assert_called_with("table") - client.auto_ml_client.update_dataset.assert_not_called() - - def test_set_target_column(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - column_spec_mock = mock.Mock() - column_spec_mock.configure_mock(name="column/1", display_name="column") - dataset_mock = mock.Mock() - tables_dataset_metadata_mock = mock.Mock() - tables_dataset_metadata_mock.configure_mock( - target_column_spec_id="2", - weight_column_spec_id="2", - ml_use_column_spec_id="3", - ) - dataset_mock.configure_mock( - name="dataset", tables_dataset_metadata=tables_dataset_metadata_mock - ) - client = self.tables_client( - { - "get_dataset.return_value": dataset_mock, - "list_table_specs.return_value": [table_spec_mock], - "list_column_specs.return_value": [column_spec_mock], - }, - {}, - ) - client.set_target_column(dataset_name="name", column_spec_display_name="column") - client.auto_ml_client.list_table_specs.assert_called_with("name") - client.auto_ml_client.list_column_specs.assert_called_with("table") - client.auto_ml_client.update_dataset.assert_called_with( - { - "name": "dataset", - "tables_dataset_metadata": { - "target_column_spec_id": "1", - "weight_column_spec_id": "2", - "ml_use_column_spec_id": "3", - }, - } - ) - - def test_set_weight_column_table_not_found(self): - client = self.tables_client( - {"list_table_specs.side_effect": exceptions.NotFound("err")}, {} - ) - try: - client.set_weight_column( - dataset_name="name", column_spec_display_name="column2" - ) - except exceptions.NotFound: - pass - client.auto_ml_client.list_table_specs.assert_called_with("name") - client.auto_ml_client.list_column_specs.assert_not_called() - client.auto_ml_client.update_dataset.assert_not_called() - - def test_set_weight_column_not_found(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - column_spec_mock = mock.Mock() - column_spec_mock.configure_mock(name="column/1", display_name="column") - client = self.tables_client( - { - "list_table_specs.return_value": [table_spec_mock], - "list_column_specs.return_value": [column_spec_mock], - }, - {}, - ) - with pytest.raises(exceptions.NotFound): - client.set_weight_column( - dataset_name="name", column_spec_display_name="column2" - ) - client.auto_ml_client.list_table_specs.assert_called_with("name") - client.auto_ml_client.list_column_specs.assert_called_with("table") - client.auto_ml_client.update_dataset.assert_not_called() - - def test_set_weight_column(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - column_spec_mock = mock.Mock() - column_spec_mock.configure_mock(name="column/2", display_name="column") - dataset_mock = mock.Mock() - tables_dataset_metadata_mock = mock.Mock() - tables_dataset_metadata_mock.configure_mock( - target_column_spec_id="1", - weight_column_spec_id="1", - ml_use_column_spec_id="3", - ) - dataset_mock.configure_mock( - name="dataset", tables_dataset_metadata=tables_dataset_metadata_mock - ) - client = self.tables_client( - { - "get_dataset.return_value": dataset_mock, - "list_table_specs.return_value": [table_spec_mock], - "list_column_specs.return_value": [column_spec_mock], - }, - {}, - ) - client.set_weight_column(dataset_name="name", column_spec_display_name="column") - client.auto_ml_client.list_table_specs.assert_called_with("name") - client.auto_ml_client.list_column_specs.assert_called_with("table") - client.auto_ml_client.update_dataset.assert_called_with( - { - "name": "dataset", - "tables_dataset_metadata": { - "target_column_spec_id": "1", - "weight_column_spec_id": "2", - "ml_use_column_spec_id": "3", - }, - } - ) - - def test_clear_weight_column(self): - dataset_mock = mock.Mock() - tables_dataset_metadata_mock = mock.Mock() - tables_dataset_metadata_mock.configure_mock( - target_column_spec_id="1", - weight_column_spec_id="2", - ml_use_column_spec_id="3", - ) - dataset_mock.configure_mock( - name="dataset", tables_dataset_metadata=tables_dataset_metadata_mock - ) - client = self.tables_client({"get_dataset.return_value": dataset_mock}, {}) - client.clear_weight_column(dataset_name="name") - client.auto_ml_client.update_dataset.assert_called_with( - { - "name": "dataset", - "tables_dataset_metadata": { - "target_column_spec_id": "1", - "weight_column_spec_id": None, - "ml_use_column_spec_id": "3", - }, - } - ) - - def test_set_test_train_column_table_not_found(self): - client = self.tables_client( - {"list_table_specs.side_effect": exceptions.NotFound("err")}, {} - ) - with pytest.raises(exceptions.NotFound): - client.set_test_train_column( - dataset_name="name", column_spec_display_name="column2" - ) - client.auto_ml_client.list_table_specs.assert_called_with("name") - client.auto_ml_client.list_column_specs.assert_not_called() - client.auto_ml_client.update_dataset.assert_not_called() - - def test_set_test_train_column_not_found(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - column_spec_mock = mock.Mock() - column_spec_mock.configure_mock(name="column/1", display_name="column") - client = self.tables_client( - { - "list_table_specs.return_value": [table_spec_mock], - "list_column_specs.return_value": [column_spec_mock], - }, - {}, - ) - with pytest.raises(exceptions.NotFound): - client.set_test_train_column( - dataset_name="name", column_spec_display_name="column2" - ) - client.auto_ml_client.list_table_specs.assert_called_with("name") - client.auto_ml_client.list_column_specs.assert_called_with("table") - client.auto_ml_client.update_dataset.assert_not_called() - - def test_set_test_train_column(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - column_spec_mock = mock.Mock() - column_spec_mock.configure_mock(name="column/3", display_name="column") - dataset_mock = mock.Mock() - tables_dataset_metadata_mock = mock.Mock() - tables_dataset_metadata_mock.configure_mock( - target_column_spec_id="1", - weight_column_spec_id="2", - ml_use_column_spec_id="2", - ) - dataset_mock.configure_mock( - name="dataset", tables_dataset_metadata=tables_dataset_metadata_mock - ) - client = self.tables_client( - { - "get_dataset.return_value": dataset_mock, - "list_table_specs.return_value": [table_spec_mock], - "list_column_specs.return_value": [column_spec_mock], - }, - {}, - ) - client.set_test_train_column( - dataset_name="name", column_spec_display_name="column" - ) - client.auto_ml_client.list_table_specs.assert_called_with("name") - client.auto_ml_client.list_column_specs.assert_called_with("table") - client.auto_ml_client.update_dataset.assert_called_with( - { - "name": "dataset", - "tables_dataset_metadata": { - "target_column_spec_id": "1", - "weight_column_spec_id": "2", - "ml_use_column_spec_id": "3", - }, - } - ) - - def test_clear_test_train_column(self): - dataset_mock = mock.Mock() - tables_dataset_metadata_mock = mock.Mock() - tables_dataset_metadata_mock.configure_mock( - target_column_spec_id="1", - weight_column_spec_id="2", - ml_use_column_spec_id="2", - ) - dataset_mock.configure_mock( - name="dataset", tables_dataset_metadata=tables_dataset_metadata_mock - ) - client = self.tables_client({"get_dataset.return_value": dataset_mock}, {}) - client.clear_test_train_column(dataset_name="name") - client.auto_ml_client.update_dataset.assert_called_with( - { - "name": "dataset", - "tables_dataset_metadata": { - "target_column_spec_id": "1", - "weight_column_spec_id": "2", - "ml_use_column_spec_id": None, - }, - } - ) - - def test_set_time_column(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - column_spec_mock = mock.Mock() - column_spec_mock.configure_mock(name="column/3", display_name="column") - dataset_mock = mock.Mock() - dataset_mock.configure_mock(name="dataset") - client = self.tables_client( - { - "get_dataset.return_value": dataset_mock, - "list_table_specs.return_value": [table_spec_mock], - "list_column_specs.return_value": [column_spec_mock], - }, - {}, - ) - client.set_time_column(dataset_name="name", column_spec_display_name="column") - client.auto_ml_client.list_table_specs.assert_called_with("name") - client.auto_ml_client.list_column_specs.assert_called_with("table") - client.auto_ml_client.update_table_spec.assert_called_with( - {"name": "table", "time_column_spec_id": "3"} - ) - - def test_clear_time_column(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - dataset_mock = mock.Mock() - dataset_mock.configure_mock(name="dataset") - client = self.tables_client( - { - "get_dataset.return_value": dataset_mock, - "list_table_specs.return_value": [table_spec_mock], - }, - {}, - ) - client.clear_time_column(dataset_name="name") - client.auto_ml_client.update_table_spec.assert_called_with( - {"name": "table", "time_column_spec_id": None} - ) - - def test_get_model_evaluation(self): - client = self.tables_client({}, {}) - ds = client.get_model_evaluation(model_evaluation_name="x") - client.auto_ml_client.get_model_evaluation.assert_called_with("x") - - def test_list_model_evaluations_empty(self): - client = self.tables_client({"list_model_evaluations.return_value": []}, {}) - ds = client.list_model_evaluations(model_name="model") - client.auto_ml_client.list_model_evaluations.assert_called_with("model") - assert ds == [] - - def test_list_model_evaluations_not_empty(self): - evaluations = ["eval"] - client = self.tables_client( - { - "list_model_evaluations.return_value": evaluations, - "location_path.return_value": LOCATION_PATH, - }, - {}, - ) - ds = client.list_model_evaluations(model_name="model") - client.auto_ml_client.list_model_evaluations.assert_called_with("model") - assert len(ds) == 1 - assert ds[0] == "eval" - - def test_list_models_empty(self): - client = self.tables_client( - { - "list_models.return_value": [], - "location_path.return_value": LOCATION_PATH, - }, - {}, - ) - ds = client.list_models() - client.auto_ml_client.location_path.assert_called_with(PROJECT, REGION) - client.auto_ml_client.list_models.assert_called_with(LOCATION_PATH) - assert ds == [] - - def test_list_models_not_empty(self): - models = ["some_model"] - client = self.tables_client( - { - "list_models.return_value": models, - "location_path.return_value": LOCATION_PATH, - }, - {}, - ) - ds = client.list_models() - client.auto_ml_client.location_path.assert_called_with(PROJECT, REGION) - client.auto_ml_client.list_models.assert_called_with(LOCATION_PATH) - assert len(ds) == 1 - assert ds[0] == "some_model" - - def test_get_model_name(self): - model_actual = "model" - client = self.tables_client({"get_model.return_value": model_actual}, {}) - model = client.get_model(model_name="my_model") - client.auto_ml_client.get_model.assert_called_with("my_model") - assert model == model_actual - - def test_get_no_model(self): - client = self.tables_client( - {"get_model.side_effect": exceptions.NotFound("err")}, {} - ) - with pytest.raises(exceptions.NotFound): - client.get_model(model_name="my_model") - client.auto_ml_client.get_model.assert_called_with("my_model") - - def test_get_model_from_empty_list(self): - client = self.tables_client({"list_models.return_value": []}, {}) - with pytest.raises(exceptions.NotFound): - client.get_model(model_display_name="my_model") - - def test_get_model_from_list_not_found(self): - client = self.tables_client( - {"list_models.return_value": [mock.Mock(display_name="not_it")]}, {} - ) - with pytest.raises(exceptions.NotFound): - client.get_model(model_display_name="my_model") - - def test_get_model_from_list(self): - client = self.tables_client( - { - "list_models.return_value": [ - mock.Mock(display_name="not_it"), - mock.Mock(display_name="my_model"), - ] - }, - {}, - ) - model = client.get_model(model_display_name="my_model") - assert model.display_name == "my_model" - - def test_get_model_from_list_ambiguous(self): - client = self.tables_client( - { - "list_models.return_value": [ - mock.Mock(display_name="my_model"), - mock.Mock(display_name="not_my_model"), - mock.Mock(display_name="my_model"), - ] - }, - {}, - ) - with pytest.raises(ValueError): - client.get_model(model_display_name="my_model") - - def test_delete_model(self): - model = mock.Mock() - model.configure_mock(name="name") - client = self.tables_client({"delete_model.return_value": None}, {}) - client.delete_model(model=model) - client.auto_ml_client.delete_model.assert_called_with("name") - - def test_delete_model_not_found(self): - client = self.tables_client({"list_models.return_value": []}, {}) - client.delete_model(model_display_name="not_found") - client.auto_ml_client.delete_model.assert_not_called() - - def test_delete_model_name(self): - client = self.tables_client({"delete_model.return_value": None}, {}) - client.delete_model(model_name="name") - client.auto_ml_client.delete_model.assert_called_with("name") - - def test_deploy_model_no_args(self): - client = self.tables_client({}, {}) - with pytest.raises(ValueError): - client.deploy_model() - client.auto_ml_client.deploy_model.assert_not_called() - - def test_deploy_model(self): - client = self.tables_client({}, {}) - client.deploy_model(model_name="name") - client.auto_ml_client.deploy_model.assert_called_with("name") - - def test_deploy_model_not_found(self): - client = self.tables_client({"list_models.return_value": []}, {}) - with pytest.raises(exceptions.NotFound): - client.deploy_model(model_display_name="name") - client.auto_ml_client.deploy_model.assert_not_called() - - def test_undeploy_model(self): - client = self.tables_client({}, {}) - client.undeploy_model(model_name="name") - client.auto_ml_client.undeploy_model.assert_called_with("name") - - def test_undeploy_model_not_found(self): - client = self.tables_client({"list_models.return_value": []}, {}) - with pytest.raises(exceptions.NotFound): - client.undeploy_model(model_display_name="name") - client.auto_ml_client.undeploy_model.assert_not_called() - - def test_create_model(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - column_spec_mock = mock.Mock() - column_spec_mock.configure_mock(name="column/2", display_name="column") - client = self.tables_client( - { - "list_table_specs.return_value": [table_spec_mock], - "list_column_specs.return_value": [column_spec_mock], - "location_path.return_value": LOCATION_PATH, - }, - {}, - ) - client.create_model( - "my_model", dataset_name="my_dataset", train_budget_milli_node_hours=1000 - ) - client.auto_ml_client.create_model.assert_called_with( - LOCATION_PATH, - { - "display_name": "my_model", - "dataset_id": "my_dataset", - "tables_model_metadata": {"train_budget_milli_node_hours": 1000}, - }, - ) - - def test_create_model_include_columns(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - column_spec_mock1 = mock.Mock() - column_spec_mock1.configure_mock(name="column/1", display_name="column1") - column_spec_mock2 = mock.Mock() - column_spec_mock2.configure_mock(name="column/2", display_name="column2") - client = self.tables_client( - { - "list_table_specs.return_value": [table_spec_mock], - "list_column_specs.return_value": [ - column_spec_mock1, - column_spec_mock2, - ], - "location_path.return_value": LOCATION_PATH, - }, - {}, - ) - client.create_model( - "my_model", - dataset_name="my_dataset", - include_column_spec_names=["column1"], - train_budget_milli_node_hours=1000, - ) - client.auto_ml_client.create_model.assert_called_with( - LOCATION_PATH, - { - "display_name": "my_model", - "dataset_id": "my_dataset", - "tables_model_metadata": { - "train_budget_milli_node_hours": 1000, - "input_feature_column_specs": [column_spec_mock1], - }, - }, - ) - - def test_create_model_exclude_columns(self): - table_spec_mock = mock.Mock() - # name is reserved in use of __init__, needs to be passed here - table_spec_mock.configure_mock(name="table") - column_spec_mock1 = mock.Mock() - column_spec_mock1.configure_mock(name="column/1", display_name="column1") - column_spec_mock2 = mock.Mock() - column_spec_mock2.configure_mock(name="column/2", display_name="column2") - client = self.tables_client( - { - "list_table_specs.return_value": [table_spec_mock], - "list_column_specs.return_value": [ - column_spec_mock1, - column_spec_mock2, - ], - "location_path.return_value": LOCATION_PATH, - }, - {}, - ) - client.create_model( - "my_model", - dataset_name="my_dataset", - exclude_column_spec_names=["column1"], - train_budget_milli_node_hours=1000, - ) - client.auto_ml_client.create_model.assert_called_with( - LOCATION_PATH, - { - "display_name": "my_model", - "dataset_id": "my_dataset", - "tables_model_metadata": { - "train_budget_milli_node_hours": 1000, - "input_feature_column_specs": [column_spec_mock2], - }, - }, - ) - - def test_create_model_invalid_hours_small(self): - client = self.tables_client({}, {}) - with pytest.raises(ValueError): - client.create_model( - "my_model", dataset_name="my_dataset", train_budget_milli_node_hours=1 - ) - client.auto_ml_client.create_model.assert_not_called() - - def test_create_model_invalid_hours_large(self): - client = self.tables_client({}, {}) - with pytest.raises(ValueError): - client.create_model( - "my_model", - dataset_name="my_dataset", - train_budget_milli_node_hours=1000000, - ) - client.auto_ml_client.create_model.assert_not_called() - - def test_create_model_invalid_no_dataset(self): - client = self.tables_client({}, {}) - with pytest.raises(ValueError): - client.create_model("my_model", train_budget_milli_node_hours=1000) - client.auto_ml_client.get_dataset.assert_not_called() - client.auto_ml_client.create_model.assert_not_called() - - def test_create_model_invalid_include_exclude(self): - client = self.tables_client({}, {}) - with pytest.raises(ValueError): - client.create_model( - "my_model", - dataset_name="my_dataset", - include_column_spec_names=["a"], - exclude_column_spec_names=["b"], - train_budget_milli_node_hours=1000, - ) - client.auto_ml_client.get_dataset.assert_not_called() - client.auto_ml_client.create_model.assert_not_called() - - def test_predict_from_array(self): - data_type = mock.Mock(type_code=data_types_pb2.CATEGORY) - column_spec = mock.Mock(display_name="a", data_type=data_type) - model_metadata = mock.Mock(input_feature_column_specs=[column_spec]) - model = mock.Mock() - model.configure_mock(tables_model_metadata=model_metadata, name="my_model") - client = self.tables_client({"get_model.return_value": model}, {}) - client.predict(["1"], model_name="my_model") - payload = data_items_pb2.ExamplePayload( - row=data_items_pb2.Row(values=[struct_pb2.Value(string_value="1")]) - ) - client.prediction_client.predict.assert_called_with("my_model", payload, None) - - def test_predict_from_dict(self): - data_type = mock.Mock(type_code=data_types_pb2.CATEGORY) - column_spec_a = mock.Mock(display_name="a", data_type=data_type) - column_spec_b = mock.Mock(display_name="b", data_type=data_type) - model_metadata = mock.Mock( - input_feature_column_specs=[column_spec_a, column_spec_b] - ) - model = mock.Mock() - model.configure_mock(tables_model_metadata=model_metadata, name="my_model") - client = self.tables_client({"get_model.return_value": model}, {}) - client.predict({"a": "1", "b": "2"}, model_name="my_model") - payload = data_items_pb2.ExamplePayload( - row=data_items_pb2.Row( - values=[ - struct_pb2.Value(string_value="1"), - struct_pb2.Value(string_value="2"), - ] - ) - ) - client.prediction_client.predict.assert_called_with("my_model", payload, None) - - def test_predict_from_dict_with_feature_importance(self): - data_type = mock.Mock(type_code=data_types_pb2.CATEGORY) - column_spec_a = mock.Mock(display_name="a", data_type=data_type) - column_spec_b = mock.Mock(display_name="b", data_type=data_type) - model_metadata = mock.Mock( - input_feature_column_specs=[column_spec_a, column_spec_b] - ) - model = mock.Mock() - model.configure_mock(tables_model_metadata=model_metadata, name="my_model") - client = self.tables_client({"get_model.return_value": model}, {}) - client.predict( - {"a": "1", "b": "2"}, model_name="my_model", feature_importance=True - ) - payload = data_items_pb2.ExamplePayload( - row=data_items_pb2.Row( - values=[ - struct_pb2.Value(string_value="1"), - struct_pb2.Value(string_value="2"), - ] - ) - ) - client.prediction_client.predict.assert_called_with( - "my_model", payload, {"feature_importance": "true"} - ) - - def test_predict_from_dict_missing(self): - data_type = mock.Mock(type_code=data_types_pb2.CATEGORY) - column_spec_a = mock.Mock(display_name="a", data_type=data_type) - column_spec_b = mock.Mock(display_name="b", data_type=data_type) - model_metadata = mock.Mock( - input_feature_column_specs=[column_spec_a, column_spec_b] - ) - model = mock.Mock() - model.configure_mock(tables_model_metadata=model_metadata, name="my_model") - client = self.tables_client({"get_model.return_value": model}, {}) - client.predict({"a": "1"}, model_name="my_model") - payload = data_items_pb2.ExamplePayload( - row=data_items_pb2.Row( - values=[ - struct_pb2.Value(string_value="1"), - struct_pb2.Value(null_value=struct_pb2.NullValue.NULL_VALUE), - ] - ) - ) - client.prediction_client.predict.assert_called_with("my_model", payload, None) - - def test_predict_all_types(self): - float_type = mock.Mock(type_code=data_types_pb2.FLOAT64) - timestamp_type = mock.Mock(type_code=data_types_pb2.TIMESTAMP) - string_type = mock.Mock(type_code=data_types_pb2.STRING) - array_type = mock.Mock( - type_code=data_types_pb2.ARRAY, - list_element_type=mock.Mock(type_code=data_types_pb2.FLOAT64), - ) - struct = data_types_pb2.StructType() - struct.fields["a"].CopyFrom( - data_types_pb2.DataType(type_code=data_types_pb2.CATEGORY) - ) - struct.fields["b"].CopyFrom( - data_types_pb2.DataType(type_code=data_types_pb2.CATEGORY) - ) - struct_type = mock.Mock(type_code=data_types_pb2.STRUCT, struct_type=struct) - category_type = mock.Mock(type_code=data_types_pb2.CATEGORY) - column_spec_float = mock.Mock(display_name="float", data_type=float_type) - column_spec_timestamp = mock.Mock( - display_name="timestamp", data_type=timestamp_type - ) - column_spec_string = mock.Mock(display_name="string", data_type=string_type) - column_spec_array = mock.Mock(display_name="array", data_type=array_type) - column_spec_struct = mock.Mock(display_name="struct", data_type=struct_type) - column_spec_category = mock.Mock( - display_name="category", data_type=category_type - ) - column_spec_null = mock.Mock(display_name="null", data_type=category_type) - model_metadata = mock.Mock( - input_feature_column_specs=[ - column_spec_float, - column_spec_timestamp, - column_spec_string, - column_spec_array, - column_spec_struct, - column_spec_category, - column_spec_null, - ] - ) - model = mock.Mock() - model.configure_mock(tables_model_metadata=model_metadata, name="my_model") - client = self.tables_client({"get_model.return_value": model}, {}) - client.predict( - { - "float": 1.0, - "timestamp": "EST", - "string": "text", - "array": [1], - "struct": {"a": "label_a", "b": "label_b"}, - "category": "a", - "null": None, - }, - model_name="my_model", - ) - struct = struct_pb2.Struct() - struct.fields["a"].CopyFrom(struct_pb2.Value(string_value="label_a")) - struct.fields["b"].CopyFrom(struct_pb2.Value(string_value="label_b")) - payload = data_items_pb2.ExamplePayload( - row=data_items_pb2.Row( - values=[ - struct_pb2.Value(number_value=1.0), - struct_pb2.Value(string_value="EST"), - struct_pb2.Value(string_value="text"), - struct_pb2.Value( - list_value=struct_pb2.ListValue( - values=[struct_pb2.Value(number_value=1.0)] - ) - ), - struct_pb2.Value(struct_value=struct), - struct_pb2.Value(string_value="a"), - struct_pb2.Value(null_value=struct_pb2.NullValue.NULL_VALUE), - ] - ) - ) - client.prediction_client.predict.assert_called_with("my_model", payload, None) - - def test_predict_from_array_missing(self): - data_type = mock.Mock(type_code=data_types_pb2.CATEGORY) - column_spec = mock.Mock(display_name="a", data_type=data_type) - model_metadata = mock.Mock(input_feature_column_specs=[column_spec]) - model = mock.Mock() - model.configure_mock(tables_model_metadata=model_metadata, name="my_model") - client = self.tables_client({"get_model.return_value": model}, {}) - with pytest.raises(ValueError): - client.predict([], model_name="my_model") - client.prediction_client.predict.assert_not_called() - - def test_batch_predict_pandas_dataframe(self): - client = self.tables_client( - gcs_client_attrs={ - "bucket_name": "my_bucket", - "upload_pandas_dataframe.return_value": "gs://input", - } - ) - dataframe = pandas.DataFrame({}) - client.batch_predict( - project=PROJECT, - region=REGION, - model_name="my_model", - pandas_dataframe=dataframe, - gcs_output_uri_prefix="gs://output", - ) - - client.gcs_client.ensure_bucket_exists.assert_called_with(PROJECT, REGION) - client.gcs_client.upload_pandas_dataframe.assert_called_with(dataframe) - - client.prediction_client.batch_predict.assert_called_with( - "my_model", - {"gcs_source": {"input_uris": ["gs://input"]}}, - {"gcs_destination": {"output_uri_prefix": "gs://output"}}, - ) - - def test_batch_predict_pandas_dataframe_init_gcs(self): - client = automl_v1beta1.TablesClient( - client=mock.Mock(), - prediction_client=mock.Mock(), - project=PROJECT, - region=REGION, - credentials=AnonymousCredentials(), - ) - - dataframe = pandas.DataFrame({}) - patch = mock.patch( - "google.cloud.automl_v1beta1.tables.tables_client.gcs_client.GcsClient", - bucket_name="my_bucket", - ) - with patch as MockGcsClient: - mockInstance = MockGcsClient.return_value - mockInstance.upload_pandas_dataframe.return_value = "gs://input" - - dataframe = pandas.DataFrame({}) - client.batch_predict( - model_name="my_model", - pandas_dataframe=dataframe, - gcs_output_uri_prefix="gs://output", - ) - - client.gcs_client.ensure_bucket_exists.assert_called_with(PROJECT, REGION) - client.gcs_client.upload_pandas_dataframe.assert_called_with(dataframe) - - client.prediction_client.batch_predict.assert_called_with( - "my_model", - {"gcs_source": {"input_uris": ["gs://input"]}}, - {"gcs_destination": {"output_uri_prefix": "gs://output"}}, - ) - - def test_batch_predict_gcs(self): - client = self.tables_client({}, {}) - client.batch_predict( - model_name="my_model", - gcs_input_uris="gs://input", - gcs_output_uri_prefix="gs://output", - ) - client.prediction_client.batch_predict.assert_called_with( - "my_model", - {"gcs_source": {"input_uris": ["gs://input"]}}, - {"gcs_destination": {"output_uri_prefix": "gs://output"}}, - ) - - def test_batch_predict_bigquery(self): - client = self.tables_client({}, {}) - client.batch_predict( - model_name="my_model", - bigquery_input_uri="bq://input", - bigquery_output_uri="bq://output", - ) - client.prediction_client.batch_predict.assert_called_with( - "my_model", - {"bigquery_source": {"input_uri": "bq://input"}}, - {"bigquery_destination": {"output_uri": "bq://output"}}, - ) - - def test_batch_predict_mixed(self): - client = self.tables_client({}, {}) - client.batch_predict( - model_name="my_model", - gcs_input_uris="gs://input", - bigquery_output_uri="bq://output", - ) - client.prediction_client.batch_predict.assert_called_with( - "my_model", - {"gcs_source": {"input_uris": ["gs://input"]}}, - {"bigquery_destination": {"output_uri": "bq://output"}}, - ) - - def test_batch_predict_missing_input_gcs_uri(self): - client = self.tables_client({}, {}) - with pytest.raises(ValueError): - client.batch_predict( - model_name="my_model", - gcs_input_uris=None, - gcs_output_uri_prefix="gs://output", - ) - client.prediction_client.batch_predict.assert_not_called() - - def test_batch_predict_missing_input_bigquery_uri(self): - client = self.tables_client({}, {}) - with pytest.raises(ValueError): - client.batch_predict( - model_name="my_model", - bigquery_input_uri=None, - gcs_output_uri_prefix="gs://output", - ) - client.prediction_client.batch_predict.assert_not_called() - - def test_batch_predict_missing_output_gcs_uri(self): - client = self.tables_client({}, {}) - with pytest.raises(ValueError): - client.batch_predict( - model_name="my_model", - gcs_input_uris="gs://input", - gcs_output_uri_prefix=None, - ) - client.prediction_client.batch_predict.assert_not_called() - - def test_batch_predict_missing_output_bigquery_uri(self): - client = self.tables_client({}, {}) - with pytest.raises(ValueError): - client.batch_predict( - model_name="my_model", - gcs_input_uris="gs://input", - bigquery_output_uri=None, - ) - client.prediction_client.batch_predict.assert_not_called() - - def test_batch_predict_missing_model(self): - client = self.tables_client({"list_models.return_value": []}, {}) - with pytest.raises(exceptions.NotFound): - client.batch_predict( - model_display_name="my_model", - gcs_input_uris="gs://input", - gcs_output_uri_prefix="gs://output", - ) - client.prediction_client.batch_predict.assert_not_called() - - def test_batch_predict_no_model(self): - client = self.tables_client({}, {}) - with pytest.raises(ValueError): - client.batch_predict( - gcs_input_uris="gs://input", gcs_output_uri_prefix="gs://output" - ) - client.auto_ml_client.list_models.assert_not_called() - client.prediction_client.batch_predict.assert_not_called() - - def test_auto_ml_client_credentials(self): - credentials_mock = mock.Mock() - patch_auto_ml_client = mock.patch( - "google.cloud.automl_v1beta1.gapic.auto_ml_client.AutoMlClient" - ) - with patch_auto_ml_client as MockAutoMlClient: - client = automl_v1beta1.TablesClient(credentials=credentials_mock) - _, auto_ml_client_kwargs = MockAutoMlClient.call_args - assert "credentials" in auto_ml_client_kwargs - assert auto_ml_client_kwargs["credentials"] == credentials_mock - - def test_prediction_client_credentials(self): - credentials_mock = mock.Mock() - patch_prediction_client = mock.patch( - "google.cloud.automl_v1beta1.gapic.prediction_service_client.PredictionServiceClient" - ) - with patch_prediction_client as MockPredictionClient: - client = automl_v1beta1.TablesClient(credentials=credentials_mock) - _, prediction_client_kwargs = MockPredictionClient.call_args - assert "credentials" in prediction_client_kwargs - assert prediction_client_kwargs["credentials"] == credentials_mock - - def test_prediction_client_client_info(self): - client_info_mock = mock.Mock() - patch_prediction_client = mock.patch( - "google.cloud.automl_v1beta1.gapic.prediction_service_client.PredictionServiceClient" - ) - with patch_prediction_client as MockPredictionClient: - client = automl_v1beta1.TablesClient(client_info=client_info_mock) - _, prediction_client_kwargs = MockPredictionClient.call_args - assert "client_info" in prediction_client_kwargs - assert prediction_client_kwargs["client_info"] == client_info_mock diff --git a/cloudbuild/.coveragerc b/cloudbuild/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/cloudbuild/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/cloudbuild/.flake8 b/cloudbuild/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/cloudbuild/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/cloudbuild/.repo-metadata.json b/cloudbuild/.repo-metadata.json deleted file mode 100644 index 2fa277bbebf2..000000000000 --- a/cloudbuild/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "cloudbuild", - "name_pretty": "Cloud Build", - "product_documentation": "https://cloud.google.com/cloud-build/docs/", - "client_documentation": "https://googleapis.dev/python/cloudbuild/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/5226584", - "release_level": "alpha", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-build", - "api_id": "cloudbuild.googleapis.com", - "requires_billing": false -} \ No newline at end of file diff --git a/cloudbuild/CHANGELOG.md b/cloudbuild/CHANGELOG.md deleted file mode 100644 index ad158194c5b6..000000000000 --- a/cloudbuild/CHANGELOG.md +++ /dev/null @@ -1,14 +0,0 @@ -# Changelog - -[PyPI History][1] - -[1]: https://pypi.org/project/google-cloud-build/#history - -## 0.1.0 - -11-07-2019 10:48 PST - -**Note**: This library is incompatible with `google-cloud-containeranalysis<0.3.1`. Please upgrade to `google-cloud-containeranalysis>=0.3.1` to use this library. - -### New Features -- Initial generation of Cloud Build v1 ([#9510](https://github.com/googleapis/google-cloud-python/pull/9510)). diff --git a/cloudbuild/LICENSE b/cloudbuild/LICENSE deleted file mode 100644 index a8ee855de2aa..000000000000 --- a/cloudbuild/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/cloudbuild/MANIFEST.in b/cloudbuild/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/cloudbuild/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/cloudbuild/README.rst b/cloudbuild/README.rst deleted file mode 100644 index 79c1733667d7..000000000000 --- a/cloudbuild/README.rst +++ /dev/null @@ -1,75 +0,0 @@ -Python Client for Cloud Build API (`Alpha`_) -============================================ - -`Cloud Build API`_: Creates and manages builds on Google Cloud Platform. - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. _Alpha: https://github.com/googleapis/google-cloud-python/blob/master/README.rst -.. _Cloud Build API: https://cloud.google.com/cloud-build -.. _Client Library Documentation: https://googleapis.dev/python/cloudbuild/latest -.. _Product Documentation: https://cloud.google.com/cloud-build - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the Cloud Build API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Cloud Build API.: https://cloud.google.com/cloud-build -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-build - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-build - -Next Steps -~~~~~~~~~~ - -- Read the `Client Library Documentation`_ for Cloud Build API - API to see other available methods on the client. -- Read the `Cloud Build API Product documentation`_ to learn - more about the product and see How-to Guides. -- View this `repository’s main README`_ to see the full list of Cloud - APIs that we cover. - -.. _Cloud Build API Product documentation: https://cloud.google.com/cloud-build -.. _repository’s main README: https://github.com/googleapis/google-cloud-python/blob/master/README.rst \ No newline at end of file diff --git a/cloudbuild/docs/README.rst b/cloudbuild/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/cloudbuild/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/cloudbuild/docs/_static/custom.css b/cloudbuild/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/cloudbuild/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/cloudbuild/docs/_templates/layout.html b/cloudbuild/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/cloudbuild/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/cloudbuild/docs/changelog.md b/cloudbuild/docs/changelog.md deleted file mode 120000 index 04c99a55caae..000000000000 --- a/cloudbuild/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../CHANGELOG.md \ No newline at end of file diff --git a/cloudbuild/docs/conf.py b/cloudbuild/docs/conf.py deleted file mode 100644 index a0a78e377bce..000000000000 --- a/cloudbuild/docs/conf.py +++ /dev/null @@ -1,357 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-build documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-build" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-build-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-build.tex", - u"google-cloud-build Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, "google-cloud-build", u"google-cloud-build Documentation", [author], 1) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-build", - u"google-cloud-build Documentation", - author, - "google-cloud-build", - "GAPIC library for the {metadata.shortName} v1 service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/master/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/cloudbuild/docs/gapic/v1/api.rst b/cloudbuild/docs/gapic/v1/api.rst deleted file mode 100644 index b73769d5c2a1..000000000000 --- a/cloudbuild/docs/gapic/v1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud Build API -========================== - -.. automodule:: google.cloud.devtools.cloudbuild_v1 - :members: - :inherited-members: \ No newline at end of file diff --git a/cloudbuild/docs/gapic/v1/types.rst b/cloudbuild/docs/gapic/v1/types.rst deleted file mode 100644 index db501043e959..000000000000 --- a/cloudbuild/docs/gapic/v1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud Build API Client -================================ - -.. automodule:: google.cloud.devtools.cloudbuild_v1.types - :members: \ No newline at end of file diff --git a/cloudbuild/docs/index.rst b/cloudbuild/docs/index.rst deleted file mode 100644 index 382348916108..000000000000 --- a/cloudbuild/docs/index.rst +++ /dev/null @@ -1,22 +0,0 @@ -.. include:: README.rst - - -API Reference -------------- - -.. toctree:: - :maxdepth: 2 - - gapic/v1/api - gapic/v1/types - - -Changelog ---------- - -For a list of all ``google-cloud-build`` releases: - -.. toctree:: - :maxdepth: 2 - - changelog diff --git a/cloudbuild/google/__init__.py b/cloudbuild/google/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/cloudbuild/google/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/cloudbuild/google/cloud/__init__.py b/cloudbuild/google/cloud/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/cloudbuild/google/cloud/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/cloudbuild/google/cloud/devtools/__init__.py b/cloudbuild/google/cloud/devtools/__init__.py deleted file mode 100644 index 8fcc60e2b9c6..000000000000 --- a/cloudbuild/google/cloud/devtools/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/cloudbuild/google/cloud/devtools/cloudbuild.py b/cloudbuild/google/cloud/devtools/cloudbuild.py deleted file mode 100644 index 1e6519eee862..000000000000 --- a/cloudbuild/google/cloud/devtools/cloudbuild.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import - -from google.cloud.devtools.cloudbuild_v1 import CloudBuildClient -from google.cloud.devtools.cloudbuild_v1 import enums -from google.cloud.devtools.cloudbuild_v1 import types - - -__all__ = ("enums", "types", "CloudBuildClient") diff --git a/cloudbuild/google/cloud/devtools/cloudbuild_v1/__init__.py b/cloudbuild/google/cloud/devtools/cloudbuild_v1/__init__.py deleted file mode 100644 index 68a61ce05837..000000000000 --- a/cloudbuild/google/cloud/devtools/cloudbuild_v1/__init__.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.devtools.cloudbuild_v1 import types -from google.cloud.devtools.cloudbuild_v1.gapic import cloud_build_client -from google.cloud.devtools.cloudbuild_v1.gapic import enums - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class CloudBuildClient(cloud_build_client.CloudBuildClient): - __doc__ = cloud_build_client.CloudBuildClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "CloudBuildClient") diff --git a/cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/__init__.py b/cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/cloud_build_client.py b/cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/cloud_build_client.py deleted file mode 100644 index 7a804ae72074..000000000000 --- a/cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/cloud_build_client.py +++ /dev/null @@ -1,1334 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.devtools.cloudbuild.v1 CloudBuild API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.page_iterator -import grpc - -from google.cloud.devtools.cloudbuild_v1.gapic import cloud_build_client_config -from google.cloud.devtools.cloudbuild_v1.gapic import enums -from google.cloud.devtools.cloudbuild_v1.gapic.transports import ( - cloud_build_grpc_transport, -) -from google.cloud.devtools.cloudbuild_v1.proto import cloudbuild_pb2 -from google.cloud.devtools.cloudbuild_v1.proto import cloudbuild_pb2_grpc -from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-build").version - - -class CloudBuildClient(object): - """ - Creates and manages builds on Google Cloud Platform. - - The main concept used by this API is a ``Build``, which describes the - location of the source to build, how to build the source, and where to - store the built artifacts, if any. - - A user can list previously-requested builds or get builds by their ID to - determine the status of the build. - """ - - SERVICE_ADDRESS = "cloudbuild.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.devtools.cloudbuild.v1.CloudBuild" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - CloudBuildClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.CloudBuildGrpcTransport, - Callable[[~.Credentials, type], ~.CloudBuildGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = cloud_build_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=cloud_build_grpc_transport.CloudBuildGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = cloud_build_grpc_transport.CloudBuildGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def create_build( - self, - project_id, - build, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Starts a build with the specified configuration. - - This method returns a long-running ``Operation``, which includes the - build ID. Pass the build ID to ``GetBuild`` to determine the build - status (such as ``SUCCESS`` or ``FAILURE``). - - Example: - >>> from google.cloud.devtools import cloudbuild_v1 - >>> - >>> client = cloudbuild_v1.CloudBuildClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `build`: - >>> build = {} - >>> - >>> response = client.create_build(project_id, build) - - Args: - project_id (str): Required. ID of the project. - build (Union[dict, ~google.cloud.devtools.cloudbuild_v1.types.Build]): Required. Build resource to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.devtools.cloudbuild_v1.types.Build` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.devtools.cloudbuild_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_build" not in self._inner_api_calls: - self._inner_api_calls[ - "create_build" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_build, - default_retry=self._method_configs["CreateBuild"].retry, - default_timeout=self._method_configs["CreateBuild"].timeout, - client_info=self._client_info, - ) - - request = cloudbuild_pb2.CreateBuildRequest(project_id=project_id, build=build) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("project_id", project_id)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_build"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_build( - self, - project_id, - id_, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Returns information about a previously requested build. - - The ``Build`` that is returned includes its status (such as ``SUCCESS``, - ``FAILURE``, or ``WORKING``), and timing information. - - Example: - >>> from google.cloud.devtools import cloudbuild_v1 - >>> - >>> client = cloudbuild_v1.CloudBuildClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `id_`: - >>> id_ = '' - >>> - >>> response = client.get_build(project_id, id_) - - Args: - project_id (str): Required. ID of the project. - id_ (str): Required. ID of the build. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.devtools.cloudbuild_v1.types.Build` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_build" not in self._inner_api_calls: - self._inner_api_calls[ - "get_build" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_build, - default_retry=self._method_configs["GetBuild"].retry, - default_timeout=self._method_configs["GetBuild"].timeout, - client_info=self._client_info, - ) - - request = cloudbuild_pb2.GetBuildRequest(project_id=project_id, id=id_) - return self._inner_api_calls["get_build"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_builds( - self, - project_id, - page_size=None, - filter_=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists previously requested builds. - - Previously requested builds may still be in-progress, or may have finished - successfully or unsuccessfully. - - Example: - >>> from google.cloud.devtools import cloudbuild_v1 - >>> - >>> client = cloudbuild_v1.CloudBuildClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # Iterate over all results - >>> for element in client.list_builds(project_id): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_builds(project_id).pages: - ... for element in page: - ... # process element - ... pass - - Args: - project_id (str): Required. ID of the project. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - filter_ (str): The raw filter text to constrain the results. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.devtools.cloudbuild_v1.types.Build` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_builds" not in self._inner_api_calls: - self._inner_api_calls[ - "list_builds" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_builds, - default_retry=self._method_configs["ListBuilds"].retry, - default_timeout=self._method_configs["ListBuilds"].timeout, - client_info=self._client_info, - ) - - request = cloudbuild_pb2.ListBuildsRequest( - project_id=project_id, page_size=page_size, filter=filter_ - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("project_id", project_id)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_builds"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="builds", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def cancel_build( - self, - project_id, - id_, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Cancels a build in progress. - - Example: - >>> from google.cloud.devtools import cloudbuild_v1 - >>> - >>> client = cloudbuild_v1.CloudBuildClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `id_`: - >>> id_ = '' - >>> - >>> response = client.cancel_build(project_id, id_) - - Args: - project_id (str): Required. ID of the project. - id_ (str): Required. ID of the build. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.devtools.cloudbuild_v1.types.Build` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "cancel_build" not in self._inner_api_calls: - self._inner_api_calls[ - "cancel_build" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.cancel_build, - default_retry=self._method_configs["CancelBuild"].retry, - default_timeout=self._method_configs["CancelBuild"].timeout, - client_info=self._client_info, - ) - - request = cloudbuild_pb2.CancelBuildRequest(project_id=project_id, id=id_) - return self._inner_api_calls["cancel_build"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_build_trigger( - self, - project_id, - trigger, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a new ``BuildTrigger``. - - This API is experimental. - - Example: - >>> from google.cloud.devtools import cloudbuild_v1 - >>> - >>> client = cloudbuild_v1.CloudBuildClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `trigger`: - >>> trigger = {} - >>> - >>> response = client.create_build_trigger(project_id, trigger) - - Args: - project_id (str): Required. ID of the project for which to configure automatic builds. - trigger (Union[dict, ~google.cloud.devtools.cloudbuild_v1.types.BuildTrigger]): Required. ``BuildTrigger`` to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.devtools.cloudbuild_v1.types.BuildTrigger` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.devtools.cloudbuild_v1.types.BuildTrigger` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_build_trigger" not in self._inner_api_calls: - self._inner_api_calls[ - "create_build_trigger" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_build_trigger, - default_retry=self._method_configs["CreateBuildTrigger"].retry, - default_timeout=self._method_configs["CreateBuildTrigger"].timeout, - client_info=self._client_info, - ) - - request = cloudbuild_pb2.CreateBuildTriggerRequest( - project_id=project_id, trigger=trigger - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("project_id", project_id)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_build_trigger"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_build_trigger( - self, - project_id, - trigger_id, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Returns information about a ``BuildTrigger``. - - This API is experimental. - - Example: - >>> from google.cloud.devtools import cloudbuild_v1 - >>> - >>> client = cloudbuild_v1.CloudBuildClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `trigger_id`: - >>> trigger_id = '' - >>> - >>> response = client.get_build_trigger(project_id, trigger_id) - - Args: - project_id (str): Required. ID of the project that owns the trigger. - trigger_id (str): Required. ID of the ``BuildTrigger`` to get. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.devtools.cloudbuild_v1.types.BuildTrigger` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_build_trigger" not in self._inner_api_calls: - self._inner_api_calls[ - "get_build_trigger" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_build_trigger, - default_retry=self._method_configs["GetBuildTrigger"].retry, - default_timeout=self._method_configs["GetBuildTrigger"].timeout, - client_info=self._client_info, - ) - - request = cloudbuild_pb2.GetBuildTriggerRequest( - project_id=project_id, trigger_id=trigger_id - ) - return self._inner_api_calls["get_build_trigger"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_build_triggers( - self, - project_id, - page_size=None, - page_token=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists existing ``BuildTrigger``\ s. - - This API is experimental. - - Example: - >>> from google.cloud.devtools import cloudbuild_v1 - >>> - >>> client = cloudbuild_v1.CloudBuildClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> response = client.list_build_triggers(project_id) - - Args: - project_id (str): Required. ID of the project for which to list BuildTriggers. - page_size (int): Number of results to return in the list. - page_token (str): Token to provide to skip to a particular spot in the list. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.devtools.cloudbuild_v1.types.ListBuildTriggersResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_build_triggers" not in self._inner_api_calls: - self._inner_api_calls[ - "list_build_triggers" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_build_triggers, - default_retry=self._method_configs["ListBuildTriggers"].retry, - default_timeout=self._method_configs["ListBuildTriggers"].timeout, - client_info=self._client_info, - ) - - request = cloudbuild_pb2.ListBuildTriggersRequest( - project_id=project_id, page_size=page_size, page_token=page_token - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("project_id", project_id)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["list_build_triggers"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_build_trigger( - self, - project_id, - trigger_id, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a ``BuildTrigger`` by its project ID and trigger ID. - - This API is experimental. - - Example: - >>> from google.cloud.devtools import cloudbuild_v1 - >>> - >>> client = cloudbuild_v1.CloudBuildClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `trigger_id`: - >>> trigger_id = '' - >>> - >>> client.delete_build_trigger(project_id, trigger_id) - - Args: - project_id (str): Required. ID of the project that owns the trigger. - trigger_id (str): Required. ID of the ``BuildTrigger`` to delete. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_build_trigger" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_build_trigger" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_build_trigger, - default_retry=self._method_configs["DeleteBuildTrigger"].retry, - default_timeout=self._method_configs["DeleteBuildTrigger"].timeout, - client_info=self._client_info, - ) - - request = cloudbuild_pb2.DeleteBuildTriggerRequest( - project_id=project_id, trigger_id=trigger_id - ) - self._inner_api_calls["delete_build_trigger"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_build_trigger( - self, - project_id, - trigger_id, - trigger, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates a ``BuildTrigger`` by its project ID and trigger ID. - - This API is experimental. - - Example: - >>> from google.cloud.devtools import cloudbuild_v1 - >>> - >>> client = cloudbuild_v1.CloudBuildClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `trigger_id`: - >>> trigger_id = '' - >>> - >>> # TODO: Initialize `trigger`: - >>> trigger = {} - >>> - >>> response = client.update_build_trigger(project_id, trigger_id, trigger) - - Args: - project_id (str): Required. ID of the project that owns the trigger. - trigger_id (str): Required. ID of the ``BuildTrigger`` to update. - trigger (Union[dict, ~google.cloud.devtools.cloudbuild_v1.types.BuildTrigger]): Required. ``BuildTrigger`` to update. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.devtools.cloudbuild_v1.types.BuildTrigger` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.devtools.cloudbuild_v1.types.BuildTrigger` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_build_trigger" not in self._inner_api_calls: - self._inner_api_calls[ - "update_build_trigger" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_build_trigger, - default_retry=self._method_configs["UpdateBuildTrigger"].retry, - default_timeout=self._method_configs["UpdateBuildTrigger"].timeout, - client_info=self._client_info, - ) - - request = cloudbuild_pb2.UpdateBuildTriggerRequest( - project_id=project_id, trigger_id=trigger_id, trigger=trigger - ) - return self._inner_api_calls["update_build_trigger"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def run_build_trigger( - self, - project_id, - trigger_id, - source, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Runs a ``BuildTrigger`` at a particular source revision. - - Example: - >>> from google.cloud.devtools import cloudbuild_v1 - >>> - >>> client = cloudbuild_v1.CloudBuildClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `trigger_id`: - >>> trigger_id = '' - >>> - >>> # TODO: Initialize `source`: - >>> source = {} - >>> - >>> response = client.run_build_trigger(project_id, trigger_id, source) - - Args: - project_id (str): Required. ID of the project. - trigger_id (str): Required. ID of the trigger. - source (Union[dict, ~google.cloud.devtools.cloudbuild_v1.types.RepoSource]): Required. Source to build against this trigger. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.devtools.cloudbuild_v1.types.RepoSource` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.devtools.cloudbuild_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "run_build_trigger" not in self._inner_api_calls: - self._inner_api_calls[ - "run_build_trigger" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.run_build_trigger, - default_retry=self._method_configs["RunBuildTrigger"].retry, - default_timeout=self._method_configs["RunBuildTrigger"].timeout, - client_info=self._client_info, - ) - - request = cloudbuild_pb2.RunBuildTriggerRequest( - project_id=project_id, trigger_id=trigger_id, source=source - ) - return self._inner_api_calls["run_build_trigger"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def retry_build( - self, - project_id, - id_, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a new build based on the specified build. - - This method creates a new build using the original build request, which - may or may not result in an identical build. - - For triggered builds: - - - Triggered builds resolve to a precise revision; therefore a retry of - a triggered build will result in a build that uses the same revision. - - For non-triggered builds that specify ``RepoSource``: - - - If the original build built from the tip of a branch, the retried - build will build from the tip of that branch, which may not be the - same revision as the original build. - - If the original build specified a commit sha or revision ID, the - retried build will use the identical source. - - For builds that specify ``StorageSource``: - - - If the original build pulled source from Google Cloud Storage without - specifying the generation of the object, the new build will use the - current object, which may be different from the original build - source. - - If the original build pulled source from Cloud Storage and specified - the generation of the object, the new build will attempt to use the - same object, which may or may not be available depending on the - bucket's lifecycle management settings. - - Example: - >>> from google.cloud.devtools import cloudbuild_v1 - >>> - >>> client = cloudbuild_v1.CloudBuildClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `id_`: - >>> id_ = '' - >>> - >>> response = client.retry_build(project_id, id_) - - Args: - project_id (str): Required. ID of the project. - id_ (str): Required. Build ID of the original build. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.devtools.cloudbuild_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "retry_build" not in self._inner_api_calls: - self._inner_api_calls[ - "retry_build" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.retry_build, - default_retry=self._method_configs["RetryBuild"].retry, - default_timeout=self._method_configs["RetryBuild"].timeout, - client_info=self._client_info, - ) - - request = cloudbuild_pb2.RetryBuildRequest(project_id=project_id, id=id_) - return self._inner_api_calls["retry_build"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_worker_pool( - self, - parent=None, - worker_pool=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a ``WorkerPool`` to run the builds, and returns the new worker - pool. - - This API is experimental. - - Example: - >>> from google.cloud.devtools import cloudbuild_v1 - >>> - >>> client = cloudbuild_v1.CloudBuildClient() - >>> - >>> response = client.create_worker_pool() - - Args: - parent (str): ID of the parent project. - worker_pool (Union[dict, ~google.cloud.devtools.cloudbuild_v1.types.WorkerPool]): ``WorkerPool`` resource to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.devtools.cloudbuild_v1.types.WorkerPool` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.devtools.cloudbuild_v1.types.WorkerPool` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_worker_pool" not in self._inner_api_calls: - self._inner_api_calls[ - "create_worker_pool" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_worker_pool, - default_retry=self._method_configs["CreateWorkerPool"].retry, - default_timeout=self._method_configs["CreateWorkerPool"].timeout, - client_info=self._client_info, - ) - - request = cloudbuild_pb2.CreateWorkerPoolRequest( - parent=parent, worker_pool=worker_pool - ) - return self._inner_api_calls["create_worker_pool"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_worker_pool( - self, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Returns information about a ``WorkerPool``. - - This API is experimental. - - Example: - >>> from google.cloud.devtools import cloudbuild_v1 - >>> - >>> client = cloudbuild_v1.CloudBuildClient() - >>> - >>> response = client.get_worker_pool() - - Args: - name (str): The field will contain name of the resource requested, for example: - "projects/project-1/workerPools/workerpool-name" - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.devtools.cloudbuild_v1.types.WorkerPool` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_worker_pool" not in self._inner_api_calls: - self._inner_api_calls[ - "get_worker_pool" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_worker_pool, - default_retry=self._method_configs["GetWorkerPool"].retry, - default_timeout=self._method_configs["GetWorkerPool"].timeout, - client_info=self._client_info, - ) - - request = cloudbuild_pb2.GetWorkerPoolRequest(name=name) - return self._inner_api_calls["get_worker_pool"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_worker_pool( - self, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a ``WorkerPool`` by its project ID and WorkerPool name. - - This API is experimental. - - Example: - >>> from google.cloud.devtools import cloudbuild_v1 - >>> - >>> client = cloudbuild_v1.CloudBuildClient() - >>> - >>> client.delete_worker_pool() - - Args: - name (str): The field will contain name of the resource requested, for example: - "projects/project-1/workerPools/workerpool-name" - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_worker_pool" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_worker_pool" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_worker_pool, - default_retry=self._method_configs["DeleteWorkerPool"].retry, - default_timeout=self._method_configs["DeleteWorkerPool"].timeout, - client_info=self._client_info, - ) - - request = cloudbuild_pb2.DeleteWorkerPoolRequest(name=name) - self._inner_api_calls["delete_worker_pool"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_worker_pool( - self, - name=None, - worker_pool=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Update a ``WorkerPool``. - - This API is experimental. - - Example: - >>> from google.cloud.devtools import cloudbuild_v1 - >>> - >>> client = cloudbuild_v1.CloudBuildClient() - >>> - >>> response = client.update_worker_pool() - - Args: - name (str): The field will contain name of the resource requested, for example: - "projects/project-1/workerPools/workerpool-name" - worker_pool (Union[dict, ~google.cloud.devtools.cloudbuild_v1.types.WorkerPool]): ``WorkerPool`` resource to update. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.devtools.cloudbuild_v1.types.WorkerPool` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.devtools.cloudbuild_v1.types.WorkerPool` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_worker_pool" not in self._inner_api_calls: - self._inner_api_calls[ - "update_worker_pool" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_worker_pool, - default_retry=self._method_configs["UpdateWorkerPool"].retry, - default_timeout=self._method_configs["UpdateWorkerPool"].timeout, - client_info=self._client_info, - ) - - request = cloudbuild_pb2.UpdateWorkerPoolRequest( - name=name, worker_pool=worker_pool - ) - return self._inner_api_calls["update_worker_pool"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_worker_pools( - self, - parent=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - List project's ``WorkerPool``\ s. - - This API is experimental. - - Example: - >>> from google.cloud.devtools import cloudbuild_v1 - >>> - >>> client = cloudbuild_v1.CloudBuildClient() - >>> - >>> response = client.list_worker_pools() - - Args: - parent (str): ID of the parent project. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.devtools.cloudbuild_v1.types.ListWorkerPoolsResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_worker_pools" not in self._inner_api_calls: - self._inner_api_calls[ - "list_worker_pools" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_worker_pools, - default_retry=self._method_configs["ListWorkerPools"].retry, - default_timeout=self._method_configs["ListWorkerPools"].timeout, - client_info=self._client_info, - ) - - request = cloudbuild_pb2.ListWorkerPoolsRequest(parent=parent) - return self._inner_api_calls["list_worker_pools"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/cloud_build_client_config.py b/cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/cloud_build_client_config.py deleted file mode 100644 index 6f67ef28527e..000000000000 --- a/cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/cloud_build_client_config.py +++ /dev/null @@ -1,103 +0,0 @@ -config = { - "interfaces": { - "google.devtools.cloudbuild.v1.CloudBuild": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "CreateBuild": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetBuild": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListBuilds": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CancelBuild": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "CreateBuildTrigger": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetBuildTrigger": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListBuildTriggers": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteBuildTrigger": { - "timeout_millis": 5000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateBuildTrigger": { - "timeout_millis": 5000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "RunBuildTrigger": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "RetryBuild": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "CreateWorkerPool": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetWorkerPool": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteWorkerPool": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateWorkerPool": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListWorkerPools": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/enums.py b/cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/enums.py deleted file mode 100644 index 4776189a05f1..000000000000 --- a/cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/enums.py +++ /dev/null @@ -1,185 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class Build(object): - class Status(enum.IntEnum): - """ - Possible status of a build or build step. - - Attributes: - STATUS_UNKNOWN (int): Status of the build is unknown. - QUEUED (int): Build or step is queued; work has not yet begun. - WORKING (int): Build or step is being executed. - SUCCESS (int): Build or step finished successfully. - FAILURE (int): Build or step failed to complete successfully. - INTERNAL_ERROR (int): Build or step failed due to an internal cause. - TIMEOUT (int): Build or step took longer than was allowed. - CANCELLED (int): Build or step was canceled by a user. - """ - - STATUS_UNKNOWN = 0 - QUEUED = 1 - WORKING = 2 - SUCCESS = 3 - FAILURE = 4 - INTERNAL_ERROR = 5 - TIMEOUT = 6 - CANCELLED = 7 - - -class BuildOptions(object): - class LogStreamingOption(enum.IntEnum): - """ - Specifies the behavior when writing build logs to Google Cloud Storage. - - Attributes: - STREAM_DEFAULT (int): Service may automatically determine build log streaming behavior. - STREAM_ON (int): Build logs should be streamed to Google Cloud Storage. - STREAM_OFF (int): Build logs should not be streamed to Google Cloud Storage; they will be - written when the build is completed. - """ - - STREAM_DEFAULT = 0 - STREAM_ON = 1 - STREAM_OFF = 2 - - class LoggingMode(enum.IntEnum): - """ - Specifies the logging mode. - - Attributes: - LOGGING_UNSPECIFIED (int): The service determines the logging mode. The default is ``LEGACY``. Do - not rely on the default logging behavior as it may change in the future. - LEGACY (int): Stackdriver logging and Cloud Storage logging are enabled. - GCS_ONLY (int): Only Cloud Storage logging is enabled. - """ - - LOGGING_UNSPECIFIED = 0 - LEGACY = 1 - GCS_ONLY = 2 - - class MachineType(enum.IntEnum): - """ - Supported VM sizes. - - Attributes: - UNSPECIFIED (int): Standard machine type. - N1_HIGHCPU_8 (int): Highcpu machine with 8 CPUs. - N1_HIGHCPU_32 (int): Highcpu machine with 32 CPUs. - """ - - UNSPECIFIED = 0 - N1_HIGHCPU_8 = 1 - N1_HIGHCPU_32 = 2 - - class SubstitutionOption(enum.IntEnum): - """ - Specifies the behavior when there is an error in the substitution checks. - - Attributes: - MUST_MATCH (int): Fails the build if error in substitutions checks, like missing - a substitution in the template or in the map. - ALLOW_LOOSE (int): Do not fail the build if error in substitutions checks. - """ - - MUST_MATCH = 0 - ALLOW_LOOSE = 1 - - class VerifyOption(enum.IntEnum): - """ - Specifies the manner in which the build should be verified, if at all. - - Attributes: - NOT_VERIFIED (int): Not a verifiable build. (default) - VERIFIED (int): Verified build. - """ - - NOT_VERIFIED = 0 - VERIFIED = 1 - - -class Hash(object): - class HashType(enum.IntEnum): - """ - Specifies the hash algorithm, if any. - - Attributes: - NONE (int): No hash requested. - SHA256 (int): Use a sha256 hash. - MD5 (int): Use a md5 hash. - """ - - NONE = 0 - SHA256 = 1 - MD5 = 2 - - -class PullRequestFilter(object): - class CommentControl(enum.IntEnum): - """ - Controls behavior of Pull Request comments. - - Attributes: - COMMENTS_DISABLED (int): Do not require comments on Pull Requests before builds are triggered. - COMMENTS_ENABLED (int): Enforce that repository owners or collaborators must comment on Pull - Requests before builds are triggered. - """ - - COMMENTS_DISABLED = 0 - COMMENTS_ENABLED = 1 - - -class WorkerPool(object): - class Region(enum.IntEnum): - """ - Supported GCP regions to create the ``WorkerPool``. - - Attributes: - REGION_UNSPECIFIED (int): no region - US_CENTRAL1 (int): us-central1 region - US_WEST1 (int): us-west1 region - US_EAST1 (int): us-east1 region - US_EAST4 (int): us-east4 region - """ - - REGION_UNSPECIFIED = 0 - US_CENTRAL1 = 1 - US_WEST1 = 2 - US_EAST1 = 3 - US_EAST4 = 4 - - class Status(enum.IntEnum): - """ - ``WorkerPool`` status - - Attributes: - STATUS_UNSPECIFIED (int): Status of the ``WorkerPool`` is unknown. - CREATING (int): ``WorkerPool`` is being created. - RUNNING (int): ``WorkerPool`` is running. - DELETING (int): ``WorkerPool`` is being deleted: cancelling builds and draining workers. - DELETED (int): ``WorkerPool`` is deleted. - """ - - STATUS_UNSPECIFIED = 0 - CREATING = 1 - RUNNING = 2 - DELETING = 3 - DELETED = 4 diff --git a/cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/transports/__init__.py b/cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/transports/cloud_build_grpc_transport.py b/cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/transports/cloud_build_grpc_transport.py deleted file mode 100644 index 632d895cd565..000000000000 --- a/cloudbuild/google/cloud/devtools/cloudbuild_v1/gapic/transports/cloud_build_grpc_transport.py +++ /dev/null @@ -1,372 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers - -from google.cloud.devtools.cloudbuild_v1.proto import cloudbuild_pb2_grpc - - -class CloudBuildGrpcTransport(object): - """gRPC transport class providing stubs for - google.devtools.cloudbuild.v1 CloudBuild API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="cloudbuild.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = {"cloud_build_stub": cloudbuild_pb2_grpc.CloudBuildStub(channel)} - - @classmethod - def create_channel( - cls, address="cloudbuild.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def create_build(self): - """Return the gRPC stub for :meth:`CloudBuildClient.create_build`. - - Starts a build with the specified configuration. - - This method returns a long-running ``Operation``, which includes the - build ID. Pass the build ID to ``GetBuild`` to determine the build - status (such as ``SUCCESS`` or ``FAILURE``). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_build_stub"].CreateBuild - - @property - def get_build(self): - """Return the gRPC stub for :meth:`CloudBuildClient.get_build`. - - Returns information about a previously requested build. - - The ``Build`` that is returned includes its status (such as ``SUCCESS``, - ``FAILURE``, or ``WORKING``), and timing information. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_build_stub"].GetBuild - - @property - def list_builds(self): - """Return the gRPC stub for :meth:`CloudBuildClient.list_builds`. - - Lists previously requested builds. - - Previously requested builds may still be in-progress, or may have finished - successfully or unsuccessfully. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_build_stub"].ListBuilds - - @property - def cancel_build(self): - """Return the gRPC stub for :meth:`CloudBuildClient.cancel_build`. - - Cancels a build in progress. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_build_stub"].CancelBuild - - @property - def create_build_trigger(self): - """Return the gRPC stub for :meth:`CloudBuildClient.create_build_trigger`. - - Creates a new ``BuildTrigger``. - - This API is experimental. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_build_stub"].CreateBuildTrigger - - @property - def get_build_trigger(self): - """Return the gRPC stub for :meth:`CloudBuildClient.get_build_trigger`. - - Returns information about a ``BuildTrigger``. - - This API is experimental. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_build_stub"].GetBuildTrigger - - @property - def list_build_triggers(self): - """Return the gRPC stub for :meth:`CloudBuildClient.list_build_triggers`. - - Lists existing ``BuildTrigger``\ s. - - This API is experimental. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_build_stub"].ListBuildTriggers - - @property - def delete_build_trigger(self): - """Return the gRPC stub for :meth:`CloudBuildClient.delete_build_trigger`. - - Deletes a ``BuildTrigger`` by its project ID and trigger ID. - - This API is experimental. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_build_stub"].DeleteBuildTrigger - - @property - def update_build_trigger(self): - """Return the gRPC stub for :meth:`CloudBuildClient.update_build_trigger`. - - Updates a ``BuildTrigger`` by its project ID and trigger ID. - - This API is experimental. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_build_stub"].UpdateBuildTrigger - - @property - def run_build_trigger(self): - """Return the gRPC stub for :meth:`CloudBuildClient.run_build_trigger`. - - Runs a ``BuildTrigger`` at a particular source revision. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_build_stub"].RunBuildTrigger - - @property - def retry_build(self): - """Return the gRPC stub for :meth:`CloudBuildClient.retry_build`. - - Creates a new build based on the specified build. - - This method creates a new build using the original build request, which - may or may not result in an identical build. - - For triggered builds: - - - Triggered builds resolve to a precise revision; therefore a retry of - a triggered build will result in a build that uses the same revision. - - For non-triggered builds that specify ``RepoSource``: - - - If the original build built from the tip of a branch, the retried - build will build from the tip of that branch, which may not be the - same revision as the original build. - - If the original build specified a commit sha or revision ID, the - retried build will use the identical source. - - For builds that specify ``StorageSource``: - - - If the original build pulled source from Google Cloud Storage without - specifying the generation of the object, the new build will use the - current object, which may be different from the original build - source. - - If the original build pulled source from Cloud Storage and specified - the generation of the object, the new build will attempt to use the - same object, which may or may not be available depending on the - bucket's lifecycle management settings. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_build_stub"].RetryBuild - - @property - def create_worker_pool(self): - """Return the gRPC stub for :meth:`CloudBuildClient.create_worker_pool`. - - Creates a ``WorkerPool`` to run the builds, and returns the new worker - pool. - - This API is experimental. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_build_stub"].CreateWorkerPool - - @property - def get_worker_pool(self): - """Return the gRPC stub for :meth:`CloudBuildClient.get_worker_pool`. - - Returns information about a ``WorkerPool``. - - This API is experimental. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_build_stub"].GetWorkerPool - - @property - def delete_worker_pool(self): - """Return the gRPC stub for :meth:`CloudBuildClient.delete_worker_pool`. - - Deletes a ``WorkerPool`` by its project ID and WorkerPool name. - - This API is experimental. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_build_stub"].DeleteWorkerPool - - @property - def update_worker_pool(self): - """Return the gRPC stub for :meth:`CloudBuildClient.update_worker_pool`. - - Update a ``WorkerPool``. - - This API is experimental. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_build_stub"].UpdateWorkerPool - - @property - def list_worker_pools(self): - """Return the gRPC stub for :meth:`CloudBuildClient.list_worker_pools`. - - List project's ``WorkerPool``\ s. - - This API is experimental. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_build_stub"].ListWorkerPools diff --git a/cloudbuild/google/cloud/devtools/cloudbuild_v1/proto/__init__.py b/cloudbuild/google/cloud/devtools/cloudbuild_v1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/cloudbuild/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild.proto b/cloudbuild/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild.proto deleted file mode 100644 index 1cf045394e33..000000000000 --- a/cloudbuild/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild.proto +++ /dev/null @@ -1,1304 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.devtools.cloudbuild.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/devtools/cloudbuild/v1;cloudbuild"; -option java_multiple_files = true; -option java_package = "com.google.cloudbuild.v1"; -option objc_class_prefix = "GCB"; - -// Creates and manages builds on Google Cloud Platform. -// -// The main concept used by this API is a `Build`, which describes the location -// of the source to build, how to build the source, and where to store the -// built artifacts, if any. -// -// A user can list previously-requested builds or get builds by their ID to -// determine the status of the build. -service CloudBuild { - option (google.api.default_host) = "cloudbuild.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Starts a build with the specified configuration. - // - // This method returns a long-running `Operation`, which includes the build - // ID. Pass the build ID to `GetBuild` to determine the build status (such as - // `SUCCESS` or `FAILURE`). - rpc CreateBuild(CreateBuildRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/projects/{project_id}/builds" - body: "build" - }; - option (google.api.method_signature) = "project_id,build"; - option (google.longrunning.operation_info) = { - response_type: "Build" - metadata_type: "BuildOperationMetadata" - }; - } - - // Returns information about a previously requested build. - // - // The `Build` that is returned includes its status (such as `SUCCESS`, - // `FAILURE`, or `WORKING`), and timing information. - rpc GetBuild(GetBuildRequest) returns (Build) { - option (google.api.http) = { - get: "/v1/projects/{project_id}/builds/{id}" - }; - option (google.api.method_signature) = "project_id,id"; - } - - // Lists previously requested builds. - // - // Previously requested builds may still be in-progress, or may have finished - // successfully or unsuccessfully. - rpc ListBuilds(ListBuildsRequest) returns (ListBuildsResponse) { - option (google.api.http) = { - get: "/v1/projects/{project_id}/builds" - }; - option (google.api.method_signature) = "project_id,filter"; - } - - // Cancels a build in progress. - rpc CancelBuild(CancelBuildRequest) returns (Build) { - option (google.api.http) = { - post: "/v1/projects/{project_id}/builds/{id}:cancel" - body: "*" - }; - option (google.api.method_signature) = "project_id,id"; - } - - // Creates a new build based on the specified build. - // - // This method creates a new build using the original build request, which may - // or may not result in an identical build. - // - // For triggered builds: - // - // * Triggered builds resolve to a precise revision; therefore a retry of a - // triggered build will result in a build that uses the same revision. - // - // For non-triggered builds that specify `RepoSource`: - // - // * If the original build built from the tip of a branch, the retried build - // will build from the tip of that branch, which may not be the same revision - // as the original build. - // * If the original build specified a commit sha or revision ID, the retried - // build will use the identical source. - // - // For builds that specify `StorageSource`: - // - // * If the original build pulled source from Google Cloud Storage without - // specifying the generation of the object, the new build will use the current - // object, which may be different from the original build source. - // * If the original build pulled source from Cloud Storage and specified the - // generation of the object, the new build will attempt to use the same - // object, which may or may not be available depending on the bucket's - // lifecycle management settings. - rpc RetryBuild(RetryBuildRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/projects/{project_id}/builds/{id}:retry" - body: "*" - }; - option (google.api.method_signature) = "project_id,id"; - option (google.longrunning.operation_info) = { - response_type: "Build" - metadata_type: "BuildOperationMetadata" - }; - } - - // Creates a new `BuildTrigger`. - // - // This API is experimental. - rpc CreateBuildTrigger(CreateBuildTriggerRequest) returns (BuildTrigger) { - option (google.api.http) = { - post: "/v1/projects/{project_id}/triggers" - body: "trigger" - }; - option (google.api.method_signature) = "project_id,trigger"; - } - - // Returns information about a `BuildTrigger`. - // - // This API is experimental. - rpc GetBuildTrigger(GetBuildTriggerRequest) returns (BuildTrigger) { - option (google.api.http) = { - get: "/v1/projects/{project_id}/triggers/{trigger_id}" - }; - option (google.api.method_signature) = "project_id,trigger_id"; - } - - // Lists existing `BuildTrigger`s. - // - // This API is experimental. - rpc ListBuildTriggers(ListBuildTriggersRequest) - returns (ListBuildTriggersResponse) { - option (google.api.http) = { - get: "/v1/projects/{project_id}/triggers" - }; - option (google.api.method_signature) = "project_id"; - } - - // Deletes a `BuildTrigger` by its project ID and trigger ID. - // - // This API is experimental. - rpc DeleteBuildTrigger(DeleteBuildTriggerRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/projects/{project_id}/triggers/{trigger_id}" - }; - option (google.api.method_signature) = "project_id,trigger_id"; - } - - // Updates a `BuildTrigger` by its project ID and trigger ID. - // - // This API is experimental. - rpc UpdateBuildTrigger(UpdateBuildTriggerRequest) returns (BuildTrigger) { - option (google.api.http) = { - patch: "/v1/projects/{project_id}/triggers/{trigger_id}" - body: "trigger" - }; - option (google.api.method_signature) = "project_id,trigger_id,trigger"; - } - - // Runs a `BuildTrigger` at a particular source revision. - rpc RunBuildTrigger(RunBuildTriggerRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/projects/{project_id}/triggers/{trigger_id}:run" - body: "source" - }; - option (google.api.method_signature) = "project_id,trigger_id,source"; - option (google.longrunning.operation_info) = { - response_type: "Build" - metadata_type: "BuildOperationMetadata" - }; - } - - // Creates a `WorkerPool` to run the builds, and returns the new worker pool. - // - // This API is experimental. - rpc CreateWorkerPool(CreateWorkerPoolRequest) returns (WorkerPool) {} - - // Returns information about a `WorkerPool`. - // - // This API is experimental. - rpc GetWorkerPool(GetWorkerPoolRequest) returns (WorkerPool) {} - - // Deletes a `WorkerPool` by its project ID and WorkerPool name. - // - // This API is experimental. - rpc DeleteWorkerPool(DeleteWorkerPoolRequest) - returns (google.protobuf.Empty) {} - - // Update a `WorkerPool`. - // - // This API is experimental. - rpc UpdateWorkerPool(UpdateWorkerPoolRequest) returns (WorkerPool) {} - - // List project's `WorkerPool`s. - // - // This API is experimental. - rpc ListWorkerPools(ListWorkerPoolsRequest) - returns (ListWorkerPoolsResponse) {} -} - -// Specifies a build to retry. -message RetryBuildRequest { - // Required. ID of the project. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Build ID of the original build. - string id = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Specifies a build trigger to run and the source to use. -message RunBuildTriggerRequest { - // Required. ID of the project. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. ID of the trigger. - string trigger_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Source to build against this trigger. - RepoSource source = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Location of the source in an archive file in Google Cloud Storage. -message StorageSource { - // Google Cloud Storage bucket containing the source (see - // [Bucket Name - // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - string bucket = 1; - - // Google Cloud Storage object containing the source. - // - // This object must be a gzipped archive file (`.tar.gz`) containing source to - // build. - string object = 2; - - // Google Cloud Storage generation for the object. If the generation is - // omitted, the latest generation will be used. - int64 generation = 3; -} - -// Location of the source in a Google Cloud Source Repository. -message RepoSource { - // ID of the project that owns the Cloud Source Repository. If omitted, the - // project ID requesting the build is assumed. - string project_id = 1; - - // Name of the Cloud Source Repository. If omitted, the name "default" is - // assumed. - string repo_name = 2; - - // A revision within the Cloud Source Repository must be specified in - // one of these ways. - oneof revision { - // Regex matching branches to build. - // - // The syntax of the regular expressions accepted is the syntax accepted by - // RE2 and described at https://github.com/google/re2/wiki/Syntax - string branch_name = 3; - - // Regex matching tags to build. - // - // The syntax of the regular expressions accepted is the syntax accepted by - // RE2 and described at https://github.com/google/re2/wiki/Syntax - string tag_name = 4; - - // Explicit commit SHA to build. - string commit_sha = 5; - } - - // Directory, relative to the source root, in which to run the build. - // - // This must be a relative path. If a step's `dir` is specified and is an - // absolute path, this value is ignored for that step's execution. - string dir = 7; -} - -// Location of the source in a supported storage service. -message Source { - // Location of source. - oneof source { - // If provided, get the source from this location in Google Cloud Storage. - StorageSource storage_source = 2; - - // If provided, get the source from this location in a Cloud Source - // Repository. - RepoSource repo_source = 3; - } -} - -// An image built by the pipeline. -message BuiltImage { - // Name used to push the container image to Google Container Registry, as - // presented to `docker push`. - string name = 1; - - // Docker Registry 2.0 digest. - string digest = 3; - - // Output only. Stores timing information for pushing the specified image. - TimeSpan push_timing = 4; -} - -// A step in the build pipeline. -message BuildStep { - // Required. The name of the container image that will run this particular - // build step. - // - // If the image is available in the host's Docker daemon's cache, it - // will be run directly. If not, the host will attempt to pull the image - // first, using the builder service account's credentials if necessary. - // - // The Docker daemon's cache will already have the latest versions of all of - // the officially supported build steps - // ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)). - // The Docker daemon will also have cached many of the layers for some popular - // images, like "ubuntu", "debian", but they will be refreshed at the time you - // attempt to use them. - // - // If you built an image in a previous build step, it will be stored in the - // host's Docker daemon's cache and is available to use as the name for a - // later build step. - string name = 1; - - // A list of environment variable definitions to be used when running a step. - // - // The elements are of the form "KEY=VALUE" for the environment variable "KEY" - // being given the value "VALUE". - repeated string env = 2; - - // A list of arguments that will be presented to the step when it is started. - // - // If the image used to run the step's container has an entrypoint, the `args` - // are used as arguments to that entrypoint. If the image does not define - // an entrypoint, the first element in args is used as the entrypoint, - // and the remainder will be used as arguments. - repeated string args = 3; - - // Working directory to use when running this step's container. - // - // If this value is a relative path, it is relative to the build's working - // directory. If this value is absolute, it may be outside the build's working - // directory, in which case the contents of the path may not be persisted - // across build step executions, unless a `volume` for that path is specified. - // - // If the build specifies a `RepoSource` with `dir` and a step with a `dir`, - // which specifies an absolute path, the `RepoSource` `dir` is ignored for - // the step's execution. - string dir = 4; - - // Unique identifier for this build step, used in `wait_for` to - // reference this build step as a dependency. - string id = 5; - - // The ID(s) of the step(s) that this build step depends on. - // This build step will not start until all the build steps in `wait_for` - // have completed successfully. If `wait_for` is empty, this build step will - // start when all previous build steps in the `Build.Steps` list have - // completed successfully. - repeated string wait_for = 6; - - // Entrypoint to be used instead of the build step image's default entrypoint. - // If unset, the image's default entrypoint is used. - string entrypoint = 7; - - // A list of environment variables which are encrypted using a Cloud Key - // Management Service crypto key. These values must be specified in the - // build's `Secret`. - repeated string secret_env = 8; - - // List of volumes to mount into the build step. - // - // Each volume is created as an empty volume prior to execution of the - // build step. Upon completion of the build, volumes and their contents are - // discarded. - // - // Using a named volume in only one step is not valid as it is indicative - // of a build request with an incorrect configuration. - repeated Volume volumes = 9; - - // Output only. Stores timing information for executing this build step. - TimeSpan timing = 10; - - // Output only. Stores timing information for pulling this build step's - // builder image only. - TimeSpan pull_timing = 13; - - // Time limit for executing this build step. If not defined, the step has no - // time limit and will be allowed to continue to run until either it completes - // or the build itself times out. - google.protobuf.Duration timeout = 11; - - // Output only. Status of the build step. At this time, build step status is - // only updated on build completion; step status is not updated in real-time - // as the build progresses. - Build.Status status = 12; -} - -// Volume describes a Docker container volume which is mounted into build steps -// in order to persist files across build step execution. -message Volume { - // Name of the volume to mount. - // - // Volume names must be unique per build step and must be valid names for - // Docker volumes. Each named volume must be used by at least two build steps. - string name = 1; - - // Path at which to mount the volume. - // - // Paths must be absolute and cannot conflict with other volume paths on the - // same build step or with certain reserved volume paths. - string path = 2; -} - -// Artifacts created by the build pipeline. -message Results { - // Container images that were built as a part of the build. - repeated BuiltImage images = 2; - - // List of build step digests, in the order corresponding to build step - // indices. - repeated string build_step_images = 3; - - // Path to the artifact manifest. Only populated when artifacts are uploaded. - string artifact_manifest = 4; - - // Number of artifacts uploaded. Only populated when artifacts are uploaded. - int64 num_artifacts = 5; - - // List of build step outputs, produced by builder images, in the order - // corresponding to build step indices. - // - // [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders) - // can produce this output by writing to `$BUILDER_OUTPUT/output`. - // Only the first 4KB of data is stored. - repeated bytes build_step_outputs = 6; - - // Time to push all non-container artifacts. - TimeSpan artifact_timing = 7; -} - -// An artifact that was uploaded during a build. This -// is a single record in the artifact manifest JSON file. -message ArtifactResult { - // The path of an artifact in a Google Cloud Storage bucket, with the - // generation number. For example, - // `gs://mybucket/path/to/output.jar#generation`. - string location = 1; - - // The file hash of the artifact. - repeated FileHashes file_hash = 2; -} - -// A build resource in the Cloud Build API. -// -// At a high level, a `Build` describes where to find source code, how to build -// it (for example, the builder image to run on the source), and where to store -// the built artifacts. -// -// Fields can include the following variables, which will be expanded when the -// build is created: -// -// - $PROJECT_ID: the project ID of the build. -// - $BUILD_ID: the autogenerated ID of the build. -// - $REPO_NAME: the source repository name specified by RepoSource. -// - $BRANCH_NAME: the branch name specified by RepoSource. -// - $TAG_NAME: the tag name specified by RepoSource. -// - $REVISION_ID or $COMMIT_SHA: the commit SHA specified by RepoSource or -// resolved from the specified branch or tag. -// - $SHORT_SHA: first 7 characters of $REVISION_ID or $COMMIT_SHA. -message Build { - // Possible status of a build or build step. - enum Status { - // Status of the build is unknown. - STATUS_UNKNOWN = 0; - - // Build or step is queued; work has not yet begun. - QUEUED = 1; - - // Build or step is being executed. - WORKING = 2; - - // Build or step finished successfully. - SUCCESS = 3; - - // Build or step failed to complete successfully. - FAILURE = 4; - - // Build or step failed due to an internal cause. - INTERNAL_ERROR = 5; - - // Build or step took longer than was allowed. - TIMEOUT = 6; - - // Build or step was canceled by a user. - CANCELLED = 7; - } - - // Output only. Unique identifier of the build. - string id = 1; - - // Output only. ID of the project. - string project_id = 16; - - // Output only. Status of the build. - Status status = 2; - - // Output only. Customer-readable message about the current status. - string status_detail = 24; - - // The location of the source files to build. - Source source = 3; - - // Required. The operations to be performed on the workspace. - repeated BuildStep steps = 11; - - // Output only. Results of the build. - Results results = 10; - - // Output only. Time at which the request to create the build was received. - google.protobuf.Timestamp create_time = 6; - - // Output only. Time at which execution of the build was started. - google.protobuf.Timestamp start_time = 7; - - // Output only. Time at which execution of the build was finished. - // - // The difference between finish_time and start_time is the duration of the - // build's execution. - google.protobuf.Timestamp finish_time = 8; - - // Amount of time that this build should be allowed to run, to second - // granularity. If this amount of time elapses, work on the build will cease - // and the build status will be `TIMEOUT`. - // - // Default time is ten minutes. - google.protobuf.Duration timeout = 12; - - // A list of images to be pushed upon the successful completion of all build - // steps. - // - // The images are pushed using the builder service account's credentials. - // - // The digests of the pushed images will be stored in the `Build` resource's - // results field. - // - // If any of the images fail to be pushed, the build status is marked - // `FAILURE`. - repeated string images = 13; - - // Artifacts produced by the build that should be uploaded upon - // successful completion of all build steps. - Artifacts artifacts = 37; - - // Google Cloud Storage bucket where logs should be written (see - // [Bucket Name - // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - // Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`. - string logs_bucket = 19; - - // Output only. A permanent fixed identifier for source. - SourceProvenance source_provenance = 21; - - // Output only. The ID of the `BuildTrigger` that triggered this build, if it - // was triggered automatically. - string build_trigger_id = 22; - - // Special options for this build. - BuildOptions options = 23; - - // Output only. URL to logs for this build in Google Cloud Console. - string log_url = 25; - - // Substitutions data for `Build` resource. - map substitutions = 29; - - // Tags for annotation of a `Build`. These are not docker tags. - repeated string tags = 31; - - // Secrets to decrypt using Cloud Key Management Service. - repeated Secret secrets = 32; - - // Output only. Stores timing information for phases of the build. Valid keys - // are: - // - // * BUILD: time to execute all build steps - // * PUSH: time to push all specified images. - // * FETCHSOURCE: time to fetch source. - // - // If the build does not specify source or images, - // these keys will not be included. - map timing = 33; -} - -// Artifacts produced by a build that should be uploaded upon -// successful completion of all build steps. -message Artifacts { - // Files in the workspace to upload to Cloud Storage upon successful - // completion of all build steps. - message ArtifactObjects { - // Cloud Storage bucket and optional object path, in the form - // "gs://bucket/path/to/somewhere/". (see [Bucket Name - // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - // - // Files in the workspace matching any path pattern will be uploaded to - // Cloud Storage with this location as a prefix. - string location = 1; - - // Path globs used to match files in the build's workspace. - repeated string paths = 2; - - // Output only. Stores timing information for pushing all artifact objects. - TimeSpan timing = 3; - } - - // A list of images to be pushed upon the successful completion of all build - // steps. - // - // The images will be pushed using the builder service account's credentials. - // - // The digests of the pushed images will be stored in the Build resource's - // results field. - // - // If any of the images fail to be pushed, the build is marked FAILURE. - repeated string images = 1; - - // A list of objects to be uploaded to Cloud Storage upon successful - // completion of all build steps. - // - // Files in the workspace matching specified paths globs will be uploaded to - // the specified Cloud Storage location using the builder service account's - // credentials. - // - // The location and generation of the uploaded objects will be stored in the - // Build resource's results field. - // - // If any objects fail to be pushed, the build is marked FAILURE. - ArtifactObjects objects = 2; -} - -// Start and end times for a build execution phase. -message TimeSpan { - // Start of time span. - google.protobuf.Timestamp start_time = 1; - - // End of time span. - google.protobuf.Timestamp end_time = 2; -} - -// Metadata for build operations. -message BuildOperationMetadata { - // The build that the operation is tracking. - Build build = 1; -} - -// Provenance of the source. Ways to find the original source, or verify that -// some source was used for this build. -message SourceProvenance { - // A copy of the build's `source.storage_source`, if exists, with any - // generations resolved. - StorageSource resolved_storage_source = 3; - - // A copy of the build's `source.repo_source`, if exists, with any - // revisions resolved. - RepoSource resolved_repo_source = 6; - - // Output only. Hash(es) of the build source, which can be used to verify that - // the original source integrity was maintained in the build. Note that - // `FileHashes` will only be populated if `BuildOptions` has requested a - // `SourceProvenanceHash`. - // - // The keys to this map are file paths used as build source and the values - // contain the hash values for those files. - // - // If the build source came in a single package such as a gzipped tarfile - // (`.tar.gz`), the `FileHash` will be for the single path to that file. - map file_hashes = 4; -} - -// Container message for hashes of byte content of files, used in -// SourceProvenance messages to verify integrity of source input to the build. -message FileHashes { - // Collection of file hashes. - repeated Hash file_hash = 1; -} - -// Container message for hash values. -message Hash { - // Specifies the hash algorithm, if any. - enum HashType { - // No hash requested. - NONE = 0; - - // Use a sha256 hash. - SHA256 = 1; - - // Use a md5 hash. - MD5 = 2; - } - - // The type of hash that was performed. - HashType type = 1; - - // The hash value. - bytes value = 2; -} - -// Pairs a set of secret environment variables containing encrypted -// values with the Cloud KMS key to use to decrypt the value. -message Secret { - // Cloud KMS key name to use to decrypt these envs. - string kms_key_name = 1; - - // Map of environment variable name to its encrypted value. - // - // Secret environment variables must be unique across all of a build's - // secrets, and must be used by at least one build step. Values can be at most - // 64 KB in size. There can be at most 100 secret values across all of a - // build's secrets. - map secret_env = 3; -} - -// Request to create a new build. -message CreateBuildRequest { - // Required. ID of the project. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Build resource to create. - Build build = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request to get a build. -message GetBuildRequest { - // Required. ID of the project. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. ID of the build. - string id = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request to list builds. -message ListBuildsRequest { - // Required. ID of the project. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Number of results to return in the list. - int32 page_size = 2; - - // Token to provide to skip to a particular spot in the list. - string page_token = 3; - - // The raw filter text to constrain the results. - string filter = 8; -} - -// Response including listed builds. -message ListBuildsResponse { - // Builds will be sorted by `create_time`, descending. - repeated Build builds = 1; - - // Token to receive the next page of results. - string next_page_token = 2; -} - -// Request to cancel an ongoing build. -message CancelBuildRequest { - // Required. ID of the project. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. ID of the build. - string id = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Configuration for an automated build in response to source repository -// changes. -message BuildTrigger { - // Output only. Unique identifier of the trigger. - string id = 1; - - // Human-readable description of this trigger. - string description = 10; - - // User assigned name of the trigger. Must be unique within the project. - string name = 21; - - // Tags for annotation of a `BuildTrigger` - repeated string tags = 19; - - // Template describing the types of source changes to trigger a build. - // - // Branch and tag names in trigger templates are interpreted as regular - // expressions. Any branch or tag change that matches that regular expression - // will trigger a build. - // - // Mutually exclusive with `github`. - RepoSource trigger_template = 7; - - // GitHubEventsConfig describes the configuration of a trigger that creates - // a build whenever a GitHub event is received. - // - // Mutually exclusive with `trigger_template`. - GitHubEventsConfig github = 13; - - // Template describing the Build request to make when the trigger is matched. - oneof build_template { - // Contents of the build template. - Build build = 4; - - // Path, from the source root, to a file whose contents is used for the - // template. - string filename = 8; - } - - // Output only. Time when the trigger was created. - google.protobuf.Timestamp create_time = 5; - - // If true, the trigger will never result in a build. - bool disabled = 9; - - // Substitutions data for Build resource. - map substitutions = 11; - - // ignored_files and included_files are file glob matches using - // http://godoc/pkg/path/filepath#Match extended with support for "**". - // - // If ignored_files and changed files are both empty, then they are - // not used to determine whether or not to trigger a build. - // - // If ignored_files is not empty, then we ignore any files that match - // any of the ignored_file globs. If the change has no files that are - // outside of the ignored_files globs, then we do not trigger a build. - repeated string ignored_files = 15; - - // If any of the files altered in the commit pass the ignored_files - // filter and included_files is empty, then as far as this filter is - // concerned, we should trigger the build. - // - // If any of the files altered in the commit pass the ignored_files - // filter and included_files is not empty, then we make sure that at - // least one of those files matches a included_files glob. If not, - // then we do not trigger a build. - repeated string included_files = 16; -} - -// GitHubEventsConfig describes the configuration of a trigger that creates a -// build whenever a GitHub event is received. -// -// This message is experimental. -message GitHubEventsConfig { - // The installationID that emits the GitHub event. - int64 installation_id = 1 [deprecated = true]; - - // Owner of the repository. For example: The owner for - // https://github.com/googlecloudplatform/cloud-builders is - // "googlecloudplatform". - string owner = 6; - - // Name of the repository. For example: The name for - // https://github.com/googlecloudplatform/cloud-builders is "cloud-builders". - string name = 7; - - // Filter describing the types of events to trigger a build. - // Currently supported event types: push, pull_request. - oneof event { - // filter to match changes in pull requests. - PullRequestFilter pull_request = 4; - - // filter to match changes in refs like branches, tags. - PushFilter push = 5; - } -} - -// PullRequestFilter contains filter properties for matching GitHub Pull -// Requests. -message PullRequestFilter { - // Controls behavior of Pull Request comments. - enum CommentControl { - // Do not require comments on Pull Requests before builds are triggered. - COMMENTS_DISABLED = 0; - - // Enforce that repository owners or collaborators must comment on Pull - // Requests before builds are triggered. - COMMENTS_ENABLED = 1; - } - - // Target refs to match. - // A target ref is the git reference where the pull request will be applied. - oneof git_ref { - // Regex of branches to match. - // - // The syntax of the regular expressions accepted is the syntax accepted by - // RE2 and described at https://github.com/google/re2/wiki/Syntax - string branch = 2; - } - - // Whether to block builds on a "/gcbrun" comment from a repository owner or - // collaborator. - CommentControl comment_control = 5; -} - -// Push contains filter properties for matching GitHub git pushes. -message PushFilter { - // Modified refs to match. - // A modified refs are the refs modified by a git push operation. - oneof git_ref { - // Regexes matching branches to build. - // - // The syntax of the regular expressions accepted is the syntax accepted by - // RE2 and described at https://github.com/google/re2/wiki/Syntax - string branch = 2; - - // Regexes matching tags to build. - // - // The syntax of the regular expressions accepted is the syntax accepted by - // RE2 and described at https://github.com/google/re2/wiki/Syntax - string tag = 3; - } -} - -// Request to create a new `BuildTrigger`. -message CreateBuildTriggerRequest { - // Required. ID of the project for which to configure automatic builds. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. `BuildTrigger` to create. - BuildTrigger trigger = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Returns the `BuildTrigger` with the specified ID. -message GetBuildTriggerRequest { - // Required. ID of the project that owns the trigger. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. ID of the `BuildTrigger` to get. - string trigger_id = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request to list existing `BuildTriggers`. -message ListBuildTriggersRequest { - // Required. ID of the project for which to list BuildTriggers. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Number of results to return in the list. - int32 page_size = 2; - - // Token to provide to skip to a particular spot in the list. - string page_token = 3; -} - -// Response containing existing `BuildTriggers`. -message ListBuildTriggersResponse { - // `BuildTriggers` for the project, sorted by `create_time` descending. - repeated BuildTrigger triggers = 1; - - // Token to receive the next page of results. - string next_page_token = 2; -} - -// Request to delete a `BuildTrigger`. -message DeleteBuildTriggerRequest { - // Required. ID of the project that owns the trigger. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. ID of the `BuildTrigger` to delete. - string trigger_id = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request to update an existing `BuildTrigger`. -message UpdateBuildTriggerRequest { - // Required. ID of the project that owns the trigger. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. ID of the `BuildTrigger` to update. - string trigger_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. `BuildTrigger` to update. - BuildTrigger trigger = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Optional arguments to enable specific features of builds. -message BuildOptions { - // Specifies the manner in which the build should be verified, if at all. - enum VerifyOption { - // Not a verifiable build. (default) - NOT_VERIFIED = 0; - - // Verified build. - VERIFIED = 1; - } - - // Supported VM sizes. - enum MachineType { - // Standard machine type. - UNSPECIFIED = 0; - - // Highcpu machine with 8 CPUs. - N1_HIGHCPU_8 = 1; - - // Highcpu machine with 32 CPUs. - N1_HIGHCPU_32 = 2; - } - - // Specifies the behavior when there is an error in the substitution checks. - enum SubstitutionOption { - // Fails the build if error in substitutions checks, like missing - // a substitution in the template or in the map. - MUST_MATCH = 0; - - // Do not fail the build if error in substitutions checks. - ALLOW_LOOSE = 1; - } - - // Specifies the behavior when writing build logs to Google Cloud Storage. - enum LogStreamingOption { - // Service may automatically determine build log streaming behavior. - STREAM_DEFAULT = 0; - - // Build logs should be streamed to Google Cloud Storage. - STREAM_ON = 1; - - // Build logs should not be streamed to Google Cloud Storage; they will be - // written when the build is completed. - STREAM_OFF = 2; - } - - // Specifies the logging mode. - enum LoggingMode { - // The service determines the logging mode. The default is `LEGACY`. Do not - // rely on the default logging behavior as it may change in the future. - LOGGING_UNSPECIFIED = 0; - - // Stackdriver logging and Cloud Storage logging are enabled. - LEGACY = 1; - - // Only Cloud Storage logging is enabled. - GCS_ONLY = 2; - } - - // Requested hash for SourceProvenance. - repeated Hash.HashType source_provenance_hash = 1; - - // Requested verifiability options. - VerifyOption requested_verify_option = 2; - - // Compute Engine machine type on which to run the build. - MachineType machine_type = 3; - - // Requested disk size for the VM that runs the build. Note that this is *NOT* - // "disk free"; some of the space will be used by the operating system and - // build utilities. Also note that this is the minimum disk size that will be - // allocated for the build -- the build may run with a larger disk than - // requested. At present, the maximum disk size is 1000GB; builds that request - // more than the maximum are rejected with an error. - int64 disk_size_gb = 6; - - // Option to specify behavior when there is an error in the substitution - // checks. - SubstitutionOption substitution_option = 4; - - // Option to define build log streaming behavior to Google Cloud - // Storage. - LogStreamingOption log_streaming_option = 5; - - // Option to specify a `WorkerPool` for the build. User specifies the pool - // with the format "[WORKERPOOL_PROJECT_ID]/[WORKERPOOL_NAME]". - // This is an experimental field. - string worker_pool = 7; - - // Option to specify the logging mode, which determines where the logs are - // stored. - LoggingMode logging = 11; - - // A list of global environment variable definitions that will exist for all - // build steps in this build. If a variable is defined in both globally and in - // a build step, the variable will use the build step value. - // - // The elements are of the form "KEY=VALUE" for the environment variable "KEY" - // being given the value "VALUE". - repeated string env = 12; - - // A list of global environment variables, which are encrypted using a Cloud - // Key Management Service crypto key. These values must be specified in the - // build's `Secret`. These variables will be available to all build steps - // in this build. - repeated string secret_env = 13; - - // Global list of volumes to mount for ALL build steps - // - // Each volume is created as an empty volume prior to starting the build - // process. Upon completion of the build, volumes and their contents are - // discarded. Global volume names and paths cannot conflict with the volumes - // defined a build step. - // - // Using a global volume in a build with only one step is not valid as - // it is indicative of a build request with an incorrect configuration. - repeated Volume volumes = 14; -} - -// Configuration for a WorkerPool to run the builds. -// -// Workers are machines that Cloud Build uses to run your builds. By default, -// all workers run in a project owned by Cloud Build. To have full control over -// the workers that execute your builds -- such as enabling them to access -// private resources on your private network -- you can request Cloud Build to -// run the workers in your own project by creating a custom workers pool. -message WorkerPool { - // Supported GCP regions to create the `WorkerPool`. - enum Region { - // no region - REGION_UNSPECIFIED = 0; - - // us-central1 region - US_CENTRAL1 = 1; - - // us-west1 region - US_WEST1 = 2; - - // us-east1 region - US_EAST1 = 3; - - // us-east4 region - US_EAST4 = 4; - } - - // `WorkerPool` status - enum Status { - // Status of the `WorkerPool` is unknown. - STATUS_UNSPECIFIED = 0; - - // `WorkerPool` is being created. - CREATING = 1; - - // `WorkerPool` is running. - RUNNING = 2; - - // `WorkerPool` is being deleted: cancelling builds and draining workers. - DELETING = 3; - - // `WorkerPool` is deleted. - DELETED = 4; - } - - // User-defined name of the `WorkerPool`. - string name = 14; - - // The project ID of the GCP project for which the `WorkerPool` is created. - string project_id = 2; - - // Output only. The service account used to manage the `WorkerPool`. The - // service account must have the Compute Instance Admin (Beta) permission at - // the project level. - string service_account_email = 3; - - // Total number of workers to be created across all requested regions. - int64 worker_count = 4; - - // Configuration to be used for a creating workers in the `WorkerPool`. - WorkerConfig worker_config = 16; - - // List of regions to create the `WorkerPool`. Regions can't be empty. - // If Cloud Build adds a new GCP region in the future, the existing - // `WorkerPool` will not be enabled in the new region automatically; - // you must add the new region to the `regions` field to enable the - // `WorkerPool` in that region. - repeated Region regions = 9; - - // Output only. Time at which the request to create the `WorkerPool` was - // received. - google.protobuf.Timestamp create_time = 11; - - // Output only. Time at which the request to update the `WorkerPool` was - // received. - google.protobuf.Timestamp update_time = 17; - - // Output only. Time at which the request to delete the `WorkerPool` was - // received. - google.protobuf.Timestamp delete_time = 12; - - // Output only. WorkerPool Status. - Status status = 13; -} - -// WorkerConfig defines the configuration to be used for a creating workers in -// the pool. -message WorkerConfig { - // Machine Type of the worker, such as n1-standard-1. - // See https://cloud.google.com/compute/docs/machine-types. - // If left blank, Cloud Build will use a standard unspecified machine to - // create the worker pool. - // `machine_type` is overridden if you specify a different machine type in - // `build_options`. In this case, the VM specified in the `build_options` - // will be created on demand at build time. For more information see - // https://cloud.google.com/cloud-build/docs/speeding-up-builds#using_custom_virtual_machine_sizes - string machine_type = 1; - - // Size of the disk attached to the worker, in GB. - // See https://cloud.google.com/compute/docs/disks/ - // If `0` is specified, Cloud Build will use a standard disk size. - // `disk_size` is overridden if you specify a different disk size in - // `build_options`. In this case, a VM with a disk size specified in the - // `build_options` will be created on demand at build time. For more - // information see - // https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#buildoptions - int64 disk_size_gb = 2; - - // The network definition used to create the worker. - // If this section is left empty, the workers will be created in - // WorkerPool.project_id on the default network. - Network network = 3; - - // The tag applied to the worker, and the same tag used by the firewall rule. - // It is used to identify the Cloud Build workers among other VMs. - // The default value for tag is `worker`. - string tag = 4; -} - -// Network describes the GCP network used to create workers in. -message Network { - // Project id containing the defined network and subnetwork. For a peered VPC, - // this will be the same as the project_id in which the workers are created. - // For a shared VPC, this will be the project sharing the network with the - // project_id project in which workers will be created. For custom workers - // with no VPC, this will be the same as project_id. - string project_id = 1; - - // Network on which the workers are created. - // "default" network is used if empty. - string network = 2; - - // Subnetwork on which the workers are created. - // "default" subnetwork is used if empty. - string subnetwork = 3; -} - -// Request to create a new `WorkerPool`. -message CreateWorkerPoolRequest { - // ID of the parent project. - string parent = 1; - - // `WorkerPool` resource to create. - WorkerPool worker_pool = 2; -} - -// Request to get a `WorkerPool` with the specified name. -message GetWorkerPoolRequest { - // The field will contain name of the resource requested, for example: - // "projects/project-1/workerPools/workerpool-name" - string name = 1; -} - -// Request to delete a `WorkerPool`. -message DeleteWorkerPoolRequest { - // The field will contain name of the resource requested, for example: - // "projects/project-1/workerPools/workerpool-name" - string name = 1; -} - -// Request to update a `WorkerPool`. -message UpdateWorkerPoolRequest { - // The field will contain name of the resource requested, for example: - // "projects/project-1/workerPools/workerpool-name" - string name = 2; - - // `WorkerPool` resource to update. - WorkerPool worker_pool = 3; -} - -// Request to list `WorkerPool`s. -message ListWorkerPoolsRequest { - // ID of the parent project. - string parent = 1; -} - -// Response containing existing `WorkerPools`. -message ListWorkerPoolsResponse { - // `WorkerPools` for the project. - repeated WorkerPool worker_pools = 1; -} diff --git a/cloudbuild/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild_pb2.py b/cloudbuild/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild_pb2.py deleted file mode 100644 index 678f16774203..000000000000 --- a/cloudbuild/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild_pb2.py +++ /dev/null @@ -1,6361 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/devtools/cloudbuild_v1/proto/cloudbuild.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/devtools/cloudbuild_v1/proto/cloudbuild.proto", - package="google.devtools.cloudbuild.v1", - syntax="proto3", - serialized_options=_b( - "\n\030com.google.cloudbuild.v1P\001ZGgoogle.golang.org/genproto/googleapis/devtools/cloudbuild/v1;cloudbuild\242\002\003GCB" - ), - serialized_pb=_b( - '\n4google/devtools/cloudbuild_v1/proto/cloudbuild.proto\x12\x1dgoogle.devtools.cloudbuild.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto"=\n\x11RetryBuildRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x02id\x18\x02 \x01(\tB\x03\xe0\x41\x02"\x8a\x01\n\x16RunBuildTriggerRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\ntrigger_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12>\n\x06source\x18\x03 \x01(\x0b\x32).google.devtools.cloudbuild.v1.RepoSourceB\x03\xe0\x41\x02"C\n\rStorageSource\x12\x0e\n\x06\x62ucket\x18\x01 \x01(\t\x12\x0e\n\x06object\x18\x02 \x01(\t\x12\x12\n\ngeneration\x18\x03 \x01(\x03"\x8d\x01\n\nRepoSource\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x11\n\trepo_name\x18\x02 \x01(\t\x12\x15\n\x0b\x62ranch_name\x18\x03 \x01(\tH\x00\x12\x12\n\x08tag_name\x18\x04 \x01(\tH\x00\x12\x14\n\ncommit_sha\x18\x05 \x01(\tH\x00\x12\x0b\n\x03\x64ir\x18\x07 \x01(\tB\n\n\x08revision"\x9c\x01\n\x06Source\x12\x46\n\x0estorage_source\x18\x02 \x01(\x0b\x32,.google.devtools.cloudbuild.v1.StorageSourceH\x00\x12@\n\x0brepo_source\x18\x03 \x01(\x0b\x32).google.devtools.cloudbuild.v1.RepoSourceH\x00\x42\x08\n\x06source"h\n\nBuiltImage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06\x64igest\x18\x03 \x01(\t\x12<\n\x0bpush_timing\x18\x04 \x01(\x0b\x32\'.google.devtools.cloudbuild.v1.TimeSpan"\x9f\x03\n\tBuildStep\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03\x65nv\x18\x02 \x03(\t\x12\x0c\n\x04\x61rgs\x18\x03 \x03(\t\x12\x0b\n\x03\x64ir\x18\x04 \x01(\t\x12\n\n\x02id\x18\x05 \x01(\t\x12\x10\n\x08wait_for\x18\x06 \x03(\t\x12\x12\n\nentrypoint\x18\x07 \x01(\t\x12\x12\n\nsecret_env\x18\x08 \x03(\t\x12\x36\n\x07volumes\x18\t \x03(\x0b\x32%.google.devtools.cloudbuild.v1.Volume\x12\x37\n\x06timing\x18\n \x01(\x0b\x32\'.google.devtools.cloudbuild.v1.TimeSpan\x12<\n\x0bpull_timing\x18\r \x01(\x0b\x32\'.google.devtools.cloudbuild.v1.TimeSpan\x12*\n\x07timeout\x18\x0b \x01(\x0b\x32\x19.google.protobuf.Duration\x12;\n\x06status\x18\x0c \x01(\x0e\x32+.google.devtools.cloudbuild.v1.Build.Status"$\n\x06Volume\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t"\xef\x01\n\x07Results\x12\x39\n\x06images\x18\x02 \x03(\x0b\x32).google.devtools.cloudbuild.v1.BuiltImage\x12\x19\n\x11\x62uild_step_images\x18\x03 \x03(\t\x12\x19\n\x11\x61rtifact_manifest\x18\x04 \x01(\t\x12\x15\n\rnum_artifacts\x18\x05 \x01(\x03\x12\x1a\n\x12\x62uild_step_outputs\x18\x06 \x03(\x0c\x12@\n\x0f\x61rtifact_timing\x18\x07 \x01(\x0b\x32\'.google.devtools.cloudbuild.v1.TimeSpan"`\n\x0e\x41rtifactResult\x12\x10\n\x08location\x18\x01 \x01(\t\x12<\n\tfile_hash\x18\x02 \x03(\x0b\x32).google.devtools.cloudbuild.v1.FileHashes"\xe0\t\n\x05\x42uild\x12\n\n\x02id\x18\x01 \x01(\t\x12\x12\n\nproject_id\x18\x10 \x01(\t\x12;\n\x06status\x18\x02 \x01(\x0e\x32+.google.devtools.cloudbuild.v1.Build.Status\x12\x15\n\rstatus_detail\x18\x18 \x01(\t\x12\x35\n\x06source\x18\x03 \x01(\x0b\x32%.google.devtools.cloudbuild.v1.Source\x12\x37\n\x05steps\x18\x0b \x03(\x0b\x32(.google.devtools.cloudbuild.v1.BuildStep\x12\x37\n\x07results\x18\n \x01(\x0b\x32&.google.devtools.cloudbuild.v1.Results\x12/\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nstart_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x66inish_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12*\n\x07timeout\x18\x0c \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0e\n\x06images\x18\r \x03(\t\x12;\n\tartifacts\x18% \x01(\x0b\x32(.google.devtools.cloudbuild.v1.Artifacts\x12\x13\n\x0blogs_bucket\x18\x13 \x01(\t\x12J\n\x11source_provenance\x18\x15 \x01(\x0b\x32/.google.devtools.cloudbuild.v1.SourceProvenance\x12\x18\n\x10\x62uild_trigger_id\x18\x16 \x01(\t\x12<\n\x07options\x18\x17 \x01(\x0b\x32+.google.devtools.cloudbuild.v1.BuildOptions\x12\x0f\n\x07log_url\x18\x19 \x01(\t\x12N\n\rsubstitutions\x18\x1d \x03(\x0b\x32\x37.google.devtools.cloudbuild.v1.Build.SubstitutionsEntry\x12\x0c\n\x04tags\x18\x1f \x03(\t\x12\x36\n\x07secrets\x18 \x03(\x0b\x32%.google.devtools.cloudbuild.v1.Secret\x12@\n\x06timing\x18! \x03(\x0b\x32\x30.google.devtools.cloudbuild.v1.Build.TimingEntry\x1a\x34\n\x12SubstitutionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aV\n\x0bTimingEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.google.devtools.cloudbuild.v1.TimeSpan:\x02\x38\x01"\x7f\n\x06Status\x12\x12\n\x0eSTATUS_UNKNOWN\x10\x00\x12\n\n\x06QUEUED\x10\x01\x12\x0b\n\x07WORKING\x10\x02\x12\x0b\n\x07SUCCESS\x10\x03\x12\x0b\n\x07\x46\x41ILURE\x10\x04\x12\x12\n\x0eINTERNAL_ERROR\x10\x05\x12\x0b\n\x07TIMEOUT\x10\x06\x12\r\n\tCANCELLED\x10\x07"\xd3\x01\n\tArtifacts\x12\x0e\n\x06images\x18\x01 \x03(\t\x12I\n\x07objects\x18\x02 \x01(\x0b\x32\x38.google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects\x1ak\n\x0f\x41rtifactObjects\x12\x10\n\x08location\x18\x01 \x01(\t\x12\r\n\x05paths\x18\x02 \x03(\t\x12\x37\n\x06timing\x18\x03 \x01(\x0b\x32\'.google.devtools.cloudbuild.v1.TimeSpan"h\n\x08TimeSpan\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"M\n\x16\x42uildOperationMetadata\x12\x33\n\x05\x62uild\x18\x01 \x01(\x0b\x32$.google.devtools.cloudbuild.v1.Build"\xde\x02\n\x10SourceProvenance\x12M\n\x17resolved_storage_source\x18\x03 \x01(\x0b\x32,.google.devtools.cloudbuild.v1.StorageSource\x12G\n\x14resolved_repo_source\x18\x06 \x01(\x0b\x32).google.devtools.cloudbuild.v1.RepoSource\x12T\n\x0b\x66ile_hashes\x18\x04 \x03(\x0b\x32?.google.devtools.cloudbuild.v1.SourceProvenance.FileHashesEntry\x1a\\\n\x0f\x46ileHashesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x38\n\x05value\x18\x02 \x01(\x0b\x32).google.devtools.cloudbuild.v1.FileHashes:\x02\x38\x01"D\n\nFileHashes\x12\x36\n\tfile_hash\x18\x01 \x03(\x0b\x32#.google.devtools.cloudbuild.v1.Hash"|\n\x04Hash\x12:\n\x04type\x18\x01 \x01(\x0e\x32,.google.devtools.cloudbuild.v1.Hash.HashType\x12\r\n\x05value\x18\x02 \x01(\x0c")\n\x08HashType\x12\x08\n\x04NONE\x10\x00\x12\n\n\x06SHA256\x10\x01\x12\x07\n\x03MD5\x10\x02"\x9a\x01\n\x06Secret\x12\x14\n\x0ckms_key_name\x18\x01 \x01(\t\x12H\n\nsecret_env\x18\x03 \x03(\x0b\x32\x34.google.devtools.cloudbuild.v1.Secret.SecretEnvEntry\x1a\x30\n\x0eSecretEnvEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01"g\n\x12\x43reateBuildRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x38\n\x05\x62uild\x18\x02 \x01(\x0b\x32$.google.devtools.cloudbuild.v1.BuildB\x03\xe0\x41\x02";\n\x0fGetBuildRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x02id\x18\x02 \x01(\tB\x03\xe0\x41\x02"c\n\x11ListBuildsRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x08 \x01(\t"c\n\x12ListBuildsResponse\x12\x34\n\x06\x62uilds\x18\x01 \x03(\x0b\x32$.google.devtools.cloudbuild.v1.Build\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t">\n\x12\x43\x61ncelBuildRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x02id\x18\x02 \x01(\tB\x03\xe0\x41\x02"\xaf\x04\n\x0c\x42uildTrigger\x12\n\n\x02id\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\n \x01(\t\x12\x0c\n\x04name\x18\x15 \x01(\t\x12\x0c\n\x04tags\x18\x13 \x03(\t\x12\x43\n\x10trigger_template\x18\x07 \x01(\x0b\x32).google.devtools.cloudbuild.v1.RepoSource\x12\x41\n\x06github\x18\r \x01(\x0b\x32\x31.google.devtools.cloudbuild.v1.GitHubEventsConfig\x12\x35\n\x05\x62uild\x18\x04 \x01(\x0b\x32$.google.devtools.cloudbuild.v1.BuildH\x00\x12\x12\n\x08\x66ilename\x18\x08 \x01(\tH\x00\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08\x64isabled\x18\t \x01(\x08\x12U\n\rsubstitutions\x18\x0b \x03(\x0b\x32>.google.devtools.cloudbuild.v1.BuildTrigger.SubstitutionsEntry\x12\x15\n\rignored_files\x18\x0f \x03(\t\x12\x16\n\x0eincluded_files\x18\x10 \x03(\t\x1a\x34\n\x12SubstitutionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x10\n\x0e\x62uild_template"\xdc\x01\n\x12GitHubEventsConfig\x12\x1b\n\x0finstallation_id\x18\x01 \x01(\x03\x42\x02\x18\x01\x12\r\n\x05owner\x18\x06 \x01(\t\x12\x0c\n\x04name\x18\x07 \x01(\t\x12H\n\x0cpull_request\x18\x04 \x01(\x0b\x32\x30.google.devtools.cloudbuild.v1.PullRequestFilterH\x00\x12\x39\n\x04push\x18\x05 \x01(\x0b\x32).google.devtools.cloudbuild.v1.PushFilterH\x00\x42\x07\n\x05\x65vent"\xc9\x01\n\x11PullRequestFilter\x12\x10\n\x06\x62ranch\x18\x02 \x01(\tH\x00\x12X\n\x0f\x63omment_control\x18\x05 \x01(\x0e\x32?.google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl"=\n\x0e\x43ommentControl\x12\x15\n\x11\x43OMMENTS_DISABLED\x10\x00\x12\x14\n\x10\x43OMMENTS_ENABLED\x10\x01\x42\t\n\x07git_ref"8\n\nPushFilter\x12\x10\n\x06\x62ranch\x18\x02 \x01(\tH\x00\x12\r\n\x03tag\x18\x03 \x01(\tH\x00\x42\t\n\x07git_ref"w\n\x19\x43reateBuildTriggerRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x07trigger\x18\x02 \x01(\x0b\x32+.google.devtools.cloudbuild.v1.BuildTriggerB\x03\xe0\x41\x02"J\n\x16GetBuildTriggerRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\ntrigger_id\x18\x02 \x01(\tB\x03\xe0\x41\x02"Z\n\x18ListBuildTriggersRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"s\n\x19ListBuildTriggersResponse\x12=\n\x08triggers\x18\x01 \x03(\x0b\x32+.google.devtools.cloudbuild.v1.BuildTrigger\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"M\n\x19\x44\x65leteBuildTriggerRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\ntrigger_id\x18\x02 \x01(\tB\x03\xe0\x41\x02"\x90\x01\n\x19UpdateBuildTriggerRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\ntrigger_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x07trigger\x18\x03 \x01(\x0b\x32+.google.devtools.cloudbuild.v1.BuildTriggerB\x03\xe0\x41\x02"\xc6\x07\n\x0c\x42uildOptions\x12L\n\x16source_provenance_hash\x18\x01 \x03(\x0e\x32,.google.devtools.cloudbuild.v1.Hash.HashType\x12Y\n\x17requested_verify_option\x18\x02 \x01(\x0e\x32\x38.google.devtools.cloudbuild.v1.BuildOptions.VerifyOption\x12M\n\x0cmachine_type\x18\x03 \x01(\x0e\x32\x37.google.devtools.cloudbuild.v1.BuildOptions.MachineType\x12\x14\n\x0c\x64isk_size_gb\x18\x06 \x01(\x03\x12[\n\x13substitution_option\x18\x04 \x01(\x0e\x32>.google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption\x12\\\n\x14log_streaming_option\x18\x05 \x01(\x0e\x32>.google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption\x12\x13\n\x0bworker_pool\x18\x07 \x01(\t\x12H\n\x07logging\x18\x0b \x01(\x0e\x32\x37.google.devtools.cloudbuild.v1.BuildOptions.LoggingMode\x12\x0b\n\x03\x65nv\x18\x0c \x03(\t\x12\x12\n\nsecret_env\x18\r \x03(\t\x12\x36\n\x07volumes\x18\x0e \x03(\x0b\x32%.google.devtools.cloudbuild.v1.Volume".\n\x0cVerifyOption\x12\x10\n\x0cNOT_VERIFIED\x10\x00\x12\x0c\n\x08VERIFIED\x10\x01"C\n\x0bMachineType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x10\n\x0cN1_HIGHCPU_8\x10\x01\x12\x11\n\rN1_HIGHCPU_32\x10\x02"5\n\x12SubstitutionOption\x12\x0e\n\nMUST_MATCH\x10\x00\x12\x0f\n\x0b\x41LLOW_LOOSE\x10\x01"G\n\x12LogStreamingOption\x12\x12\n\x0eSTREAM_DEFAULT\x10\x00\x12\r\n\tSTREAM_ON\x10\x01\x12\x0e\n\nSTREAM_OFF\x10\x02"@\n\x0bLoggingMode\x12\x17\n\x13LOGGING_UNSPECIFIED\x10\x00\x12\n\n\x06LEGACY\x10\x01\x12\x0c\n\x08GCS_ONLY\x10\x02"\xf4\x04\n\nWorkerPool\x12\x0c\n\x04name\x18\x0e \x01(\t\x12\x12\n\nproject_id\x18\x02 \x01(\t\x12\x1d\n\x15service_account_email\x18\x03 \x01(\t\x12\x14\n\x0cworker_count\x18\x04 \x01(\x03\x12\x42\n\rworker_config\x18\x10 \x01(\x0b\x32+.google.devtools.cloudbuild.v1.WorkerConfig\x12\x41\n\x07regions\x18\t \x03(\x0e\x32\x30.google.devtools.cloudbuild.v1.WorkerPool.Region\x12/\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x11 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x64\x65lete_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12@\n\x06status\x18\r \x01(\x0e\x32\x30.google.devtools.cloudbuild.v1.WorkerPool.Status"[\n\x06Region\x12\x16\n\x12REGION_UNSPECIFIED\x10\x00\x12\x0f\n\x0bUS_CENTRAL1\x10\x01\x12\x0c\n\x08US_WEST1\x10\x02\x12\x0c\n\x08US_EAST1\x10\x03\x12\x0c\n\x08US_EAST4\x10\x04"V\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\x0b\n\x07\x44\x45LETED\x10\x04"\x80\x01\n\x0cWorkerConfig\x12\x14\n\x0cmachine_type\x18\x01 \x01(\t\x12\x14\n\x0c\x64isk_size_gb\x18\x02 \x01(\x03\x12\x37\n\x07network\x18\x03 \x01(\x0b\x32&.google.devtools.cloudbuild.v1.Network\x12\x0b\n\x03tag\x18\x04 \x01(\t"B\n\x07Network\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x0f\n\x07network\x18\x02 \x01(\t\x12\x12\n\nsubnetwork\x18\x03 \x01(\t"i\n\x17\x43reateWorkerPoolRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12>\n\x0bworker_pool\x18\x02 \x01(\x0b\x32).google.devtools.cloudbuild.v1.WorkerPool"$\n\x14GetWorkerPoolRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"\'\n\x17\x44\x65leteWorkerPoolRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"g\n\x17UpdateWorkerPoolRequest\x12\x0c\n\x04name\x18\x02 \x01(\t\x12>\n\x0bworker_pool\x18\x03 \x01(\x0b\x32).google.devtools.cloudbuild.v1.WorkerPool"(\n\x16ListWorkerPoolsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t"Z\n\x17ListWorkerPoolsResponse\x12?\n\x0cworker_pools\x18\x01 \x03(\x0b\x32).google.devtools.cloudbuild.v1.WorkerPool2\xa1\x16\n\nCloudBuild\x12\xc5\x01\n\x0b\x43reateBuild\x12\x31.google.devtools.cloudbuild.v1.CreateBuildRequest\x1a\x1d.google.longrunning.Operation"d\x82\xd3\xe4\x93\x02)" /v1/projects/{project_id}/builds:\x05\x62uild\xda\x41\x10project_id,build\xca\x41\x1f\n\x05\x42uild\x12\x16\x42uildOperationMetadata\x12\x9f\x01\n\x08GetBuild\x12..google.devtools.cloudbuild.v1.GetBuildRequest\x1a$.google.devtools.cloudbuild.v1.Build"=\x82\xd3\xe4\x93\x02\'\x12%/v1/projects/{project_id}/builds/{id}\xda\x41\rproject_id,id\x12\xaf\x01\n\nListBuilds\x12\x30.google.devtools.cloudbuild.v1.ListBuildsRequest\x1a\x31.google.devtools.cloudbuild.v1.ListBuildsResponse"<\x82\xd3\xe4\x93\x02"\x12 /v1/projects/{project_id}/builds\xda\x41\x11project_id,filter\x12\xaf\x01\n\x0b\x43\x61ncelBuild\x12\x31.google.devtools.cloudbuild.v1.CancelBuildRequest\x1a$.google.devtools.cloudbuild.v1.Build"G\x82\xd3\xe4\x93\x02\x31",/v1/projects/{project_id}/builds/{id}:cancel:\x01*\xda\x41\rproject_id,id\x12\xc7\x01\n\nRetryBuild\x12\x30.google.devtools.cloudbuild.v1.RetryBuildRequest\x1a\x1d.google.longrunning.Operation"h\x82\xd3\xe4\x93\x02\x30"+/v1/projects/{project_id}/builds/{id}:retry:\x01*\xda\x41\rproject_id,id\xca\x41\x1f\n\x05\x42uild\x12\x16\x42uildOperationMetadata\x12\xc5\x01\n\x12\x43reateBuildTrigger\x12\x38.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest\x1a+.google.devtools.cloudbuild.v1.BuildTrigger"H\x82\xd3\xe4\x93\x02-""/v1/projects/{project_id}/triggers:\x07trigger\xda\x41\x12project_id,trigger\x12\xc6\x01\n\x0fGetBuildTrigger\x12\x35.google.devtools.cloudbuild.v1.GetBuildTriggerRequest\x1a+.google.devtools.cloudbuild.v1.BuildTrigger"O\x82\xd3\xe4\x93\x02\x31\x12//v1/projects/{project_id}/triggers/{trigger_id}\xda\x41\x15project_id,trigger_id\x12\xbf\x01\n\x11ListBuildTriggers\x12\x37.google.devtools.cloudbuild.v1.ListBuildTriggersRequest\x1a\x38.google.devtools.cloudbuild.v1.ListBuildTriggersResponse"7\x82\xd3\xe4\x93\x02$\x12"/v1/projects/{project_id}/triggers\xda\x41\nproject_id\x12\xb7\x01\n\x12\x44\x65leteBuildTrigger\x12\x38.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest\x1a\x16.google.protobuf.Empty"O\x82\xd3\xe4\x93\x02\x31*//v1/projects/{project_id}/triggers/{trigger_id}\xda\x41\x15project_id,trigger_id\x12\xdd\x01\n\x12UpdateBuildTrigger\x12\x38.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest\x1a+.google.devtools.cloudbuild.v1.BuildTrigger"`\x82\xd3\xe4\x93\x02:2//v1/projects/{project_id}/triggers/{trigger_id}:\x07trigger\xda\x41\x1dproject_id,trigger_id,trigger\x12\xee\x01\n\x0fRunBuildTrigger\x12\x35.google.devtools.cloudbuild.v1.RunBuildTriggerRequest\x1a\x1d.google.longrunning.Operation"\x84\x01\x82\xd3\xe4\x93\x02="3/v1/projects/{project_id}/triggers/{trigger_id}:run:\x06source\xda\x41\x1cproject_id,trigger_id,source\xca\x41\x1f\n\x05\x42uild\x12\x16\x42uildOperationMetadata\x12w\n\x10\x43reateWorkerPool\x12\x36.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest\x1a).google.devtools.cloudbuild.v1.WorkerPool"\x00\x12q\n\rGetWorkerPool\x12\x33.google.devtools.cloudbuild.v1.GetWorkerPoolRequest\x1a).google.devtools.cloudbuild.v1.WorkerPool"\x00\x12\x64\n\x10\x44\x65leteWorkerPool\x12\x36.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest\x1a\x16.google.protobuf.Empty"\x00\x12w\n\x10UpdateWorkerPool\x12\x36.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest\x1a).google.devtools.cloudbuild.v1.WorkerPool"\x00\x12\x82\x01\n\x0fListWorkerPools\x12\x35.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest\x1a\x36.google.devtools.cloudbuild.v1.ListWorkerPoolsResponse"\x00\x1aM\xca\x41\x19\x63loudbuild.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBk\n\x18\x63om.google.cloudbuild.v1P\x01ZGgoogle.golang.org/genproto/googleapis/devtools/cloudbuild/v1;cloudbuild\xa2\x02\x03GCBb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, - google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_BUILD_STATUS = _descriptor.EnumDescriptor( - name="Status", - full_name="google.devtools.cloudbuild.v1.Build.Status", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATUS_UNKNOWN", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="QUEUED", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="WORKING", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SUCCESS", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FAILURE", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="INTERNAL_ERROR", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TIMEOUT", index=6, number=6, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLED", index=7, number=7, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2906, - serialized_end=3033, -) -_sym_db.RegisterEnumDescriptor(_BUILD_STATUS) - -_HASH_HASHTYPE = _descriptor.EnumDescriptor( - name="HashType", - full_name="google.devtools.cloudbuild.v1.Hash.HashType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="NONE", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SHA256", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MD5", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3940, - serialized_end=3981, -) -_sym_db.RegisterEnumDescriptor(_HASH_HASHTYPE) - -_PULLREQUESTFILTER_COMMENTCONTROL = _descriptor.EnumDescriptor( - name="CommentControl", - full_name="google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="COMMENTS_DISABLED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="COMMENTS_ENABLED", - index=1, - number=1, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=5487, - serialized_end=5548, -) -_sym_db.RegisterEnumDescriptor(_PULLREQUESTFILTER_COMMENTCONTROL) - -_BUILDOPTIONS_VERIFYOPTION = _descriptor.EnumDescriptor( - name="VerifyOption", - full_name="google.devtools.cloudbuild.v1.BuildOptions.VerifyOption", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="NOT_VERIFIED", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VERIFIED", index=1, number=1, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=6909, - serialized_end=6955, -) -_sym_db.RegisterEnumDescriptor(_BUILDOPTIONS_VERIFYOPTION) - -_BUILDOPTIONS_MACHINETYPE = _descriptor.EnumDescriptor( - name="MachineType", - full_name="google.devtools.cloudbuild.v1.BuildOptions.MachineType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNSPECIFIED", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="N1_HIGHCPU_8", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="N1_HIGHCPU_32", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=6957, - serialized_end=7024, -) -_sym_db.RegisterEnumDescriptor(_BUILDOPTIONS_MACHINETYPE) - -_BUILDOPTIONS_SUBSTITUTIONOPTION = _descriptor.EnumDescriptor( - name="SubstitutionOption", - full_name="google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="MUST_MATCH", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="ALLOW_LOOSE", index=1, number=1, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=7026, - serialized_end=7079, -) -_sym_db.RegisterEnumDescriptor(_BUILDOPTIONS_SUBSTITUTIONOPTION) - -_BUILDOPTIONS_LOGSTREAMINGOPTION = _descriptor.EnumDescriptor( - name="LogStreamingOption", - full_name="google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STREAM_DEFAULT", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="STREAM_ON", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="STREAM_OFF", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=7081, - serialized_end=7152, -) -_sym_db.RegisterEnumDescriptor(_BUILDOPTIONS_LOGSTREAMINGOPTION) - -_BUILDOPTIONS_LOGGINGMODE = _descriptor.EnumDescriptor( - name="LoggingMode", - full_name="google.devtools.cloudbuild.v1.BuildOptions.LoggingMode", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="LOGGING_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEGACY", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="GCS_ONLY", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=7154, - serialized_end=7218, -) -_sym_db.RegisterEnumDescriptor(_BUILDOPTIONS_LOGGINGMODE) - -_WORKERPOOL_REGION = _descriptor.EnumDescriptor( - name="Region", - full_name="google.devtools.cloudbuild.v1.WorkerPool.Region", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="REGION_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="US_CENTRAL1", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="US_WEST1", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="US_EAST1", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="US_EAST4", index=4, number=4, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=7670, - serialized_end=7761, -) -_sym_db.RegisterEnumDescriptor(_WORKERPOOL_REGION) - -_WORKERPOOL_STATUS = _descriptor.EnumDescriptor( - name="Status", - full_name="google.devtools.cloudbuild.v1.WorkerPool.Status", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATUS_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CREATING", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RUNNING", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DELETING", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DELETED", index=4, number=4, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=7763, - serialized_end=7849, -) -_sym_db.RegisterEnumDescriptor(_WORKERPOOL_STATUS) - - -_RETRYBUILDREQUEST = _descriptor.Descriptor( - name="RetryBuildRequest", - full_name="google.devtools.cloudbuild.v1.RetryBuildRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.devtools.cloudbuild.v1.RetryBuildRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="id", - full_name="google.devtools.cloudbuild.v1.RetryBuildRequest.id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=306, - serialized_end=367, -) - - -_RUNBUILDTRIGGERREQUEST = _descriptor.Descriptor( - name="RunBuildTriggerRequest", - full_name="google.devtools.cloudbuild.v1.RunBuildTriggerRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.devtools.cloudbuild.v1.RunBuildTriggerRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="trigger_id", - full_name="google.devtools.cloudbuild.v1.RunBuildTriggerRequest.trigger_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="source", - full_name="google.devtools.cloudbuild.v1.RunBuildTriggerRequest.source", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=370, - serialized_end=508, -) - - -_STORAGESOURCE = _descriptor.Descriptor( - name="StorageSource", - full_name="google.devtools.cloudbuild.v1.StorageSource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bucket", - full_name="google.devtools.cloudbuild.v1.StorageSource.bucket", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="object", - full_name="google.devtools.cloudbuild.v1.StorageSource.object", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="generation", - full_name="google.devtools.cloudbuild.v1.StorageSource.generation", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=510, - serialized_end=577, -) - - -_REPOSOURCE = _descriptor.Descriptor( - name="RepoSource", - full_name="google.devtools.cloudbuild.v1.RepoSource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.devtools.cloudbuild.v1.RepoSource.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="repo_name", - full_name="google.devtools.cloudbuild.v1.RepoSource.repo_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="branch_name", - full_name="google.devtools.cloudbuild.v1.RepoSource.branch_name", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tag_name", - full_name="google.devtools.cloudbuild.v1.RepoSource.tag_name", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="commit_sha", - full_name="google.devtools.cloudbuild.v1.RepoSource.commit_sha", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="dir", - full_name="google.devtools.cloudbuild.v1.RepoSource.dir", - index=5, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="revision", - full_name="google.devtools.cloudbuild.v1.RepoSource.revision", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=580, - serialized_end=721, -) - - -_SOURCE = _descriptor.Descriptor( - name="Source", - full_name="google.devtools.cloudbuild.v1.Source", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="storage_source", - full_name="google.devtools.cloudbuild.v1.Source.storage_source", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="repo_source", - full_name="google.devtools.cloudbuild.v1.Source.repo_source", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="source", - full_name="google.devtools.cloudbuild.v1.Source.source", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=724, - serialized_end=880, -) - - -_BUILTIMAGE = _descriptor.Descriptor( - name="BuiltImage", - full_name="google.devtools.cloudbuild.v1.BuiltImage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.devtools.cloudbuild.v1.BuiltImage.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="digest", - full_name="google.devtools.cloudbuild.v1.BuiltImage.digest", - index=1, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="push_timing", - full_name="google.devtools.cloudbuild.v1.BuiltImage.push_timing", - index=2, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=882, - serialized_end=986, -) - - -_BUILDSTEP = _descriptor.Descriptor( - name="BuildStep", - full_name="google.devtools.cloudbuild.v1.BuildStep", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.devtools.cloudbuild.v1.BuildStep.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="env", - full_name="google.devtools.cloudbuild.v1.BuildStep.env", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="args", - full_name="google.devtools.cloudbuild.v1.BuildStep.args", - index=2, - number=3, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="dir", - full_name="google.devtools.cloudbuild.v1.BuildStep.dir", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="id", - full_name="google.devtools.cloudbuild.v1.BuildStep.id", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="wait_for", - full_name="google.devtools.cloudbuild.v1.BuildStep.wait_for", - index=5, - number=6, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="entrypoint", - full_name="google.devtools.cloudbuild.v1.BuildStep.entrypoint", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="secret_env", - full_name="google.devtools.cloudbuild.v1.BuildStep.secret_env", - index=7, - number=8, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="volumes", - full_name="google.devtools.cloudbuild.v1.BuildStep.volumes", - index=8, - number=9, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="timing", - full_name="google.devtools.cloudbuild.v1.BuildStep.timing", - index=9, - number=10, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pull_timing", - full_name="google.devtools.cloudbuild.v1.BuildStep.pull_timing", - index=10, - number=13, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="timeout", - full_name="google.devtools.cloudbuild.v1.BuildStep.timeout", - index=11, - number=11, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="status", - full_name="google.devtools.cloudbuild.v1.BuildStep.status", - index=12, - number=12, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=989, - serialized_end=1404, -) - - -_VOLUME = _descriptor.Descriptor( - name="Volume", - full_name="google.devtools.cloudbuild.v1.Volume", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.devtools.cloudbuild.v1.Volume.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="path", - full_name="google.devtools.cloudbuild.v1.Volume.path", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1406, - serialized_end=1442, -) - - -_RESULTS = _descriptor.Descriptor( - name="Results", - full_name="google.devtools.cloudbuild.v1.Results", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="images", - full_name="google.devtools.cloudbuild.v1.Results.images", - index=0, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="build_step_images", - full_name="google.devtools.cloudbuild.v1.Results.build_step_images", - index=1, - number=3, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="artifact_manifest", - full_name="google.devtools.cloudbuild.v1.Results.artifact_manifest", - index=2, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="num_artifacts", - full_name="google.devtools.cloudbuild.v1.Results.num_artifacts", - index=3, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="build_step_outputs", - full_name="google.devtools.cloudbuild.v1.Results.build_step_outputs", - index=4, - number=6, - type=12, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="artifact_timing", - full_name="google.devtools.cloudbuild.v1.Results.artifact_timing", - index=5, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1445, - serialized_end=1684, -) - - -_ARTIFACTRESULT = _descriptor.Descriptor( - name="ArtifactResult", - full_name="google.devtools.cloudbuild.v1.ArtifactResult", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="location", - full_name="google.devtools.cloudbuild.v1.ArtifactResult.location", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="file_hash", - full_name="google.devtools.cloudbuild.v1.ArtifactResult.file_hash", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1686, - serialized_end=1782, -) - - -_BUILD_SUBSTITUTIONSENTRY = _descriptor.Descriptor( - name="SubstitutionsEntry", - full_name="google.devtools.cloudbuild.v1.Build.SubstitutionsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.devtools.cloudbuild.v1.Build.SubstitutionsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.devtools.cloudbuild.v1.Build.SubstitutionsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2764, - serialized_end=2816, -) - -_BUILD_TIMINGENTRY = _descriptor.Descriptor( - name="TimingEntry", - full_name="google.devtools.cloudbuild.v1.Build.TimingEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.devtools.cloudbuild.v1.Build.TimingEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.devtools.cloudbuild.v1.Build.TimingEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2818, - serialized_end=2904, -) - -_BUILD = _descriptor.Descriptor( - name="Build", - full_name="google.devtools.cloudbuild.v1.Build", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="id", - full_name="google.devtools.cloudbuild.v1.Build.id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.devtools.cloudbuild.v1.Build.project_id", - index=1, - number=16, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="status", - full_name="google.devtools.cloudbuild.v1.Build.status", - index=2, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="status_detail", - full_name="google.devtools.cloudbuild.v1.Build.status_detail", - index=3, - number=24, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="source", - full_name="google.devtools.cloudbuild.v1.Build.source", - index=4, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="steps", - full_name="google.devtools.cloudbuild.v1.Build.steps", - index=5, - number=11, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="results", - full_name="google.devtools.cloudbuild.v1.Build.results", - index=6, - number=10, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.devtools.cloudbuild.v1.Build.create_time", - index=7, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.devtools.cloudbuild.v1.Build.start_time", - index=8, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="finish_time", - full_name="google.devtools.cloudbuild.v1.Build.finish_time", - index=9, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="timeout", - full_name="google.devtools.cloudbuild.v1.Build.timeout", - index=10, - number=12, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="images", - full_name="google.devtools.cloudbuild.v1.Build.images", - index=11, - number=13, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="artifacts", - full_name="google.devtools.cloudbuild.v1.Build.artifacts", - index=12, - number=37, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="logs_bucket", - full_name="google.devtools.cloudbuild.v1.Build.logs_bucket", - index=13, - number=19, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="source_provenance", - full_name="google.devtools.cloudbuild.v1.Build.source_provenance", - index=14, - number=21, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="build_trigger_id", - full_name="google.devtools.cloudbuild.v1.Build.build_trigger_id", - index=15, - number=22, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="options", - full_name="google.devtools.cloudbuild.v1.Build.options", - index=16, - number=23, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="log_url", - full_name="google.devtools.cloudbuild.v1.Build.log_url", - index=17, - number=25, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="substitutions", - full_name="google.devtools.cloudbuild.v1.Build.substitutions", - index=18, - number=29, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tags", - full_name="google.devtools.cloudbuild.v1.Build.tags", - index=19, - number=31, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="secrets", - full_name="google.devtools.cloudbuild.v1.Build.secrets", - index=20, - number=32, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="timing", - full_name="google.devtools.cloudbuild.v1.Build.timing", - index=21, - number=33, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_BUILD_SUBSTITUTIONSENTRY, _BUILD_TIMINGENTRY], - enum_types=[_BUILD_STATUS], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1785, - serialized_end=3033, -) - - -_ARTIFACTS_ARTIFACTOBJECTS = _descriptor.Descriptor( - name="ArtifactObjects", - full_name="google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="location", - full_name="google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects.location", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="paths", - full_name="google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects.paths", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="timing", - full_name="google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects.timing", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3140, - serialized_end=3247, -) - -_ARTIFACTS = _descriptor.Descriptor( - name="Artifacts", - full_name="google.devtools.cloudbuild.v1.Artifacts", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="images", - full_name="google.devtools.cloudbuild.v1.Artifacts.images", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="objects", - full_name="google.devtools.cloudbuild.v1.Artifacts.objects", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_ARTIFACTS_ARTIFACTOBJECTS], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3036, - serialized_end=3247, -) - - -_TIMESPAN = _descriptor.Descriptor( - name="TimeSpan", - full_name="google.devtools.cloudbuild.v1.TimeSpan", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.devtools.cloudbuild.v1.TimeSpan.start_time", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.devtools.cloudbuild.v1.TimeSpan.end_time", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3249, - serialized_end=3353, -) - - -_BUILDOPERATIONMETADATA = _descriptor.Descriptor( - name="BuildOperationMetadata", - full_name="google.devtools.cloudbuild.v1.BuildOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="build", - full_name="google.devtools.cloudbuild.v1.BuildOperationMetadata.build", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3355, - serialized_end=3432, -) - - -_SOURCEPROVENANCE_FILEHASHESENTRY = _descriptor.Descriptor( - name="FileHashesEntry", - full_name="google.devtools.cloudbuild.v1.SourceProvenance.FileHashesEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.devtools.cloudbuild.v1.SourceProvenance.FileHashesEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.devtools.cloudbuild.v1.SourceProvenance.FileHashesEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3693, - serialized_end=3785, -) - -_SOURCEPROVENANCE = _descriptor.Descriptor( - name="SourceProvenance", - full_name="google.devtools.cloudbuild.v1.SourceProvenance", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="resolved_storage_source", - full_name="google.devtools.cloudbuild.v1.SourceProvenance.resolved_storage_source", - index=0, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="resolved_repo_source", - full_name="google.devtools.cloudbuild.v1.SourceProvenance.resolved_repo_source", - index=1, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="file_hashes", - full_name="google.devtools.cloudbuild.v1.SourceProvenance.file_hashes", - index=2, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_SOURCEPROVENANCE_FILEHASHESENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3435, - serialized_end=3785, -) - - -_FILEHASHES = _descriptor.Descriptor( - name="FileHashes", - full_name="google.devtools.cloudbuild.v1.FileHashes", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="file_hash", - full_name="google.devtools.cloudbuild.v1.FileHashes.file_hash", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3787, - serialized_end=3855, -) - - -_HASH = _descriptor.Descriptor( - name="Hash", - full_name="google.devtools.cloudbuild.v1.Hash", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.devtools.cloudbuild.v1.Hash.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.devtools.cloudbuild.v1.Hash.value", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_HASH_HASHTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3857, - serialized_end=3981, -) - - -_SECRET_SECRETENVENTRY = _descriptor.Descriptor( - name="SecretEnvEntry", - full_name="google.devtools.cloudbuild.v1.Secret.SecretEnvEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.devtools.cloudbuild.v1.Secret.SecretEnvEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.devtools.cloudbuild.v1.Secret.SecretEnvEntry.value", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4090, - serialized_end=4138, -) - -_SECRET = _descriptor.Descriptor( - name="Secret", - full_name="google.devtools.cloudbuild.v1.Secret", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="kms_key_name", - full_name="google.devtools.cloudbuild.v1.Secret.kms_key_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="secret_env", - full_name="google.devtools.cloudbuild.v1.Secret.secret_env", - index=1, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_SECRET_SECRETENVENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3984, - serialized_end=4138, -) - - -_CREATEBUILDREQUEST = _descriptor.Descriptor( - name="CreateBuildRequest", - full_name="google.devtools.cloudbuild.v1.CreateBuildRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.devtools.cloudbuild.v1.CreateBuildRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="build", - full_name="google.devtools.cloudbuild.v1.CreateBuildRequest.build", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4140, - serialized_end=4243, -) - - -_GETBUILDREQUEST = _descriptor.Descriptor( - name="GetBuildRequest", - full_name="google.devtools.cloudbuild.v1.GetBuildRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.devtools.cloudbuild.v1.GetBuildRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="id", - full_name="google.devtools.cloudbuild.v1.GetBuildRequest.id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4245, - serialized_end=4304, -) - - -_LISTBUILDSREQUEST = _descriptor.Descriptor( - name="ListBuildsRequest", - full_name="google.devtools.cloudbuild.v1.ListBuildsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.devtools.cloudbuild.v1.ListBuildsRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.devtools.cloudbuild.v1.ListBuildsRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.devtools.cloudbuild.v1.ListBuildsRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.devtools.cloudbuild.v1.ListBuildsRequest.filter", - index=3, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4306, - serialized_end=4405, -) - - -_LISTBUILDSRESPONSE = _descriptor.Descriptor( - name="ListBuildsResponse", - full_name="google.devtools.cloudbuild.v1.ListBuildsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="builds", - full_name="google.devtools.cloudbuild.v1.ListBuildsResponse.builds", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.devtools.cloudbuild.v1.ListBuildsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4407, - serialized_end=4506, -) - - -_CANCELBUILDREQUEST = _descriptor.Descriptor( - name="CancelBuildRequest", - full_name="google.devtools.cloudbuild.v1.CancelBuildRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.devtools.cloudbuild.v1.CancelBuildRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="id", - full_name="google.devtools.cloudbuild.v1.CancelBuildRequest.id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4508, - serialized_end=4570, -) - - -_BUILDTRIGGER_SUBSTITUTIONSENTRY = _descriptor.Descriptor( - name="SubstitutionsEntry", - full_name="google.devtools.cloudbuild.v1.BuildTrigger.SubstitutionsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.devtools.cloudbuild.v1.BuildTrigger.SubstitutionsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.devtools.cloudbuild.v1.BuildTrigger.SubstitutionsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2764, - serialized_end=2816, -) - -_BUILDTRIGGER = _descriptor.Descriptor( - name="BuildTrigger", - full_name="google.devtools.cloudbuild.v1.BuildTrigger", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="id", - full_name="google.devtools.cloudbuild.v1.BuildTrigger.id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.devtools.cloudbuild.v1.BuildTrigger.description", - index=1, - number=10, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.devtools.cloudbuild.v1.BuildTrigger.name", - index=2, - number=21, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tags", - full_name="google.devtools.cloudbuild.v1.BuildTrigger.tags", - index=3, - number=19, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="trigger_template", - full_name="google.devtools.cloudbuild.v1.BuildTrigger.trigger_template", - index=4, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="github", - full_name="google.devtools.cloudbuild.v1.BuildTrigger.github", - index=5, - number=13, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="build", - full_name="google.devtools.cloudbuild.v1.BuildTrigger.build", - index=6, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filename", - full_name="google.devtools.cloudbuild.v1.BuildTrigger.filename", - index=7, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.devtools.cloudbuild.v1.BuildTrigger.create_time", - index=8, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="disabled", - full_name="google.devtools.cloudbuild.v1.BuildTrigger.disabled", - index=9, - number=9, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="substitutions", - full_name="google.devtools.cloudbuild.v1.BuildTrigger.substitutions", - index=10, - number=11, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ignored_files", - full_name="google.devtools.cloudbuild.v1.BuildTrigger.ignored_files", - index=11, - number=15, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="included_files", - full_name="google.devtools.cloudbuild.v1.BuildTrigger.included_files", - index=12, - number=16, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_BUILDTRIGGER_SUBSTITUTIONSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="build_template", - full_name="google.devtools.cloudbuild.v1.BuildTrigger.build_template", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=4573, - serialized_end=5132, -) - - -_GITHUBEVENTSCONFIG = _descriptor.Descriptor( - name="GitHubEventsConfig", - full_name="google.devtools.cloudbuild.v1.GitHubEventsConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="installation_id", - full_name="google.devtools.cloudbuild.v1.GitHubEventsConfig.installation_id", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="owner", - full_name="google.devtools.cloudbuild.v1.GitHubEventsConfig.owner", - index=1, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.devtools.cloudbuild.v1.GitHubEventsConfig.name", - index=2, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pull_request", - full_name="google.devtools.cloudbuild.v1.GitHubEventsConfig.pull_request", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="push", - full_name="google.devtools.cloudbuild.v1.GitHubEventsConfig.push", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="event", - full_name="google.devtools.cloudbuild.v1.GitHubEventsConfig.event", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=5135, - serialized_end=5355, -) - - -_PULLREQUESTFILTER = _descriptor.Descriptor( - name="PullRequestFilter", - full_name="google.devtools.cloudbuild.v1.PullRequestFilter", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="branch", - full_name="google.devtools.cloudbuild.v1.PullRequestFilter.branch", - index=0, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="comment_control", - full_name="google.devtools.cloudbuild.v1.PullRequestFilter.comment_control", - index=1, - number=5, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_PULLREQUESTFILTER_COMMENTCONTROL], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="git_ref", - full_name="google.devtools.cloudbuild.v1.PullRequestFilter.git_ref", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=5358, - serialized_end=5559, -) - - -_PUSHFILTER = _descriptor.Descriptor( - name="PushFilter", - full_name="google.devtools.cloudbuild.v1.PushFilter", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="branch", - full_name="google.devtools.cloudbuild.v1.PushFilter.branch", - index=0, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tag", - full_name="google.devtools.cloudbuild.v1.PushFilter.tag", - index=1, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="git_ref", - full_name="google.devtools.cloudbuild.v1.PushFilter.git_ref", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=5561, - serialized_end=5617, -) - - -_CREATEBUILDTRIGGERREQUEST = _descriptor.Descriptor( - name="CreateBuildTriggerRequest", - full_name="google.devtools.cloudbuild.v1.CreateBuildTriggerRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.devtools.cloudbuild.v1.CreateBuildTriggerRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="trigger", - full_name="google.devtools.cloudbuild.v1.CreateBuildTriggerRequest.trigger", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5619, - serialized_end=5738, -) - - -_GETBUILDTRIGGERREQUEST = _descriptor.Descriptor( - name="GetBuildTriggerRequest", - full_name="google.devtools.cloudbuild.v1.GetBuildTriggerRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.devtools.cloudbuild.v1.GetBuildTriggerRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="trigger_id", - full_name="google.devtools.cloudbuild.v1.GetBuildTriggerRequest.trigger_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5740, - serialized_end=5814, -) - - -_LISTBUILDTRIGGERSREQUEST = _descriptor.Descriptor( - name="ListBuildTriggersRequest", - full_name="google.devtools.cloudbuild.v1.ListBuildTriggersRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.devtools.cloudbuild.v1.ListBuildTriggersRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.devtools.cloudbuild.v1.ListBuildTriggersRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.devtools.cloudbuild.v1.ListBuildTriggersRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5816, - serialized_end=5906, -) - - -_LISTBUILDTRIGGERSRESPONSE = _descriptor.Descriptor( - name="ListBuildTriggersResponse", - full_name="google.devtools.cloudbuild.v1.ListBuildTriggersResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="triggers", - full_name="google.devtools.cloudbuild.v1.ListBuildTriggersResponse.triggers", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.devtools.cloudbuild.v1.ListBuildTriggersResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5908, - serialized_end=6023, -) - - -_DELETEBUILDTRIGGERREQUEST = _descriptor.Descriptor( - name="DeleteBuildTriggerRequest", - full_name="google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="trigger_id", - full_name="google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest.trigger_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6025, - serialized_end=6102, -) - - -_UPDATEBUILDTRIGGERREQUEST = _descriptor.Descriptor( - name="UpdateBuildTriggerRequest", - full_name="google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="trigger_id", - full_name="google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest.trigger_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="trigger", - full_name="google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest.trigger", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6105, - serialized_end=6249, -) - - -_BUILDOPTIONS = _descriptor.Descriptor( - name="BuildOptions", - full_name="google.devtools.cloudbuild.v1.BuildOptions", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="source_provenance_hash", - full_name="google.devtools.cloudbuild.v1.BuildOptions.source_provenance_hash", - index=0, - number=1, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="requested_verify_option", - full_name="google.devtools.cloudbuild.v1.BuildOptions.requested_verify_option", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="machine_type", - full_name="google.devtools.cloudbuild.v1.BuildOptions.machine_type", - index=2, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="disk_size_gb", - full_name="google.devtools.cloudbuild.v1.BuildOptions.disk_size_gb", - index=3, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="substitution_option", - full_name="google.devtools.cloudbuild.v1.BuildOptions.substitution_option", - index=4, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="log_streaming_option", - full_name="google.devtools.cloudbuild.v1.BuildOptions.log_streaming_option", - index=5, - number=5, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="worker_pool", - full_name="google.devtools.cloudbuild.v1.BuildOptions.worker_pool", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="logging", - full_name="google.devtools.cloudbuild.v1.BuildOptions.logging", - index=7, - number=11, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="env", - full_name="google.devtools.cloudbuild.v1.BuildOptions.env", - index=8, - number=12, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="secret_env", - full_name="google.devtools.cloudbuild.v1.BuildOptions.secret_env", - index=9, - number=13, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="volumes", - full_name="google.devtools.cloudbuild.v1.BuildOptions.volumes", - index=10, - number=14, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[ - _BUILDOPTIONS_VERIFYOPTION, - _BUILDOPTIONS_MACHINETYPE, - _BUILDOPTIONS_SUBSTITUTIONOPTION, - _BUILDOPTIONS_LOGSTREAMINGOPTION, - _BUILDOPTIONS_LOGGINGMODE, - ], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6252, - serialized_end=7218, -) - - -_WORKERPOOL = _descriptor.Descriptor( - name="WorkerPool", - full_name="google.devtools.cloudbuild.v1.WorkerPool", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.devtools.cloudbuild.v1.WorkerPool.name", - index=0, - number=14, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.devtools.cloudbuild.v1.WorkerPool.project_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="service_account_email", - full_name="google.devtools.cloudbuild.v1.WorkerPool.service_account_email", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="worker_count", - full_name="google.devtools.cloudbuild.v1.WorkerPool.worker_count", - index=3, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="worker_config", - full_name="google.devtools.cloudbuild.v1.WorkerPool.worker_config", - index=4, - number=16, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="regions", - full_name="google.devtools.cloudbuild.v1.WorkerPool.regions", - index=5, - number=9, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.devtools.cloudbuild.v1.WorkerPool.create_time", - index=6, - number=11, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_time", - full_name="google.devtools.cloudbuild.v1.WorkerPool.update_time", - index=7, - number=17, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="delete_time", - full_name="google.devtools.cloudbuild.v1.WorkerPool.delete_time", - index=8, - number=12, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="status", - full_name="google.devtools.cloudbuild.v1.WorkerPool.status", - index=9, - number=13, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_WORKERPOOL_REGION, _WORKERPOOL_STATUS], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7221, - serialized_end=7849, -) - - -_WORKERCONFIG = _descriptor.Descriptor( - name="WorkerConfig", - full_name="google.devtools.cloudbuild.v1.WorkerConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="machine_type", - full_name="google.devtools.cloudbuild.v1.WorkerConfig.machine_type", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="disk_size_gb", - full_name="google.devtools.cloudbuild.v1.WorkerConfig.disk_size_gb", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="network", - full_name="google.devtools.cloudbuild.v1.WorkerConfig.network", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tag", - full_name="google.devtools.cloudbuild.v1.WorkerConfig.tag", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7852, - serialized_end=7980, -) - - -_NETWORK = _descriptor.Descriptor( - name="Network", - full_name="google.devtools.cloudbuild.v1.Network", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.devtools.cloudbuild.v1.Network.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="network", - full_name="google.devtools.cloudbuild.v1.Network.network", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="subnetwork", - full_name="google.devtools.cloudbuild.v1.Network.subnetwork", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7982, - serialized_end=8048, -) - - -_CREATEWORKERPOOLREQUEST = _descriptor.Descriptor( - name="CreateWorkerPoolRequest", - full_name="google.devtools.cloudbuild.v1.CreateWorkerPoolRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.devtools.cloudbuild.v1.CreateWorkerPoolRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="worker_pool", - full_name="google.devtools.cloudbuild.v1.CreateWorkerPoolRequest.worker_pool", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8050, - serialized_end=8155, -) - - -_GETWORKERPOOLREQUEST = _descriptor.Descriptor( - name="GetWorkerPoolRequest", - full_name="google.devtools.cloudbuild.v1.GetWorkerPoolRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.devtools.cloudbuild.v1.GetWorkerPoolRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8157, - serialized_end=8193, -) - - -_DELETEWORKERPOOLREQUEST = _descriptor.Descriptor( - name="DeleteWorkerPoolRequest", - full_name="google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8195, - serialized_end=8234, -) - - -_UPDATEWORKERPOOLREQUEST = _descriptor.Descriptor( - name="UpdateWorkerPoolRequest", - full_name="google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest.name", - index=0, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="worker_pool", - full_name="google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest.worker_pool", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8236, - serialized_end=8339, -) - - -_LISTWORKERPOOLSREQUEST = _descriptor.Descriptor( - name="ListWorkerPoolsRequest", - full_name="google.devtools.cloudbuild.v1.ListWorkerPoolsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.devtools.cloudbuild.v1.ListWorkerPoolsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8341, - serialized_end=8381, -) - - -_LISTWORKERPOOLSRESPONSE = _descriptor.Descriptor( - name="ListWorkerPoolsResponse", - full_name="google.devtools.cloudbuild.v1.ListWorkerPoolsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="worker_pools", - full_name="google.devtools.cloudbuild.v1.ListWorkerPoolsResponse.worker_pools", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8383, - serialized_end=8473, -) - -_RUNBUILDTRIGGERREQUEST.fields_by_name["source"].message_type = _REPOSOURCE -_REPOSOURCE.oneofs_by_name["revision"].fields.append( - _REPOSOURCE.fields_by_name["branch_name"] -) -_REPOSOURCE.fields_by_name["branch_name"].containing_oneof = _REPOSOURCE.oneofs_by_name[ - "revision" -] -_REPOSOURCE.oneofs_by_name["revision"].fields.append( - _REPOSOURCE.fields_by_name["tag_name"] -) -_REPOSOURCE.fields_by_name["tag_name"].containing_oneof = _REPOSOURCE.oneofs_by_name[ - "revision" -] -_REPOSOURCE.oneofs_by_name["revision"].fields.append( - _REPOSOURCE.fields_by_name["commit_sha"] -) -_REPOSOURCE.fields_by_name["commit_sha"].containing_oneof = _REPOSOURCE.oneofs_by_name[ - "revision" -] -_SOURCE.fields_by_name["storage_source"].message_type = _STORAGESOURCE -_SOURCE.fields_by_name["repo_source"].message_type = _REPOSOURCE -_SOURCE.oneofs_by_name["source"].fields.append(_SOURCE.fields_by_name["storage_source"]) -_SOURCE.fields_by_name["storage_source"].containing_oneof = _SOURCE.oneofs_by_name[ - "source" -] -_SOURCE.oneofs_by_name["source"].fields.append(_SOURCE.fields_by_name["repo_source"]) -_SOURCE.fields_by_name["repo_source"].containing_oneof = _SOURCE.oneofs_by_name[ - "source" -] -_BUILTIMAGE.fields_by_name["push_timing"].message_type = _TIMESPAN -_BUILDSTEP.fields_by_name["volumes"].message_type = _VOLUME -_BUILDSTEP.fields_by_name["timing"].message_type = _TIMESPAN -_BUILDSTEP.fields_by_name["pull_timing"].message_type = _TIMESPAN -_BUILDSTEP.fields_by_name[ - "timeout" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_BUILDSTEP.fields_by_name["status"].enum_type = _BUILD_STATUS -_RESULTS.fields_by_name["images"].message_type = _BUILTIMAGE -_RESULTS.fields_by_name["artifact_timing"].message_type = _TIMESPAN -_ARTIFACTRESULT.fields_by_name["file_hash"].message_type = _FILEHASHES -_BUILD_SUBSTITUTIONSENTRY.containing_type = _BUILD -_BUILD_TIMINGENTRY.fields_by_name["value"].message_type = _TIMESPAN -_BUILD_TIMINGENTRY.containing_type = _BUILD -_BUILD.fields_by_name["status"].enum_type = _BUILD_STATUS -_BUILD.fields_by_name["source"].message_type = _SOURCE -_BUILD.fields_by_name["steps"].message_type = _BUILDSTEP -_BUILD.fields_by_name["results"].message_type = _RESULTS -_BUILD.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_BUILD.fields_by_name[ - "start_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_BUILD.fields_by_name[ - "finish_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_BUILD.fields_by_name[ - "timeout" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_BUILD.fields_by_name["artifacts"].message_type = _ARTIFACTS -_BUILD.fields_by_name["source_provenance"].message_type = _SOURCEPROVENANCE -_BUILD.fields_by_name["options"].message_type = _BUILDOPTIONS -_BUILD.fields_by_name["substitutions"].message_type = _BUILD_SUBSTITUTIONSENTRY -_BUILD.fields_by_name["secrets"].message_type = _SECRET -_BUILD.fields_by_name["timing"].message_type = _BUILD_TIMINGENTRY -_BUILD_STATUS.containing_type = _BUILD -_ARTIFACTS_ARTIFACTOBJECTS.fields_by_name["timing"].message_type = _TIMESPAN -_ARTIFACTS_ARTIFACTOBJECTS.containing_type = _ARTIFACTS -_ARTIFACTS.fields_by_name["objects"].message_type = _ARTIFACTS_ARTIFACTOBJECTS -_TIMESPAN.fields_by_name[ - "start_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_TIMESPAN.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_BUILDOPERATIONMETADATA.fields_by_name["build"].message_type = _BUILD -_SOURCEPROVENANCE_FILEHASHESENTRY.fields_by_name["value"].message_type = _FILEHASHES -_SOURCEPROVENANCE_FILEHASHESENTRY.containing_type = _SOURCEPROVENANCE -_SOURCEPROVENANCE.fields_by_name[ - "resolved_storage_source" -].message_type = _STORAGESOURCE -_SOURCEPROVENANCE.fields_by_name["resolved_repo_source"].message_type = _REPOSOURCE -_SOURCEPROVENANCE.fields_by_name[ - "file_hashes" -].message_type = _SOURCEPROVENANCE_FILEHASHESENTRY -_FILEHASHES.fields_by_name["file_hash"].message_type = _HASH -_HASH.fields_by_name["type"].enum_type = _HASH_HASHTYPE -_HASH_HASHTYPE.containing_type = _HASH -_SECRET_SECRETENVENTRY.containing_type = _SECRET -_SECRET.fields_by_name["secret_env"].message_type = _SECRET_SECRETENVENTRY -_CREATEBUILDREQUEST.fields_by_name["build"].message_type = _BUILD -_LISTBUILDSRESPONSE.fields_by_name["builds"].message_type = _BUILD -_BUILDTRIGGER_SUBSTITUTIONSENTRY.containing_type = _BUILDTRIGGER -_BUILDTRIGGER.fields_by_name["trigger_template"].message_type = _REPOSOURCE -_BUILDTRIGGER.fields_by_name["github"].message_type = _GITHUBEVENTSCONFIG -_BUILDTRIGGER.fields_by_name["build"].message_type = _BUILD -_BUILDTRIGGER.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_BUILDTRIGGER.fields_by_name[ - "substitutions" -].message_type = _BUILDTRIGGER_SUBSTITUTIONSENTRY -_BUILDTRIGGER.oneofs_by_name["build_template"].fields.append( - _BUILDTRIGGER.fields_by_name["build"] -) -_BUILDTRIGGER.fields_by_name["build"].containing_oneof = _BUILDTRIGGER.oneofs_by_name[ - "build_template" -] -_BUILDTRIGGER.oneofs_by_name["build_template"].fields.append( - _BUILDTRIGGER.fields_by_name["filename"] -) -_BUILDTRIGGER.fields_by_name[ - "filename" -].containing_oneof = _BUILDTRIGGER.oneofs_by_name["build_template"] -_GITHUBEVENTSCONFIG.fields_by_name["pull_request"].message_type = _PULLREQUESTFILTER -_GITHUBEVENTSCONFIG.fields_by_name["push"].message_type = _PUSHFILTER -_GITHUBEVENTSCONFIG.oneofs_by_name["event"].fields.append( - _GITHUBEVENTSCONFIG.fields_by_name["pull_request"] -) -_GITHUBEVENTSCONFIG.fields_by_name[ - "pull_request" -].containing_oneof = _GITHUBEVENTSCONFIG.oneofs_by_name["event"] -_GITHUBEVENTSCONFIG.oneofs_by_name["event"].fields.append( - _GITHUBEVENTSCONFIG.fields_by_name["push"] -) -_GITHUBEVENTSCONFIG.fields_by_name[ - "push" -].containing_oneof = _GITHUBEVENTSCONFIG.oneofs_by_name["event"] -_PULLREQUESTFILTER.fields_by_name[ - "comment_control" -].enum_type = _PULLREQUESTFILTER_COMMENTCONTROL -_PULLREQUESTFILTER_COMMENTCONTROL.containing_type = _PULLREQUESTFILTER -_PULLREQUESTFILTER.oneofs_by_name["git_ref"].fields.append( - _PULLREQUESTFILTER.fields_by_name["branch"] -) -_PULLREQUESTFILTER.fields_by_name[ - "branch" -].containing_oneof = _PULLREQUESTFILTER.oneofs_by_name["git_ref"] -_PUSHFILTER.oneofs_by_name["git_ref"].fields.append( - _PUSHFILTER.fields_by_name["branch"] -) -_PUSHFILTER.fields_by_name["branch"].containing_oneof = _PUSHFILTER.oneofs_by_name[ - "git_ref" -] -_PUSHFILTER.oneofs_by_name["git_ref"].fields.append(_PUSHFILTER.fields_by_name["tag"]) -_PUSHFILTER.fields_by_name["tag"].containing_oneof = _PUSHFILTER.oneofs_by_name[ - "git_ref" -] -_CREATEBUILDTRIGGERREQUEST.fields_by_name["trigger"].message_type = _BUILDTRIGGER -_LISTBUILDTRIGGERSRESPONSE.fields_by_name["triggers"].message_type = _BUILDTRIGGER -_UPDATEBUILDTRIGGERREQUEST.fields_by_name["trigger"].message_type = _BUILDTRIGGER -_BUILDOPTIONS.fields_by_name["source_provenance_hash"].enum_type = _HASH_HASHTYPE -_BUILDOPTIONS.fields_by_name[ - "requested_verify_option" -].enum_type = _BUILDOPTIONS_VERIFYOPTION -_BUILDOPTIONS.fields_by_name["machine_type"].enum_type = _BUILDOPTIONS_MACHINETYPE -_BUILDOPTIONS.fields_by_name[ - "substitution_option" -].enum_type = _BUILDOPTIONS_SUBSTITUTIONOPTION -_BUILDOPTIONS.fields_by_name[ - "log_streaming_option" -].enum_type = _BUILDOPTIONS_LOGSTREAMINGOPTION -_BUILDOPTIONS.fields_by_name["logging"].enum_type = _BUILDOPTIONS_LOGGINGMODE -_BUILDOPTIONS.fields_by_name["volumes"].message_type = _VOLUME -_BUILDOPTIONS_VERIFYOPTION.containing_type = _BUILDOPTIONS -_BUILDOPTIONS_MACHINETYPE.containing_type = _BUILDOPTIONS -_BUILDOPTIONS_SUBSTITUTIONOPTION.containing_type = _BUILDOPTIONS -_BUILDOPTIONS_LOGSTREAMINGOPTION.containing_type = _BUILDOPTIONS -_BUILDOPTIONS_LOGGINGMODE.containing_type = _BUILDOPTIONS -_WORKERPOOL.fields_by_name["worker_config"].message_type = _WORKERCONFIG -_WORKERPOOL.fields_by_name["regions"].enum_type = _WORKERPOOL_REGION -_WORKERPOOL.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_WORKERPOOL.fields_by_name[ - "update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_WORKERPOOL.fields_by_name[ - "delete_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_WORKERPOOL.fields_by_name["status"].enum_type = _WORKERPOOL_STATUS -_WORKERPOOL_REGION.containing_type = _WORKERPOOL -_WORKERPOOL_STATUS.containing_type = _WORKERPOOL -_WORKERCONFIG.fields_by_name["network"].message_type = _NETWORK -_CREATEWORKERPOOLREQUEST.fields_by_name["worker_pool"].message_type = _WORKERPOOL -_UPDATEWORKERPOOLREQUEST.fields_by_name["worker_pool"].message_type = _WORKERPOOL -_LISTWORKERPOOLSRESPONSE.fields_by_name["worker_pools"].message_type = _WORKERPOOL -DESCRIPTOR.message_types_by_name["RetryBuildRequest"] = _RETRYBUILDREQUEST -DESCRIPTOR.message_types_by_name["RunBuildTriggerRequest"] = _RUNBUILDTRIGGERREQUEST -DESCRIPTOR.message_types_by_name["StorageSource"] = _STORAGESOURCE -DESCRIPTOR.message_types_by_name["RepoSource"] = _REPOSOURCE -DESCRIPTOR.message_types_by_name["Source"] = _SOURCE -DESCRIPTOR.message_types_by_name["BuiltImage"] = _BUILTIMAGE -DESCRIPTOR.message_types_by_name["BuildStep"] = _BUILDSTEP -DESCRIPTOR.message_types_by_name["Volume"] = _VOLUME -DESCRIPTOR.message_types_by_name["Results"] = _RESULTS -DESCRIPTOR.message_types_by_name["ArtifactResult"] = _ARTIFACTRESULT -DESCRIPTOR.message_types_by_name["Build"] = _BUILD -DESCRIPTOR.message_types_by_name["Artifacts"] = _ARTIFACTS -DESCRIPTOR.message_types_by_name["TimeSpan"] = _TIMESPAN -DESCRIPTOR.message_types_by_name["BuildOperationMetadata"] = _BUILDOPERATIONMETADATA -DESCRIPTOR.message_types_by_name["SourceProvenance"] = _SOURCEPROVENANCE -DESCRIPTOR.message_types_by_name["FileHashes"] = _FILEHASHES -DESCRIPTOR.message_types_by_name["Hash"] = _HASH -DESCRIPTOR.message_types_by_name["Secret"] = _SECRET -DESCRIPTOR.message_types_by_name["CreateBuildRequest"] = _CREATEBUILDREQUEST -DESCRIPTOR.message_types_by_name["GetBuildRequest"] = _GETBUILDREQUEST -DESCRIPTOR.message_types_by_name["ListBuildsRequest"] = _LISTBUILDSREQUEST -DESCRIPTOR.message_types_by_name["ListBuildsResponse"] = _LISTBUILDSRESPONSE -DESCRIPTOR.message_types_by_name["CancelBuildRequest"] = _CANCELBUILDREQUEST -DESCRIPTOR.message_types_by_name["BuildTrigger"] = _BUILDTRIGGER -DESCRIPTOR.message_types_by_name["GitHubEventsConfig"] = _GITHUBEVENTSCONFIG -DESCRIPTOR.message_types_by_name["PullRequestFilter"] = _PULLREQUESTFILTER -DESCRIPTOR.message_types_by_name["PushFilter"] = _PUSHFILTER -DESCRIPTOR.message_types_by_name[ - "CreateBuildTriggerRequest" -] = _CREATEBUILDTRIGGERREQUEST -DESCRIPTOR.message_types_by_name["GetBuildTriggerRequest"] = _GETBUILDTRIGGERREQUEST -DESCRIPTOR.message_types_by_name["ListBuildTriggersRequest"] = _LISTBUILDTRIGGERSREQUEST -DESCRIPTOR.message_types_by_name[ - "ListBuildTriggersResponse" -] = _LISTBUILDTRIGGERSRESPONSE -DESCRIPTOR.message_types_by_name[ - "DeleteBuildTriggerRequest" -] = _DELETEBUILDTRIGGERREQUEST -DESCRIPTOR.message_types_by_name[ - "UpdateBuildTriggerRequest" -] = _UPDATEBUILDTRIGGERREQUEST -DESCRIPTOR.message_types_by_name["BuildOptions"] = _BUILDOPTIONS -DESCRIPTOR.message_types_by_name["WorkerPool"] = _WORKERPOOL -DESCRIPTOR.message_types_by_name["WorkerConfig"] = _WORKERCONFIG -DESCRIPTOR.message_types_by_name["Network"] = _NETWORK -DESCRIPTOR.message_types_by_name["CreateWorkerPoolRequest"] = _CREATEWORKERPOOLREQUEST -DESCRIPTOR.message_types_by_name["GetWorkerPoolRequest"] = _GETWORKERPOOLREQUEST -DESCRIPTOR.message_types_by_name["DeleteWorkerPoolRequest"] = _DELETEWORKERPOOLREQUEST -DESCRIPTOR.message_types_by_name["UpdateWorkerPoolRequest"] = _UPDATEWORKERPOOLREQUEST -DESCRIPTOR.message_types_by_name["ListWorkerPoolsRequest"] = _LISTWORKERPOOLSREQUEST -DESCRIPTOR.message_types_by_name["ListWorkerPoolsResponse"] = _LISTWORKERPOOLSRESPONSE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -RetryBuildRequest = _reflection.GeneratedProtocolMessageType( - "RetryBuildRequest", - (_message.Message,), - dict( - DESCRIPTOR=_RETRYBUILDREQUEST, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Specifies a build to retry. - - - Attributes: - project_id: - Required. ID of the project. - id: - Required. Build ID of the original build. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.RetryBuildRequest) - ), -) -_sym_db.RegisterMessage(RetryBuildRequest) - -RunBuildTriggerRequest = _reflection.GeneratedProtocolMessageType( - "RunBuildTriggerRequest", - (_message.Message,), - dict( - DESCRIPTOR=_RUNBUILDTRIGGERREQUEST, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Specifies a build trigger to run and the source to use. - - - Attributes: - project_id: - Required. ID of the project. - trigger_id: - Required. ID of the trigger. - source: - Required. Source to build against this trigger. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.RunBuildTriggerRequest) - ), -) -_sym_db.RegisterMessage(RunBuildTriggerRequest) - -StorageSource = _reflection.GeneratedProtocolMessageType( - "StorageSource", - (_message.Message,), - dict( - DESCRIPTOR=_STORAGESOURCE, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Location of the source in an archive file in Google Cloud - Storage. - - - Attributes: - bucket: - Google Cloud Storage bucket containing the source (see `Bucket - Name Requirements - `__). - object: - Google Cloud Storage object containing the source. This - object must be a gzipped archive file (``.tar.gz``) containing - source to build. - generation: - Google Cloud Storage generation for the object. If the - generation is omitted, the latest generation will be used. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.StorageSource) - ), -) -_sym_db.RegisterMessage(StorageSource) - -RepoSource = _reflection.GeneratedProtocolMessageType( - "RepoSource", - (_message.Message,), - dict( - DESCRIPTOR=_REPOSOURCE, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Location of the source in a Google Cloud Source - Repository. - - - Attributes: - project_id: - ID of the project that owns the Cloud Source Repository. If - omitted, the project ID requesting the build is assumed. - repo_name: - Name of the Cloud Source Repository. If omitted, the name - "default" is assumed. - revision: - A revision within the Cloud Source Repository must be - specified in one of these ways. - branch_name: - Regex matching branches to build. The syntax of the regular - expressions accepted is the syntax accepted by RE2 and - described at https://github.com/google/re2/wiki/Syntax - tag_name: - Regex matching tags to build. The syntax of the regular - expressions accepted is the syntax accepted by RE2 and - described at https://github.com/google/re2/wiki/Syntax - commit_sha: - Explicit commit SHA to build. - dir: - Directory, relative to the source root, in which to run the - build. This must be a relative path. If a step's ``dir`` is - specified and is an absolute path, this value is ignored for - that step's execution. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.RepoSource) - ), -) -_sym_db.RegisterMessage(RepoSource) - -Source = _reflection.GeneratedProtocolMessageType( - "Source", - (_message.Message,), - dict( - DESCRIPTOR=_SOURCE, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Location of the source in a supported storage service. - - - Attributes: - source: - Location of source. - storage_source: - If provided, get the source from this location in Google Cloud - Storage. - repo_source: - If provided, get the source from this location in a Cloud - Source Repository. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.Source) - ), -) -_sym_db.RegisterMessage(Source) - -BuiltImage = _reflection.GeneratedProtocolMessageType( - "BuiltImage", - (_message.Message,), - dict( - DESCRIPTOR=_BUILTIMAGE, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""An image built by the pipeline. - - - Attributes: - name: - Name used to push the container image to Google Container - Registry, as presented to ``docker push``. - digest: - Docker Registry 2.0 digest. - push_timing: - Output only. Stores timing information for pushing the - specified image. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.BuiltImage) - ), -) -_sym_db.RegisterMessage(BuiltImage) - -BuildStep = _reflection.GeneratedProtocolMessageType( - "BuildStep", - (_message.Message,), - dict( - DESCRIPTOR=_BUILDSTEP, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""A step in the build pipeline. - - - Attributes: - name: - Required. The name of the container image that will run this - particular build step. If the image is available in the - host's Docker daemon's cache, it will be run directly. If not, - the host will attempt to pull the image first, using the - builder service account's credentials if necessary. The - Docker daemon's cache will already have the latest versions of - all of the officially supported build steps - (https://github.com/GoogleCloudPlatform/cloud-builders). The - Docker daemon will also have cached many of the layers for - some popular images, like "ubuntu", "debian", but they will be - refreshed at the time you attempt to use them. If you built - an image in a previous build step, it will be stored in the - host's Docker daemon's cache and is available to use as the - name for a later build step. - env: - A list of environment variable definitions to be used when - running a step. The elements are of the form "KEY=VALUE" for - the environment variable "KEY" being given the value "VALUE". - args: - A list of arguments that will be presented to the step when it - is started. If the image used to run the step's container has - an entrypoint, the ``args`` are used as arguments to that - entrypoint. If the image does not define an entrypoint, the - first element in args is used as the entrypoint, and the - remainder will be used as arguments. - dir: - Working directory to use when running this step's container. - If this value is a relative path, it is relative to the - build's working directory. If this value is absolute, it may - be outside the build's working directory, in which case the - contents of the path may not be persisted across build step - executions, unless a ``volume`` for that path is specified. - If the build specifies a ``RepoSource`` with ``dir`` and a - step with a ``dir``, which specifies an absolute path, the - ``RepoSource`` ``dir`` is ignored for the step's execution. - id: - Unique identifier for this build step, used in ``wait_for`` to - reference this build step as a dependency. - wait_for: - The ID(s) of the step(s) that this build step depends on. This - build step will not start until all the build steps in - ``wait_for`` have completed successfully. If ``wait_for`` is - empty, this build step will start when all previous build - steps in the ``Build.Steps`` list have completed successfully. - entrypoint: - Entrypoint to be used instead of the build step image's - default entrypoint. If unset, the image's default entrypoint - is used. - secret_env: - A list of environment variables which are encrypted using a - Cloud Key Management Service crypto key. These values must be - specified in the build's ``Secret``. - volumes: - List of volumes to mount into the build step. Each volume is - created as an empty volume prior to execution of the build - step. Upon completion of the build, volumes and their contents - are discarded. Using a named volume in only one step is not - valid as it is indicative of a build request with an incorrect - configuration. - timing: - Output only. Stores timing information for executing this - build step. - pull_timing: - Output only. Stores timing information for pulling this build - step's builder image only. - timeout: - Time limit for executing this build step. If not defined, the - step has no time limit and will be allowed to continue to run - until either it completes or the build itself times out. - status: - Output only. Status of the build step. At this time, build - step status is only updated on build completion; step status - is not updated in real-time as the build progresses. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.BuildStep) - ), -) -_sym_db.RegisterMessage(BuildStep) - -Volume = _reflection.GeneratedProtocolMessageType( - "Volume", - (_message.Message,), - dict( - DESCRIPTOR=_VOLUME, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Volume describes a Docker container volume which is - mounted into build steps in order to persist files across build step - execution. - - - Attributes: - name: - Name of the volume to mount. Volume names must be unique per - build step and must be valid names for Docker volumes. Each - named volume must be used by at least two build steps. - path: - Path at which to mount the volume. Paths must be absolute and - cannot conflict with other volume paths on the same build step - or with certain reserved volume paths. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.Volume) - ), -) -_sym_db.RegisterMessage(Volume) - -Results = _reflection.GeneratedProtocolMessageType( - "Results", - (_message.Message,), - dict( - DESCRIPTOR=_RESULTS, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Artifacts created by the build pipeline. - - - Attributes: - images: - Container images that were built as a part of the build. - build_step_images: - List of build step digests, in the order corresponding to - build step indices. - artifact_manifest: - Path to the artifact manifest. Only populated when artifacts - are uploaded. - num_artifacts: - Number of artifacts uploaded. Only populated when artifacts - are uploaded. - build_step_outputs: - List of build step outputs, produced by builder images, in the - order corresponding to build step indices. `Cloud Builders - `__ - can produce this output by writing to - ``$BUILDER_OUTPUT/output``. Only the first 4KB of data is - stored. - artifact_timing: - Time to push all non-container artifacts. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.Results) - ), -) -_sym_db.RegisterMessage(Results) - -ArtifactResult = _reflection.GeneratedProtocolMessageType( - "ArtifactResult", - (_message.Message,), - dict( - DESCRIPTOR=_ARTIFACTRESULT, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""An artifact that was uploaded during a build. This is a - single record in the artifact manifest JSON file. - - - Attributes: - location: - The path of an artifact in a Google Cloud Storage bucket, with - the generation number. For example, - ``gs://mybucket/path/to/output.jar#generation``. - file_hash: - The file hash of the artifact. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.ArtifactResult) - ), -) -_sym_db.RegisterMessage(ArtifactResult) - -Build = _reflection.GeneratedProtocolMessageType( - "Build", - (_message.Message,), - dict( - SubstitutionsEntry=_reflection.GeneratedProtocolMessageType( - "SubstitutionsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_BUILD_SUBSTITUTIONSENTRY, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2" - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.Build.SubstitutionsEntry) - ), - ), - TimingEntry=_reflection.GeneratedProtocolMessageType( - "TimingEntry", - (_message.Message,), - dict( - DESCRIPTOR=_BUILD_TIMINGENTRY, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2" - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.Build.TimingEntry) - ), - ), - DESCRIPTOR=_BUILD, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""A build resource in the Cloud Build API. - - At a high level, a ``Build`` describes where to find source code, how to - build it (for example, the builder image to run on the source), and - where to store the built artifacts. - - Fields can include the following variables, which will be expanded when - the build is created: - - - $PROJECT\_ID: the project ID of the build. - - $BUILD\_ID: the autogenerated ID of the build. - - $REPO\_NAME: the source repository name specified by RepoSource. - - $BRANCH\_NAME: the branch name specified by RepoSource. - - $TAG\_NAME: the tag name specified by RepoSource. - - $REVISION\_ID or $COMMIT\_SHA: the commit SHA specified by RepoSource - or resolved from the specified branch or tag. - - $SHORT\_SHA: first 7 characters of $REVISION\_ID or $COMMIT\_SHA. - - - Attributes: - id: - Output only. Unique identifier of the build. - project_id: - Output only. ID of the project. - status: - Output only. Status of the build. - status_detail: - Output only. Customer-readable message about the current - status. - source: - The location of the source files to build. - steps: - Required. The operations to be performed on the workspace. - results: - Output only. Results of the build. - create_time: - Output only. Time at which the request to create the build was - received. - start_time: - Output only. Time at which execution of the build was started. - finish_time: - Output only. Time at which execution of the build was - finished. The difference between finish\_time and start\_time - is the duration of the build's execution. - timeout: - Amount of time that this build should be allowed to run, to - second granularity. If this amount of time elapses, work on - the build will cease and the build status will be ``TIMEOUT``. - Default time is ten minutes. - images: - A list of images to be pushed upon the successful completion - of all build steps. The images are pushed using the builder - service account's credentials. The digests of the pushed - images will be stored in the ``Build`` resource's results - field. If any of the images fail to be pushed, the build - status is marked ``FAILURE``. - artifacts: - Artifacts produced by the build that should be uploaded upon - successful completion of all build steps. - logs_bucket: - Google Cloud Storage bucket where logs should be written (see - `Bucket Name Requirements - `__). Logs file names will be of the - format ``${logs_bucket}/log-${build_id}.txt``. - source_provenance: - Output only. A permanent fixed identifier for source. - build_trigger_id: - Output only. The ID of the ``BuildTrigger`` that triggered - this build, if it was triggered automatically. - options: - Special options for this build. - log_url: - Output only. URL to logs for this build in Google Cloud - Console. - substitutions: - Substitutions data for ``Build`` resource. - tags: - Tags for annotation of a ``Build``. These are not docker tags. - secrets: - Secrets to decrypt using Cloud Key Management Service. - timing: - Output only. Stores timing information for phases of the - build. Valid keys are: - BUILD: time to execute all build - steps - PUSH: time to push all specified images. - - FETCHSOURCE: time to fetch source. If the build does not - specify source or images, these keys will not be included. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.Build) - ), -) -_sym_db.RegisterMessage(Build) -_sym_db.RegisterMessage(Build.SubstitutionsEntry) -_sym_db.RegisterMessage(Build.TimingEntry) - -Artifacts = _reflection.GeneratedProtocolMessageType( - "Artifacts", - (_message.Message,), - dict( - ArtifactObjects=_reflection.GeneratedProtocolMessageType( - "ArtifactObjects", - (_message.Message,), - dict( - DESCRIPTOR=_ARTIFACTS_ARTIFACTOBJECTS, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Files in the workspace to upload to Cloud Storage upon - successful completion of all build steps. - - - Attributes: - location: - Cloud Storage bucket and optional object path, in the form - "gs://bucket/path/to/somewhere/". (see `Bucket Name - Requirements `__). Files in the workspace matching any - path pattern will be uploaded to Cloud Storage with this - location as a prefix. - paths: - Path globs used to match files in the build's workspace. - timing: - Output only. Stores timing information for pushing all - artifact objects. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects) - ), - ), - DESCRIPTOR=_ARTIFACTS, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Artifacts produced by a build that should be uploaded upon - successful completion of all build steps. - - - Attributes: - images: - A list of images to be pushed upon the successful completion - of all build steps. The images will be pushed using the - builder service account's credentials. The digests of the - pushed images will be stored in the Build resource's results - field. If any of the images fail to be pushed, the build is - marked FAILURE. - objects: - A list of objects to be uploaded to Cloud Storage upon - successful completion of all build steps. Files in the - workspace matching specified paths globs will be uploaded to - the specified Cloud Storage location using the builder service - account's credentials. The location and generation of the - uploaded objects will be stored in the Build resource's - results field. If any objects fail to be pushed, the build is - marked FAILURE. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.Artifacts) - ), -) -_sym_db.RegisterMessage(Artifacts) -_sym_db.RegisterMessage(Artifacts.ArtifactObjects) - -TimeSpan = _reflection.GeneratedProtocolMessageType( - "TimeSpan", - (_message.Message,), - dict( - DESCRIPTOR=_TIMESPAN, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Start and end times for a build execution phase. - - - Attributes: - start_time: - Start of time span. - end_time: - End of time span. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.TimeSpan) - ), -) -_sym_db.RegisterMessage(TimeSpan) - -BuildOperationMetadata = _reflection.GeneratedProtocolMessageType( - "BuildOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_BUILDOPERATIONMETADATA, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Metadata for build operations. - - - Attributes: - build: - The build that the operation is tracking. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.BuildOperationMetadata) - ), -) -_sym_db.RegisterMessage(BuildOperationMetadata) - -SourceProvenance = _reflection.GeneratedProtocolMessageType( - "SourceProvenance", - (_message.Message,), - dict( - FileHashesEntry=_reflection.GeneratedProtocolMessageType( - "FileHashesEntry", - (_message.Message,), - dict( - DESCRIPTOR=_SOURCEPROVENANCE_FILEHASHESENTRY, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2" - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.SourceProvenance.FileHashesEntry) - ), - ), - DESCRIPTOR=_SOURCEPROVENANCE, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Provenance of the source. Ways to find the original - source, or verify that some source was used for this build. - - - Attributes: - resolved_storage_source: - A copy of the build's ``source.storage_source``, if exists, - with any generations resolved. - resolved_repo_source: - A copy of the build's ``source.repo_source``, if exists, with - any revisions resolved. - file_hashes: - Output only. Hash(es) of the build source, which can be used - to verify that the original source integrity was maintained in - the build. Note that ``FileHashes`` will only be populated if - ``BuildOptions`` has requested a ``SourceProvenanceHash``. - The keys to this map are file paths used as build source and - the values contain the hash values for those files. If the - build source came in a single package such as a gzipped - tarfile (``.tar.gz``), the ``FileHash`` will be for the single - path to that file. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.SourceProvenance) - ), -) -_sym_db.RegisterMessage(SourceProvenance) -_sym_db.RegisterMessage(SourceProvenance.FileHashesEntry) - -FileHashes = _reflection.GeneratedProtocolMessageType( - "FileHashes", - (_message.Message,), - dict( - DESCRIPTOR=_FILEHASHES, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Container message for hashes of byte content of files, - used in SourceProvenance messages to verify integrity of source input to - the build. - - - Attributes: - file_hash: - Collection of file hashes. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.FileHashes) - ), -) -_sym_db.RegisterMessage(FileHashes) - -Hash = _reflection.GeneratedProtocolMessageType( - "Hash", - (_message.Message,), - dict( - DESCRIPTOR=_HASH, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Container message for hash values. - - - Attributes: - type: - The type of hash that was performed. - value: - The hash value. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.Hash) - ), -) -_sym_db.RegisterMessage(Hash) - -Secret = _reflection.GeneratedProtocolMessageType( - "Secret", - (_message.Message,), - dict( - SecretEnvEntry=_reflection.GeneratedProtocolMessageType( - "SecretEnvEntry", - (_message.Message,), - dict( - DESCRIPTOR=_SECRET_SECRETENVENTRY, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2" - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.Secret.SecretEnvEntry) - ), - ), - DESCRIPTOR=_SECRET, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Pairs a set of secret environment variables containing - encrypted values with the Cloud KMS key to use to decrypt the value. - - - Attributes: - kms_key_name: - Cloud KMS key name to use to decrypt these envs. - secret_env: - Map of environment variable name to its encrypted value. - Secret environment variables must be unique across all of a - build's secrets, and must be used by at least one build step. - Values can be at most 64 KB in size. There can be at most 100 - secret values across all of a build's secrets. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.Secret) - ), -) -_sym_db.RegisterMessage(Secret) -_sym_db.RegisterMessage(Secret.SecretEnvEntry) - -CreateBuildRequest = _reflection.GeneratedProtocolMessageType( - "CreateBuildRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEBUILDREQUEST, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Request to create a new build. - - - Attributes: - project_id: - Required. ID of the project. - build: - Required. Build resource to create. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.CreateBuildRequest) - ), -) -_sym_db.RegisterMessage(CreateBuildRequest) - -GetBuildRequest = _reflection.GeneratedProtocolMessageType( - "GetBuildRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETBUILDREQUEST, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Request to get a build. - - - Attributes: - project_id: - Required. ID of the project. - id: - Required. ID of the build. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.GetBuildRequest) - ), -) -_sym_db.RegisterMessage(GetBuildRequest) - -ListBuildsRequest = _reflection.GeneratedProtocolMessageType( - "ListBuildsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTBUILDSREQUEST, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Request to list builds. - - - Attributes: - project_id: - Required. ID of the project. - page_size: - Number of results to return in the list. - page_token: - Token to provide to skip to a particular spot in the list. - filter: - The raw filter text to constrain the results. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.ListBuildsRequest) - ), -) -_sym_db.RegisterMessage(ListBuildsRequest) - -ListBuildsResponse = _reflection.GeneratedProtocolMessageType( - "ListBuildsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTBUILDSRESPONSE, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Response including listed builds. - - - Attributes: - builds: - Builds will be sorted by ``create_time``, descending. - next_page_token: - Token to receive the next page of results. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.ListBuildsResponse) - ), -) -_sym_db.RegisterMessage(ListBuildsResponse) - -CancelBuildRequest = _reflection.GeneratedProtocolMessageType( - "CancelBuildRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CANCELBUILDREQUEST, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Request to cancel an ongoing build. - - - Attributes: - project_id: - Required. ID of the project. - id: - Required. ID of the build. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.CancelBuildRequest) - ), -) -_sym_db.RegisterMessage(CancelBuildRequest) - -BuildTrigger = _reflection.GeneratedProtocolMessageType( - "BuildTrigger", - (_message.Message,), - dict( - SubstitutionsEntry=_reflection.GeneratedProtocolMessageType( - "SubstitutionsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_BUILDTRIGGER_SUBSTITUTIONSENTRY, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2" - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.BuildTrigger.SubstitutionsEntry) - ), - ), - DESCRIPTOR=_BUILDTRIGGER, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Configuration for an automated build in response to source - repository changes. - - - Attributes: - id: - Output only. Unique identifier of the trigger. - description: - Human-readable description of this trigger. - name: - User assigned name of the trigger. Must be unique within the - project. - tags: - Tags for annotation of a ``BuildTrigger`` - trigger_template: - Template describing the types of source changes to trigger a - build. Branch and tag names in trigger templates are - interpreted as regular expressions. Any branch or tag change - that matches that regular expression will trigger a build. - Mutually exclusive with ``github``. - github: - GitHubEventsConfig describes the configuration of a trigger - that creates a build whenever a GitHub event is received. - Mutually exclusive with ``trigger_template``. - build_template: - Template describing the Build request to make when the trigger - is matched. - build: - Contents of the build template. - filename: - Path, from the source root, to a file whose contents is used - for the template. - create_time: - Output only. Time when the trigger was created. - disabled: - If true, the trigger will never result in a build. - substitutions: - Substitutions data for Build resource. - ignored_files: - ignored\_files and included\_files are file glob matches using - http://godoc/pkg/path/filepath#Match extended with support for - "\*\*". If ignored\_files and changed files are both empty, - then they are not used to determine whether or not to trigger - a build. If ignored\_files is not empty, then we ignore any - files that match any of the ignored\_file globs. If the change - has no files that are outside of the ignored\_files globs, - then we do not trigger a build. - included_files: - If any of the files altered in the commit pass the - ignored\_files filter and included\_files is empty, then as - far as this filter is concerned, we should trigger the build. - If any of the files altered in the commit pass the - ignored\_files filter and included\_files is not empty, then - we make sure that at least one of those files matches a - included\_files glob. If not, then we do not trigger a build. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.BuildTrigger) - ), -) -_sym_db.RegisterMessage(BuildTrigger) -_sym_db.RegisterMessage(BuildTrigger.SubstitutionsEntry) - -GitHubEventsConfig = _reflection.GeneratedProtocolMessageType( - "GitHubEventsConfig", - (_message.Message,), - dict( - DESCRIPTOR=_GITHUBEVENTSCONFIG, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""GitHubEventsConfig describes the configuration of a - trigger that creates a build whenever a GitHub event is received. - - This message is experimental. - - - Attributes: - installation_id: - The installationID that emits the GitHub event. - owner: - Owner of the repository. For example: The owner for - https://github.com/googlecloudplatform/cloud-builders is - "googlecloudplatform". - name: - Name of the repository. For example: The name for - https://github.com/googlecloudplatform/cloud-builders is - "cloud-builders". - event: - Filter describing the types of events to trigger a build. - Currently supported event types: push, pull\_request. - pull_request: - filter to match changes in pull requests. - push: - filter to match changes in refs like branches, tags. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.GitHubEventsConfig) - ), -) -_sym_db.RegisterMessage(GitHubEventsConfig) - -PullRequestFilter = _reflection.GeneratedProtocolMessageType( - "PullRequestFilter", - (_message.Message,), - dict( - DESCRIPTOR=_PULLREQUESTFILTER, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""PullRequestFilter contains filter properties for matching - GitHub Pull Requests. - - - Attributes: - git_ref: - Target refs to match. A target ref is the git reference where - the pull request will be applied. - branch: - Regex of branches to match. The syntax of the regular - expressions accepted is the syntax accepted by RE2 and - described at https://github.com/google/re2/wiki/Syntax - comment_control: - Whether to block builds on a "/gcbrun" comment from a - repository owner or collaborator. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.PullRequestFilter) - ), -) -_sym_db.RegisterMessage(PullRequestFilter) - -PushFilter = _reflection.GeneratedProtocolMessageType( - "PushFilter", - (_message.Message,), - dict( - DESCRIPTOR=_PUSHFILTER, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Push contains filter properties for matching GitHub git - pushes. - - - Attributes: - git_ref: - Modified refs to match. A modified refs are the refs modified - by a git push operation. - branch: - Regexes matching branches to build. The syntax of the regular - expressions accepted is the syntax accepted by RE2 and - described at https://github.com/google/re2/wiki/Syntax - tag: - Regexes matching tags to build. The syntax of the regular - expressions accepted is the syntax accepted by RE2 and - described at https://github.com/google/re2/wiki/Syntax - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.PushFilter) - ), -) -_sym_db.RegisterMessage(PushFilter) - -CreateBuildTriggerRequest = _reflection.GeneratedProtocolMessageType( - "CreateBuildTriggerRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEBUILDTRIGGERREQUEST, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Request to create a new ``BuildTrigger``. - - - Attributes: - project_id: - Required. ID of the project for which to configure automatic - builds. - trigger: - Required. ``BuildTrigger`` to create. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.CreateBuildTriggerRequest) - ), -) -_sym_db.RegisterMessage(CreateBuildTriggerRequest) - -GetBuildTriggerRequest = _reflection.GeneratedProtocolMessageType( - "GetBuildTriggerRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETBUILDTRIGGERREQUEST, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Returns the ``BuildTrigger`` with the specified ID. - - - Attributes: - project_id: - Required. ID of the project that owns the trigger. - trigger_id: - Required. ID of the ``BuildTrigger`` to get. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.GetBuildTriggerRequest) - ), -) -_sym_db.RegisterMessage(GetBuildTriggerRequest) - -ListBuildTriggersRequest = _reflection.GeneratedProtocolMessageType( - "ListBuildTriggersRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTBUILDTRIGGERSREQUEST, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Request to list existing ``BuildTriggers``. - - - Attributes: - project_id: - Required. ID of the project for which to list BuildTriggers. - page_size: - Number of results to return in the list. - page_token: - Token to provide to skip to a particular spot in the list. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.ListBuildTriggersRequest) - ), -) -_sym_db.RegisterMessage(ListBuildTriggersRequest) - -ListBuildTriggersResponse = _reflection.GeneratedProtocolMessageType( - "ListBuildTriggersResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTBUILDTRIGGERSRESPONSE, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Response containing existing ``BuildTriggers``. - - - Attributes: - triggers: - \ ``BuildTriggers`` for the project, sorted by ``create_time`` - descending. - next_page_token: - Token to receive the next page of results. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.ListBuildTriggersResponse) - ), -) -_sym_db.RegisterMessage(ListBuildTriggersResponse) - -DeleteBuildTriggerRequest = _reflection.GeneratedProtocolMessageType( - "DeleteBuildTriggerRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEBUILDTRIGGERREQUEST, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Request to delete a ``BuildTrigger``. - - - Attributes: - project_id: - Required. ID of the project that owns the trigger. - trigger_id: - Required. ID of the ``BuildTrigger`` to delete. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest) - ), -) -_sym_db.RegisterMessage(DeleteBuildTriggerRequest) - -UpdateBuildTriggerRequest = _reflection.GeneratedProtocolMessageType( - "UpdateBuildTriggerRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEBUILDTRIGGERREQUEST, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Request to update an existing ``BuildTrigger``. - - - Attributes: - project_id: - Required. ID of the project that owns the trigger. - trigger_id: - Required. ID of the ``BuildTrigger`` to update. - trigger: - Required. ``BuildTrigger`` to update. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest) - ), -) -_sym_db.RegisterMessage(UpdateBuildTriggerRequest) - -BuildOptions = _reflection.GeneratedProtocolMessageType( - "BuildOptions", - (_message.Message,), - dict( - DESCRIPTOR=_BUILDOPTIONS, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Optional arguments to enable specific features of builds. - - - Attributes: - source_provenance_hash: - Requested hash for SourceProvenance. - requested_verify_option: - Requested verifiability options. - machine_type: - Compute Engine machine type on which to run the build. - disk_size_gb: - Requested disk size for the VM that runs the build. Note that - this is *NOT* "disk free"; some of the space will be used by - the operating system and build utilities. Also note that this - is the minimum disk size that will be allocated for the build - -- the build may run with a larger disk than requested. At - present, the maximum disk size is 1000GB; builds that request - more than the maximum are rejected with an error. - substitution_option: - Option to specify behavior when there is an error in the - substitution checks. - log_streaming_option: - Option to define build log streaming behavior to Google Cloud - Storage. - worker_pool: - Option to specify a ``WorkerPool`` for the build. User - specifies the pool with the format - "[WORKERPOOL\_PROJECT\_ID]/[WORKERPOOL\_NAME]". This is an - experimental field. - logging: - Option to specify the logging mode, which determines where the - logs are stored. - env: - A list of global environment variable definitions that will - exist for all build steps in this build. If a variable is - defined in both globally and in a build step, the variable - will use the build step value. The elements are of the form - "KEY=VALUE" for the environment variable "KEY" being given the - value "VALUE". - secret_env: - A list of global environment variables, which are encrypted - using a Cloud Key Management Service crypto key. These values - must be specified in the build's ``Secret``. These variables - will be available to all build steps in this build. - volumes: - Global list of volumes to mount for ALL build steps Each - volume is created as an empty volume prior to starting the - build process. Upon completion of the build, volumes and their - contents are discarded. Global volume names and paths cannot - conflict with the volumes defined a build step. Using a - global volume in a build with only one step is not valid as it - is indicative of a build request with an incorrect - configuration. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.BuildOptions) - ), -) -_sym_db.RegisterMessage(BuildOptions) - -WorkerPool = _reflection.GeneratedProtocolMessageType( - "WorkerPool", - (_message.Message,), - dict( - DESCRIPTOR=_WORKERPOOL, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Configuration for a WorkerPool to run the builds. - - Workers are machines that Cloud Build uses to run your builds. By - default, all workers run in a project owned by Cloud Build. To have full - control over the workers that execute your builds -- such as enabling - them to access private resources on your private network -- you can - request Cloud Build to run the workers in your own project by creating a - custom workers pool. - - - Attributes: - name: - User-defined name of the ``WorkerPool``. - project_id: - The project ID of the GCP project for which the ``WorkerPool`` - is created. - service_account_email: - Output only. The service account used to manage the - ``WorkerPool``. The service account must have the Compute - Instance Admin (Beta) permission at the project level. - worker_count: - Total number of workers to be created across all requested - regions. - worker_config: - Configuration to be used for a creating workers in the - ``WorkerPool``. - regions: - List of regions to create the ``WorkerPool``. Regions can't be - empty. If Cloud Build adds a new GCP region in the future, the - existing ``WorkerPool`` will not be enabled in the new region - automatically; you must add the new region to the ``regions`` - field to enable the ``WorkerPool`` in that region. - create_time: - Output only. Time at which the request to create the - ``WorkerPool`` was received. - update_time: - Output only. Time at which the request to update the - ``WorkerPool`` was received. - delete_time: - Output only. Time at which the request to delete the - ``WorkerPool`` was received. - status: - Output only. WorkerPool Status. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.WorkerPool) - ), -) -_sym_db.RegisterMessage(WorkerPool) - -WorkerConfig = _reflection.GeneratedProtocolMessageType( - "WorkerConfig", - (_message.Message,), - dict( - DESCRIPTOR=_WORKERCONFIG, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""WorkerConfig defines the configuration to be used for a - creating workers in the pool. - - - Attributes: - machine_type: - Machine Type of the worker, such as n1-standard-1. See - https://cloud.google.com/compute/docs/machine-types. If left - blank, Cloud Build will use a standard unspecified machine to - create the worker pool. ``machine_type`` is overridden if you - specify a different machine type in ``build_options``. In this - case, the VM specified in the ``build_options`` will be - created on demand at build time. For more information see - https://cloud.google.com/cloud-build/docs/speeding-up- - builds#using\_custom\_virtual\_machine\_sizes - disk_size_gb: - Size of the disk attached to the worker, in GB. See - https://cloud.google.com/compute/docs/disks/ If ``0`` is - specified, Cloud Build will use a standard disk size. - ``disk_size`` is overridden if you specify a different disk - size in ``build_options``. In this case, a VM with a disk size - specified in the ``build_options`` will be created on demand - at build time. For more information see - https://cloud.google.com/cloud- - build/docs/api/reference/rest/v1/projects.builds#buildoptions - network: - The network definition used to create the worker. If this - section is left empty, the workers will be created in - WorkerPool.project\_id on the default network. - tag: - The tag applied to the worker, and the same tag used by the - firewall rule. It is used to identify the Cloud Build workers - among other VMs. The default value for tag is ``worker``. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.WorkerConfig) - ), -) -_sym_db.RegisterMessage(WorkerConfig) - -Network = _reflection.GeneratedProtocolMessageType( - "Network", - (_message.Message,), - dict( - DESCRIPTOR=_NETWORK, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Network describes the GCP network used to create workers - in. - - - Attributes: - project_id: - Project id containing the defined network and subnetwork. For - a peered VPC, this will be the same as the project\_id in - which the workers are created. For a shared VPC, this will be - the project sharing the network with the project\_id project - in which workers will be created. For custom workers with no - VPC, this will be the same as project\_id. - network: - Network on which the workers are created. "default" network is - used if empty. - subnetwork: - Subnetwork on which the workers are created. "default" - subnetwork is used if empty. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.Network) - ), -) -_sym_db.RegisterMessage(Network) - -CreateWorkerPoolRequest = _reflection.GeneratedProtocolMessageType( - "CreateWorkerPoolRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEWORKERPOOLREQUEST, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Request to create a new ``WorkerPool``. - - - Attributes: - parent: - ID of the parent project. - worker_pool: - \ ``WorkerPool`` resource to create. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.CreateWorkerPoolRequest) - ), -) -_sym_db.RegisterMessage(CreateWorkerPoolRequest) - -GetWorkerPoolRequest = _reflection.GeneratedProtocolMessageType( - "GetWorkerPoolRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETWORKERPOOLREQUEST, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Request to get a ``WorkerPool`` with the specified name. - - - Attributes: - name: - The field will contain name of the resource requested, for - example: "projects/project-1/workerPools/workerpool-name" - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.GetWorkerPoolRequest) - ), -) -_sym_db.RegisterMessage(GetWorkerPoolRequest) - -DeleteWorkerPoolRequest = _reflection.GeneratedProtocolMessageType( - "DeleteWorkerPoolRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEWORKERPOOLREQUEST, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Request to delete a ``WorkerPool``. - - - Attributes: - name: - The field will contain name of the resource requested, for - example: "projects/project-1/workerPools/workerpool-name" - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest) - ), -) -_sym_db.RegisterMessage(DeleteWorkerPoolRequest) - -UpdateWorkerPoolRequest = _reflection.GeneratedProtocolMessageType( - "UpdateWorkerPoolRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEWORKERPOOLREQUEST, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Request to update a ``WorkerPool``. - - - Attributes: - name: - The field will contain name of the resource requested, for - example: "projects/project-1/workerPools/workerpool-name" - worker_pool: - \ ``WorkerPool`` resource to update. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest) - ), -) -_sym_db.RegisterMessage(UpdateWorkerPoolRequest) - -ListWorkerPoolsRequest = _reflection.GeneratedProtocolMessageType( - "ListWorkerPoolsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTWORKERPOOLSREQUEST, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Request to list ``WorkerPool``\ s. - - - Attributes: - parent: - ID of the parent project. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.ListWorkerPoolsRequest) - ), -) -_sym_db.RegisterMessage(ListWorkerPoolsRequest) - -ListWorkerPoolsResponse = _reflection.GeneratedProtocolMessageType( - "ListWorkerPoolsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTWORKERPOOLSRESPONSE, - __module__="google.devtools.cloudbuild_v1.proto.cloudbuild_pb2", - __doc__="""Response containing existing ``WorkerPools``. - - - Attributes: - worker_pools: - \ ``WorkerPools`` for the project. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.ListWorkerPoolsResponse) - ), -) -_sym_db.RegisterMessage(ListWorkerPoolsResponse) - - -DESCRIPTOR._options = None -_RETRYBUILDREQUEST.fields_by_name["project_id"]._options = None -_RETRYBUILDREQUEST.fields_by_name["id"]._options = None -_RUNBUILDTRIGGERREQUEST.fields_by_name["project_id"]._options = None -_RUNBUILDTRIGGERREQUEST.fields_by_name["trigger_id"]._options = None -_RUNBUILDTRIGGERREQUEST.fields_by_name["source"]._options = None -_BUILD_SUBSTITUTIONSENTRY._options = None -_BUILD_TIMINGENTRY._options = None -_SOURCEPROVENANCE_FILEHASHESENTRY._options = None -_SECRET_SECRETENVENTRY._options = None -_CREATEBUILDREQUEST.fields_by_name["project_id"]._options = None -_CREATEBUILDREQUEST.fields_by_name["build"]._options = None -_GETBUILDREQUEST.fields_by_name["project_id"]._options = None -_GETBUILDREQUEST.fields_by_name["id"]._options = None -_LISTBUILDSREQUEST.fields_by_name["project_id"]._options = None -_CANCELBUILDREQUEST.fields_by_name["project_id"]._options = None -_CANCELBUILDREQUEST.fields_by_name["id"]._options = None -_BUILDTRIGGER_SUBSTITUTIONSENTRY._options = None -_GITHUBEVENTSCONFIG.fields_by_name["installation_id"]._options = None -_CREATEBUILDTRIGGERREQUEST.fields_by_name["project_id"]._options = None -_CREATEBUILDTRIGGERREQUEST.fields_by_name["trigger"]._options = None -_GETBUILDTRIGGERREQUEST.fields_by_name["project_id"]._options = None -_GETBUILDTRIGGERREQUEST.fields_by_name["trigger_id"]._options = None -_LISTBUILDTRIGGERSREQUEST.fields_by_name["project_id"]._options = None -_DELETEBUILDTRIGGERREQUEST.fields_by_name["project_id"]._options = None -_DELETEBUILDTRIGGERREQUEST.fields_by_name["trigger_id"]._options = None -_UPDATEBUILDTRIGGERREQUEST.fields_by_name["project_id"]._options = None -_UPDATEBUILDTRIGGERREQUEST.fields_by_name["trigger_id"]._options = None -_UPDATEBUILDTRIGGERREQUEST.fields_by_name["trigger"]._options = None - -_CLOUDBUILD = _descriptor.ServiceDescriptor( - name="CloudBuild", - full_name="google.devtools.cloudbuild.v1.CloudBuild", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\031cloudbuild.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=8476, - serialized_end=11325, - methods=[ - _descriptor.MethodDescriptor( - name="CreateBuild", - full_name="google.devtools.cloudbuild.v1.CloudBuild.CreateBuild", - index=0, - containing_service=None, - input_type=_CREATEBUILDREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002)" /v1/projects/{project_id}/builds:\005build\332A\020project_id,build\312A\037\n\005Build\022\026BuildOperationMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="GetBuild", - full_name="google.devtools.cloudbuild.v1.CloudBuild.GetBuild", - index=1, - containing_service=None, - input_type=_GETBUILDREQUEST, - output_type=_BUILD, - serialized_options=_b( - "\202\323\344\223\002'\022%/v1/projects/{project_id}/builds/{id}\332A\rproject_id,id" - ), - ), - _descriptor.MethodDescriptor( - name="ListBuilds", - full_name="google.devtools.cloudbuild.v1.CloudBuild.ListBuilds", - index=2, - containing_service=None, - input_type=_LISTBUILDSREQUEST, - output_type=_LISTBUILDSRESPONSE, - serialized_options=_b( - '\202\323\344\223\002"\022 /v1/projects/{project_id}/builds\332A\021project_id,filter' - ), - ), - _descriptor.MethodDescriptor( - name="CancelBuild", - full_name="google.devtools.cloudbuild.v1.CloudBuild.CancelBuild", - index=3, - containing_service=None, - input_type=_CANCELBUILDREQUEST, - output_type=_BUILD, - serialized_options=_b( - '\202\323\344\223\0021",/v1/projects/{project_id}/builds/{id}:cancel:\001*\332A\rproject_id,id' - ), - ), - _descriptor.MethodDescriptor( - name="RetryBuild", - full_name="google.devtools.cloudbuild.v1.CloudBuild.RetryBuild", - index=4, - containing_service=None, - input_type=_RETRYBUILDREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\0020"+/v1/projects/{project_id}/builds/{id}:retry:\001*\332A\rproject_id,id\312A\037\n\005Build\022\026BuildOperationMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="CreateBuildTrigger", - full_name="google.devtools.cloudbuild.v1.CloudBuild.CreateBuildTrigger", - index=5, - containing_service=None, - input_type=_CREATEBUILDTRIGGERREQUEST, - output_type=_BUILDTRIGGER, - serialized_options=_b( - '\202\323\344\223\002-""/v1/projects/{project_id}/triggers:\007trigger\332A\022project_id,trigger' - ), - ), - _descriptor.MethodDescriptor( - name="GetBuildTrigger", - full_name="google.devtools.cloudbuild.v1.CloudBuild.GetBuildTrigger", - index=6, - containing_service=None, - input_type=_GETBUILDTRIGGERREQUEST, - output_type=_BUILDTRIGGER, - serialized_options=_b( - "\202\323\344\223\0021\022//v1/projects/{project_id}/triggers/{trigger_id}\332A\025project_id,trigger_id" - ), - ), - _descriptor.MethodDescriptor( - name="ListBuildTriggers", - full_name="google.devtools.cloudbuild.v1.CloudBuild.ListBuildTriggers", - index=7, - containing_service=None, - input_type=_LISTBUILDTRIGGERSREQUEST, - output_type=_LISTBUILDTRIGGERSRESPONSE, - serialized_options=_b( - '\202\323\344\223\002$\022"/v1/projects/{project_id}/triggers\332A\nproject_id' - ), - ), - _descriptor.MethodDescriptor( - name="DeleteBuildTrigger", - full_name="google.devtools.cloudbuild.v1.CloudBuild.DeleteBuildTrigger", - index=8, - containing_service=None, - input_type=_DELETEBUILDTRIGGERREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\0021*//v1/projects/{project_id}/triggers/{trigger_id}\332A\025project_id,trigger_id" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateBuildTrigger", - full_name="google.devtools.cloudbuild.v1.CloudBuild.UpdateBuildTrigger", - index=9, - containing_service=None, - input_type=_UPDATEBUILDTRIGGERREQUEST, - output_type=_BUILDTRIGGER, - serialized_options=_b( - "\202\323\344\223\002:2//v1/projects/{project_id}/triggers/{trigger_id}:\007trigger\332A\035project_id,trigger_id,trigger" - ), - ), - _descriptor.MethodDescriptor( - name="RunBuildTrigger", - full_name="google.devtools.cloudbuild.v1.CloudBuild.RunBuildTrigger", - index=10, - containing_service=None, - input_type=_RUNBUILDTRIGGERREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002="3/v1/projects/{project_id}/triggers/{trigger_id}:run:\006source\332A\034project_id,trigger_id,source\312A\037\n\005Build\022\026BuildOperationMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="CreateWorkerPool", - full_name="google.devtools.cloudbuild.v1.CloudBuild.CreateWorkerPool", - index=11, - containing_service=None, - input_type=_CREATEWORKERPOOLREQUEST, - output_type=_WORKERPOOL, - serialized_options=None, - ), - _descriptor.MethodDescriptor( - name="GetWorkerPool", - full_name="google.devtools.cloudbuild.v1.CloudBuild.GetWorkerPool", - index=12, - containing_service=None, - input_type=_GETWORKERPOOLREQUEST, - output_type=_WORKERPOOL, - serialized_options=None, - ), - _descriptor.MethodDescriptor( - name="DeleteWorkerPool", - full_name="google.devtools.cloudbuild.v1.CloudBuild.DeleteWorkerPool", - index=13, - containing_service=None, - input_type=_DELETEWORKERPOOLREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=None, - ), - _descriptor.MethodDescriptor( - name="UpdateWorkerPool", - full_name="google.devtools.cloudbuild.v1.CloudBuild.UpdateWorkerPool", - index=14, - containing_service=None, - input_type=_UPDATEWORKERPOOLREQUEST, - output_type=_WORKERPOOL, - serialized_options=None, - ), - _descriptor.MethodDescriptor( - name="ListWorkerPools", - full_name="google.devtools.cloudbuild.v1.CloudBuild.ListWorkerPools", - index=15, - containing_service=None, - input_type=_LISTWORKERPOOLSREQUEST, - output_type=_LISTWORKERPOOLSRESPONSE, - serialized_options=None, - ), - ], -) -_sym_db.RegisterServiceDescriptor(_CLOUDBUILD) - -DESCRIPTOR.services_by_name["CloudBuild"] = _CLOUDBUILD - -# @@protoc_insertion_point(module_scope) diff --git a/cloudbuild/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild_pb2_grpc.py b/cloudbuild/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild_pb2_grpc.py deleted file mode 100644 index c8abcba7c2ab..000000000000 --- a/cloudbuild/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild_pb2_grpc.py +++ /dev/null @@ -1,378 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.devtools.cloudbuild_v1.proto import ( - cloudbuild_pb2 as google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class CloudBuildStub(object): - """Creates and manages builds on Google Cloud Platform. - - The main concept used by this API is a `Build`, which describes the location - of the source to build, how to build the source, and where to store the - built artifacts, if any. - - A user can list previously-requested builds or get builds by their ID to - determine the status of the build. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateBuild = channel.unary_unary( - "/google.devtools.cloudbuild.v1.CloudBuild/CreateBuild", - request_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.CreateBuildRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.GetBuild = channel.unary_unary( - "/google.devtools.cloudbuild.v1.CloudBuild/GetBuild", - request_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.GetBuildRequest.SerializeToString, - response_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.Build.FromString, - ) - self.ListBuilds = channel.unary_unary( - "/google.devtools.cloudbuild.v1.CloudBuild/ListBuilds", - request_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.ListBuildsRequest.SerializeToString, - response_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.ListBuildsResponse.FromString, - ) - self.CancelBuild = channel.unary_unary( - "/google.devtools.cloudbuild.v1.CloudBuild/CancelBuild", - request_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.CancelBuildRequest.SerializeToString, - response_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.Build.FromString, - ) - self.RetryBuild = channel.unary_unary( - "/google.devtools.cloudbuild.v1.CloudBuild/RetryBuild", - request_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.RetryBuildRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.CreateBuildTrigger = channel.unary_unary( - "/google.devtools.cloudbuild.v1.CloudBuild/CreateBuildTrigger", - request_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.CreateBuildTriggerRequest.SerializeToString, - response_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.BuildTrigger.FromString, - ) - self.GetBuildTrigger = channel.unary_unary( - "/google.devtools.cloudbuild.v1.CloudBuild/GetBuildTrigger", - request_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.GetBuildTriggerRequest.SerializeToString, - response_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.BuildTrigger.FromString, - ) - self.ListBuildTriggers = channel.unary_unary( - "/google.devtools.cloudbuild.v1.CloudBuild/ListBuildTriggers", - request_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.ListBuildTriggersRequest.SerializeToString, - response_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.ListBuildTriggersResponse.FromString, - ) - self.DeleteBuildTrigger = channel.unary_unary( - "/google.devtools.cloudbuild.v1.CloudBuild/DeleteBuildTrigger", - request_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.DeleteBuildTriggerRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.UpdateBuildTrigger = channel.unary_unary( - "/google.devtools.cloudbuild.v1.CloudBuild/UpdateBuildTrigger", - request_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.UpdateBuildTriggerRequest.SerializeToString, - response_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.BuildTrigger.FromString, - ) - self.RunBuildTrigger = channel.unary_unary( - "/google.devtools.cloudbuild.v1.CloudBuild/RunBuildTrigger", - request_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.RunBuildTriggerRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.CreateWorkerPool = channel.unary_unary( - "/google.devtools.cloudbuild.v1.CloudBuild/CreateWorkerPool", - request_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.CreateWorkerPoolRequest.SerializeToString, - response_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.WorkerPool.FromString, - ) - self.GetWorkerPool = channel.unary_unary( - "/google.devtools.cloudbuild.v1.CloudBuild/GetWorkerPool", - request_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.GetWorkerPoolRequest.SerializeToString, - response_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.WorkerPool.FromString, - ) - self.DeleteWorkerPool = channel.unary_unary( - "/google.devtools.cloudbuild.v1.CloudBuild/DeleteWorkerPool", - request_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.DeleteWorkerPoolRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.UpdateWorkerPool = channel.unary_unary( - "/google.devtools.cloudbuild.v1.CloudBuild/UpdateWorkerPool", - request_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.UpdateWorkerPoolRequest.SerializeToString, - response_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.WorkerPool.FromString, - ) - self.ListWorkerPools = channel.unary_unary( - "/google.devtools.cloudbuild.v1.CloudBuild/ListWorkerPools", - request_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.ListWorkerPoolsRequest.SerializeToString, - response_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.ListWorkerPoolsResponse.FromString, - ) - - -class CloudBuildServicer(object): - """Creates and manages builds on Google Cloud Platform. - - The main concept used by this API is a `Build`, which describes the location - of the source to build, how to build the source, and where to store the - built artifacts, if any. - - A user can list previously-requested builds or get builds by their ID to - determine the status of the build. - """ - - def CreateBuild(self, request, context): - """Starts a build with the specified configuration. - - This method returns a long-running `Operation`, which includes the build - ID. Pass the build ID to `GetBuild` to determine the build status (such as - `SUCCESS` or `FAILURE`). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetBuild(self, request, context): - """Returns information about a previously requested build. - - The `Build` that is returned includes its status (such as `SUCCESS`, - `FAILURE`, or `WORKING`), and timing information. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListBuilds(self, request, context): - """Lists previously requested builds. - - Previously requested builds may still be in-progress, or may have finished - successfully or unsuccessfully. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CancelBuild(self, request, context): - """Cancels a build in progress. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def RetryBuild(self, request, context): - """Creates a new build based on the specified build. - - This method creates a new build using the original build request, which may - or may not result in an identical build. - - For triggered builds: - - * Triggered builds resolve to a precise revision; therefore a retry of a - triggered build will result in a build that uses the same revision. - - For non-triggered builds that specify `RepoSource`: - - * If the original build built from the tip of a branch, the retried build - will build from the tip of that branch, which may not be the same revision - as the original build. - * If the original build specified a commit sha or revision ID, the retried - build will use the identical source. - - For builds that specify `StorageSource`: - - * If the original build pulled source from Google Cloud Storage without - specifying the generation of the object, the new build will use the current - object, which may be different from the original build source. - * If the original build pulled source from Cloud Storage and specified the - generation of the object, the new build will attempt to use the same - object, which may or may not be available depending on the bucket's - lifecycle management settings. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateBuildTrigger(self, request, context): - """Creates a new `BuildTrigger`. - - This API is experimental. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetBuildTrigger(self, request, context): - """Returns information about a `BuildTrigger`. - - This API is experimental. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListBuildTriggers(self, request, context): - """Lists existing `BuildTrigger`s. - - This API is experimental. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteBuildTrigger(self, request, context): - """Deletes a `BuildTrigger` by its project ID and trigger ID. - - This API is experimental. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateBuildTrigger(self, request, context): - """Updates a `BuildTrigger` by its project ID and trigger ID. - - This API is experimental. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def RunBuildTrigger(self, request, context): - """Runs a `BuildTrigger` at a particular source revision. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateWorkerPool(self, request, context): - """Creates a `WorkerPool` to run the builds, and returns the new worker pool. - - This API is experimental. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetWorkerPool(self, request, context): - """Returns information about a `WorkerPool`. - - This API is experimental. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteWorkerPool(self, request, context): - """Deletes a `WorkerPool` by its project ID and WorkerPool name. - - This API is experimental. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateWorkerPool(self, request, context): - """Update a `WorkerPool`. - - This API is experimental. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListWorkerPools(self, request, context): - """List project's `WorkerPool`s. - - This API is experimental. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_CloudBuildServicer_to_server(servicer, server): - rpc_method_handlers = { - "CreateBuild": grpc.unary_unary_rpc_method_handler( - servicer.CreateBuild, - request_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.CreateBuildRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "GetBuild": grpc.unary_unary_rpc_method_handler( - servicer.GetBuild, - request_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.GetBuildRequest.FromString, - response_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.Build.SerializeToString, - ), - "ListBuilds": grpc.unary_unary_rpc_method_handler( - servicer.ListBuilds, - request_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.ListBuildsRequest.FromString, - response_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.ListBuildsResponse.SerializeToString, - ), - "CancelBuild": grpc.unary_unary_rpc_method_handler( - servicer.CancelBuild, - request_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.CancelBuildRequest.FromString, - response_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.Build.SerializeToString, - ), - "RetryBuild": grpc.unary_unary_rpc_method_handler( - servicer.RetryBuild, - request_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.RetryBuildRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "CreateBuildTrigger": grpc.unary_unary_rpc_method_handler( - servicer.CreateBuildTrigger, - request_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.CreateBuildTriggerRequest.FromString, - response_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.BuildTrigger.SerializeToString, - ), - "GetBuildTrigger": grpc.unary_unary_rpc_method_handler( - servicer.GetBuildTrigger, - request_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.GetBuildTriggerRequest.FromString, - response_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.BuildTrigger.SerializeToString, - ), - "ListBuildTriggers": grpc.unary_unary_rpc_method_handler( - servicer.ListBuildTriggers, - request_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.ListBuildTriggersRequest.FromString, - response_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.ListBuildTriggersResponse.SerializeToString, - ), - "DeleteBuildTrigger": grpc.unary_unary_rpc_method_handler( - servicer.DeleteBuildTrigger, - request_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.DeleteBuildTriggerRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "UpdateBuildTrigger": grpc.unary_unary_rpc_method_handler( - servicer.UpdateBuildTrigger, - request_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.UpdateBuildTriggerRequest.FromString, - response_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.BuildTrigger.SerializeToString, - ), - "RunBuildTrigger": grpc.unary_unary_rpc_method_handler( - servicer.RunBuildTrigger, - request_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.RunBuildTriggerRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "CreateWorkerPool": grpc.unary_unary_rpc_method_handler( - servicer.CreateWorkerPool, - request_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.CreateWorkerPoolRequest.FromString, - response_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.WorkerPool.SerializeToString, - ), - "GetWorkerPool": grpc.unary_unary_rpc_method_handler( - servicer.GetWorkerPool, - request_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.GetWorkerPoolRequest.FromString, - response_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.WorkerPool.SerializeToString, - ), - "DeleteWorkerPool": grpc.unary_unary_rpc_method_handler( - servicer.DeleteWorkerPool, - request_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.DeleteWorkerPoolRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "UpdateWorkerPool": grpc.unary_unary_rpc_method_handler( - servicer.UpdateWorkerPool, - request_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.UpdateWorkerPoolRequest.FromString, - response_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.WorkerPool.SerializeToString, - ), - "ListWorkerPools": grpc.unary_unary_rpc_method_handler( - servicer.ListWorkerPools, - request_deserializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.ListWorkerPoolsRequest.FromString, - response_serializer=google_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.ListWorkerPoolsResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.devtools.cloudbuild.v1.CloudBuild", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/cloudbuild/google/cloud/devtools/cloudbuild_v1/types.py b/cloudbuild/google/cloud/devtools/cloudbuild_v1/types.py deleted file mode 100644 index fb2ebcd5e7fc..000000000000 --- a/cloudbuild/google/cloud/devtools/cloudbuild_v1/types.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.devtools.cloudbuild_v1.proto import cloudbuild_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import duration_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import timestamp_pb2 -from google.rpc import status_pb2 - - -_shared_modules = [ - operations_pb2, - any_pb2, - duration_pb2, - empty_pb2, - timestamp_pb2, - status_pb2, -] - -_local_modules = [cloudbuild_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.devtools.cloudbuild_v1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/cloudbuild/noxfile.py b/cloudbuild/noxfile.py deleted file mode 100644 index 595d6dd40596..000000000000 --- a/cloudbuild/noxfile.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=65") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/cloudbuild/setup.cfg b/cloudbuild/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/cloudbuild/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/cloudbuild/setup.py b/cloudbuild/setup.py deleted file mode 100644 index c53b7b014b0b..000000000000 --- a/cloudbuild/setup.py +++ /dev/null @@ -1,81 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import io -import os - -import setuptools - -name = "google-cloud-build" -description = "Google Cloud Build API client library" -version = "0.1.0" -# Should be one of: -# 'Development Status :: 3 - Alpha' -# 'Development Status :: 4 - Beta' -# 'Development Status :: 5 - Production/Stable' -release_status = "Development Status :: 3 - Alpha" -dependencies = [ - "google-api-core[grpc] >= 1.14.0, < 2.0.0dev", - 'enum34; python_version < "3.4"', -] - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") - -if "google.cloud.devtools" in packages: - namespaces.append("google.cloud.devtools") - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/googleapis/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - include_package_data=True, - zip_safe=False, -) diff --git a/cloudbuild/synth.metadata b/cloudbuild/synth.metadata deleted file mode 100644 index aa01ef27070b..000000000000 --- a/cloudbuild/synth.metadata +++ /dev/null @@ -1,153 +0,0 @@ -{ - "updateTime": "2020-01-30T13:16:30.046417Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c1246a29e22b0f98e800a536b5b0da2d933a55f2", - "internalRef": "292310790", - "log": "c1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\ncf3b61102ed5f36b827bc82ec39be09525f018c8\n Fix to protos for v1p1beta1 release of Cloud Security Command Center\n\nPiperOrigin-RevId: 292034635\n\n4e1cfaa7c0fede9e65d64213ca3da1b1255816c0\nUpdate the public proto to support UTF-8 encoded id for CatalogService API, increase the ListCatalogItems deadline to 300s and some minor documentation change\n\nPiperOrigin-RevId: 292030970\n\n9c483584f8fd5a1b862ae07973f4cc7bb3e46648\nasset: add annotations to v1p1beta1\n\nPiperOrigin-RevId: 292009868\n\ne19209fac29731d0baf6d9ac23da1164f7bdca24\nAdd the google.rpc.context.AttributeContext message to the open source\ndirectories.\n\nPiperOrigin-RevId: 291999930\n\nae5662960573f279502bf98a108a35ba1175e782\noslogin API: move file level option on top of the file to avoid protobuf.js bug.\n\nPiperOrigin-RevId: 291990506\n\neba3897fff7c49ed85d3c47fc96fe96e47f6f684\nAdd cc_proto_library and cc_grpc_library targets for Spanner and IAM protos.\n\nPiperOrigin-RevId: 291988651\n\n8e981acfd9b97ea2f312f11bbaa7b6c16e412dea\nBeta launch for PersonDetection and FaceDetection features.\n\nPiperOrigin-RevId: 291821782\n\n994e067fae3b21e195f7da932b08fff806d70b5d\nasset: add annotations to v1p2beta1\n\nPiperOrigin-RevId: 291815259\n\n244e1d2c89346ca2e0701b39e65552330d68545a\nAdd Playable Locations service\n\nPiperOrigin-RevId: 291806349\n\n909f8f67963daf45dd88d020877fb9029b76788d\nasset: add annotations to v1beta2\n\nPiperOrigin-RevId: 291805301\n\n3c39a1d6e23c1ef63c7fba4019c25e76c40dfe19\nKMS: add file-level message for CryptoKeyPath, it is defined in gapic yaml but not\nin proto files.\n\nPiperOrigin-RevId: 291420695\n\nc6f3f350b8387f8d1b85ed4506f30187ebaaddc3\ncontaineranalysis: update v1beta1 and bazel build with annotations\n\nPiperOrigin-RevId: 291401900\n\n92887d74b44e4e636252b7b8477d0d2570cd82db\nfix: fix the location of grpc config file.\n\nPiperOrigin-RevId: 291396015\n\ne26cab8afd19d396b929039dac5d874cf0b5336c\nexpr: add default_host and method_signature annotations to CelService\n\nPiperOrigin-RevId: 291240093\n\n06093ae3952441c34ec176d1f7431b8765cec0be\nirm: fix v1alpha2 bazel build by adding missing proto imports\n\nPiperOrigin-RevId: 291227940\n\na8a2514af326e4673063f9a3c9d0ef1091c87e6c\nAdd proto annotation for cloud/irm API\n\nPiperOrigin-RevId: 291217859\n\n8d16f76de065f530d395a4c7eabbf766d6a120fd\nGenerate Memcache v1beta2 API protos and gRPC ServiceConfig files\n\nPiperOrigin-RevId: 291008516\n\n3af1dabd93df9a9f17bf3624d3b875c11235360b\ngrafeas: Add containeranalysis default_host to Grafeas service\n\nPiperOrigin-RevId: 290965849\n\nbe2663fa95e31cba67d0cd62611a6674db9f74b7\nfix(google/maps/roads): add missing opening bracket\n\nPiperOrigin-RevId: 290964086\n\nfacc26550a0af0696e0534bc9cae9df14275aa7c\nUpdating v2 protos with the latest inline documentation (in comments) and adding a per-service .yaml file.\n\nPiperOrigin-RevId: 290952261\n\ncda99c1f7dc5e4ca9b1caeae1dc330838cbc1461\nChange api_name to 'asset' for v1p1beta1\n\nPiperOrigin-RevId: 290800639\n\n94e9e90c303a820ce40643d9129e7f0d2054e8a1\nAdds Google Maps Road service\n\nPiperOrigin-RevId: 290795667\n\na3b23dcb2eaecce98c600c7d009451bdec52dbda\nrpc: new message ErrorInfo, other comment updates\n\nPiperOrigin-RevId: 290781668\n\n26420ef4e46c37f193c0fbe53d6ebac481de460e\nAdd proto definition for Org Policy v1.\n\nPiperOrigin-RevId: 290771923\n\n7f0dab8177cf371ae019a082e2512de7ac102888\nPublish Routes Preferred API v1 service definitions.\n\nPiperOrigin-RevId: 290326986\n\nad6e508d0728e1d1bca6e3f328cd562718cb772d\nFix: Qualify resource type references with \"jobs.googleapis.com/\"\n\nPiperOrigin-RevId: 290285762\n\n58e770d568a2b78168ddc19a874178fee8265a9d\ncts client library\n\nPiperOrigin-RevId: 290146169\n\naf9daa4c3b4c4a8b7133b81588dd9ffd37270af2\nAdd more programming language options to public proto\n\nPiperOrigin-RevId: 290144091\n\nd9f2bbf2df301ef84641d4cec7c828736a0bd907\ntalent: add missing resource.proto dep to Bazel build target\n\nPiperOrigin-RevId: 290143164\n\n3b3968237451d027b42471cd28884a5a1faed6c7\nAnnotate Talent API.\nAdd gRPC service config for retry.\nUpdate bazel file with google.api.resource dependency.\n\nPiperOrigin-RevId: 290125172\n\n0735b4b096872960568d1f366bfa75b7b0e1f1a3\nWeekly library update.\n\nPiperOrigin-RevId: 289939042\n\n8760d3d9a4543d7f9c0d1c7870aca08b116e4095\nWeekly library update.\n\nPiperOrigin-RevId: 289939020\n\n8607df842f782a901805187e02fff598145b0b0e\nChange Talent API timeout to 30s.\n\nPiperOrigin-RevId: 289912621\n\n908155991fe32570653bcb72ecfdcfc896642f41\nAdd Recommendations AI V1Beta1\n\nPiperOrigin-RevId: 289901914\n\n5c9a8c2bebd8b71aa66d1cc473edfaac837a2c78\nAdding no-arg method signatures for ListBillingAccounts and ListServices\n\nPiperOrigin-RevId: 289891136\n\n50b0e8286ac988b0593bd890eb31fef6ea2f5767\nlongrunning: add grpc service config and default_host annotation to operations.proto\n\nPiperOrigin-RevId: 289876944\n\n6cac27dabe51c54807b0401698c32d34998948a9\n Updating default deadline for Cloud Security Command Center's v1 APIs.\n\nPiperOrigin-RevId: 289875412\n\nd99df0d67057a233c711187e0689baa4f8e6333d\nFix: Correct spelling in C# namespace option\n\nPiperOrigin-RevId: 289709813\n\n2fa8d48165cc48e35b0c62e6f7bdade12229326c\nfeat: Publish Recommender v1 to GitHub.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289619243\n\n9118db63d1ab493a2e44a3b4973fde810a835c49\nfirestore: don't retry reads that fail with Aborted\n\nFor transaction reads that fail with ABORTED, we need to rollback and start a new transaction. Our current configuration makes it so that GAPIC retries ABORTED reads multiple times without making any progress. Instead, we should retry at the transaction level.\n\nPiperOrigin-RevId: 289532382\n\n1dbfd3fe4330790b1e99c0bb20beb692f1e20b8a\nFix bazel build\nAdd other langauges (Java was already there) for bigquery/storage/v1alpha2 api.\n\nPiperOrigin-RevId: 289519766\n\nc06599cdd7d11f8d3fd25f8d3249e5bb1a3d5d73\nInitial commit of google.cloud.policytroubleshooter API, The API helps in troubleshooting GCP policies. Refer https://cloud.google.com/iam/docs/troubleshooting-access for more information\n\nPiperOrigin-RevId: 289491444\n\nfce7d80fa16ea241e87f7bc33d68595422e94ecd\nDo not pass samples option for Artman config of recommender v1 API.\n\nPiperOrigin-RevId: 289477403\n\nef179e8c61436297e6bb124352e47e45c8c80cb1\nfix: Address missing Bazel dependency.\n\nBazel builds stopped working in 06ec6d5 because\nthe google/longrunning/operations.proto file took\nan import from google/api/client.proto, but that\nimport was not added to BUILD.bazel.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289446074\n\n8841655b242c84fd691d77d7bcf21b61044f01ff\nMigrate Data Labeling v1beta1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289446026\n\n06ec6d5d053fff299eaa6eaa38afdd36c5e2fc68\nAdd annotations to google.longrunning.v1\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289413169\n\n0480cf40be1d3cc231f4268a2fdb36a8dd60e641\nMigrate IAM Admin v1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289411084\n\n1017173e9adeb858587639af61889ad970c728b1\nSpecify a C# namespace for BigQuery Connection v1beta1\n\nPiperOrigin-RevId: 289396763\n\nb08714b378e8e5b0c4ecdde73f92c36d6303b4b6\nfix: Integrate latest proto-docs-plugin fix.\nFixes dialogflow v2\n\nPiperOrigin-RevId: 289189004\n\n51217a67e79255ee1f2e70a6a3919df082513327\nCreate BUILD file for recommender v1\n\nPiperOrigin-RevId: 289183234\n\nacacd87263c0a60e458561b8b8ce9f67c760552a\nGenerate recommender v1 API protos and gRPC ServiceConfig files\n\nPiperOrigin-RevId: 289177510\n\n9d2f7133b97720b1fa3601f6dcd30760ba6d8a1e\nFix kokoro build script\n\nPiperOrigin-RevId: 289166315\n\nc43a67530d2a47a0220cad20ca8de39b3fbaf2c5\ncloudtasks: replace missing RPC timeout config for v2beta2 and v2beta3\n\nPiperOrigin-RevId: 289162391\n\n4cefc229a9197236fc0adf02d69b71c0c5cf59de\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 289158456\n\n56f263fe959c50786dab42e3c61402d32d1417bd\nCatalog API: Adding config necessary to build client libraries\n\nPiperOrigin-RevId: 289149879\n\n4543762b23a57fc3c53d409efc3a9affd47b6ab3\nFix Bazel build\nbilling/v1 and dialogflow/v2 remain broken (not bazel-related issues).\nBilling has wrong configuration, dialogflow failure is caused by a bug in documentation plugin.\n\nPiperOrigin-RevId: 289140194\n\nc9dce519127b97e866ca133a01157f4ce27dcceb\nUpdate Bigtable docs\n\nPiperOrigin-RevId: 289114419\n\n802c5c5f2bf94c3facb011267d04e71942e0d09f\nMigrate DLP to proto annotations (but not GAPIC v2).\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289102579\n\n6357f30f2ec3cff1d8239d18b707ff9d438ea5da\nRemove gRPC configuration file that was in the wrong place.\n\nPiperOrigin-RevId: 289096111\n\n" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "cloudbuild", - "apiVersion": "v1", - "language": "python", - "generator": "gapic", - "config": "google/devtools/cloudbuild/artman_cloudbuild.yaml" - } - } - ], - "newFiles": [ - { - "path": ".coveragerc" - }, - { - "path": ".flake8" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "LICENSE" - }, - { - "path": "MANIFEST.in" - }, - { - "path": "README.rst" - }, - { - "path": "docs/README.rst" - }, - { - "path": "docs/_static/custom.css" - }, - { - "path": "docs/_templates/layout.html" - }, - { - "path": "docs/changelog.md" - }, - { - "path": "docs/conf.py" - }, - { - "path": "docs/gapic/v1/api.rst" - }, - { - "path": "docs/gapic/v1/types.rst" - }, - { - "path": "docs/index.rst" - }, - { - "path": "google/__init__.py" - }, - { - "path": "google/cloud/__init__.py" - }, - { - "path": "google/cloud/devtools/__init__.py" - }, - { - "path": "google/cloud/devtools/cloudbuild.py" - }, - { - "path": "google/cloud/devtools/cloudbuild_v1/__init__.py" - }, - { - "path": "google/cloud/devtools/cloudbuild_v1/gapic/__init__.py" - }, - { - "path": "google/cloud/devtools/cloudbuild_v1/gapic/cloud_build_client.py" - }, - { - "path": "google/cloud/devtools/cloudbuild_v1/gapic/cloud_build_client_config.py" - }, - { - "path": "google/cloud/devtools/cloudbuild_v1/gapic/enums.py" - }, - { - "path": "google/cloud/devtools/cloudbuild_v1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/devtools/cloudbuild_v1/gapic/transports/cloud_build_grpc_transport.py" - }, - { - "path": "google/cloud/devtools/cloudbuild_v1/proto/__init__.py" - }, - { - "path": "google/cloud/devtools/cloudbuild_v1/proto/cloudbuild.proto" - }, - { - "path": "google/cloud/devtools/cloudbuild_v1/proto/cloudbuild_pb2.py" - }, - { - "path": "google/cloud/devtools/cloudbuild_v1/proto/cloudbuild_pb2_grpc.py" - }, - { - "path": "google/cloud/devtools/cloudbuild_v1/types.py" - }, - { - "path": "noxfile.py" - }, - { - "path": "setup.cfg" - }, - { - "path": "setup.py" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "tests/unit/gapic/v1/test_cloud_build_client_v1.py" - } - ] -} \ No newline at end of file diff --git a/cloudbuild/synth.py b/cloudbuild/synth.py deleted file mode 100644 index 91be2d374719..000000000000 --- a/cloudbuild/synth.py +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -from synthtool import gcp - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() -version = 'v1' - -# ---------------------------------------------------------------------------- -# Generate cloudbuild GAPIC layer -# ---------------------------------------------------------------------------- -library = gapic.py_library( - 'cloudbuild', - version, - config_path='/google/devtools/cloudbuild/artman_cloudbuild.yaml', - generator_args=["--dev_samples"], - include_protos=True -) - -s.move( - library, - excludes=[ - 'docs/index.rst', - 'nox*.py', - 'setup.py', - 'setup.cfg', - 'README.rst', - '**/*.proto', - 'google/cloud/devtools/__init__.py', # declare this as a namespace package - ], -) - -# Move protos to the right directory -s.move(library / "google/cloud/cloudbuild_v1/proto/*.proto", "google/cloud/devtools/cloudbuild_v1/proto") - -# Fix up imports -s.replace( - ["google/**/*.py", "tests/unit/**/*.py"], - r"from google.devtools.cloudbuild_v1.proto import ", - r"from google.cloud.devtools.cloudbuild_v1.proto import ", -) - - -# Rename package to `google-cloud-build` -s.replace( - ["**/*.rst", "*/**/*.py", "**/*.md"], - "google-cloud-cloudbuild", - "google-cloud-build" -) - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- - -# coverage level is low because of missing coverage for __init__.py files -templated_files = common.py_library(unit_cov_level=65, cov_level=65) -s.move(templated_files) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) \ No newline at end of file diff --git a/cloudbuild/tests/unit/gapic/v1/test_cloud_build_client_v1.py b/cloudbuild/tests/unit/gapic/v1/test_cloud_build_client_v1.py deleted file mode 100644 index 32d115d4aea4..000000000000 --- a/cloudbuild/tests/unit/gapic/v1/test_cloud_build_client_v1.py +++ /dev/null @@ -1,754 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud.devtools import cloudbuild_v1 -from google.cloud.devtools.cloudbuild_v1.proto import cloudbuild_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestCloudBuildClient(object): - def test_create_build(self): - # Setup Expected Response - name = "name3373707" - done = True - expected_response = {"name": name, "done": done} - expected_response = operations_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup Request - project_id = "projectId-1969970175" - build = {} - - response = client.create_build(project_id, build) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloudbuild_pb2.CreateBuildRequest( - project_id=project_id, build=build - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_build_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup request - project_id = "projectId-1969970175" - build = {} - - with pytest.raises(CustomException): - client.create_build(project_id, build) - - def test_get_build(self): - # Setup Expected Response - id_2 = "id23227150" - project_id_2 = "projectId2939242356" - status_detail = "statusDetail2089931070" - logs_bucket = "logsBucket1565363834" - build_trigger_id = "buildTriggerId1105559411" - log_url = "logUrl342054388" - expected_response = { - "id": id_2, - "project_id": project_id_2, - "status_detail": status_detail, - "logs_bucket": logs_bucket, - "build_trigger_id": build_trigger_id, - "log_url": log_url, - } - expected_response = cloudbuild_pb2.Build(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup Request - project_id = "projectId-1969970175" - id_ = "id3355" - - response = client.get_build(project_id, id_) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloudbuild_pb2.GetBuildRequest(project_id=project_id, id=id_) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_build_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup request - project_id = "projectId-1969970175" - id_ = "id3355" - - with pytest.raises(CustomException): - client.get_build(project_id, id_) - - def test_list_builds(self): - # Setup Expected Response - next_page_token = "" - builds_element = {} - builds = [builds_element] - expected_response = {"next_page_token": next_page_token, "builds": builds} - expected_response = cloudbuild_pb2.ListBuildsResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup Request - project_id = "projectId-1969970175" - - paged_list_response = client.list_builds(project_id) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.builds[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = cloudbuild_pb2.ListBuildsRequest(project_id=project_id) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_builds_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup request - project_id = "projectId-1969970175" - - paged_list_response = client.list_builds(project_id) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_cancel_build(self): - # Setup Expected Response - id_2 = "id23227150" - project_id_2 = "projectId2939242356" - status_detail = "statusDetail2089931070" - logs_bucket = "logsBucket1565363834" - build_trigger_id = "buildTriggerId1105559411" - log_url = "logUrl342054388" - expected_response = { - "id": id_2, - "project_id": project_id_2, - "status_detail": status_detail, - "logs_bucket": logs_bucket, - "build_trigger_id": build_trigger_id, - "log_url": log_url, - } - expected_response = cloudbuild_pb2.Build(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup Request - project_id = "projectId-1969970175" - id_ = "id3355" - - response = client.cancel_build(project_id, id_) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloudbuild_pb2.CancelBuildRequest( - project_id=project_id, id=id_ - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_cancel_build_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup request - project_id = "projectId-1969970175" - id_ = "id3355" - - with pytest.raises(CustomException): - client.cancel_build(project_id, id_) - - def test_create_build_trigger(self): - # Setup Expected Response - id_ = "id3355" - description = "description-1724546052" - name = "name3373707" - filename = "filename-734768633" - disabled = True - expected_response = { - "id": id_, - "description": description, - "name": name, - "filename": filename, - "disabled": disabled, - } - expected_response = cloudbuild_pb2.BuildTrigger(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup Request - project_id = "projectId-1969970175" - trigger = {} - - response = client.create_build_trigger(project_id, trigger) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloudbuild_pb2.CreateBuildTriggerRequest( - project_id=project_id, trigger=trigger - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_build_trigger_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup request - project_id = "projectId-1969970175" - trigger = {} - - with pytest.raises(CustomException): - client.create_build_trigger(project_id, trigger) - - def test_get_build_trigger(self): - # Setup Expected Response - id_ = "id3355" - description = "description-1724546052" - name = "name3373707" - filename = "filename-734768633" - disabled = True - expected_response = { - "id": id_, - "description": description, - "name": name, - "filename": filename, - "disabled": disabled, - } - expected_response = cloudbuild_pb2.BuildTrigger(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup Request - project_id = "projectId-1969970175" - trigger_id = "triggerId1363517698" - - response = client.get_build_trigger(project_id, trigger_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloudbuild_pb2.GetBuildTriggerRequest( - project_id=project_id, trigger_id=trigger_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_build_trigger_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup request - project_id = "projectId-1969970175" - trigger_id = "triggerId1363517698" - - with pytest.raises(CustomException): - client.get_build_trigger(project_id, trigger_id) - - def test_list_build_triggers(self): - # Setup Expected Response - next_page_token = "nextPageToken-1530815211" - expected_response = {"next_page_token": next_page_token} - expected_response = cloudbuild_pb2.ListBuildTriggersResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup Request - project_id = "projectId-1969970175" - - response = client.list_build_triggers(project_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloudbuild_pb2.ListBuildTriggersRequest( - project_id=project_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_build_triggers_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup request - project_id = "projectId-1969970175" - - with pytest.raises(CustomException): - client.list_build_triggers(project_id) - - def test_delete_build_trigger(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup Request - project_id = "projectId-1969970175" - trigger_id = "triggerId1363517698" - - client.delete_build_trigger(project_id, trigger_id) - - assert len(channel.requests) == 1 - expected_request = cloudbuild_pb2.DeleteBuildTriggerRequest( - project_id=project_id, trigger_id=trigger_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_build_trigger_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup request - project_id = "projectId-1969970175" - trigger_id = "triggerId1363517698" - - with pytest.raises(CustomException): - client.delete_build_trigger(project_id, trigger_id) - - def test_update_build_trigger(self): - # Setup Expected Response - id_ = "id3355" - description = "description-1724546052" - name = "name3373707" - filename = "filename-734768633" - disabled = True - expected_response = { - "id": id_, - "description": description, - "name": name, - "filename": filename, - "disabled": disabled, - } - expected_response = cloudbuild_pb2.BuildTrigger(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup Request - project_id = "projectId-1969970175" - trigger_id = "triggerId1363517698" - trigger = {} - - response = client.update_build_trigger(project_id, trigger_id, trigger) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloudbuild_pb2.UpdateBuildTriggerRequest( - project_id=project_id, trigger_id=trigger_id, trigger=trigger - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_build_trigger_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup request - project_id = "projectId-1969970175" - trigger_id = "triggerId1363517698" - trigger = {} - - with pytest.raises(CustomException): - client.update_build_trigger(project_id, trigger_id, trigger) - - def test_run_build_trigger(self): - # Setup Expected Response - name = "name3373707" - done = True - expected_response = {"name": name, "done": done} - expected_response = operations_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup Request - project_id = "projectId-1969970175" - trigger_id = "triggerId1363517698" - source = {} - - response = client.run_build_trigger(project_id, trigger_id, source) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloudbuild_pb2.RunBuildTriggerRequest( - project_id=project_id, trigger_id=trigger_id, source=source - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_run_build_trigger_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup request - project_id = "projectId-1969970175" - trigger_id = "triggerId1363517698" - source = {} - - with pytest.raises(CustomException): - client.run_build_trigger(project_id, trigger_id, source) - - def test_retry_build(self): - # Setup Expected Response - name = "name3373707" - done = True - expected_response = {"name": name, "done": done} - expected_response = operations_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup Request - project_id = "projectId-1969970175" - id_ = "id3355" - - response = client.retry_build(project_id, id_) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloudbuild_pb2.RetryBuildRequest( - project_id=project_id, id=id_ - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_retry_build_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - # Setup request - project_id = "projectId-1969970175" - id_ = "id3355" - - with pytest.raises(CustomException): - client.retry_build(project_id, id_) - - def test_create_worker_pool(self): - # Setup Expected Response - name = "name3373707" - project_id = "projectId-1969970175" - service_account_email = "serviceAccountEmail-1300473088" - worker_count = 372044046 - expected_response = { - "name": name, - "project_id": project_id, - "service_account_email": service_account_email, - "worker_count": worker_count, - } - expected_response = cloudbuild_pb2.WorkerPool(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - response = client.create_worker_pool() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloudbuild_pb2.CreateWorkerPoolRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_worker_pool_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - with pytest.raises(CustomException): - client.create_worker_pool() - - def test_get_worker_pool(self): - # Setup Expected Response - name = "name3373707" - project_id = "projectId-1969970175" - service_account_email = "serviceAccountEmail-1300473088" - worker_count = 372044046 - expected_response = { - "name": name, - "project_id": project_id, - "service_account_email": service_account_email, - "worker_count": worker_count, - } - expected_response = cloudbuild_pb2.WorkerPool(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - response = client.get_worker_pool() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloudbuild_pb2.GetWorkerPoolRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_worker_pool_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - with pytest.raises(CustomException): - client.get_worker_pool() - - def test_delete_worker_pool(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - client.delete_worker_pool() - - assert len(channel.requests) == 1 - expected_request = cloudbuild_pb2.DeleteWorkerPoolRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_worker_pool_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - with pytest.raises(CustomException): - client.delete_worker_pool() - - def test_update_worker_pool(self): - # Setup Expected Response - name = "name3373707" - project_id = "projectId-1969970175" - service_account_email = "serviceAccountEmail-1300473088" - worker_count = 372044046 - expected_response = { - "name": name, - "project_id": project_id, - "service_account_email": service_account_email, - "worker_count": worker_count, - } - expected_response = cloudbuild_pb2.WorkerPool(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - response = client.update_worker_pool() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloudbuild_pb2.UpdateWorkerPoolRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_worker_pool_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - with pytest.raises(CustomException): - client.update_worker_pool() - - def test_list_worker_pools(self): - # Setup Expected Response - expected_response = {} - expected_response = cloudbuild_pb2.ListWorkerPoolsResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - response = client.list_worker_pools() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloudbuild_pb2.ListWorkerPoolsRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_worker_pools_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = cloudbuild_v1.CloudBuildClient() - - with pytest.raises(CustomException): - client.list_worker_pools() diff --git a/container/.coveragerc b/container/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/container/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/container/.flake8 b/container/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/container/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/container/.repo-metadata.json b/container/.repo-metadata.json deleted file mode 100644 index 9eff44e5832e..000000000000 --- a/container/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "container", - "name_pretty": "Kubernetes Engine", - "product_documentation": "https://cloud.google.com/kubernetes-engine/", - "client_documentation": "https://googleapis.dev/python/container/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559777", - "release_level": "alpha", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-container", - "api_id": "container.googleapis.com", - "requires_billing": true -} \ No newline at end of file diff --git a/container/CHANGELOG.md b/container/CHANGELOG.md deleted file mode 100644 index 4b550fcfed4a..000000000000 --- a/container/CHANGELOG.md +++ /dev/null @@ -1,117 +0,0 @@ -# Changelog - -[PyPI History][1] - -[1]: https://pypi.org/project/google-cloud-container/#history - -## 0.3.0 - -07-30-2019 10:28 PDT - - -### Implementation Changes - -### New Features -- Add 'client_options' support, update list method docstrings (via synth). ([#8501](https://github.com/googleapis/google-cloud-python/pull/8501)) -- Add synth support for v1beta1 API version (via manual synth). ([#8436](https://github.com/googleapis/google-cloud-python/pull/8436)) -- Allow kwargs to be passed to create_channel (via synth). ([#8384](https://github.com/googleapis/google-cloud-python/pull/8384)) - -### Dependencies -- Bump minimum version for google-api-core to 1.14.0. ([#8709](https://github.com/googleapis/google-cloud-python/pull/8709)) -- Update pin for 'grpc-google-iam-v1' to 0.12.3+. ([#8647](https://github.com/googleapis/google-cloud-python/pull/8647)) -- Remove classifier for Python 3.4 for end-of-life. ([#7535](https://github.com/googleapis/google-cloud-python/pull/7535)) - -### Documentation -- Update intersphinx mapping for requests. ([#8805](https://github.com/googleapis/google-cloud-python/pull/8805)) -- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705)) -- Add compatibility check badges to READMEs. ([#8288](https://github.com/googleapis/google-cloud-python/pull/8288)) -- Add docs job to publish to googleapis.dev. ([#8464](https://github.com/googleapis/google-cloud-python/pull/8464)) - -### Internal / Testing Changes -- Pin black version (via synth). ([#8575](https://github.com/googleapis/google-cloud-python/pull/8575)) -- Declare encoding as utf-8 in pb2 files (via synth). ([#8347](https://github.com/googleapis/google-cloud-python/pull/8347)) -- Add disclaimer to auto-generated template files (via synth). ([#8309](https://github.com/googleapis/google-cloud-python/pull/8309)) -- Update noxfile and setup.py (via synth). ([#8298](https://github.com/googleapis/google-cloud-python/pull/8298)) -- Blacken (via synth). ([#8285](https://github.com/googleapis/google-cloud-python/pull/8285)) -- Add routing header to method metadata, add nox session `docs` (via synth). ([#7922](https://github.com/googleapis/google-cloud-python/pull/7922)) -- Copy proto files alongside protoc versions. -- Minor gapic-generator change. ([#7225](https://github.com/googleapis/google-cloud-python/pull/7225)) -- Add protos as an artifact to library ([#7205](https://github.com/googleapis/google-cloud-python/pull/7205)) -- Update copyright headers ([#7140](https://github.com/googleapis/google-cloud-python/pull/7140)) -- Protoc-generated serialization update. ([#7078](https://github.com/googleapis/google-cloud-python/pull/7078)) -- Pick up stub docstring fix in GAPIC generator. ([#6966](https://github.com/googleapis/google-cloud-python/pull/6966)) - -## 0.2.1 - -12-17-2018 16:36 PST - - -### Documentation -- Document Python 2 deprecation ([#6910](https://github.com/googleapis/google-cloud-python/pull/6910)) -- Improve linkage between container docs pages. ([#6852](https://github.com/googleapis/google-cloud-python/pull/6852)) - -### Internal / Testing Changes -- Add baseline for synth.metadata - -## 0.2.0 - -12-04-2018 11:28 PST - - -### Implementation Changes -- Import `iam.policy` from `google.api_core.iam.policy` ([#6741](https://github.com/googleapis/google-cloud-python/pull/6741)) -- Pick up fixes to GAPIC generator. ([#6634](https://github.com/googleapis/google-cloud-python/pull/6634)) -- Fix `client_info` bug, update docstrings. ([#6407](https://github.com/googleapis/google-cloud-python/pull/6407)) -- Avoid overwriting '__module__' of messages from shared modules. ([#5364](https://github.com/googleapis/google-cloud-python/pull/5364)) -- Fix bad trove classifier - -### Dependencies -- Bump minimum `api_core` version for all GAPIC libs to 1.4.1. ([#6391](https://github.com/googleapis/google-cloud-python/pull/6391)) - -### Documentation -- Docs: normalize use of support level badges ([#6159](https://github.com/googleapis/google-cloud-python/pull/6159)) -- Container: harmonize / DRY 'README.rst' / 'docs/index.rst'. ([#6018](https://github.com/googleapis/google-cloud-python/pull/6018)) -- Rename releases to changelog and include from CHANGELOG.md ([#5191](https://github.com/googleapis/google-cloud-python/pull/5191)) - -### Internal / Testing Changes -- Update noxfile. -- blacken all gen'd libs ([#6792](https://github.com/googleapis/google-cloud-python/pull/6792)) -- Omit local dependencies from coverage. ([#6701](https://github.com/googleapis/google-cloud-python/pull/6701)) -- Run black at end of synth.py ([#6698](https://github.com/googleapis/google-cloud-python/pull/6698)) -- Unblack container gapic and protos. -- Run Black on Generated libraries ([#6666](https://github.com/googleapis/google-cloud-python/pull/6666)) -- Add templates for flake8, coveragerc, noxfile, and black. ([#6642](https://github.com/googleapis/google-cloud-python/pull/6642)) -- Pass posargs to py.test ([#6653](https://github.com/googleapis/google-cloud-python/pull/6653)) -- Update synth.py yaml location ([#6480](https://github.com/googleapis/google-cloud-python/pull/6480)) -- Use new Nox ([#6175](https://github.com/googleapis/google-cloud-python/pull/6175)) -- Container: add 'synth.py'. ([#6084](https://github.com/googleapis/google-cloud-python/pull/6084)) -- Nox: use inplace installs ([#5865](https://github.com/googleapis/google-cloud-python/pull/5865)) -- Modify system tests to use prerelease versions of grpcio ([#5304](https://github.com/googleapis/google-cloud-python/pull/5304)) -- Add Test runs for Python 3.7 and remove 3.4 ([#5295](https://github.com/googleapis/google-cloud-python/pull/5295)) - -## 0.1.1 - -### Dependencies - -- Update dependency range for api-core to include v1.0.0 releases (#4944) - -### Documentation - -- Replacing references to `stable/` docs with `latest/`. (#4638) - -### Testing and internal changes - -- Re-enable lint for tests, remove usage of pylint (#4921) -- Normalize all setup.py files (#4909) -- nox unittest updates (#4646) - -## 0.1.0 - -[![release level](https://img.shields.io/badge/release%20level-alpha-orange.svg?style=flat)](https://cloud.google.com/terms/launch-stages) - -Google Kubernetes Engine is a managed environment for deploying containerized -applications. It brings our latest innovations in developer productivity, -resource efficiency, automated operations, and open source flexibility to -accelerate your time to market. - -PyPI: https://pypi.org/project/google-cloud-container/0.1.0/ diff --git a/container/LICENSE b/container/LICENSE deleted file mode 100644 index 724a8807144b..000000000000 --- a/container/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/container/MANIFEST.in b/container/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/container/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/container/README.rst b/container/README.rst deleted file mode 100644 index f98cd02b73c3..000000000000 --- a/container/README.rst +++ /dev/null @@ -1,101 +0,0 @@ -Python Client for Google Kubernetes Engine API -============================================== - -|alpha| |pypi| |versions| - -`Google Kubernetes Engine API`_: The Google Kubernetes Engine API is used for -building and managing container based applications, powered by the open source -Kubernetes technology. - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. |alpha| image:: https://img.shields.io/badge/support-alpha-orange.svg - :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#alpha-support -.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-container.svg - :target: https://pypi.org/project/google-cloud-container/ -.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-container.svg - :target: https://pypi.org/project/google-cloud-container/ -.. _Google Kubernetes Engine API: https://cloud.google.com/kubernetes-engine -.. _Client Library Documentation: https://googleapis.dev/python/container/latest -.. _Product Documentation: https://cloud.google.com/kubernetes-engine - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable the Google Container Engine API.`_ -3. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable the Google Container Engine API.: https://cloud.google.com/container -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Supported Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.5 - -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7. Python 2.7 support will be removed on January 1, 2020. - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-container - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-container - -Example Usage -~~~~~~~~~~~~~ - -.. code:: py - - from google.cloud import container_v1 - - client = container_v1.ClusterManagerClient() - - project_id = '' - zone = '' - - response = client.list_clusters(project_id, zone) - -Next Steps -~~~~~~~~~~ - -- Read the `Client API Documentation`_ to see other available methods on the client. -- Read the `Product documentation`_ to learn more about the product and see - How-to Guides. - -.. _Client API Documentation: https://googleapis.dev/python/container/latest diff --git a/container/docs/README.rst b/container/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/container/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/container/docs/_static/custom.css b/container/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/container/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/container/docs/_templates/layout.html b/container/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/container/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/container/docs/changelog.md b/container/docs/changelog.md deleted file mode 120000 index 04c99a55caae..000000000000 --- a/container/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../CHANGELOG.md \ No newline at end of file diff --git a/container/docs/conf.py b/container/docs/conf.py deleted file mode 100644 index b42e5dc71647..000000000000 --- a/container/docs/conf.py +++ /dev/null @@ -1,356 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-container documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-container" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-container-doc" - -# -- Options for warnings ------------------------------------------------------ - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-container.tex", - u"google-cloud-container Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - master_doc, - "google-cloud-container", - u"google-cloud-container Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-container", - u"google-cloud-container Documentation", - author, - "google-cloud-container", - "GAPIC library for the {metadata.shortName} v1 service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/stable/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/container/docs/gapic/v1/api.rst b/container/docs/gapic/v1/api.rst deleted file mode 100644 index 62435f64eb2a..000000000000 --- a/container/docs/gapic/v1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Google Container Engine API -====================================== - -.. automodule:: google.cloud.container_v1 - :members: - :inherited-members: \ No newline at end of file diff --git a/container/docs/gapic/v1/types.rst b/container/docs/gapic/v1/types.rst deleted file mode 100644 index 7b1c1f951994..000000000000 --- a/container/docs/gapic/v1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Google Container Engine API Client -============================================ - -.. automodule:: google.cloud.container_v1.types - :members: \ No newline at end of file diff --git a/container/docs/index.rst b/container/docs/index.rst deleted file mode 100644 index 9b788c6c01bf..000000000000 --- a/container/docs/index.rst +++ /dev/null @@ -1,19 +0,0 @@ -.. include:: README.rst - -API Reference -------------- -.. toctree:: - :maxdepth: 2 - - gapic/v1/api - gapic/v1/types - -Changelog ---------- - -For a list of all ``google-cloud-container`` releases: - -.. toctree:: - :maxdepth: 2 - - changelog diff --git a/container/google/__init__.py b/container/google/__init__.py deleted file mode 100644 index 2f4b4738aee1..000000000000 --- a/container/google/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/container/google/cloud/__init__.py b/container/google/cloud/__init__.py deleted file mode 100644 index 2f4b4738aee1..000000000000 --- a/container/google/cloud/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/container/google/cloud/container.py b/container/google/cloud/container.py deleted file mode 100644 index aa663f733845..000000000000 --- a/container/google/cloud/container.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import - -from google.cloud.container_v1 import ClusterManagerClient -from google.cloud.container_v1 import enums -from google.cloud.container_v1 import types - - -__all__ = ("enums", "types", "ClusterManagerClient") diff --git a/container/google/cloud/container_v1/__init__.py b/container/google/cloud/container_v1/__init__.py deleted file mode 100644 index ffa2273ef616..000000000000 --- a/container/google/cloud/container_v1/__init__.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import - -from google.cloud.container_v1 import types -from google.cloud.container_v1.gapic import cluster_manager_client -from google.cloud.container_v1.gapic import enums - - -class ClusterManagerClient(cluster_manager_client.ClusterManagerClient): - __doc__ = cluster_manager_client.ClusterManagerClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "ClusterManagerClient") diff --git a/container/google/cloud/container_v1/gapic/__init__.py b/container/google/cloud/container_v1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/container/google/cloud/container_v1/gapic/cluster_manager_client.py b/container/google/cloud/container_v1/gapic/cluster_manager_client.py deleted file mode 100644 index c7894cd234bc..000000000000 --- a/container/google/cloud/container_v1/gapic/cluster_manager_client.py +++ /dev/null @@ -1,3338 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.container.v1 ClusterManager API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.page_iterator -import grpc - -from google.cloud.container_v1.gapic import cluster_manager_client_config -from google.cloud.container_v1.gapic import enums -from google.cloud.container_v1.gapic.transports import cluster_manager_grpc_transport -from google.cloud.container_v1.proto import cluster_service_pb2 -from google.cloud.container_v1.proto import cluster_service_pb2_grpc -from google.protobuf import empty_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-container" -).version - - -class ClusterManagerClient(object): - """Google Kubernetes Engine Cluster Manager v1""" - - SERVICE_ADDRESS = "container.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.container.v1.ClusterManager" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - ClusterManagerClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.ClusterManagerGrpcTransport, - Callable[[~.Credentials, type], ~.ClusterManagerGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = cluster_manager_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=cluster_manager_grpc_transport.ClusterManagerGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = cluster_manager_grpc_transport.ClusterManagerGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def list_clusters( - self, - project_id, - zone, - parent=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists all clusters owned by a project in either the specified zone or all - zones. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> response = client.list_clusters(project_id, zone) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the parent field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides, or "-" for all zones. This field has been - deprecated and replaced by the parent field. - parent (str): The parent (project and location) where the clusters will be listed. - Specified in the format 'projects/*/locations/*'. Location "-" matches - all zones and all regions. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.ListClustersResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_clusters" not in self._inner_api_calls: - self._inner_api_calls[ - "list_clusters" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_clusters, - default_retry=self._method_configs["ListClusters"].retry, - default_timeout=self._method_configs["ListClusters"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.ListClustersRequest( - project_id=project_id, zone=zone, parent=parent - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["list_clusters"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_cluster( - self, - project_id, - zone, - cluster_id, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets the details of a specific cluster. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> response = client.get_cluster(project_id, zone, cluster_id) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster to retrieve. - This field has been deprecated and replaced by the name field. - name (str): The name (project, location, cluster) of the cluster to retrieve. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Cluster` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_cluster" not in self._inner_api_calls: - self._inner_api_calls[ - "get_cluster" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_cluster, - default_retry=self._method_configs["GetCluster"].retry, - default_timeout=self._method_configs["GetCluster"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.GetClusterRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id, name=name - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_cluster"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_cluster( - self, - project_id, - zone, - cluster, - parent=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a cluster, consisting of the specified number and type of Google - Compute Engine instances. - - By default, the cluster is created in the project's `default - network `__. - - One firewall is added for the cluster. After cluster creation, the - Kubelet creates routes for each node to allow the containers on that - node to communicate with all other instances in the cluster. - - Finally, an entry is added to the project's global metadata indicating - which CIDR range the cluster is using. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster`: - >>> cluster = {} - >>> - >>> response = client.create_cluster(project_id, zone, cluster) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the parent field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the parent field. - cluster (Union[dict, ~google.cloud.container_v1.types.Cluster]): Required. A `cluster - resource `__ - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.container_v1.types.Cluster` - parent (str): The parent (project and location) where the cluster will be created. - Specified in the format 'projects/*/locations/*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_cluster" not in self._inner_api_calls: - self._inner_api_calls[ - "create_cluster" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_cluster, - default_retry=self._method_configs["CreateCluster"].retry, - default_timeout=self._method_configs["CreateCluster"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.CreateClusterRequest( - project_id=project_id, zone=zone, cluster=cluster, parent=parent - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_cluster"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_cluster( - self, - project_id, - zone, - cluster_id, - update, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates the settings of a specific cluster. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `update`: - >>> update = {} - >>> - >>> response = client.update_cluster(project_id, zone, cluster_id, update) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster to upgrade. - This field has been deprecated and replaced by the name field. - update (Union[dict, ~google.cloud.container_v1.types.ClusterUpdate]): Required. A description of the update. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.container_v1.types.ClusterUpdate` - name (str): The name (project, location, cluster) of the cluster to update. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_cluster" not in self._inner_api_calls: - self._inner_api_calls[ - "update_cluster" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_cluster, - default_retry=self._method_configs["UpdateCluster"].retry, - default_timeout=self._method_configs["UpdateCluster"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.UpdateClusterRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - update=update, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_cluster"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_node_pool( - self, - project_id, - zone, - cluster_id, - node_pool_id, - node_version, - image_type, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates the version and/or image type for the specified node pool. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `node_pool_id`: - >>> node_pool_id = '' - >>> - >>> # TODO: Initialize `node_version`: - >>> node_version = '' - >>> - >>> # TODO: Initialize `image_type`: - >>> image_type = '' - >>> - >>> response = client.update_node_pool(project_id, zone, cluster_id, node_pool_id, node_version, image_type) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster to upgrade. - This field has been deprecated and replaced by the name field. - node_pool_id (str): Required. Deprecated. The name of the node pool to upgrade. - This field has been deprecated and replaced by the name field. - node_version (str): Required. The Kubernetes version to change the nodes to (typically an - upgrade). - - Users may specify either explicit versions offered by Kubernetes Engine or - version aliases, which have the following behavior: - - - "latest": picks the highest valid Kubernetes version - - "1.X": picks the highest valid patch+gke.N patch in the 1.X version - - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version - - "1.X.Y-gke.N": picks an explicit Kubernetes version - - "-": picks the Kubernetes master version - image_type (str): Required. The desired image type for the node pool. - name (str): The name (project, location, cluster, node pool) of the node pool to - update. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_node_pool" not in self._inner_api_calls: - self._inner_api_calls[ - "update_node_pool" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_node_pool, - default_retry=self._method_configs["UpdateNodePool"].retry, - default_timeout=self._method_configs["UpdateNodePool"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.UpdateNodePoolRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - node_version=node_version, - image_type=image_type, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_node_pool"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_node_pool_autoscaling( - self, - project_id, - zone, - cluster_id, - node_pool_id, - autoscaling, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the autoscaling settings for the specified node pool. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `node_pool_id`: - >>> node_pool_id = '' - >>> - >>> # TODO: Initialize `autoscaling`: - >>> autoscaling = {} - >>> - >>> response = client.set_node_pool_autoscaling(project_id, zone, cluster_id, node_pool_id, autoscaling) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster to upgrade. - This field has been deprecated and replaced by the name field. - node_pool_id (str): Required. Deprecated. The name of the node pool to upgrade. - This field has been deprecated and replaced by the name field. - autoscaling (Union[dict, ~google.cloud.container_v1.types.NodePoolAutoscaling]): Required. Autoscaling configuration for the node pool. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.container_v1.types.NodePoolAutoscaling` - name (str): The name (project, location, cluster, node pool) of the node pool to set - autoscaler settings. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_node_pool_autoscaling" not in self._inner_api_calls: - self._inner_api_calls[ - "set_node_pool_autoscaling" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_node_pool_autoscaling, - default_retry=self._method_configs["SetNodePoolAutoscaling"].retry, - default_timeout=self._method_configs["SetNodePoolAutoscaling"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetNodePoolAutoscalingRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - autoscaling=autoscaling, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_node_pool_autoscaling"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_logging_service( - self, - project_id, - zone, - cluster_id, - logging_service, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the logging service for a specific cluster. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `logging_service`: - >>> logging_service = '' - >>> - >>> response = client.set_logging_service(project_id, zone, cluster_id, logging_service) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster to upgrade. - This field has been deprecated and replaced by the name field. - logging_service (str): Required. The logging service the cluster should use to write metrics. - Currently available options: - - - "logging.googleapis.com" - the Google Cloud Logging service - - "none" - no metrics will be exported from the cluster - name (str): The name (project, location, cluster) of the cluster to set logging. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_logging_service" not in self._inner_api_calls: - self._inner_api_calls[ - "set_logging_service" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_logging_service, - default_retry=self._method_configs["SetLoggingService"].retry, - default_timeout=self._method_configs["SetLoggingService"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetLoggingServiceRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - logging_service=logging_service, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_logging_service"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_monitoring_service( - self, - project_id, - zone, - cluster_id, - monitoring_service, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the monitoring service for a specific cluster. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `monitoring_service`: - >>> monitoring_service = '' - >>> - >>> response = client.set_monitoring_service(project_id, zone, cluster_id, monitoring_service) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster to upgrade. - This field has been deprecated and replaced by the name field. - monitoring_service (str): Required. The monitoring service the cluster should use to write - metrics. Currently available options: - - - "monitoring.googleapis.com/kubernetes" - the Google Cloud Monitoring - service with Kubernetes-native resource model - - "monitoring.googleapis.com" - the Google Cloud Monitoring service - - "none" - no metrics will be exported from the cluster - name (str): The name (project, location, cluster) of the cluster to set monitoring. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_monitoring_service" not in self._inner_api_calls: - self._inner_api_calls[ - "set_monitoring_service" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_monitoring_service, - default_retry=self._method_configs["SetMonitoringService"].retry, - default_timeout=self._method_configs["SetMonitoringService"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetMonitoringServiceRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - monitoring_service=monitoring_service, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_monitoring_service"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_addons_config( - self, - project_id, - zone, - cluster_id, - addons_config, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the addons for a specific cluster. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `addons_config`: - >>> addons_config = {} - >>> - >>> response = client.set_addons_config(project_id, zone, cluster_id, addons_config) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster to upgrade. - This field has been deprecated and replaced by the name field. - addons_config (Union[dict, ~google.cloud.container_v1.types.AddonsConfig]): Required. The desired configurations for the various addons available to run in the - cluster. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.container_v1.types.AddonsConfig` - name (str): The name (project, location, cluster) of the cluster to set addons. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_addons_config" not in self._inner_api_calls: - self._inner_api_calls[ - "set_addons_config" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_addons_config, - default_retry=self._method_configs["SetAddonsConfig"].retry, - default_timeout=self._method_configs["SetAddonsConfig"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetAddonsConfigRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - addons_config=addons_config, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_addons_config"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_locations( - self, - project_id, - zone, - cluster_id, - locations, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the locations for a specific cluster. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `locations`: - >>> locations = [] - >>> - >>> response = client.set_locations(project_id, zone, cluster_id, locations) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster to upgrade. - This field has been deprecated and replaced by the name field. - locations (list[str]): Required. The desired list of Google Compute Engine - `zones `__ in - which the cluster's nodes should be located. Changing the locations a - cluster is in will result in nodes being either created or removed from - the cluster, depending on whether locations are being added or removed. - - This list must always include the cluster's primary zone. - name (str): The name (project, location, cluster) of the cluster to set locations. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_locations" not in self._inner_api_calls: - self._inner_api_calls[ - "set_locations" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_locations, - default_retry=self._method_configs["SetLocations"].retry, - default_timeout=self._method_configs["SetLocations"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetLocationsRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - locations=locations, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_locations"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_master( - self, - project_id, - zone, - cluster_id, - master_version, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates the master for a specific cluster. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `master_version`: - >>> master_version = '' - >>> - >>> response = client.update_master(project_id, zone, cluster_id, master_version) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster to upgrade. - This field has been deprecated and replaced by the name field. - master_version (str): Required. The Kubernetes version to change the master to. - - Users may specify either explicit versions offered by Kubernetes Engine or - version aliases, which have the following behavior: - - - "latest": picks the highest valid Kubernetes version - - "1.X": picks the highest valid patch+gke.N patch in the 1.X version - - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version - - "1.X.Y-gke.N": picks an explicit Kubernetes version - - "-": picks the default Kubernetes version - name (str): The name (project, location, cluster) of the cluster to update. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_master" not in self._inner_api_calls: - self._inner_api_calls[ - "update_master" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_master, - default_retry=self._method_configs["UpdateMaster"].retry, - default_timeout=self._method_configs["UpdateMaster"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.UpdateMasterRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - master_version=master_version, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_master"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_master_auth( - self, - project_id, - zone, - cluster_id, - action, - update, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets master auth materials. Currently supports changing the admin password - or a specific cluster, either via password generation or explicitly setting - the password. - - Example: - >>> from google.cloud import container_v1 - >>> from google.cloud.container_v1 import enums - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `action`: - >>> action = enums.SetMasterAuthRequest.Action.UNKNOWN - >>> - >>> # TODO: Initialize `update`: - >>> update = {} - >>> - >>> response = client.set_master_auth(project_id, zone, cluster_id, action, update) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster to upgrade. - This field has been deprecated and replaced by the name field. - action (~google.cloud.container_v1.types.Action): Required. The exact form of action to be taken on the master auth. - update (Union[dict, ~google.cloud.container_v1.types.MasterAuth]): Required. A description of the update. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.container_v1.types.MasterAuth` - name (str): The name (project, location, cluster) of the cluster to set auth. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_master_auth" not in self._inner_api_calls: - self._inner_api_calls[ - "set_master_auth" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_master_auth, - default_retry=self._method_configs["SetMasterAuth"].retry, - default_timeout=self._method_configs["SetMasterAuth"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetMasterAuthRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - action=action, - update=update, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_master_auth"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_cluster( - self, - project_id, - zone, - cluster_id, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes the cluster, including the Kubernetes endpoint and all worker - nodes. - - Firewalls and routes that were configured during cluster creation - are also deleted. - - Other Google Compute Engine resources that might be in use by the cluster, - such as load balancer resources, are not deleted if they weren't present - when the cluster was initially created. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> response = client.delete_cluster(project_id, zone, cluster_id) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster to delete. - This field has been deprecated and replaced by the name field. - name (str): The name (project, location, cluster) of the cluster to delete. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_cluster" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_cluster" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_cluster, - default_retry=self._method_configs["DeleteCluster"].retry, - default_timeout=self._method_configs["DeleteCluster"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.DeleteClusterRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id, name=name - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["delete_cluster"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_operations( - self, - project_id, - zone, - parent=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists all operations in a project in a specific zone or all zones. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> response = client.list_operations(project_id, zone) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the parent field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ to - return operations for, or ``-`` for all zones. This field has been - deprecated and replaced by the parent field. - parent (str): The parent (project and location) where the operations will be listed. - Specified in the format 'projects/*/locations/*'. Location "-" matches - all zones and all regions. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.ListOperationsResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_operations" not in self._inner_api_calls: - self._inner_api_calls[ - "list_operations" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_operations, - default_retry=self._method_configs["ListOperations"].retry, - default_timeout=self._method_configs["ListOperations"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.ListOperationsRequest( - project_id=project_id, zone=zone, parent=parent - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["list_operations"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_operation( - self, - project_id, - zone, - operation_id, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets the specified operation. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `operation_id`: - >>> operation_id = '' - >>> - >>> response = client.get_operation(project_id, zone, operation_id) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - operation_id (str): Required. Deprecated. The server-assigned ``name`` of the operation. - This field has been deprecated and replaced by the name field. - name (str): The name (project, location, operation id) of the operation to get. - Specified in the format 'projects/*/locations/*/operations/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_operation" not in self._inner_api_calls: - self._inner_api_calls[ - "get_operation" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_operation, - default_retry=self._method_configs["GetOperation"].retry, - default_timeout=self._method_configs["GetOperation"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.GetOperationRequest( - project_id=project_id, zone=zone, operation_id=operation_id, name=name - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_operation"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def cancel_operation( - self, - project_id, - zone, - operation_id, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Cancels the specified operation. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `operation_id`: - >>> operation_id = '' - >>> - >>> client.cancel_operation(project_id, zone, operation_id) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the operation resides. This field has been deprecated and replaced - by the name field. - operation_id (str): Required. Deprecated. The server-assigned ``name`` of the operation. - This field has been deprecated and replaced by the name field. - name (str): The name (project, location, operation id) of the operation to cancel. - Specified in the format 'projects/*/locations/*/operations/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "cancel_operation" not in self._inner_api_calls: - self._inner_api_calls[ - "cancel_operation" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.cancel_operation, - default_retry=self._method_configs["CancelOperation"].retry, - default_timeout=self._method_configs["CancelOperation"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.CancelOperationRequest( - project_id=project_id, zone=zone, operation_id=operation_id, name=name - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["cancel_operation"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_server_config( - self, - project_id, - zone, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Returns configuration info about the Google Kubernetes Engine service. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> response = client.get_server_config(project_id, zone) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ to - return operations for. This field has been deprecated and replaced by - the name field. - name (str): The name (project and location) of the server config to get, specified - in the format 'projects/*/locations/*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.ServerConfig` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_server_config" not in self._inner_api_calls: - self._inner_api_calls[ - "get_server_config" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_server_config, - default_retry=self._method_configs["GetServerConfig"].retry, - default_timeout=self._method_configs["GetServerConfig"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.GetServerConfigRequest( - project_id=project_id, zone=zone, name=name - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_server_config"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_node_pools( - self, - project_id, - zone, - cluster_id, - parent=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists the node pools for a cluster. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> response = client.list_node_pools(project_id, zone, cluster_id) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project - number `__. - This field has been deprecated and replaced by the parent field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the parent field. - cluster_id (str): Required. Deprecated. The name of the cluster. - This field has been deprecated and replaced by the parent field. - parent (str): The parent (project, location, cluster id) where the node pools will be - listed. Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.ListNodePoolsResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_node_pools" not in self._inner_api_calls: - self._inner_api_calls[ - "list_node_pools" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_node_pools, - default_retry=self._method_configs["ListNodePools"].retry, - default_timeout=self._method_configs["ListNodePools"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.ListNodePoolsRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id, parent=parent - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["list_node_pools"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_node_pool( - self, - project_id, - zone, - cluster_id, - node_pool_id, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Retrieves the requested node pool. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `node_pool_id`: - >>> node_pool_id = '' - >>> - >>> response = client.get_node_pool(project_id, zone, cluster_id, node_pool_id) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project - number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster. - This field has been deprecated and replaced by the name field. - node_pool_id (str): Required. Deprecated. The name of the node pool. - This field has been deprecated and replaced by the name field. - name (str): The name (project, location, cluster, node pool id) of the node pool to - get. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.NodePool` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_node_pool" not in self._inner_api_calls: - self._inner_api_calls[ - "get_node_pool" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_node_pool, - default_retry=self._method_configs["GetNodePool"].retry, - default_timeout=self._method_configs["GetNodePool"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.GetNodePoolRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_node_pool"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_node_pool( - self, - project_id, - zone, - cluster_id, - node_pool, - parent=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a node pool for a cluster. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `node_pool`: - >>> node_pool = {} - >>> - >>> response = client.create_node_pool(project_id, zone, cluster_id, node_pool) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project - number `__. - This field has been deprecated and replaced by the parent field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the parent field. - cluster_id (str): Required. Deprecated. The name of the cluster. - This field has been deprecated and replaced by the parent field. - node_pool (Union[dict, ~google.cloud.container_v1.types.NodePool]): Required. The node pool to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.container_v1.types.NodePool` - parent (str): The parent (project, location, cluster id) where the node pool will be - created. Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_node_pool" not in self._inner_api_calls: - self._inner_api_calls[ - "create_node_pool" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_node_pool, - default_retry=self._method_configs["CreateNodePool"].retry, - default_timeout=self._method_configs["CreateNodePool"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.CreateNodePoolRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool=node_pool, - parent=parent, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_node_pool"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_node_pool( - self, - project_id, - zone, - cluster_id, - node_pool_id, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a node pool from a cluster. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `node_pool_id`: - >>> node_pool_id = '' - >>> - >>> response = client.delete_node_pool(project_id, zone, cluster_id, node_pool_id) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project - number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster. - This field has been deprecated and replaced by the name field. - node_pool_id (str): Required. Deprecated. The name of the node pool to delete. - This field has been deprecated and replaced by the name field. - name (str): The name (project, location, cluster, node pool id) of the node pool to - delete. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_node_pool" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_node_pool" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_node_pool, - default_retry=self._method_configs["DeleteNodePool"].retry, - default_timeout=self._method_configs["DeleteNodePool"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.DeleteNodePoolRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["delete_node_pool"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def rollback_node_pool_upgrade( - self, - project_id, - zone, - cluster_id, - node_pool_id, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Rolls back a previously Aborted or Failed NodePool upgrade. - This makes no changes if the last upgrade successfully completed. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `node_pool_id`: - >>> node_pool_id = '' - >>> - >>> response = client.rollback_node_pool_upgrade(project_id, zone, cluster_id, node_pool_id) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster to rollback. - This field has been deprecated and replaced by the name field. - node_pool_id (str): Required. Deprecated. The name of the node pool to rollback. - This field has been deprecated and replaced by the name field. - name (str): The name (project, location, cluster, node pool id) of the node poll to - rollback upgrade. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "rollback_node_pool_upgrade" not in self._inner_api_calls: - self._inner_api_calls[ - "rollback_node_pool_upgrade" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.rollback_node_pool_upgrade, - default_retry=self._method_configs["RollbackNodePoolUpgrade"].retry, - default_timeout=self._method_configs["RollbackNodePoolUpgrade"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.RollbackNodePoolUpgradeRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["rollback_node_pool_upgrade"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_node_pool_management( - self, - project_id, - zone, - cluster_id, - node_pool_id, - management, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the NodeManagement options for a node pool. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `node_pool_id`: - >>> node_pool_id = '' - >>> - >>> # TODO: Initialize `management`: - >>> management = {} - >>> - >>> response = client.set_node_pool_management(project_id, zone, cluster_id, node_pool_id, management) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster to update. - This field has been deprecated and replaced by the name field. - node_pool_id (str): Required. Deprecated. The name of the node pool to update. - This field has been deprecated and replaced by the name field. - management (Union[dict, ~google.cloud.container_v1.types.NodeManagement]): Required. NodeManagement configuration for the node pool. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.container_v1.types.NodeManagement` - name (str): The name (project, location, cluster, node pool id) of the node pool to - set management properties. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_node_pool_management" not in self._inner_api_calls: - self._inner_api_calls[ - "set_node_pool_management" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_node_pool_management, - default_retry=self._method_configs["SetNodePoolManagement"].retry, - default_timeout=self._method_configs["SetNodePoolManagement"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetNodePoolManagementRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - management=management, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_node_pool_management"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_labels( - self, - project_id, - zone, - cluster_id, - resource_labels, - label_fingerprint, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets labels on a cluster. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `resource_labels`: - >>> resource_labels = {} - >>> - >>> # TODO: Initialize `label_fingerprint`: - >>> label_fingerprint = '' - >>> - >>> response = client.set_labels(project_id, zone, cluster_id, resource_labels, label_fingerprint) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project - number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster. - This field has been deprecated and replaced by the name field. - resource_labels (dict[str -> str]): Required. The labels to set for that cluster. - label_fingerprint (str): Required. The fingerprint of the previous set of labels for this resource, - used to detect conflicts. The fingerprint is initially generated by - Kubernetes Engine and changes after every request to modify or update - labels. You must always provide an up-to-date fingerprint hash when - updating or changing labels. Make a get() request to the - resource to get the latest fingerprint. - name (str): The name (project, location, cluster id) of the cluster to set labels. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_labels" not in self._inner_api_calls: - self._inner_api_calls[ - "set_labels" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_labels, - default_retry=self._method_configs["SetLabels"].retry, - default_timeout=self._method_configs["SetLabels"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetLabelsRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - resource_labels=resource_labels, - label_fingerprint=label_fingerprint, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_labels"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_legacy_abac( - self, - project_id, - zone, - cluster_id, - enabled, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Enables or disables the ABAC authorization mechanism on a cluster. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `enabled`: - >>> enabled = False - >>> - >>> response = client.set_legacy_abac(project_id, zone, cluster_id, enabled) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster to update. - This field has been deprecated and replaced by the name field. - enabled (bool): Required. Whether ABAC authorization will be enabled in the cluster. - name (str): The name (project, location, cluster id) of the cluster to set legacy - abac. Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_legacy_abac" not in self._inner_api_calls: - self._inner_api_calls[ - "set_legacy_abac" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_legacy_abac, - default_retry=self._method_configs["SetLegacyAbac"].retry, - default_timeout=self._method_configs["SetLegacyAbac"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetLegacyAbacRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - enabled=enabled, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_legacy_abac"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def start_i_p_rotation( - self, - project_id, - zone, - cluster_id, - name=None, - rotate_credentials=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Starts master IP rotation. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> response = client.start_i_p_rotation(project_id, zone, cluster_id) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project - number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster. - This field has been deprecated and replaced by the name field. - name (str): The name (project, location, cluster id) of the cluster to start IP - rotation. Specified in the format 'projects/*/locations/*/clusters/\*'. - rotate_credentials (bool): Whether to rotate credentials during IP rotation. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "start_i_p_rotation" not in self._inner_api_calls: - self._inner_api_calls[ - "start_i_p_rotation" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.start_i_p_rotation, - default_retry=self._method_configs["StartIPRotation"].retry, - default_timeout=self._method_configs["StartIPRotation"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.StartIPRotationRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - name=name, - rotate_credentials=rotate_credentials, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["start_i_p_rotation"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def complete_i_p_rotation( - self, - project_id, - zone, - cluster_id, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Completes master IP rotation. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> response = client.complete_i_p_rotation(project_id, zone, cluster_id) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project - number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster. - This field has been deprecated and replaced by the name field. - name (str): The name (project, location, cluster id) of the cluster to complete IP - rotation. Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "complete_i_p_rotation" not in self._inner_api_calls: - self._inner_api_calls[ - "complete_i_p_rotation" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.complete_i_p_rotation, - default_retry=self._method_configs["CompleteIPRotation"].retry, - default_timeout=self._method_configs["CompleteIPRotation"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.CompleteIPRotationRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id, name=name - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["complete_i_p_rotation"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_node_pool_size( - self, - project_id, - zone, - cluster_id, - node_pool_id, - node_count, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the size for a specific node pool. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `node_pool_id`: - >>> node_pool_id = '' - >>> - >>> # TODO: Initialize `node_count`: - >>> node_count = 0 - >>> - >>> response = client.set_node_pool_size(project_id, zone, cluster_id, node_pool_id, node_count) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster to update. - This field has been deprecated and replaced by the name field. - node_pool_id (str): Required. Deprecated. The name of the node pool to update. - This field has been deprecated and replaced by the name field. - node_count (int): Required. The desired node count for the pool. - name (str): The name (project, location, cluster, node pool id) of the node pool to - set size. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_node_pool_size" not in self._inner_api_calls: - self._inner_api_calls[ - "set_node_pool_size" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_node_pool_size, - default_retry=self._method_configs["SetNodePoolSize"].retry, - default_timeout=self._method_configs["SetNodePoolSize"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetNodePoolSizeRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - node_count=node_count, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_node_pool_size"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_network_policy( - self, - project_id, - zone, - cluster_id, - network_policy, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Enables or disables Network Policy for a cluster. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `network_policy`: - >>> network_policy = {} - >>> - >>> response = client.set_network_policy(project_id, zone, cluster_id, network_policy) - - Args: - project_id (str): Required. Deprecated. The Google Developers Console `project ID or - project - number `__. - This field has been deprecated and replaced by the name field. - zone (str): Required. Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Required. Deprecated. The name of the cluster. - This field has been deprecated and replaced by the name field. - network_policy (Union[dict, ~google.cloud.container_v1.types.NetworkPolicy]): Required. Configuration options for the NetworkPolicy feature. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.container_v1.types.NetworkPolicy` - name (str): The name (project, location, cluster id) of the cluster to set - networking policy. Specified in the format - 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_network_policy" not in self._inner_api_calls: - self._inner_api_calls[ - "set_network_policy" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_network_policy, - default_retry=self._method_configs["SetNetworkPolicy"].retry, - default_timeout=self._method_configs["SetNetworkPolicy"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetNetworkPolicyRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - network_policy=network_policy, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_network_policy"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_maintenance_policy( - self, - project_id, - zone, - cluster_id, - maintenance_policy, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the maintenance policy for a cluster. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `maintenance_policy`: - >>> maintenance_policy = {} - >>> - >>> response = client.set_maintenance_policy(project_id, zone, cluster_id, maintenance_policy) - - Args: - project_id (str): Required. The Google Developers Console `project ID or project - number `__. - zone (str): Required. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. - cluster_id (str): Required. The name of the cluster to update. - maintenance_policy (Union[dict, ~google.cloud.container_v1.types.MaintenancePolicy]): Required. The maintenance policy to be set for the cluster. An empty field - clears the existing maintenance policy. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.container_v1.types.MaintenancePolicy` - name (str): The name (project, location, cluster id) of the cluster to set - maintenance policy. Specified in the format - 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_maintenance_policy" not in self._inner_api_calls: - self._inner_api_calls[ - "set_maintenance_policy" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_maintenance_policy, - default_retry=self._method_configs["SetMaintenancePolicy"].retry, - default_timeout=self._method_configs["SetMaintenancePolicy"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetMaintenancePolicyRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - maintenance_policy=maintenance_policy, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_maintenance_policy"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_usable_subnetworks( - self, - parent=None, - filter_=None, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists subnetworks that are usable for creating clusters in a project. - - Example: - >>> from google.cloud import container_v1 - >>> - >>> client = container_v1.ClusterManagerClient() - >>> - >>> # Iterate over all results - >>> for element in client.list_usable_subnetworks(): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_usable_subnetworks().pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): The parent project where subnetworks are usable. Specified in the format - 'projects/\*'. - filter_ (str): Filtering currently only supports equality on the networkProjectId and - must be in the form: "networkProjectId=[PROJECTID]", where - ``networkProjectId`` is the project which owns the listed subnetworks. - This defaults to the parent project ID. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.container_v1.types.UsableSubnetwork` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_usable_subnetworks" not in self._inner_api_calls: - self._inner_api_calls[ - "list_usable_subnetworks" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_usable_subnetworks, - default_retry=self._method_configs["ListUsableSubnetworks"].retry, - default_timeout=self._method_configs["ListUsableSubnetworks"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.ListUsableSubnetworksRequest( - parent=parent, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_usable_subnetworks"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="subnetworks", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator diff --git a/container/google/cloud/container_v1/gapic/cluster_manager_client_config.py b/container/google/cloud/container_v1/gapic/cluster_manager_client_config.py deleted file mode 100644 index 1a761ab11def..000000000000 --- a/container/google/cloud/container_v1/gapic/cluster_manager_client_config.py +++ /dev/null @@ -1,178 +0,0 @@ -config = { - "interfaces": { - "google.container.v1.ClusterManager": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "ListClusters": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetCluster": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateCluster": { - "timeout_millis": 45000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateNodePool": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetNodePoolAutoscaling": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetLoggingService": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetMonitoringService": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetAddonsConfig": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetLocations": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateMaster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetMasterAuth": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListOperations": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetOperation": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CancelOperation": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetServerConfig": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListNodePools": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetNodePool": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateNodePool": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteNodePool": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "RollbackNodePoolUpgrade": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetNodePoolManagement": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetLabels": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetLegacyAbac": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "StartIPRotation": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "CompleteIPRotation": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetNodePoolSize": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetNetworkPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetMaintenancePolicy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListUsableSubnetworks": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/container/google/cloud/container_v1/gapic/enums.py b/container/google/cloud/container_v1/gapic/enums.py deleted file mode 100644 index 91a90e6ec731..000000000000 --- a/container/google/cloud/container_v1/gapic/enums.py +++ /dev/null @@ -1,260 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class Cluster(object): - class Status(enum.IntEnum): - """ - The current status of the cluster. - - Attributes: - STATUS_UNSPECIFIED (int): Not set. - PROVISIONING (int): The PROVISIONING state indicates the cluster is being created. - RUNNING (int): The RUNNING state indicates the cluster has been created and is fully - usable. - RECONCILING (int): The RECONCILING state indicates that some work is actively being done on - the cluster, such as upgrading the master or node software. Details can - be found in the ``statusMessage`` field. - STOPPING (int): The STOPPING state indicates the cluster is being deleted. - ERROR (int): The ERROR state indicates the cluster may be unusable. Details can be - found in the ``statusMessage`` field. - DEGRADED (int): The DEGRADED state indicates the cluster requires user action to restore - full functionality. Details can be found in the ``statusMessage`` field. - """ - - STATUS_UNSPECIFIED = 0 - PROVISIONING = 1 - RUNNING = 2 - RECONCILING = 3 - STOPPING = 4 - ERROR = 5 - DEGRADED = 6 - - -class DatabaseEncryption(object): - class State(enum.IntEnum): - """ - State of etcd encryption. - - Attributes: - UNKNOWN (int): Should never be set - ENCRYPTED (int): Secrets in etcd are encrypted. - DECRYPTED (int): Secrets in etcd are stored in plain text (at etcd level) - this is - unrelated to GCE level full disk encryption. - """ - - UNKNOWN = 0 - ENCRYPTED = 1 - DECRYPTED = 2 - - -class NetworkPolicy(object): - class Provider(enum.IntEnum): - """ - Allowed Network Policy providers. - - Attributes: - PROVIDER_UNSPECIFIED (int): Not set - CALICO (int): Tigera (Calico Felix). - """ - - PROVIDER_UNSPECIFIED = 0 - CALICO = 1 - - -class NodePool(object): - class Status(enum.IntEnum): - """ - The current status of the node pool instance. - - Attributes: - STATUS_UNSPECIFIED (int): Not set. - PROVISIONING (int): The PROVISIONING state indicates the node pool is being created. - RUNNING (int): The RUNNING state indicates the node pool has been created - and is fully usable. - RUNNING_WITH_ERROR (int): The RUNNING\_WITH\_ERROR state indicates the node pool has been created - and is partially usable. Some error state has occurred and some - functionality may be impaired. Customer may need to reissue a request or - trigger a new update. - RECONCILING (int): The RECONCILING state indicates that some work is actively being done on - the node pool, such as upgrading node software. Details can be found in - the ``statusMessage`` field. - STOPPING (int): The STOPPING state indicates the node pool is being deleted. - ERROR (int): The ERROR state indicates the node pool may be unusable. Details can be - found in the ``statusMessage`` field. - """ - - STATUS_UNSPECIFIED = 0 - PROVISIONING = 1 - RUNNING = 2 - RUNNING_WITH_ERROR = 3 - RECONCILING = 4 - STOPPING = 5 - ERROR = 6 - - -class NodeTaint(object): - class Effect(enum.IntEnum): - """ - Possible values for Effect in taint. - - Attributes: - EFFECT_UNSPECIFIED (int): Not set - NO_SCHEDULE (int): NoSchedule - PREFER_NO_SCHEDULE (int): PreferNoSchedule - NO_EXECUTE (int): NoExecute - """ - - EFFECT_UNSPECIFIED = 0 - NO_SCHEDULE = 1 - PREFER_NO_SCHEDULE = 2 - NO_EXECUTE = 3 - - -class Operation(object): - class Status(enum.IntEnum): - """ - Current status of the operation. - - Attributes: - STATUS_UNSPECIFIED (int): Not set. - PENDING (int): The operation has been created. - RUNNING (int): The operation is currently running. - DONE (int): The operation is done, either cancelled or completed. - ABORTING (int): The operation is aborting. - """ - - STATUS_UNSPECIFIED = 0 - PENDING = 1 - RUNNING = 2 - DONE = 3 - ABORTING = 4 - - class Type(enum.IntEnum): - """ - Operation type. - - Attributes: - TYPE_UNSPECIFIED (int): Not set. - CREATE_CLUSTER (int): Cluster create. - DELETE_CLUSTER (int): Cluster delete. - UPGRADE_MASTER (int): A master upgrade. - UPGRADE_NODES (int): A node upgrade. - REPAIR_CLUSTER (int): Cluster repair. - UPDATE_CLUSTER (int): Cluster update. - CREATE_NODE_POOL (int): Node pool create. - DELETE_NODE_POOL (int): Node pool delete. - SET_NODE_POOL_MANAGEMENT (int): Set node pool management. - AUTO_REPAIR_NODES (int): Automatic node pool repair. - AUTO_UPGRADE_NODES (int): Automatic node upgrade. - SET_LABELS (int): Set labels. - SET_MASTER_AUTH (int): Set/generate master auth materials - SET_NODE_POOL_SIZE (int): Set node pool size. - SET_NETWORK_POLICY (int): Updates network policy for a cluster. - SET_MAINTENANCE_POLICY (int): Set the maintenance policy. - """ - - TYPE_UNSPECIFIED = 0 - CREATE_CLUSTER = 1 - DELETE_CLUSTER = 2 - UPGRADE_MASTER = 3 - UPGRADE_NODES = 4 - REPAIR_CLUSTER = 5 - UPDATE_CLUSTER = 6 - CREATE_NODE_POOL = 7 - DELETE_NODE_POOL = 8 - SET_NODE_POOL_MANAGEMENT = 9 - AUTO_REPAIR_NODES = 10 - AUTO_UPGRADE_NODES = 11 - SET_LABELS = 12 - SET_MASTER_AUTH = 13 - SET_NODE_POOL_SIZE = 14 - SET_NETWORK_POLICY = 15 - SET_MAINTENANCE_POLICY = 16 - - -class SetMasterAuthRequest(object): - class Action(enum.IntEnum): - """ - Operation type: what type update to perform. - - Attributes: - UNKNOWN (int): Operation is unknown and will error out. - SET_PASSWORD (int): Set the password to a user generated value. - GENERATE_PASSWORD (int): Generate a new password and set it to that. - SET_USERNAME (int): Set the username. If an empty username is provided, basic authentication - is disabled for the cluster. If a non-empty username is provided, basic - authentication is enabled, with either a provided password or a generated - one. - """ - - UNKNOWN = 0 - SET_PASSWORD = 1 - GENERATE_PASSWORD = 2 - SET_USERNAME = 3 - - -class StatusCondition(object): - class Code(enum.IntEnum): - """ - Code for each condition - - Attributes: - UNKNOWN (int): UNKNOWN indicates a generic condition. - GCE_STOCKOUT (int): GCE\_STOCKOUT indicates a Google Compute Engine stockout. - GKE_SERVICE_ACCOUNT_DELETED (int): GKE\_SERVICE\_ACCOUNT\_DELETED indicates that the user deleted their - robot service account. - GCE_QUOTA_EXCEEDED (int): Google Compute Engine quota was exceeded. - SET_BY_OPERATOR (int): Cluster state was manually changed by an SRE due to a system logic error. - CLOUD_KMS_KEY_ERROR (int): Unable to perform an encrypt operation against the CloudKMS key used for - etcd level encryption. - More codes TBA - """ - - UNKNOWN = 0 - GCE_STOCKOUT = 1 - GKE_SERVICE_ACCOUNT_DELETED = 2 - GCE_QUOTA_EXCEEDED = 3 - SET_BY_OPERATOR = 4 - CLOUD_KMS_KEY_ERROR = 7 - - -class UsableSubnetworkSecondaryRange(object): - class Status(enum.IntEnum): - """ - Status shows the current usage of a secondary IP range. - - Attributes: - UNKNOWN (int): UNKNOWN is the zero value of the Status enum. It's not a valid status. - UNUSED (int): UNUSED denotes that this range is unclaimed by any cluster. - IN_USE_SERVICE (int): IN\_USE\_SERVICE denotes that this range is claimed by a cluster for - services. It cannot be used for other clusters. - IN_USE_SHAREABLE_POD (int): IN\_USE\_SHAREABLE\_POD denotes this range was created by the network - admin and is currently claimed by a cluster for pods. It can only be - used by other clusters as a pod range. - IN_USE_MANAGED_POD (int): IN\_USE\_MANAGED\_POD denotes this range was created by GKE and is - claimed for pods. It cannot be used for other clusters. - """ - - UNKNOWN = 0 - UNUSED = 1 - IN_USE_SERVICE = 2 - IN_USE_SHAREABLE_POD = 3 - IN_USE_MANAGED_POD = 4 diff --git a/container/google/cloud/container_v1/gapic/transports/__init__.py b/container/google/cloud/container_v1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/container/google/cloud/container_v1/gapic/transports/cluster_manager_grpc_transport.py b/container/google/cloud/container_v1/gapic/transports/cluster_manager_grpc_transport.py deleted file mode 100644 index e0a6e5b862a1..000000000000 --- a/container/google/cloud/container_v1/gapic/transports/cluster_manager_grpc_transport.py +++ /dev/null @@ -1,534 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers - -from google.cloud.container_v1.proto import cluster_service_pb2_grpc - - -class ClusterManagerGrpcTransport(object): - """gRPC transport class providing stubs for - google.container.v1 ClusterManager API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="container.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "cluster_manager_stub": cluster_service_pb2_grpc.ClusterManagerStub(channel) - } - - @classmethod - def create_channel( - cls, address="container.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def list_clusters(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.list_clusters`. - - Lists all clusters owned by a project in either the specified zone or all - zones. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].ListClusters - - @property - def get_cluster(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.get_cluster`. - - Gets the details of a specific cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].GetCluster - - @property - def create_cluster(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.create_cluster`. - - Creates a cluster, consisting of the specified number and type of Google - Compute Engine instances. - - By default, the cluster is created in the project's `default - network `__. - - One firewall is added for the cluster. After cluster creation, the - Kubelet creates routes for each node to allow the containers on that - node to communicate with all other instances in the cluster. - - Finally, an entry is added to the project's global metadata indicating - which CIDR range the cluster is using. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].CreateCluster - - @property - def update_cluster(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.update_cluster`. - - Updates the settings of a specific cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].UpdateCluster - - @property - def update_node_pool(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.update_node_pool`. - - Updates the version and/or image type for the specified node pool. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].UpdateNodePool - - @property - def set_node_pool_autoscaling(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_node_pool_autoscaling`. - - Sets the autoscaling settings for the specified node pool. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetNodePoolAutoscaling - - @property - def set_logging_service(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_logging_service`. - - Sets the logging service for a specific cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetLoggingService - - @property - def set_monitoring_service(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_monitoring_service`. - - Sets the monitoring service for a specific cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetMonitoringService - - @property - def set_addons_config(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_addons_config`. - - Sets the addons for a specific cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetAddonsConfig - - @property - def set_locations(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_locations`. - - Sets the locations for a specific cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetLocations - - @property - def update_master(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.update_master`. - - Updates the master for a specific cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].UpdateMaster - - @property - def set_master_auth(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_master_auth`. - - Sets master auth materials. Currently supports changing the admin password - or a specific cluster, either via password generation or explicitly setting - the password. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetMasterAuth - - @property - def delete_cluster(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.delete_cluster`. - - Deletes the cluster, including the Kubernetes endpoint and all worker - nodes. - - Firewalls and routes that were configured during cluster creation - are also deleted. - - Other Google Compute Engine resources that might be in use by the cluster, - such as load balancer resources, are not deleted if they weren't present - when the cluster was initially created. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].DeleteCluster - - @property - def list_operations(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.list_operations`. - - Lists all operations in a project in a specific zone or all zones. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].ListOperations - - @property - def get_operation(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.get_operation`. - - Gets the specified operation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].GetOperation - - @property - def cancel_operation(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.cancel_operation`. - - Cancels the specified operation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].CancelOperation - - @property - def get_server_config(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.get_server_config`. - - Returns configuration info about the Google Kubernetes Engine service. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].GetServerConfig - - @property - def list_node_pools(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.list_node_pools`. - - Lists the node pools for a cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].ListNodePools - - @property - def get_node_pool(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.get_node_pool`. - - Retrieves the requested node pool. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].GetNodePool - - @property - def create_node_pool(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.create_node_pool`. - - Creates a node pool for a cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].CreateNodePool - - @property - def delete_node_pool(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.delete_node_pool`. - - Deletes a node pool from a cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].DeleteNodePool - - @property - def rollback_node_pool_upgrade(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.rollback_node_pool_upgrade`. - - Rolls back a previously Aborted or Failed NodePool upgrade. - This makes no changes if the last upgrade successfully completed. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].RollbackNodePoolUpgrade - - @property - def set_node_pool_management(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_node_pool_management`. - - Sets the NodeManagement options for a node pool. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetNodePoolManagement - - @property - def set_labels(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_labels`. - - Sets labels on a cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetLabels - - @property - def set_legacy_abac(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_legacy_abac`. - - Enables or disables the ABAC authorization mechanism on a cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetLegacyAbac - - @property - def start_i_p_rotation(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.start_i_p_rotation`. - - Starts master IP rotation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].StartIPRotation - - @property - def complete_i_p_rotation(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.complete_i_p_rotation`. - - Completes master IP rotation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].CompleteIPRotation - - @property - def set_node_pool_size(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_node_pool_size`. - - Sets the size for a specific node pool. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetNodePoolSize - - @property - def set_network_policy(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_network_policy`. - - Enables or disables Network Policy for a cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetNetworkPolicy - - @property - def set_maintenance_policy(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_maintenance_policy`. - - Sets the maintenance policy for a cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetMaintenancePolicy - - @property - def list_usable_subnetworks(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.list_usable_subnetworks`. - - Lists subnetworks that are usable for creating clusters in a project. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].ListUsableSubnetworks diff --git a/container/google/cloud/container_v1/proto/__init__.py b/container/google/cloud/container_v1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/container/google/cloud/container_v1/proto/cluster_service.proto b/container/google/cloud/container_v1/proto/cluster_service.proto deleted file mode 100644 index 86475baad305..000000000000 --- a/container/google/cloud/container_v1/proto/cluster_service.proto +++ /dev/null @@ -1,3041 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.container.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Container.V1"; -option go_package = "google.golang.org/genproto/googleapis/container/v1;container"; -option java_multiple_files = true; -option java_outer_classname = "ClusterServiceProto"; -option java_package = "com.google.container.v1"; -option php_namespace = "Google\\Cloud\\Container\\V1"; - -// Google Kubernetes Engine Cluster Manager v1 -service ClusterManager { - option (google.api.default_host) = "container.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Lists all clusters owned by a project in either the specified zone or all - // zones. - rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/clusters" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/clusters" - } - }; - option (google.api.method_signature) = "project_id,zone"; - } - - // Gets the details of a specific cluster. - rpc GetCluster(GetClusterRequest) returns (Cluster) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/clusters/*}" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - } - - // Creates a cluster, consisting of the specified number and type of Google - // Compute Engine instances. - // - // By default, the cluster is created in the project's - // [default network](/compute/docs/networks-and-firewalls#networks). - // - // One firewall is added for the cluster. After cluster creation, - // the Kubelet creates routes for each node to allow the containers - // on that node to communicate with all other instances in the - // cluster. - // - // Finally, an entry is added to the project's global metadata indicating - // which CIDR range the cluster is using. - rpc CreateCluster(CreateClusterRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/clusters" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster"; - } - - // Updates the settings of a specific cluster. - rpc UpdateCluster(UpdateClusterRequest) returns (Operation) { - option (google.api.http) = { - put: "/v1/{name=projects/*/locations/*/clusters/*}" - body: "*" - additional_bindings { - put: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,update"; - } - - // Updates the version and/or image type for the specified node pool. - rpc UpdateNodePool(UpdateNodePoolRequest) returns (Operation) { - option (google.api.http) = { - put: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/update" - body: "*" - } - }; - } - - // Sets the autoscaling settings for the specified node pool. - rpc SetNodePoolAutoscaling(SetNodePoolAutoscalingRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setAutoscaling" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/autoscaling" - body: "*" - } - }; - } - - // Sets the logging service for a specific cluster. - rpc SetLoggingService(SetLoggingServiceRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setLogging" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/logging" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,logging_service"; - } - - // Sets the monitoring service for a specific cluster. - rpc SetMonitoringService(SetMonitoringServiceRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setMonitoring" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/monitoring" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,monitoring_service"; - } - - // Sets the addons for a specific cluster. - rpc SetAddonsConfig(SetAddonsConfigRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setAddons" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/addons" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,addons_config"; - } - - // Sets the locations for a specific cluster. - rpc SetLocations(SetLocationsRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setLocations" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/locations" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,locations"; - } - - // Updates the master for a specific cluster. - rpc UpdateMaster(UpdateMasterRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:updateMaster" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/master" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,master_version"; - } - - // Sets master auth materials. Currently supports changing the admin password - // or a specific cluster, either via password generation or explicitly setting - // the password. - rpc SetMasterAuth(SetMasterAuthRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setMasterAuth" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMasterAuth" - body: "*" - } - }; - } - - // Deletes the cluster, including the Kubernetes endpoint and all worker - // nodes. - // - // Firewalls and routes that were configured during cluster creation - // are also deleted. - // - // Other Google Compute Engine resources that might be in use by the cluster, - // such as load balancer resources, are not deleted if they weren't present - // when the cluster was initially created. - rpc DeleteCluster(DeleteClusterRequest) returns (Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/clusters/*}" - additional_bindings { - delete: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - } - - // Lists all operations in a project in a specific zone or all zones. - rpc ListOperations(ListOperationsRequest) returns (ListOperationsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/operations" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/operations" - } - }; - option (google.api.method_signature) = "project_id,zone"; - } - - // Gets the specified operation. - rpc GetOperation(GetOperationRequest) returns (Operation) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/operations/*}" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/operations/{operation_id}" - } - }; - option (google.api.method_signature) = "project_id,zone,operation_id"; - } - - // Cancels the specified operation. - rpc CancelOperation(CancelOperationRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/operations/*}:cancel" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/operations/{operation_id}:cancel" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,operation_id"; - } - - // Returns configuration info about the Google Kubernetes Engine service. - rpc GetServerConfig(GetServerConfigRequest) returns (ServerConfig) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*}/serverConfig" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/serverconfig" - } - }; - option (google.api.method_signature) = "project_id,zone"; - } - - // Lists the node pools for a cluster. - rpc ListNodePools(ListNodePoolsRequest) returns (ListNodePoolsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - } - - // Retrieves the requested node pool. - rpc GetNodePool(GetNodePoolRequest) returns (NodePool) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" - additional_bindings { - get: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,node_pool_id"; - } - - // Creates a node pool for a cluster. - rpc CreateNodePool(CreateNodePoolRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,node_pool"; - } - - // Deletes a node pool from a cluster. - rpc DeleteNodePool(DeleteNodePoolRequest) returns (Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" - additional_bindings { - delete: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,node_pool_id"; - } - - // Rolls back a previously Aborted or Failed NodePool upgrade. - // This makes no changes if the last upgrade successfully completed. - rpc RollbackNodePoolUpgrade(RollbackNodePoolUpgradeRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:rollback" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}:rollback" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,node_pool_id"; - } - - // Sets the NodeManagement options for a node pool. - rpc SetNodePoolManagement(SetNodePoolManagementRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setManagement" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setManagement" - body: "*" - } - }; - } - - // Sets labels on a cluster. - rpc SetLabels(SetLabelsRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setResourceLabels" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/resourceLabels" - body: "*" - } - }; - } - - // Enables or disables the ABAC authorization mechanism on a cluster. - rpc SetLegacyAbac(SetLegacyAbacRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setLegacyAbac" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/legacyAbac" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,enabled"; - } - - // Starts master IP rotation. - rpc StartIPRotation(StartIPRotationRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:startIpRotation" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:startIpRotation" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - } - - // Completes master IP rotation. - rpc CompleteIPRotation(CompleteIPRotationRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:completeIpRotation" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:completeIpRotation" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id"; - } - - // Sets the size for a specific node pool. - rpc SetNodePoolSize(SetNodePoolSizeRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setSize" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setSize" - body: "*" - } - }; - } - - // Enables or disables Network Policy for a cluster. - rpc SetNetworkPolicy(SetNetworkPolicyRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setNetworkPolicy" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setNetworkPolicy" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,network_policy"; - } - - // Sets the maintenance policy for a cluster. - rpc SetMaintenancePolicy(SetMaintenancePolicyRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/clusters/*}:setMaintenancePolicy" - body: "*" - additional_bindings { - post: "/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMaintenancePolicy" - body: "*" - } - }; - option (google.api.method_signature) = "project_id,zone,cluster_id,maintenance_policy"; - } - - // Lists subnetworks that are usable for creating clusters in a project. - rpc ListUsableSubnetworks(ListUsableSubnetworksRequest) returns (ListUsableSubnetworksResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*}/aggregated/usableSubnetworks" - }; - } -} - -// Parameters that describe the nodes in a cluster. -message NodeConfig { - // The name of a Google Compute Engine [machine - // type](/compute/docs/machine-types) (e.g. - // `n1-standard-1`). - // - // If unspecified, the default machine type is - // `n1-standard-1`. - string machine_type = 1; - - // Size of the disk attached to each node, specified in GB. - // The smallest allowed disk size is 10GB. - // - // If unspecified, the default disk size is 100GB. - int32 disk_size_gb = 2; - - // The set of Google API scopes to be made available on all of the - // node VMs under the "default" service account. - // - // The following scopes are recommended, but not required, and by default are - // not included: - // - // * `https://www.googleapis.com/auth/compute` is required for mounting - // persistent storage on your nodes. - // * `https://www.googleapis.com/auth/devstorage.read_only` is required for - // communicating with **gcr.io** - // (the [Google Container Registry](/container-registry/)). - // - // If unspecified, no scopes are added, unless Cloud Logging or Cloud - // Monitoring are enabled, in which case their required scopes will be added. - repeated string oauth_scopes = 3; - - // The Google Cloud Platform Service Account to be used by the node VMs. If - // no Service Account is specified, the "default" service account is used. - string service_account = 9; - - // The metadata key/value pairs assigned to instances in the cluster. - // - // Keys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes - // in length. These are reflected as part of a URL in the metadata server. - // Additionally, to avoid ambiguity, keys must not conflict with any other - // metadata keys for the project or be one of the reserved keys: - // "cluster-location" - // "cluster-name" - // "cluster-uid" - // "configure-sh" - // "containerd-configure-sh" - // "enable-os-login" - // "gci-update-strategy" - // "gci-ensure-gke-docker" - // "instance-template" - // "kube-env" - // "startup-script" - // "user-data" - // "disable-address-manager" - // "windows-startup-script-ps1" - // "common-psm1" - // "k8s-node-setup-psm1" - // "install-ssh-psm1" - // "user-profile-psm1" - // "serial-port-logging-enable" - // - // Values are free-form strings, and only have meaning as interpreted by - // the image running in the instance. The only restriction placed on them is - // that each value's size must be less than or equal to 32 KB. - // - // The total size of all keys and values must be less than 512 KB. - map metadata = 4; - - // The image type to use for this node. Note that for a given image type, - // the latest version of it will be used. - string image_type = 5; - - // The map of Kubernetes labels (key/value pairs) to be applied to each node. - // These will added in addition to any default label(s) that - // Kubernetes may apply to the node. - // In case of conflict in label keys, the applied set may differ depending on - // the Kubernetes version -- it's best to assume the behavior is undefined - // and conflicts should be avoided. - // For more information, including usage and the valid values, see: - // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - map labels = 6; - - // The number of local SSD disks to be attached to the node. - // - // The limit for this value is dependent upon the maximum number of - // disks available on a machine per zone. See: - // https://cloud.google.com/compute/docs/disks/local-ssd - // for more information. - int32 local_ssd_count = 7; - - // The list of instance tags applied to all nodes. Tags are used to identify - // valid sources or targets for network firewalls and are specified by - // the client during cluster or node pool creation. Each tag within the list - // must comply with RFC1035. - repeated string tags = 8; - - // Whether the nodes are created as preemptible VM instances. See: - // https://cloud.google.com/compute/docs/instances/preemptible for more - // information about preemptible VM instances. - bool preemptible = 10; - - // A list of hardware accelerators to be attached to each node. - // See https://cloud.google.com/compute/docs/gpus for more information about - // support for GPUs. - repeated AcceleratorConfig accelerators = 11; - - // Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') - // - // If unspecified, the default disk type is 'pd-standard' - string disk_type = 12; - - // Minimum CPU platform to be used by this instance. The instance may be - // scheduled on the specified or newer CPU platform. Applicable values are the - // friendly names of CPU platforms, such as - // minCpuPlatform: "Intel Haswell" or - // minCpuPlatform: "Intel Sandy Bridge". For more - // information, read [how to specify min CPU - // platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) - string min_cpu_platform = 13; - - // List of kubernetes taints to be applied to each node. - // - // For more information, including usage and the valid values, see: - // https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - repeated NodeTaint taints = 15; - - // Shielded Instance options. - ShieldedInstanceConfig shielded_instance_config = 20; -} - -// A set of Shielded Instance options. -message ShieldedInstanceConfig { - // Defines whether the instance has Secure Boot enabled. - // - // Secure Boot helps ensure that the system only runs authentic software by - // verifying the digital signature of all boot components, and halting the - // boot process if signature verification fails. - bool enable_secure_boot = 1; - - // Defines whether the instance has integrity monitoring enabled. - // - // Enables monitoring and attestation of the boot integrity of the instance. - // The attestation is performed against the integrity policy baseline. This - // baseline is initially derived from the implicitly trusted boot image when - // the instance is created. - bool enable_integrity_monitoring = 2; -} - -// Kubernetes taint is comprised of three fields: key, value, and effect. Effect -// can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. -// -// For more information, including usage and the valid values, see: -// https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ -message NodeTaint { - // Possible values for Effect in taint. - enum Effect { - // Not set - EFFECT_UNSPECIFIED = 0; - - // NoSchedule - NO_SCHEDULE = 1; - - // PreferNoSchedule - PREFER_NO_SCHEDULE = 2; - - // NoExecute - NO_EXECUTE = 3; - } - - // Key for taint. - string key = 1; - - // Value for taint. - string value = 2; - - // Effect for taint. - Effect effect = 3; -} - -// The authentication information for accessing the master endpoint. -// Authentication can be done using HTTP basic auth or using client -// certificates. -message MasterAuth { - // The username to use for HTTP basic authentication to the master endpoint. - // For clusters v1.6.0 and later, basic authentication can be disabled by - // leaving username unspecified (or setting it to the empty string). - string username = 1; - - // The password to use for HTTP basic authentication to the master endpoint. - // Because the master endpoint is open to the Internet, you should create a - // strong password. If a password is provided for cluster creation, username - // must be non-empty. - string password = 2; - - // Configuration for client certificate authentication on the cluster. For - // clusters before v1.12, if no configuration is specified, a client - // certificate is issued. - ClientCertificateConfig client_certificate_config = 3; - - // [Output only] Base64-encoded public certificate that is the root of - // trust for the cluster. - string cluster_ca_certificate = 100; - - // [Output only] Base64-encoded public certificate used by clients to - // authenticate to the cluster endpoint. - string client_certificate = 101; - - // [Output only] Base64-encoded private key used by clients to authenticate - // to the cluster endpoint. - string client_key = 102; -} - -// Configuration for client certificates on the cluster. -message ClientCertificateConfig { - // Issue a client certificate. - bool issue_client_certificate = 1; -} - -// Configuration for the addons that can be automatically spun up in the -// cluster, enabling additional functionality. -message AddonsConfig { - // Configuration for the HTTP (L7) load balancing controller addon, which - // makes it easy to set up HTTP load balancers for services in a cluster. - HttpLoadBalancing http_load_balancing = 1; - - // Configuration for the horizontal pod autoscaling feature, which - // increases or decreases the number of replica pods a replication controller - // has based on the resource usage of the existing pods. - HorizontalPodAutoscaling horizontal_pod_autoscaling = 2; - - // Configuration for the Kubernetes Dashboard. - // This addon is deprecated, and will be disabled in 1.15. It is recommended - // to use the Cloud Console to manage and monitor your Kubernetes clusters, - // workloads and applications. For more information, see: - // https://cloud.google.com/kubernetes-engine/docs/concepts/dashboards - KubernetesDashboard kubernetes_dashboard = 3 [deprecated = true]; - - // Configuration for NetworkPolicy. This only tracks whether the addon - // is enabled or not on the Master, it does not track whether network policy - // is enabled for the nodes. - NetworkPolicyConfig network_policy_config = 4; - - // Configuration for the Cloud Run addon, which allows the user to use a - // managed Knative service. - CloudRunConfig cloud_run_config = 7; -} - -// Configuration options for the HTTP (L7) load balancing controller addon, -// which makes it easy to set up HTTP load balancers for services in a cluster. -message HttpLoadBalancing { - // Whether the HTTP Load Balancing controller is enabled in the cluster. - // When enabled, it runs a small pod in the cluster that manages the load - // balancers. - bool disabled = 1; -} - -// Configuration options for the horizontal pod autoscaling feature, which -// increases or decreases the number of replica pods a replication controller -// has based on the resource usage of the existing pods. -message HorizontalPodAutoscaling { - // Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. - // When enabled, it ensures that a Heapster pod is running in the cluster, - // which is also used by the Cloud Monitoring service. - bool disabled = 1; -} - -// Configuration for the Kubernetes Dashboard. -message KubernetesDashboard { - // Whether the Kubernetes Dashboard is enabled for this cluster. - bool disabled = 1; -} - -// Configuration for NetworkPolicy. This only tracks whether the addon -// is enabled or not on the Master, it does not track whether network policy -// is enabled for the nodes. -message NetworkPolicyConfig { - // Whether NetworkPolicy is enabled for this cluster. - bool disabled = 1; -} - -// Configuration options for private clusters. -message PrivateClusterConfig { - // Whether nodes have internal IP addresses only. If enabled, all nodes are - // given only RFC 1918 private addresses and communicate with the master via - // private networking. - bool enable_private_nodes = 1; - - // Whether the master's internal IP address is used as the cluster endpoint. - bool enable_private_endpoint = 2; - - // The IP range in CIDR notation to use for the hosted master network. This - // range will be used for assigning internal IP addresses to the master or - // set of masters, as well as the ILB VIP. This range must not overlap with - // any other ranges in use within the cluster's network. - string master_ipv4_cidr_block = 3; - - // Output only. The internal IP address of this cluster's master endpoint. - string private_endpoint = 4; - - // Output only. The external IP address of this cluster's master endpoint. - string public_endpoint = 5; -} - -// Configuration for returning group information from authenticators. -message AuthenticatorGroupsConfig { - // Whether this cluster should return group membership lookups - // during authentication using a group of security groups. - bool enabled = 1; - - // The name of the security group-of-groups to be used. Only relevant - // if enabled = true. - string security_group = 2; -} - -// Configuration options for the Cloud Run feature. -message CloudRunConfig { - // Whether Cloud Run addon is enabled for this cluster. - bool disabled = 1; -} - -// Configuration options for the master authorized networks feature. Enabled -// master authorized networks will disallow all external traffic to access -// Kubernetes master through HTTPS except traffic from the given CIDR blocks, -// Google Compute Engine Public IPs and Google Prod IPs. -message MasterAuthorizedNetworksConfig { - // CidrBlock contains an optional name and one CIDR block. - message CidrBlock { - // display_name is an optional field for users to identify CIDR blocks. - string display_name = 1; - - // cidr_block must be specified in CIDR notation. - string cidr_block = 2; - } - - // Whether or not master authorized networks is enabled. - bool enabled = 1; - - // cidr_blocks define up to 50 external networks that could access - // Kubernetes master through HTTPS. - repeated CidrBlock cidr_blocks = 2; -} - -// Configuration for the legacy Attribute Based Access Control authorization -// mode. -message LegacyAbac { - // Whether the ABAC authorizer is enabled for this cluster. When enabled, - // identities in the system, including service accounts, nodes, and - // controllers, will have statically granted permissions beyond those - // provided by the RBAC configuration or IAM. - bool enabled = 1; -} - -// Configuration options for the NetworkPolicy feature. -// https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ -message NetworkPolicy { - // Allowed Network Policy providers. - enum Provider { - // Not set - PROVIDER_UNSPECIFIED = 0; - - // Tigera (Calico Felix). - CALICO = 1; - } - - // The selected network policy provider. - Provider provider = 1; - - // Whether network policy is enabled on the cluster. - bool enabled = 2; -} - -// Configuration for Binary Authorization. -message BinaryAuthorization { - // Enable Binary Authorization for this cluster. If enabled, all container - // images will be validated by Binary Authorization. - bool enabled = 1; -} - -// Configuration for controlling how IPs are allocated in the cluster. -message IPAllocationPolicy { - // Whether alias IPs will be used for pod IPs in the cluster. - bool use_ip_aliases = 1; - - // Whether a new subnetwork will be created automatically for the cluster. - // - // This field is only applicable when `use_ip_aliases` is true. - bool create_subnetwork = 2; - - // A custom subnetwork name to be used if `create_subnetwork` is true. If - // this field is empty, then an automatic name will be chosen for the new - // subnetwork. - string subnetwork_name = 3; - - // This field is deprecated, use cluster_ipv4_cidr_block. - string cluster_ipv4_cidr = 4 [deprecated = true]; - - // This field is deprecated, use node_ipv4_cidr_block. - string node_ipv4_cidr = 5 [deprecated = true]; - - // This field is deprecated, use services_ipv4_cidr_block. - string services_ipv4_cidr = 6 [deprecated = true]; - - // The name of the secondary range to be used for the cluster CIDR - // block. The secondary range will be used for pod IP - // addresses. This must be an existing secondary range associated - // with the cluster subnetwork. - // - // This field is only applicable with use_ip_aliases is true and - // create_subnetwork is false. - string cluster_secondary_range_name = 7; - - // The name of the secondary range to be used as for the services - // CIDR block. The secondary range will be used for service - // ClusterIPs. This must be an existing secondary range associated - // with the cluster subnetwork. - // - // This field is only applicable with use_ip_aliases is true and - // create_subnetwork is false. - string services_secondary_range_name = 8; - - // The IP address range for the cluster pod IPs. If this field is set, then - // `cluster.cluster_ipv4_cidr` must be left blank. - // - // This field is only applicable when `use_ip_aliases` is true. - // - // Set to blank to have a range chosen with the default size. - // - // Set to /netmask (e.g. `/14`) to have a range chosen with a specific - // netmask. - // - // Set to a - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. - // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range - // to use. - string cluster_ipv4_cidr_block = 9; - - // The IP address range of the instance IPs in this cluster. - // - // This is applicable only if `create_subnetwork` is true. - // - // Set to blank to have a range chosen with the default size. - // - // Set to /netmask (e.g. `/14`) to have a range chosen with a specific - // netmask. - // - // Set to a - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. - // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range - // to use. - string node_ipv4_cidr_block = 10; - - // The IP address range of the services IPs in this cluster. If blank, a range - // will be automatically chosen with the default size. - // - // This field is only applicable when `use_ip_aliases` is true. - // - // Set to blank to have a range chosen with the default size. - // - // Set to /netmask (e.g. `/14`) to have a range chosen with a specific - // netmask. - // - // Set to a - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. - // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range - // to use. - string services_ipv4_cidr_block = 11; - - // The IP address range of the Cloud TPUs in this cluster. If unspecified, a - // range will be automatically chosen with the default size. - // - // This field is only applicable when `use_ip_aliases` is true. - // - // If unspecified, the range will use the default size. - // - // Set to /netmask (e.g. `/14`) to have a range chosen with a specific - // netmask. - // - // Set to a - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. - // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range - // to use. - string tpu_ipv4_cidr_block = 13; -} - -// A Google Kubernetes Engine cluster. -message Cluster { - // The current status of the cluster. - enum Status { - // Not set. - STATUS_UNSPECIFIED = 0; - - // The PROVISIONING state indicates the cluster is being created. - PROVISIONING = 1; - - // The RUNNING state indicates the cluster has been created and is fully - // usable. - RUNNING = 2; - - // The RECONCILING state indicates that some work is actively being done on - // the cluster, such as upgrading the master or node software. Details can - // be found in the `statusMessage` field. - RECONCILING = 3; - - // The STOPPING state indicates the cluster is being deleted. - STOPPING = 4; - - // The ERROR state indicates the cluster may be unusable. Details - // can be found in the `statusMessage` field. - ERROR = 5; - - // The DEGRADED state indicates the cluster requires user action to restore - // full functionality. Details can be found in the `statusMessage` field. - DEGRADED = 6; - } - - // The name of this cluster. The name must be unique within this project - // and location (e.g. zone or region), and can be up to 40 characters with - // the following restrictions: - // - // * Lowercase letters, numbers, and hyphens only. - // * Must start with a letter. - // * Must end with a number or a letter. - string name = 1; - - // An optional description of this cluster. - string description = 2; - - // The number of nodes to create in this cluster. You must ensure that your - // Compute Engine resource quota - // is sufficient for this number of instances. You must also have available - // firewall and routes quota. - // For requests, this field should only be used in lieu of a - // "node_pool" object, since this configuration (along with the - // "node_config") will be used to create a "NodePool" object with an - // auto-generated name. Do not use this and a node_pool at the same time. - // - // This field is deprecated, use node_pool.initial_node_count instead. - int32 initial_node_count = 3 [deprecated = true]; - - // Parameters used in creating the cluster's nodes. - // For requests, this field should only be used in lieu of a - // "node_pool" object, since this configuration (along with the - // "initial_node_count") will be used to create a "NodePool" object with an - // auto-generated name. Do not use this and a node_pool at the same time. - // For responses, this field will be populated with the node configuration of - // the first node pool. (For configuration of each node pool, see - // `node_pool.config`) - // - // If unspecified, the defaults are used. - // This field is deprecated, use node_pool.config instead. - NodeConfig node_config = 4 [deprecated = true]; - - // The authentication information for accessing the master endpoint. - // If unspecified, the defaults are used: - // For clusters before v1.12, if master_auth is unspecified, `username` will - // be set to "admin", a random password will be generated, and a client - // certificate will be issued. - MasterAuth master_auth = 5; - - // The logging service the cluster should use to write logs. - // Currently available options: - // - // * "logging.googleapis.com/kubernetes" - the Google Cloud Logging - // service with Kubernetes-native resource model - // * `logging.googleapis.com` - the Google Cloud Logging service. - // * `none` - no logs will be exported from the cluster. - // * if left as an empty string,`logging.googleapis.com` will be used. - string logging_service = 6; - - // The monitoring service the cluster should use to write metrics. - // Currently available options: - // - // * `monitoring.googleapis.com` - the Google Cloud Monitoring service. - // * `none` - no metrics will be exported from the cluster. - // * if left as an empty string, `monitoring.googleapis.com` will be used. - string monitoring_service = 7; - - // The name of the Google Compute Engine - // [network](/compute/docs/networks-and-firewalls#networks) to which the - // cluster is connected. If left unspecified, the `default` network - // will be used. - string network = 8; - - // The IP address range of the container pods in this cluster, in - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `10.96.0.0/14`). Leave blank to have - // one automatically chosen or specify a `/14` block in `10.0.0.0/8`. - string cluster_ipv4_cidr = 9; - - // Configurations for the various addons available to run in the cluster. - AddonsConfig addons_config = 10; - - // The name of the Google Compute Engine - // [subnetwork](/compute/docs/subnetworks) to which the - // cluster is connected. - string subnetwork = 11; - - // The node pools associated with this cluster. - // This field should not be set if "node_config" or "initial_node_count" are - // specified. - repeated NodePool node_pools = 12; - - // The list of Google Compute Engine - // [zones](/compute/docs/zones#available) in which the cluster's nodes - // should be located. - repeated string locations = 13; - - // Kubernetes alpha features are enabled on this cluster. This includes alpha - // API groups (e.g. v1alpha1) and features that may not be production ready in - // the kubernetes version of the master and nodes. - // The cluster has no SLA for uptime and master/node upgrades are disabled. - // Alpha enabled clusters are automatically deleted thirty days after - // creation. - bool enable_kubernetes_alpha = 14; - - // The resource labels for the cluster to use to annotate any related - // Google Compute Engine resources. - map resource_labels = 15; - - // The fingerprint of the set of labels for this cluster. - string label_fingerprint = 16; - - // Configuration for the legacy ABAC authorization mode. - LegacyAbac legacy_abac = 18; - - // Configuration options for the NetworkPolicy feature. - NetworkPolicy network_policy = 19; - - // Configuration for cluster IP allocation. - IPAllocationPolicy ip_allocation_policy = 20; - - // The configuration options for master authorized networks feature. - MasterAuthorizedNetworksConfig master_authorized_networks_config = 22; - - // Configure the maintenance policy for this cluster. - MaintenancePolicy maintenance_policy = 23; - - // Configuration for Binary Authorization. - BinaryAuthorization binary_authorization = 24; - - // Cluster-level autoscaling configuration. - ClusterAutoscaling autoscaling = 26; - - // Configuration for cluster networking. - NetworkConfig network_config = 27; - - // The default constraint on the maximum number of pods that can be run - // simultaneously on a node in the node pool of this cluster. Only honored - // if cluster created with IP Alias support. - MaxPodsConstraint default_max_pods_constraint = 30; - - // Configuration for exporting resource usages. Resource usage export is - // disabled when this config is unspecified. - ResourceUsageExportConfig resource_usage_export_config = 33; - - // Configuration controlling RBAC group membership information. - AuthenticatorGroupsConfig authenticator_groups_config = 34; - - // Configuration for private cluster. - PrivateClusterConfig private_cluster_config = 37; - - // Configuration of etcd encryption. - DatabaseEncryption database_encryption = 38; - - // Cluster-level Vertical Pod Autoscaling configuration. - VerticalPodAutoscaling vertical_pod_autoscaling = 39; - - // [Output only] Server-defined URL for the resource. - string self_link = 100; - - // [Output only] The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field is deprecated, use location instead. - string zone = 101 [deprecated = true]; - - // [Output only] The IP address of this cluster's master endpoint. - // The endpoint can be accessed from the internet at - // `https://username:password@endpoint/`. - // - // See the `masterAuth` property of this resource for username and - // password information. - string endpoint = 102; - - // The initial Kubernetes version for this cluster. Valid versions are those - // found in validMasterVersions returned by getServerConfig. The version can - // be upgraded over time; such upgrades are reflected in - // currentMasterVersion and currentNodeVersion. - // - // Users may specify either explicit versions offered by - // Kubernetes Engine or version aliases, which have the following behavior: - // - // - "latest": picks the highest valid Kubernetes version - // - "1.X": picks the highest valid patch+gke.N patch in the 1.X version - // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version - // - "1.X.Y-gke.N": picks an explicit Kubernetes version - // - "","-": picks the default Kubernetes version - string initial_cluster_version = 103; - - // [Output only] The current software version of the master endpoint. - string current_master_version = 104; - - // [Output only] Deprecated, use - // [NodePools.version](/kubernetes-engine/docs/reference/rest/v1/projects.zones.clusters.nodePools) - // instead. The current version of the node software components. If they are - // currently at multiple versions because they're in the process of being - // upgraded, this reflects the minimum version of all nodes. - string current_node_version = 105 [deprecated = true]; - - // [Output only] The time the cluster was created, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string create_time = 106; - - // [Output only] The current status of this cluster. - Status status = 107; - - // [Output only] Additional information about the current status of this - // cluster, if available. - string status_message = 108; - - // [Output only] The size of the address space on each node for hosting - // containers. This is provisioned from within the `container_ipv4_cidr` - // range. This field will only be set when cluster is in route-based network - // mode. - int32 node_ipv4_cidr_size = 109; - - // [Output only] The IP address range of the Kubernetes services in - // this cluster, in - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `1.2.3.4/29`). Service addresses are - // typically put in the last `/16` from the container CIDR. - string services_ipv4_cidr = 110; - - // Deprecated. Use node_pools.instance_group_urls. - repeated string instance_group_urls = 111 [deprecated = true]; - - // [Output only] The number of nodes currently in the cluster. Deprecated. - // Call Kubernetes API directly to retrieve node information. - int32 current_node_count = 112 [deprecated = true]; - - // [Output only] The time the cluster will be automatically - // deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string expire_time = 113; - - // [Output only] The name of the Google Compute Engine - // [zone](/compute/docs/regions-zones/regions-zones#available) or - // [region](/compute/docs/regions-zones/regions-zones#available) in which - // the cluster resides. - string location = 114; - - // Enable the ability to use Cloud TPUs in this cluster. - bool enable_tpu = 115; - - // [Output only] The IP address range of the Cloud TPUs in this cluster, in - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `1.2.3.4/29`). - string tpu_ipv4_cidr_block = 116; - - // Which conditions caused the current cluster state. - repeated StatusCondition conditions = 118; -} - -// ClusterUpdate describes an update to the cluster. Exactly one update can -// be applied to a cluster with each request, so at most one field can be -// provided. -message ClusterUpdate { - // The Kubernetes version to change the nodes to (typically an - // upgrade). - // - // Users may specify either explicit versions offered by - // Kubernetes Engine or version aliases, which have the following behavior: - // - // - "latest": picks the highest valid Kubernetes version - // - "1.X": picks the highest valid patch+gke.N patch in the 1.X version - // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version - // - "1.X.Y-gke.N": picks an explicit Kubernetes version - // - "-": picks the Kubernetes master version - string desired_node_version = 4; - - // The monitoring service the cluster should use to write metrics. - // Currently available options: - // - // * "monitoring.googleapis.com/kubernetes" - the Google Cloud Monitoring - // service with Kubernetes-native resource model - // * "monitoring.googleapis.com" - the Google Cloud Monitoring service - // * "none" - no metrics will be exported from the cluster - string desired_monitoring_service = 5; - - // Configurations for the various addons available to run in the cluster. - AddonsConfig desired_addons_config = 6; - - // The node pool to be upgraded. This field is mandatory if - // "desired_node_version", "desired_image_family" or - // "desired_node_pool_autoscaling" is specified and there is more than one - // node pool on the cluster. - string desired_node_pool_id = 7; - - // The desired image type for the node pool. - // NOTE: Set the "desired_node_pool" field as well. - string desired_image_type = 8; - - // Configuration of etcd encryption. - DatabaseEncryption desired_database_encryption = 46; - - // Autoscaler configuration for the node pool specified in - // desired_node_pool_id. If there is only one pool in the - // cluster and desired_node_pool_id is not provided then - // the change applies to that single node pool. - NodePoolAutoscaling desired_node_pool_autoscaling = 9; - - // The desired list of Google Compute Engine - // [zones](/compute/docs/zones#available) in which the cluster's nodes - // should be located. Changing the locations a cluster is in will result - // in nodes being either created or removed from the cluster, depending on - // whether locations are being added or removed. - // - // This list must always include the cluster's primary zone. - repeated string desired_locations = 10; - - // The desired configuration options for master authorized networks feature. - MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12; - - // Cluster-level autoscaling configuration. - ClusterAutoscaling desired_cluster_autoscaling = 15; - - // The desired configuration options for the Binary Authorization feature. - BinaryAuthorization desired_binary_authorization = 16; - - // The logging service the cluster should use to write logs. - // Currently available options: - // - // * "logging.googleapis.com/kubernetes" - the Google Cloud Logging - // service with Kubernetes-native resource model - // * "logging.googleapis.com" - the Google Cloud Logging service - // * "none" - no logs will be exported from the cluster - string desired_logging_service = 19; - - // The desired configuration for exporting resource usage. - ResourceUsageExportConfig desired_resource_usage_export_config = 21; - - // Cluster-level Vertical Pod Autoscaling configuration. - VerticalPodAutoscaling desired_vertical_pod_autoscaling = 22; - - // The desired config of Intra-node visibility. - IntraNodeVisibilityConfig desired_intra_node_visibility_config = 26; - - // The Kubernetes version to change the master to. - // - // Users may specify either explicit versions offered by - // Kubernetes Engine or version aliases, which have the following behavior: - // - // - "latest": picks the highest valid Kubernetes version - // - "1.X": picks the highest valid patch+gke.N patch in the 1.X version - // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version - // - "1.X.Y-gke.N": picks an explicit Kubernetes version - // - "-": picks the default Kubernetes version - string desired_master_version = 100; -} - -// This operation resource represents operations that may have happened or are -// happening on the cluster. All fields are output only. -message Operation { - // Current status of the operation. - enum Status { - // Not set. - STATUS_UNSPECIFIED = 0; - - // The operation has been created. - PENDING = 1; - - // The operation is currently running. - RUNNING = 2; - - // The operation is done, either cancelled or completed. - DONE = 3; - - // The operation is aborting. - ABORTING = 4; - } - - // Operation type. - enum Type { - // Not set. - TYPE_UNSPECIFIED = 0; - - // Cluster create. - CREATE_CLUSTER = 1; - - // Cluster delete. - DELETE_CLUSTER = 2; - - // A master upgrade. - UPGRADE_MASTER = 3; - - // A node upgrade. - UPGRADE_NODES = 4; - - // Cluster repair. - REPAIR_CLUSTER = 5; - - // Cluster update. - UPDATE_CLUSTER = 6; - - // Node pool create. - CREATE_NODE_POOL = 7; - - // Node pool delete. - DELETE_NODE_POOL = 8; - - // Set node pool management. - SET_NODE_POOL_MANAGEMENT = 9; - - // Automatic node pool repair. - AUTO_REPAIR_NODES = 10; - - // Automatic node upgrade. - AUTO_UPGRADE_NODES = 11; - - // Set labels. - SET_LABELS = 12; - - // Set/generate master auth materials - SET_MASTER_AUTH = 13; - - // Set node pool size. - SET_NODE_POOL_SIZE = 14; - - // Updates network policy for a cluster. - SET_NETWORK_POLICY = 15; - - // Set the maintenance policy. - SET_MAINTENANCE_POLICY = 16; - } - - // The server-assigned ID for the operation. - string name = 1; - - // The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the operation - // is taking place. - // This field is deprecated, use location instead. - string zone = 2 [deprecated = true]; - - // The operation type. - Type operation_type = 3; - - // The current status of the operation. - Status status = 4; - - // Detailed operation progress, if available. - string detail = 8; - - // If an error has occurred, a textual description of the error. - string status_message = 5; - - // Server-defined URL for the resource. - string self_link = 6; - - // Server-defined URL for the target of the operation. - string target_link = 7; - - // [Output only] The name of the Google Compute Engine - // [zone](/compute/docs/regions-zones/regions-zones#available) or - // [region](/compute/docs/regions-zones/regions-zones#available) in which - // the cluster resides. - string location = 9; - - // [Output only] The time the operation started, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string start_time = 10; - - // [Output only] The time the operation completed, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string end_time = 11; - - // Which conditions caused the current cluster state. - repeated StatusCondition cluster_conditions = 13; - - // Which conditions caused the current node pool state. - repeated StatusCondition nodepool_conditions = 14; -} - -// CreateClusterRequest creates a cluster. -message CreateClusterRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the parent field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. A [cluster - // resource](/container-engine/reference/rest/v1/projects.zones.clusters) - Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; - - // The parent (project and location) where the cluster will be created. - // Specified in the format 'projects/*/locations/*'. - string parent = 5; -} - -// GetClusterRequest gets the settings of a cluster. -message GetClusterRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster to retrieve. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // The name (project, location, cluster) of the cluster to retrieve. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 5; -} - -// UpdateClusterRequest updates the settings of a cluster. -message UpdateClusterRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. A description of the update. - ClusterUpdate update = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to update. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 5; -} - -// UpdateNodePoolRequests update a node pool's image and/or version. -message UpdateNodePoolRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the node pool to upgrade. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. The Kubernetes version to change the nodes to (typically an - // upgrade). - // - // Users may specify either explicit versions offered by Kubernetes Engine or - // version aliases, which have the following behavior: - // - // - "latest": picks the highest valid Kubernetes version - // - "1.X": picks the highest valid patch+gke.N patch in the 1.X version - // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version - // - "1.X.Y-gke.N": picks an explicit Kubernetes version - // - "-": picks the Kubernetes master version - string node_version = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. The desired image type for the node pool. - string image_type = 6 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool) of the node pool to - // update. Specified in the format - // 'projects/*/locations/*/clusters/*/nodePools/*'. - string name = 8; -} - -// SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. -message SetNodePoolAutoscalingRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the node pool to upgrade. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Autoscaling configuration for the node pool. - NodePoolAutoscaling autoscaling = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool) of the node pool to set - // autoscaler settings. Specified in the format - // 'projects/*/locations/*/clusters/*/nodePools/*'. - string name = 6; -} - -// SetLoggingServiceRequest sets the logging service of a cluster. -message SetLoggingServiceRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. The logging service the cluster should use to write metrics. - // Currently available options: - // - // * "logging.googleapis.com" - the Google Cloud Logging service - // * "none" - no metrics will be exported from the cluster - string logging_service = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set logging. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 5; -} - -// SetMonitoringServiceRequest sets the monitoring service of a cluster. -message SetMonitoringServiceRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. The monitoring service the cluster should use to write metrics. - // Currently available options: - // - // * "monitoring.googleapis.com/kubernetes" - the Google Cloud Monitoring - // service with Kubernetes-native resource model - // * "monitoring.googleapis.com" - the Google Cloud Monitoring service - // * "none" - no metrics will be exported from the cluster - string monitoring_service = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set monitoring. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 6; -} - -// SetAddonsConfigRequest sets the addons associated with the cluster. -message SetAddonsConfigRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. The desired configurations for the various addons available to run in the - // cluster. - AddonsConfig addons_config = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set addons. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 6; -} - -// SetLocationsRequest sets the locations of the cluster. -message SetLocationsRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. The desired list of Google Compute Engine - // [zones](/compute/docs/zones#available) in which the cluster's nodes - // should be located. Changing the locations a cluster is in will result - // in nodes being either created or removed from the cluster, depending on - // whether locations are being added or removed. - // - // This list must always include the cluster's primary zone. - repeated string locations = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set locations. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 6; -} - -// UpdateMasterRequest updates the master of the cluster. -message UpdateMasterRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. The Kubernetes version to change the master to. - // - // Users may specify either explicit versions offered by Kubernetes Engine or - // version aliases, which have the following behavior: - // - // - "latest": picks the highest valid Kubernetes version - // - "1.X": picks the highest valid patch+gke.N patch in the 1.X version - // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version - // - "1.X.Y-gke.N": picks an explicit Kubernetes version - // - "-": picks the default Kubernetes version - string master_version = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to update. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 7; -} - -// SetMasterAuthRequest updates the admin password of a cluster. -message SetMasterAuthRequest { - // Operation type: what type update to perform. - enum Action { - // Operation is unknown and will error out. - UNKNOWN = 0; - - // Set the password to a user generated value. - SET_PASSWORD = 1; - - // Generate a new password and set it to that. - GENERATE_PASSWORD = 2; - - // Set the username. If an empty username is provided, basic authentication - // is disabled for the cluster. If a non-empty username is provided, basic - // authentication is enabled, with either a provided password or a generated - // one. - SET_USERNAME = 3; - } - - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. The exact form of action to be taken on the master auth. - Action action = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. A description of the update. - MasterAuth update = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster) of the cluster to set auth. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 7; -} - -// DeleteClusterRequest deletes a cluster. -message DeleteClusterRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster to delete. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // The name (project, location, cluster) of the cluster to delete. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 4; -} - -// ListClustersRequest lists clusters. -message ListClustersRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides, or "-" for all zones. - // This field has been deprecated and replaced by the parent field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // The parent (project and location) where the clusters will be listed. - // Specified in the format 'projects/*/locations/*'. - // Location "-" matches all zones and all regions. - string parent = 4; -} - -// ListClustersResponse is the result of ListClustersRequest. -message ListClustersResponse { - // A list of clusters in the project in the specified zone, or - // across all ones. - repeated Cluster clusters = 1; - - // If any zones are listed here, the list of clusters returned - // may be missing those zones. - repeated string missing_zones = 2; -} - -// GetOperationRequest gets a single operation. -message GetOperationRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The server-assigned `name` of the operation. - // This field has been deprecated and replaced by the name field. - string operation_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // The name (project, location, operation id) of the operation to get. - // Specified in the format 'projects/*/locations/*/operations/*'. - string name = 5; -} - -// ListOperationsRequest lists operations. -message ListOperationsRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) to return operations for, or `-` for - // all zones. This field has been deprecated and replaced by the parent field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // The parent (project and location) where the operations will be listed. - // Specified in the format 'projects/*/locations/*'. - // Location "-" matches all zones and all regions. - string parent = 4; -} - -// CancelOperationRequest cancels a single operation. -message CancelOperationRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the operation resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The server-assigned `name` of the operation. - // This field has been deprecated and replaced by the name field. - string operation_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // The name (project, location, operation id) of the operation to cancel. - // Specified in the format 'projects/*/locations/*/operations/*'. - string name = 4; -} - -// ListOperationsResponse is the result of ListOperationsRequest. -message ListOperationsResponse { - // A list of operations in the project in the specified zone. - repeated Operation operations = 1; - - // If any zones are listed here, the list of operations returned - // may be missing the operations from those zones. - repeated string missing_zones = 2; -} - -// Gets the current Kubernetes Engine service configuration. -message GetServerConfigRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) to return operations for. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // The name (project and location) of the server config to get, - // specified in the format 'projects/*/locations/*'. - string name = 4; -} - -// Kubernetes Engine service configuration. -message ServerConfig { - // Version of Kubernetes the service deploys by default. - string default_cluster_version = 1; - - // List of valid node upgrade target versions. - repeated string valid_node_versions = 3; - - // Default image type. - string default_image_type = 4; - - // List of valid image types. - repeated string valid_image_types = 5; - - // List of valid master versions. - repeated string valid_master_versions = 6; -} - -// CreateNodePoolRequest creates a node pool for a cluster. -message CreateNodePoolRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://developers.google.com/console/help/new/#projectnumber). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the parent field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the parent field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. The node pool to create. - NodePool node_pool = 4 [(google.api.field_behavior) = REQUIRED]; - - // The parent (project, location, cluster id) where the node pool will be - // created. Specified in the format - // 'projects/*/locations/*/clusters/*'. - string parent = 6; -} - -// DeleteNodePoolRequest deletes a node pool for a cluster. -message DeleteNodePoolRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://developers.google.com/console/help/new/#projectnumber). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the node pool to delete. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // The name (project, location, cluster, node pool id) of the node pool to - // delete. Specified in the format - // 'projects/*/locations/*/clusters/*/nodePools/*'. - string name = 6; -} - -// ListNodePoolsRequest lists the node pool(s) for a cluster. -message ListNodePoolsRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://developers.google.com/console/help/new/#projectnumber). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the parent field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the parent field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // The parent (project, location, cluster id) where the node pools will be - // listed. Specified in the format 'projects/*/locations/*/clusters/*'. - string parent = 5; -} - -// GetNodePoolRequest retrieves a node pool for a cluster. -message GetNodePoolRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://developers.google.com/console/help/new/#projectnumber). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the node pool. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // The name (project, location, cluster, node pool id) of the node pool to - // get. Specified in the format - // 'projects/*/locations/*/clusters/*/nodePools/*'. - string name = 6; -} - -// NodePool contains the name and configuration for a cluster's node pool. -// Node pools are a set of nodes (i.e. VM's), with a common configuration and -// specification, under the control of the cluster master. They may have a set -// of Kubernetes labels applied to them, which may be used to reference them -// during pod scheduling. They may also be resized up or down, to accommodate -// the workload. -message NodePool { - // The current status of the node pool instance. - enum Status { - // Not set. - STATUS_UNSPECIFIED = 0; - - // The PROVISIONING state indicates the node pool is being created. - PROVISIONING = 1; - - // The RUNNING state indicates the node pool has been created - // and is fully usable. - RUNNING = 2; - - // The RUNNING_WITH_ERROR state indicates the node pool has been created - // and is partially usable. Some error state has occurred and some - // functionality may be impaired. Customer may need to reissue a request - // or trigger a new update. - RUNNING_WITH_ERROR = 3; - - // The RECONCILING state indicates that some work is actively being done on - // the node pool, such as upgrading node software. Details can - // be found in the `statusMessage` field. - RECONCILING = 4; - - // The STOPPING state indicates the node pool is being deleted. - STOPPING = 5; - - // The ERROR state indicates the node pool may be unusable. Details - // can be found in the `statusMessage` field. - ERROR = 6; - } - - // The name of the node pool. - string name = 1; - - // The node configuration of the pool. - NodeConfig config = 2; - - // The initial node count for the pool. You must ensure that your - // Compute Engine resource quota - // is sufficient for this number of instances. You must also have available - // firewall and routes quota. - int32 initial_node_count = 3; - - // [Output only] Server-defined URL for the resource. - string self_link = 100; - - // The version of the Kubernetes of this node. - string version = 101; - - // [Output only] The resource URLs of the [managed instance - // groups](/compute/docs/instance-groups/creating-groups-of-managed-instances) - // associated with this node pool. - repeated string instance_group_urls = 102; - - // [Output only] The status of the nodes in this pool instance. - Status status = 103; - - // [Output only] Additional information about the current status of this - // node pool instance, if available. - string status_message = 104; - - // Autoscaler configuration for this NodePool. Autoscaler is enabled - // only if a valid configuration is present. - NodePoolAutoscaling autoscaling = 4; - - // NodeManagement configuration for this NodePool. - NodeManagement management = 5; - - // The constraint on the maximum number of pods that can be run - // simultaneously on a node in the node pool. - MaxPodsConstraint max_pods_constraint = 6; - - // Which conditions caused the current node pool state. - repeated StatusCondition conditions = 105; - - // [Output only] The pod CIDR block size per node in this node pool. - int32 pod_ipv4_cidr_size = 7; -} - -// NodeManagement defines the set of node management services turned on for the -// node pool. -message NodeManagement { - // A flag that specifies whether node auto-upgrade is enabled for the node - // pool. If enabled, node auto-upgrade helps keep the nodes in your node pool - // up to date with the latest release version of Kubernetes. - bool auto_upgrade = 1; - - // A flag that specifies whether the node auto-repair is enabled for the node - // pool. If enabled, the nodes in this node pool will be monitored and, if - // they fail health checks too many times, an automatic repair action will be - // triggered. - bool auto_repair = 2; - - // Specifies the Auto Upgrade knobs for the node pool. - AutoUpgradeOptions upgrade_options = 10; -} - -// AutoUpgradeOptions defines the set of options for the user to control how -// the Auto Upgrades will proceed. -message AutoUpgradeOptions { - // [Output only] This field is set when upgrades are about to commence - // with the approximate start time for the upgrades, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string auto_upgrade_start_time = 1; - - // [Output only] This field is set when upgrades are about to commence - // with the description of the upgrade. - string description = 2; -} - -// MaintenancePolicy defines the maintenance policy to be used for the cluster. -message MaintenancePolicy { - // Specifies the maintenance window in which maintenance may be performed. - MaintenanceWindow window = 1; - - // A hash identifying the version of this policy, so that updates to fields of - // the policy won't accidentally undo intermediate changes (and so that users - // of the API unaware of some fields won't accidentally remove other fields). - // Make a get() request to the cluster to get the current - // resource version and include it with requests to set the policy. - string resource_version = 3; -} - -// MaintenanceWindow defines the maintenance window to be used for the cluster. -message MaintenanceWindow { - oneof policy { - // DailyMaintenanceWindow specifies a daily maintenance operation window. - DailyMaintenanceWindow daily_maintenance_window = 2; - - // RecurringWindow specifies some number of recurring time periods for - // maintenance to occur. The time windows may be overlapping. If no - // maintenance windows are set, maintenance can occur at any time. - RecurringTimeWindow recurring_window = 3; - } - - // Exceptions to maintenance window. Non-emergency maintenance should not - // occur in these windows. - map maintenance_exclusions = 4; -} - -// Represents an arbitrary window of time. -message TimeWindow { - // The time that the window first starts. - google.protobuf.Timestamp start_time = 1; - - // The time that the window ends. The end time should take place after the - // start time. - google.protobuf.Timestamp end_time = 2; -} - -// Represents an arbitrary window of time that recurs. -message RecurringTimeWindow { - // The window of the first recurrence. - TimeWindow window = 1; - - // An RRULE (https://tools.ietf.org/html/rfc5545#section-3.8.5.3) for how - // this window reccurs. They go on for the span of time between the start and - // end time. - // - // For example, to have something repeat every weekday, you'd use: - // FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR - // To repeat some window daily (equivalent to the DailyMaintenanceWindow): - // FREQ=DAILY - // For the first weekend of every month: - // FREQ=MONTHLY;BYSETPOS=1;BYDAY=SA,SU - // This specifies how frequently the window starts. Eg, if you wanted to have - // a 9-5 UTC-4 window every weekday, you'd use something like: - // - // start time = 2019-01-01T09:00:00-0400 - // end time = 2019-01-01T17:00:00-0400 - // recurrence = FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR - // - // Windows can span multiple days. Eg, to make the window encompass every - // weekend from midnight Saturday till the last minute of Sunday UTC: - // - // start time = 2019-01-05T00:00:00Z - // end time = 2019-01-07T23:59:00Z - // recurrence = FREQ=WEEKLY;BYDAY=SA - // - // Note the start and end time's specific dates are largely arbitrary except - // to specify duration of the window and when it first starts. - // The FREQ values of HOURLY, MINUTELY, and SECONDLY are not supported. - string recurrence = 2; -} - -// Time window specified for daily maintenance operations. -message DailyMaintenanceWindow { - // Time within the maintenance window to start the maintenance operations. - // Time format should be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) - // format "HH:MM", where HH : [00-23] and MM : [00-59] GMT. - string start_time = 2; - - // [Output only] Duration of the time window, automatically chosen to be - // smallest possible in the given scenario. - // Duration will be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) - // format "PTnHnMnS". - string duration = 3; -} - -// SetNodePoolManagementRequest sets the node management properties of a node -// pool. -message SetNodePoolManagementRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster to update. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the node pool to update. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. NodeManagement configuration for the node pool. - NodeManagement management = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool id) of the node pool to set - // management properties. Specified in the format - // 'projects/*/locations/*/clusters/*/nodePools/*'. - string name = 7; -} - -// SetNodePoolSizeRequest sets the size a node -// pool. -message SetNodePoolSizeRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster to update. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the node pool to update. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. The desired node count for the pool. - int32 node_count = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster, node pool id) of the node pool to set - // size. - // Specified in the format 'projects/*/locations/*/clusters/*/nodePools/*'. - string name = 7; -} - -// RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed -// NodePool upgrade. This will be an no-op if the last upgrade successfully -// completed. -message RollbackNodePoolUpgradeRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster to rollback. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the node pool to rollback. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // The name (project, location, cluster, node pool id) of the node poll to - // rollback upgrade. - // Specified in the format 'projects/*/locations/*/clusters/*/nodePools/*'. - string name = 6; -} - -// ListNodePoolsResponse is the result of ListNodePoolsRequest. -message ListNodePoolsResponse { - // A list of node pools for a cluster. - repeated NodePool node_pools = 1; -} - -// ClusterAutoscaling contains global, per-cluster information -// required by Cluster Autoscaler to automatically adjust -// the size of the cluster and create/delete -// node pools based on the current needs. -message ClusterAutoscaling { - // Enables automatic node pool creation and deletion. - bool enable_node_autoprovisioning = 1; - - // Contains global constraints regarding minimum and maximum - // amount of resources in the cluster. - repeated ResourceLimit resource_limits = 2; - - // AutoprovisioningNodePoolDefaults contains defaults for a node pool - // created by NAP. - AutoprovisioningNodePoolDefaults autoprovisioning_node_pool_defaults = 4; - - // The list of Google Compute Engine [zones](/compute/docs/zones#available) - // in which the NodePool's nodes can be created by NAP. - repeated string autoprovisioning_locations = 5; -} - -// AutoprovisioningNodePoolDefaults contains defaults for a node pool created -// by NAP. -message AutoprovisioningNodePoolDefaults { - // Scopes that are used by NAP when creating node pools. If oauth_scopes are - // specified, service_account should be empty. - repeated string oauth_scopes = 1; - - // The Google Cloud Platform Service Account to be used by the node VMs. If - // service_account is specified, scopes should be empty. - string service_account = 2; -} - -// Contains information about amount of some resource in the cluster. -// For memory, value should be in GB. -message ResourceLimit { - // Resource name "cpu", "memory" or gpu-specific string. - string resource_type = 1; - - // Minimum amount of the resource in the cluster. - int64 minimum = 2; - - // Maximum amount of the resource in the cluster. - int64 maximum = 3; -} - -// NodePoolAutoscaling contains information required by cluster autoscaler to -// adjust the size of the node pool to the current cluster usage. -message NodePoolAutoscaling { - // Is autoscaling enabled for this node pool. - bool enabled = 1; - - // Minimum number of nodes in the NodePool. Must be >= 1 and <= - // max_node_count. - int32 min_node_count = 2; - - // Maximum number of nodes in the NodePool. Must be >= min_node_count. There - // has to enough quota to scale up the cluster. - int32 max_node_count = 3; - - // Can this node pool be deleted automatically. - bool autoprovisioned = 4; -} - -// SetLabelsRequest sets the Google Cloud Platform labels on a Google Container -// Engine cluster, which will in turn set them for Google Compute Engine -// resources used by that cluster -message SetLabelsRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://developers.google.com/console/help/new/#projectnumber). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. The labels to set for that cluster. - map resource_labels = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. The fingerprint of the previous set of labels for this resource, - // used to detect conflicts. The fingerprint is initially generated by - // Kubernetes Engine and changes after every request to modify or update - // labels. You must always provide an up-to-date fingerprint hash when - // updating or changing labels. Make a get() request to the - // resource to get the latest fingerprint. - string label_fingerprint = 5 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster id) of the cluster to set labels. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 7; -} - -// SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for -// a cluster. -message SetLegacyAbacRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster to update. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Whether ABAC authorization will be enabled in the cluster. - bool enabled = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster id) of the cluster to set legacy abac. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 6; -} - -// StartIPRotationRequest creates a new IP for the cluster and then performs -// a node upgrade on each node pool to point to the new IP. -message StartIPRotationRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://developers.google.com/console/help/new/#projectnumber). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // The name (project, location, cluster id) of the cluster to start IP - // rotation. Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 6; - - // Whether to rotate credentials during IP rotation. - bool rotate_credentials = 7; -} - -// CompleteIPRotationRequest moves the cluster master back into single-IP mode. -message CompleteIPRotationRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://developers.google.com/console/help/new/#projectnumber). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // The name (project, location, cluster id) of the cluster to complete IP - // rotation. Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 7; -} - -// AcceleratorConfig represents a Hardware Accelerator request. -message AcceleratorConfig { - // The number of the accelerator cards exposed to an instance. - int64 accelerator_count = 1; - - // The accelerator type resource name. List of supported accelerators - // [here](/compute/docs/gpus) - string accelerator_type = 2; -} - -// SetNetworkPolicyRequest enables/disables network policy for a cluster. -message SetNetworkPolicyRequest { - // Required. Deprecated. The Google Developers Console [project ID or project - // number](https://developers.google.com/console/help/new/#projectnumber). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [ - deprecated = true, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Configuration options for the NetworkPolicy feature. - NetworkPolicy network_policy = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster id) of the cluster to set networking - // policy. Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 6; -} - -// SetMaintenancePolicyRequest sets the maintenance policy for a cluster. -message SetMaintenancePolicyRequest { - // Required. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - string zone = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the cluster to update. - string cluster_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The maintenance policy to be set for the cluster. An empty field - // clears the existing maintenance policy. - MaintenancePolicy maintenance_policy = 4 [(google.api.field_behavior) = REQUIRED]; - - // The name (project, location, cluster id) of the cluster to set maintenance - // policy. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 5; -} - -// StatusCondition describes why a cluster or a node pool has a certain status -// (e.g., ERROR or DEGRADED). -message StatusCondition { - // Code for each condition - enum Code { - // UNKNOWN indicates a generic condition. - UNKNOWN = 0; - - // GCE_STOCKOUT indicates a Google Compute Engine stockout. - GCE_STOCKOUT = 1; - - // GKE_SERVICE_ACCOUNT_DELETED indicates that the user deleted their robot - // service account. - GKE_SERVICE_ACCOUNT_DELETED = 2; - - // Google Compute Engine quota was exceeded. - GCE_QUOTA_EXCEEDED = 3; - - // Cluster state was manually changed by an SRE due to a system logic error. - SET_BY_OPERATOR = 4; - - // Unable to perform an encrypt operation against the CloudKMS key used for - // etcd level encryption. - // More codes TBA - CLOUD_KMS_KEY_ERROR = 7; - } - - // Machine-friendly representation of the condition - Code code = 1; - - // Human-friendly representation of the condition - string message = 2; -} - -// NetworkConfig reports the relative names of network & subnetwork. -message NetworkConfig { - // Output only. The relative name of the Google Compute Engine - // [network][google.container.v1.NetworkConfig.network](/compute/docs/networks-and-firewalls#networks) to which - // the cluster is connected. - // Example: projects/my-project/global/networks/my-network - string network = 1; - - // Output only. The relative name of the Google Compute Engine - // [subnetwork](/compute/docs/vpc) to which the cluster is connected. - // Example: projects/my-project/regions/us-central1/subnetworks/my-subnet - string subnetwork = 2; - - // Whether Intra-node visibility is enabled for this cluster. - // This makes same node pod to pod traffic visible for VPC network. - bool enable_intra_node_visibility = 5; -} - -// IntraNodeVisibilityConfig contains the desired config of the intra-node -// visibility on this cluster. -message IntraNodeVisibilityConfig { - // Enables intra node visibility for this cluster. - bool enabled = 1; -} - -// Constraints applied to pods. -message MaxPodsConstraint { - // Constraint enforced on the max num of pods per node. - int64 max_pods_per_node = 1; -} - -// Configuration of etcd encryption. -message DatabaseEncryption { - // State of etcd encryption. - enum State { - // Should never be set - UNKNOWN = 0; - - // Secrets in etcd are encrypted. - ENCRYPTED = 1; - - // Secrets in etcd are stored in plain text (at etcd level) - this is - // unrelated to GCE level full disk encryption. - DECRYPTED = 2; - } - - // Denotes the state of etcd encryption. - State state = 2; - - // Name of CloudKMS key to use for the encryption of secrets in etcd. - // Ex. projects/my-project/locations/global/keyRings/my-ring/cryptoKeys/my-key - string key_name = 1; -} - -// ListUsableSubnetworksRequest requests the list of usable subnetworks -// available to a user for creating clusters. -message ListUsableSubnetworksRequest { - // The parent project where subnetworks are usable. - // Specified in the format 'projects/*'. - string parent = 1; - - // Filtering currently only supports equality on the networkProjectId and must - // be in the form: "networkProjectId=[PROJECTID]", where `networkProjectId` - // is the project which owns the listed subnetworks. This defaults to the - // parent project ID. - string filter = 2; - - // The max number of results per page that should be returned. If the number - // of available results is larger than `page_size`, a `next_page_token` is - // returned which can be used to get the next page of results in subsequent - // requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - int32 page_size = 3; - - // Specifies a page token to use. Set this to the nextPageToken returned by - // previous list requests to get the next page of results. - string page_token = 4; -} - -// ListUsableSubnetworksResponse is the response of -// ListUsableSubnetworksRequest. -message ListUsableSubnetworksResponse { - // A list of usable subnetworks in the specified network project. - repeated UsableSubnetwork subnetworks = 1; - - // This token allows you to get the next page of results for list requests. - // If the number of results is larger than `page_size`, use the - // `next_page_token` as a value for the query parameter `page_token` in the - // next request. The value will become empty when there are no more pages. - string next_page_token = 2; -} - -// Secondary IP range of a usable subnetwork. -message UsableSubnetworkSecondaryRange { - // Status shows the current usage of a secondary IP range. - enum Status { - // UNKNOWN is the zero value of the Status enum. It's not a valid status. - UNKNOWN = 0; - - // UNUSED denotes that this range is unclaimed by any cluster. - UNUSED = 1; - - // IN_USE_SERVICE denotes that this range is claimed by a cluster for - // services. It cannot be used for other clusters. - IN_USE_SERVICE = 2; - - // IN_USE_SHAREABLE_POD denotes this range was created by the network admin - // and is currently claimed by a cluster for pods. It can only be used by - // other clusters as a pod range. - IN_USE_SHAREABLE_POD = 3; - - // IN_USE_MANAGED_POD denotes this range was created by GKE and is claimed - // for pods. It cannot be used for other clusters. - IN_USE_MANAGED_POD = 4; - } - - // The name associated with this subnetwork secondary range, used when adding - // an alias IP range to a VM instance. - string range_name = 1; - - // The range of IP addresses belonging to this subnetwork secondary range. - string ip_cidr_range = 2; - - // This field is to determine the status of the secondary range programmably. - Status status = 3; -} - -// UsableSubnetwork resource returns the subnetwork name, its associated network -// and the primary CIDR range. -message UsableSubnetwork { - // Subnetwork Name. - // Example: projects/my-project/regions/us-central1/subnetworks/my-subnet - string subnetwork = 1; - - // Network Name. - // Example: projects/my-project/global/networks/my-network - string network = 2; - - // The range of internal addresses that are owned by this subnetwork. - string ip_cidr_range = 3; - - // Secondary IP ranges. - repeated UsableSubnetworkSecondaryRange secondary_ip_ranges = 4; - - // A human readable status message representing the reasons for cases where - // the caller cannot use the secondary ranges under the subnet. For example if - // the secondary_ip_ranges is empty due to a permission issue, an insufficient - // permission message will be given by status_message. - string status_message = 5; -} - -// Configuration for exporting cluster resource usages. -message ResourceUsageExportConfig { - // Parameters for using BigQuery as the destination of resource usage export. - message BigQueryDestination { - // The ID of a BigQuery Dataset. - string dataset_id = 1; - } - - // Parameters for controlling consumption metering. - message ConsumptionMeteringConfig { - // Whether to enable consumption metering for this cluster. If enabled, a - // second BigQuery table will be created to hold resource consumption - // records. - bool enabled = 1; - } - - // Configuration to use BigQuery as usage export destination. - BigQueryDestination bigquery_destination = 1; - - // Whether to enable network egress metering for this cluster. If enabled, a - // daemonset will be created in the cluster to meter network egress traffic. - bool enable_network_egress_metering = 2; - - // Configuration to enable resource consumption metering. - ConsumptionMeteringConfig consumption_metering_config = 3; -} - -// VerticalPodAutoscaling contains global, per-cluster information -// required by Vertical Pod Autoscaler to automatically adjust -// the resources of pods controlled by it. -message VerticalPodAutoscaling { - // Enables vertical pod autoscaling. - bool enabled = 1; -} diff --git a/container/google/cloud/container_v1/proto/cluster_service_pb2.py b/container/google/cloud/container_v1/proto/cluster_service_pb2.py deleted file mode 100644 index cc473062cc3b..000000000000 --- a/container/google/cloud/container_v1/proto/cluster_service_pb2.py +++ /dev/null @@ -1,12775 +0,0 @@ -# -*- coding: utf-8 -*- -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/container_v1/proto/cluster_service.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/container_v1/proto/cluster_service.proto", - package="google.container.v1", - syntax="proto3", - serialized_options=_b( - "\n\027com.google.container.v1B\023ClusterServiceProtoP\001Z\n\x16\x44\x61ilyMaintenanceWindow\x12\x12\n\nstart_time\x18\x02 \x01(\t\x12\x10\n\x08\x64uration\x18\x03 \x01(\t"\xd2\x01\n\x1cSetNodePoolManagementRequest\x12\x19\n\nproject_id\x18\x01 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x13\n\x04zone\x18\x02 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x19\n\ncluster_id\x18\x03 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x1b\n\x0cnode_pool_id\x18\x04 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12<\n\nmanagement\x18\x05 \x01(\x0b\x32#.google.container.v1.NodeManagementB\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x07 \x01(\t"\xa7\x01\n\x16SetNodePoolSizeRequest\x12\x19\n\nproject_id\x18\x01 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x13\n\x04zone\x18\x02 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x19\n\ncluster_id\x18\x03 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x1b\n\x0cnode_pool_id\x18\x04 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x17\n\nnode_count\x18\x05 \x01(\x05\x42\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x07 \x01(\t"\x96\x01\n\x1eRollbackNodePoolUpgradeRequest\x12\x19\n\nproject_id\x18\x01 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x13\n\x04zone\x18\x02 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x19\n\ncluster_id\x18\x03 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x1b\n\x0cnode_pool_id\x18\x04 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x0c\n\x04name\x18\x06 \x01(\t"J\n\x15ListNodePoolsResponse\x12\x31\n\nnode_pools\x18\x01 \x03(\x0b\x32\x1d.google.container.v1.NodePool"\xff\x01\n\x12\x43lusterAutoscaling\x12$\n\x1c\x65nable_node_autoprovisioning\x18\x01 \x01(\x08\x12;\n\x0fresource_limits\x18\x02 \x03(\x0b\x32".google.container.v1.ResourceLimit\x12\x62\n#autoprovisioning_node_pool_defaults\x18\x04 \x01(\x0b\x32\x35.google.container.v1.AutoprovisioningNodePoolDefaults\x12"\n\x1a\x61utoprovisioning_locations\x18\x05 \x03(\t"Q\n AutoprovisioningNodePoolDefaults\x12\x14\n\x0coauth_scopes\x18\x01 \x03(\t\x12\x17\n\x0fservice_account\x18\x02 \x01(\t"H\n\rResourceLimit\x12\x15\n\rresource_type\x18\x01 \x01(\t\x12\x0f\n\x07minimum\x18\x02 \x01(\x03\x12\x0f\n\x07maximum\x18\x03 \x01(\x03"o\n\x13NodePoolAutoscaling\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x16\n\x0emin_node_count\x18\x02 \x01(\x05\x12\x16\n\x0emax_node_count\x18\x03 \x01(\x05\x12\x17\n\x0f\x61utoprovisioned\x18\x04 \x01(\x08"\x9b\x02\n\x10SetLabelsRequest\x12\x19\n\nproject_id\x18\x01 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x13\n\x04zone\x18\x02 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x19\n\ncluster_id\x18\x03 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12W\n\x0fresource_labels\x18\x04 \x03(\x0b\x32\x39.google.container.v1.SetLabelsRequest.ResourceLabelsEntryB\x03\xe0\x41\x02\x12\x1e\n\x11label_fingerprint\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x07 \x01(\t\x1a\x35\n\x13ResourceLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\x85\x01\n\x14SetLegacyAbacRequest\x12\x19\n\nproject_id\x18\x01 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x13\n\x04zone\x18\x02 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x19\n\ncluster_id\x18\x03 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x14\n\x07\x65nabled\x18\x04 \x01(\x08\x42\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x06 \x01(\t"\x8d\x01\n\x16StartIPRotationRequest\x12\x19\n\nproject_id\x18\x01 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x13\n\x04zone\x18\x02 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x19\n\ncluster_id\x18\x03 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x0c\n\x04name\x18\x06 \x01(\t\x12\x1a\n\x12rotate_credentials\x18\x07 \x01(\x08"t\n\x19\x43ompleteIPRotationRequest\x12\x19\n\nproject_id\x18\x01 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x13\n\x04zone\x18\x02 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x19\n\ncluster_id\x18\x03 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x0c\n\x04name\x18\x07 \x01(\t"H\n\x11\x41\x63\x63\x65leratorConfig\x12\x19\n\x11\x61\x63\x63\x65lerator_count\x18\x01 \x01(\x03\x12\x18\n\x10\x61\x63\x63\x65lerator_type\x18\x02 \x01(\t"\xb3\x01\n\x17SetNetworkPolicyRequest\x12\x19\n\nproject_id\x18\x01 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x13\n\x04zone\x18\x02 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12\x19\n\ncluster_id\x18\x03 \x01(\tB\x05\x18\x01\xe0\x41\x02\x12?\n\x0enetwork_policy\x18\x04 \x01(\x0b\x32".google.container.v1.NetworkPolicyB\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x06 \x01(\t"\xb9\x01\n\x1bSetMaintenancePolicyRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04zone\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\ncluster_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12G\n\x12maintenance_policy\x18\x04 \x01(\x0b\x32&.google.container.v1.MaintenancePolicyB\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x05 \x01(\t"\xea\x01\n\x0fStatusCondition\x12\x37\n\x04\x63ode\x18\x01 \x01(\x0e\x32).google.container.v1.StatusCondition.Code\x12\x0f\n\x07message\x18\x02 \x01(\t"\x8c\x01\n\x04\x43ode\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x10\n\x0cGCE_STOCKOUT\x10\x01\x12\x1f\n\x1bGKE_SERVICE_ACCOUNT_DELETED\x10\x02\x12\x16\n\x12GCE_QUOTA_EXCEEDED\x10\x03\x12\x13\n\x0fSET_BY_OPERATOR\x10\x04\x12\x17\n\x13\x43LOUD_KMS_KEY_ERROR\x10\x07"Z\n\rNetworkConfig\x12\x0f\n\x07network\x18\x01 \x01(\t\x12\x12\n\nsubnetwork\x18\x02 \x01(\t\x12$\n\x1c\x65nable_intra_node_visibility\x18\x05 \x01(\x08",\n\x19IntraNodeVisibilityConfig\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08".\n\x11MaxPodsConstraint\x12\x19\n\x11max_pods_per_node\x18\x01 \x01(\x03"\x98\x01\n\x12\x44\x61tabaseEncryption\x12<\n\x05state\x18\x02 \x01(\x0e\x32-.google.container.v1.DatabaseEncryption.State\x12\x10\n\x08key_name\x18\x01 \x01(\t"2\n\x05State\x12\x0b\n\x07UNKNOWN\x10\x00\x12\r\n\tENCRYPTED\x10\x01\x12\r\n\tDECRYPTED\x10\x02"e\n\x1cListUsableSubnetworksRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t"t\n\x1dListUsableSubnetworksResponse\x12:\n\x0bsubnetworks\x18\x01 \x03(\x0b\x32%.google.container.v1.UsableSubnetwork\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\x80\x02\n\x1eUsableSubnetworkSecondaryRange\x12\x12\n\nrange_name\x18\x01 \x01(\t\x12\x15\n\rip_cidr_range\x18\x02 \x01(\t\x12J\n\x06status\x18\x03 \x01(\x0e\x32:.google.container.v1.UsableSubnetworkSecondaryRange.Status"g\n\x06Status\x12\x0b\n\x07UNKNOWN\x10\x00\x12\n\n\x06UNUSED\x10\x01\x12\x12\n\x0eIN_USE_SERVICE\x10\x02\x12\x18\n\x14IN_USE_SHAREABLE_POD\x10\x03\x12\x16\n\x12IN_USE_MANAGED_POD\x10\x04"\xb8\x01\n\x10UsableSubnetwork\x12\x12\n\nsubnetwork\x18\x01 \x01(\t\x12\x0f\n\x07network\x18\x02 \x01(\t\x12\x15\n\rip_cidr_range\x18\x03 \x01(\t\x12P\n\x13secondary_ip_ranges\x18\x04 \x03(\x0b\x32\x33.google.container.v1.UsableSubnetworkSecondaryRange\x12\x16\n\x0estatus_message\x18\x05 \x01(\t"\xed\x02\n\x19ResourceUsageExportConfig\x12`\n\x14\x62igquery_destination\x18\x01 \x01(\x0b\x32\x42.google.container.v1.ResourceUsageExportConfig.BigQueryDestination\x12&\n\x1e\x65nable_network_egress_metering\x18\x02 \x01(\x08\x12m\n\x1b\x63onsumption_metering_config\x18\x03 \x01(\x0b\x32H.google.container.v1.ResourceUsageExportConfig.ConsumptionMeteringConfig\x1a)\n\x13\x42igQueryDestination\x12\x12\n\ndataset_id\x18\x01 \x01(\t\x1a,\n\x19\x43onsumptionMeteringConfig\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08")\n\x16VerticalPodAutoscaling\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x32\xa1\x42\n\x0e\x43lusterManager\x12\xde\x01\n\x0cListClusters\x12(.google.container.v1.ListClustersRequest\x1a).google.container.v1.ListClustersResponse"y\x82\xd3\xe4\x93\x02\x61\x12,/v1/{parent=projects/*/locations/*}/clustersZ1\x12//v1/projects/{project_id}/zones/{zone}/clusters\xda\x41\x0fproject_id,zone\x12\xe6\x01\n\nGetCluster\x12&.google.container.v1.GetClusterRequest\x1a\x1c.google.container.v1.Cluster"\x91\x01\x82\xd3\xe4\x93\x02n\x12,/v1/{name=projects/*/locations/*/clusters/*}Z>\x12*/v1/{name=projects/*/locations/*/clusters/*}:setResourceLabels:\x01*ZP"K/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/resourceLabels:\x01*\x12\x96\x02\n\rSetLegacyAbac\x12).google.container.v1.SetLegacyAbacRequest\x1a\x1e.google.container.v1.Operation"\xb9\x01\x82\xd3\xe4\x93\x02\x8d\x01":/v1/{name=projects/*/locations/*/clusters/*}:setLegacyAbac:\x01*ZL"G/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/legacyAbac:\x01*\xda\x41"project_id,zone,cluster_id,enabled\x12\x99\x02\n\x0fStartIPRotation\x12+.google.container.v1.StartIPRotationRequest\x1a\x1e.google.container.v1.Operation"\xb8\x01\x82\xd3\xe4\x93\x02\x94\x01"`__ (e.g. ``n1-standard-1``). If - unspecified, the default machine type is ``n1-standard-1``. - disk_size_gb: - Size of the disk attached to each node, specified in GB. The - smallest allowed disk size is 10GB. If unspecified, the - default disk size is 100GB. - oauth_scopes: - The set of Google API scopes to be made available on all of - the node VMs under the "default" service account. The - following scopes are recommended, but not required, and by - default are not included: - - ``https://www.googleapis.com/auth/compute`` is required for - mounting persistent storage on your nodes. - - ``https://www.googleapis.com/auth/devstorage.read_only`` is - required for communicating with **gcr.io** (the `Google - Container Registry `__). If - unspecified, no scopes are added, unless Cloud Logging or - Cloud Monitoring are enabled, in which case their required - scopes will be added. - service_account: - The Google Cloud Platform Service Account to be used by the - node VMs. If no Service Account is specified, the "default" - service account is used. - metadata: - The metadata key/value pairs assigned to instances in the - cluster. Keys must conform to the regexp [a-zA-Z0-9-\_]+ and - be less than 128 bytes in length. These are reflected as part - of a URL in the metadata server. Additionally, to avoid - ambiguity, keys must not conflict with any other metadata keys - for the project or be one of the reserved keys: "cluster- - location" "cluster-name" "cluster-uid" "configure-sh" - "containerd-configure-sh" "enable-os-login" "gci-update- - strategy" "gci-ensure-gke-docker" "instance-template" "kube- - env" "startup-script" "user-data" "disable-address-manager" - "windows-startup-script-ps1" "common-psm1" "k8s-node-setup- - psm1" "install-ssh-psm1" "user-profile-psm1" "serial-port- - logging-enable" Values are free-form strings, and only have - meaning as interpreted by the image running in the instance. - The only restriction placed on them is that each value's size - must be less than or equal to 32 KB. The total size of all - keys and values must be less than 512 KB. - image_type: - The image type to use for this node. Note that for a given - image type, the latest version of it will be used. - labels: - The map of Kubernetes labels (key/value pairs) to be applied - to each node. These will added in addition to any default - label(s) that Kubernetes may apply to the node. In case of - conflict in label keys, the applied set may differ depending - on the Kubernetes version -- it's best to assume the behavior - is undefined and conflicts should be avoided. For more - information, including usage and the valid values, see: - https://kubernetes.io/docs/concepts/overview/working-with- - objects/labels/ - local_ssd_count: - The number of local SSD disks to be attached to the node. The - limit for this value is dependent upon the maximum number of - disks available on a machine per zone. See: - https://cloud.google.com/compute/docs/disks/local-ssd for more - information. - tags: - The list of instance tags applied to all nodes. Tags are used - to identify valid sources or targets for network firewalls and - are specified by the client during cluster or node pool - creation. Each tag within the list must comply with RFC1035. - preemptible: - Whether the nodes are created as preemptible VM instances. - See: - https://cloud.google.com/compute/docs/instances/preemptible - for more information about preemptible VM instances. - accelerators: - A list of hardware accelerators to be attached to each node. - See https://cloud.google.com/compute/docs/gpus for more - information about support for GPUs. - disk_type: - Type of the disk attached to each node (e.g. 'pd-standard' or - 'pd-ssd') If unspecified, the default disk type is 'pd- - standard' - min_cpu_platform: - Minimum CPU platform to be used by this instance. The instance - may be scheduled on the specified or newer CPU platform. - Applicable values are the friendly names of CPU platforms, - such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: - "Intel Sandy Bridge". For more information, read `how to - specify min CPU platform - `__ - taints: - List of kubernetes taints to be applied to each node. For - more information, including usage and the valid values, see: - https://kubernetes.io/docs/concepts/configuration/taint-and- - toleration/ - shielded_instance_config: - Shielded Instance options. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.NodeConfig) - ), -) -_sym_db.RegisterMessage(NodeConfig) -_sym_db.RegisterMessage(NodeConfig.MetadataEntry) -_sym_db.RegisterMessage(NodeConfig.LabelsEntry) - -ShieldedInstanceConfig = _reflection.GeneratedProtocolMessageType( - "ShieldedInstanceConfig", - (_message.Message,), - dict( - DESCRIPTOR=_SHIELDEDINSTANCECONFIG, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""A set of Shielded Instance options. - - - Attributes: - enable_secure_boot: - Defines whether the instance has Secure Boot enabled. Secure - Boot helps ensure that the system only runs authentic software - by verifying the digital signature of all boot components, and - halting the boot process if signature verification fails. - enable_integrity_monitoring: - Defines whether the instance has integrity monitoring enabled. - Enables monitoring and attestation of the boot integrity of - the instance. The attestation is performed against the - integrity policy baseline. This baseline is initially derived - from the implicitly trusted boot image when the instance is - created. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.ShieldedInstanceConfig) - ), -) -_sym_db.RegisterMessage(ShieldedInstanceConfig) - -NodeTaint = _reflection.GeneratedProtocolMessageType( - "NodeTaint", - (_message.Message,), - dict( - DESCRIPTOR=_NODETAINT, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Kubernetes taint is comprised of three fields: key, value, and effect. - Effect can only be one of three types: NoSchedule, PreferNoSchedule or - NoExecute. - - For more information, including usage and the valid values, see: - https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - - - Attributes: - key: - Key for taint. - value: - Value for taint. - effect: - Effect for taint. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.NodeTaint) - ), -) -_sym_db.RegisterMessage(NodeTaint) - -MasterAuth = _reflection.GeneratedProtocolMessageType( - "MasterAuth", - (_message.Message,), - dict( - DESCRIPTOR=_MASTERAUTH, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""The authentication information for accessing the master endpoint. - Authentication can be done using HTTP basic auth or using client - certificates. - - - Attributes: - username: - The username to use for HTTP basic authentication to the - master endpoint. For clusters v1.6.0 and later, basic - authentication can be disabled by leaving username unspecified - (or setting it to the empty string). - password: - The password to use for HTTP basic authentication to the - master endpoint. Because the master endpoint is open to the - Internet, you should create a strong password. If a password - is provided for cluster creation, username must be non-empty. - client_certificate_config: - Configuration for client certificate authentication on the - cluster. For clusters before v1.12, if no configuration is - specified, a client certificate is issued. - cluster_ca_certificate: - [Output only] Base64-encoded public certificate that is the - root of trust for the cluster. - client_certificate: - [Output only] Base64-encoded public certificate used by - clients to authenticate to the cluster endpoint. - client_key: - [Output only] Base64-encoded private key used by clients to - authenticate to the cluster endpoint. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.MasterAuth) - ), -) -_sym_db.RegisterMessage(MasterAuth) - -ClientCertificateConfig = _reflection.GeneratedProtocolMessageType( - "ClientCertificateConfig", - (_message.Message,), - dict( - DESCRIPTOR=_CLIENTCERTIFICATECONFIG, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Configuration for client certificates on the cluster. - - - Attributes: - issue_client_certificate: - Issue a client certificate. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.ClientCertificateConfig) - ), -) -_sym_db.RegisterMessage(ClientCertificateConfig) - -AddonsConfig = _reflection.GeneratedProtocolMessageType( - "AddonsConfig", - (_message.Message,), - dict( - DESCRIPTOR=_ADDONSCONFIG, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Configuration for the addons that can be automatically spun up in the - cluster, enabling additional functionality. - - - Attributes: - http_load_balancing: - Configuration for the HTTP (L7) load balancing controller - addon, which makes it easy to set up HTTP load balancers for - services in a cluster. - horizontal_pod_autoscaling: - Configuration for the horizontal pod autoscaling feature, - which increases or decreases the number of replica pods a - replication controller has based on the resource usage of the - existing pods. - kubernetes_dashboard: - Configuration for the Kubernetes Dashboard. This addon is - deprecated, and will be disabled in 1.15. It is recommended to - use the Cloud Console to manage and monitor your Kubernetes - clusters, workloads and applications. For more information, - see: https://cloud.google.com/kubernetes- - engine/docs/concepts/dashboards - network_policy_config: - Configuration for NetworkPolicy. This only tracks whether the - addon is enabled or not on the Master, it does not track - whether network policy is enabled for the nodes. - cloud_run_config: - Configuration for the Cloud Run addon, which allows the user - to use a managed Knative service. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.AddonsConfig) - ), -) -_sym_db.RegisterMessage(AddonsConfig) - -HttpLoadBalancing = _reflection.GeneratedProtocolMessageType( - "HttpLoadBalancing", - (_message.Message,), - dict( - DESCRIPTOR=_HTTPLOADBALANCING, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Configuration options for the HTTP (L7) load balancing controller addon, - which makes it easy to set up HTTP load balancers for services in a - cluster. - - - Attributes: - disabled: - Whether the HTTP Load Balancing controller is enabled in the - cluster. When enabled, it runs a small pod in the cluster that - manages the load balancers. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.HttpLoadBalancing) - ), -) -_sym_db.RegisterMessage(HttpLoadBalancing) - -HorizontalPodAutoscaling = _reflection.GeneratedProtocolMessageType( - "HorizontalPodAutoscaling", - (_message.Message,), - dict( - DESCRIPTOR=_HORIZONTALPODAUTOSCALING, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Configuration options for the horizontal pod autoscaling feature, which - increases or decreases the number of replica pods a replication - controller has based on the resource usage of the existing pods. - - - Attributes: - disabled: - Whether the Horizontal Pod Autoscaling feature is enabled in - the cluster. When enabled, it ensures that a Heapster pod is - running in the cluster, which is also used by the Cloud - Monitoring service. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.HorizontalPodAutoscaling) - ), -) -_sym_db.RegisterMessage(HorizontalPodAutoscaling) - -KubernetesDashboard = _reflection.GeneratedProtocolMessageType( - "KubernetesDashboard", - (_message.Message,), - dict( - DESCRIPTOR=_KUBERNETESDASHBOARD, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Configuration for the Kubernetes Dashboard. - - - Attributes: - disabled: - Whether the Kubernetes Dashboard is enabled for this cluster. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.KubernetesDashboard) - ), -) -_sym_db.RegisterMessage(KubernetesDashboard) - -NetworkPolicyConfig = _reflection.GeneratedProtocolMessageType( - "NetworkPolicyConfig", - (_message.Message,), - dict( - DESCRIPTOR=_NETWORKPOLICYCONFIG, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Configuration for NetworkPolicy. This only tracks whether the addon is - enabled or not on the Master, it does not track whether network policy - is enabled for the nodes. - - - Attributes: - disabled: - Whether NetworkPolicy is enabled for this cluster. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.NetworkPolicyConfig) - ), -) -_sym_db.RegisterMessage(NetworkPolicyConfig) - -PrivateClusterConfig = _reflection.GeneratedProtocolMessageType( - "PrivateClusterConfig", - (_message.Message,), - dict( - DESCRIPTOR=_PRIVATECLUSTERCONFIG, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Configuration options for private clusters. - - - Attributes: - enable_private_nodes: - Whether nodes have internal IP addresses only. If enabled, all - nodes are given only RFC 1918 private addresses and - communicate with the master via private networking. - enable_private_endpoint: - Whether the master's internal IP address is used as the - cluster endpoint. - master_ipv4_cidr_block: - The IP range in CIDR notation to use for the hosted master - network. This range will be used for assigning internal IP - addresses to the master or set of masters, as well as the ILB - VIP. This range must not overlap with any other ranges in use - within the cluster's network. - private_endpoint: - Output only. The internal IP address of this cluster's master - endpoint. - public_endpoint: - Output only. The external IP address of this cluster's master - endpoint. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.PrivateClusterConfig) - ), -) -_sym_db.RegisterMessage(PrivateClusterConfig) - -AuthenticatorGroupsConfig = _reflection.GeneratedProtocolMessageType( - "AuthenticatorGroupsConfig", - (_message.Message,), - dict( - DESCRIPTOR=_AUTHENTICATORGROUPSCONFIG, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Configuration for returning group information from authenticators. - - - Attributes: - enabled: - Whether this cluster should return group membership lookups - during authentication using a group of security groups. - security_group: - The name of the security group-of-groups to be used. Only - relevant if enabled = true. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.AuthenticatorGroupsConfig) - ), -) -_sym_db.RegisterMessage(AuthenticatorGroupsConfig) - -CloudRunConfig = _reflection.GeneratedProtocolMessageType( - "CloudRunConfig", - (_message.Message,), - dict( - DESCRIPTOR=_CLOUDRUNCONFIG, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Configuration options for the Cloud Run feature. - - - Attributes: - disabled: - Whether Cloud Run addon is enabled for this cluster. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.CloudRunConfig) - ), -) -_sym_db.RegisterMessage(CloudRunConfig) - -MasterAuthorizedNetworksConfig = _reflection.GeneratedProtocolMessageType( - "MasterAuthorizedNetworksConfig", - (_message.Message,), - dict( - CidrBlock=_reflection.GeneratedProtocolMessageType( - "CidrBlock", - (_message.Message,), - dict( - DESCRIPTOR=_MASTERAUTHORIZEDNETWORKSCONFIG_CIDRBLOCK, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""CidrBlock contains an optional name and one CIDR block. - - - Attributes: - display_name: - display\_name is an optional field for users to identify CIDR - blocks. - cidr_block: - cidr\_block must be specified in CIDR notation. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.MasterAuthorizedNetworksConfig.CidrBlock) - ), - ), - DESCRIPTOR=_MASTERAUTHORIZEDNETWORKSCONFIG, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Configuration options for the master authorized networks feature. - Enabled master authorized networks will disallow all external traffic to - access Kubernetes master through HTTPS except traffic from the given - CIDR blocks, Google Compute Engine Public IPs and Google Prod IPs. - - - Attributes: - enabled: - Whether or not master authorized networks is enabled. - cidr_blocks: - cidr\_blocks define up to 50 external networks that could - access Kubernetes master through HTTPS. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.MasterAuthorizedNetworksConfig) - ), -) -_sym_db.RegisterMessage(MasterAuthorizedNetworksConfig) -_sym_db.RegisterMessage(MasterAuthorizedNetworksConfig.CidrBlock) - -LegacyAbac = _reflection.GeneratedProtocolMessageType( - "LegacyAbac", - (_message.Message,), - dict( - DESCRIPTOR=_LEGACYABAC, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Configuration for the legacy Attribute Based Access Control - authorization mode. - - - Attributes: - enabled: - Whether the ABAC authorizer is enabled for this cluster. When - enabled, identities in the system, including service accounts, - nodes, and controllers, will have statically granted - permissions beyond those provided by the RBAC configuration or - IAM. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.LegacyAbac) - ), -) -_sym_db.RegisterMessage(LegacyAbac) - -NetworkPolicy = _reflection.GeneratedProtocolMessageType( - "NetworkPolicy", - (_message.Message,), - dict( - DESCRIPTOR=_NETWORKPOLICY, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Configuration options for the NetworkPolicy feature. - https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ - - - Attributes: - provider: - The selected network policy provider. - enabled: - Whether network policy is enabled on the cluster. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.NetworkPolicy) - ), -) -_sym_db.RegisterMessage(NetworkPolicy) - -BinaryAuthorization = _reflection.GeneratedProtocolMessageType( - "BinaryAuthorization", - (_message.Message,), - dict( - DESCRIPTOR=_BINARYAUTHORIZATION, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Configuration for Binary Authorization. - - - Attributes: - enabled: - Enable Binary Authorization for this cluster. If enabled, all - container images will be validated by Binary Authorization. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.BinaryAuthorization) - ), -) -_sym_db.RegisterMessage(BinaryAuthorization) - -IPAllocationPolicy = _reflection.GeneratedProtocolMessageType( - "IPAllocationPolicy", - (_message.Message,), - dict( - DESCRIPTOR=_IPALLOCATIONPOLICY, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Configuration for controlling how IPs are allocated in the cluster. - - - Attributes: - use_ip_aliases: - Whether alias IPs will be used for pod IPs in the cluster. - create_subnetwork: - Whether a new subnetwork will be created automatically for the - cluster. This field is only applicable when - ``use_ip_aliases`` is true. - subnetwork_name: - A custom subnetwork name to be used if ``create_subnetwork`` - is true. If this field is empty, then an automatic name will - be chosen for the new subnetwork. - cluster_ipv4_cidr: - This field is deprecated, use cluster\_ipv4\_cidr\_block. - node_ipv4_cidr: - This field is deprecated, use node\_ipv4\_cidr\_block. - services_ipv4_cidr: - This field is deprecated, use services\_ipv4\_cidr\_block. - cluster_secondary_range_name: - The name of the secondary range to be used for the cluster - CIDR block. The secondary range will be used for pod IP - addresses. This must be an existing secondary range associated - with the cluster subnetwork. This field is only applicable - with use\_ip\_aliases is true and create\_subnetwork is false. - services_secondary_range_name: - The name of the secondary range to be used as for the services - CIDR block. The secondary range will be used for service - ClusterIPs. This must be an existing secondary range - associated with the cluster subnetwork. This field is only - applicable with use\_ip\_aliases is true and - create\_subnetwork is false. - cluster_ipv4_cidr_block: - The IP address range for the cluster pod IPs. If this field is - set, then ``cluster.cluster_ipv4_cidr`` must be left blank. - This field is only applicable when ``use_ip_aliases`` is true. - Set to blank to have a range chosen with the default size. - Set to /netmask (e.g. ``/14``) to have a range chosen with a - specific netmask. Set to a `CIDR - `__ notation (e.g. ``10.96.0.0/14``) from the - RFC-1918 private networks (e.g. ``10.0.0.0/8``, - ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific - range to use. - node_ipv4_cidr_block: - The IP address range of the instance IPs in this cluster. - This is applicable only if ``create_subnetwork`` is true. Set - to blank to have a range chosen with the default size. Set to - /netmask (e.g. ``/14``) to have a range chosen with a specific - netmask. Set to a `CIDR - `__ notation (e.g. ``10.96.0.0/14``) from the - RFC-1918 private networks (e.g. ``10.0.0.0/8``, - ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific - range to use. - services_ipv4_cidr_block: - The IP address range of the services IPs in this cluster. If - blank, a range will be automatically chosen with the default - size. This field is only applicable when ``use_ip_aliases`` - is true. Set to blank to have a range chosen with the default - size. Set to /netmask (e.g. ``/14``) to have a range chosen - with a specific netmask. Set to a `CIDR - `__ notation (e.g. ``10.96.0.0/14``) from the - RFC-1918 private networks (e.g. ``10.0.0.0/8``, - ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific - range to use. - tpu_ipv4_cidr_block: - The IP address range of the Cloud TPUs in this cluster. If - unspecified, a range will be automatically chosen with the - default size. This field is only applicable when - ``use_ip_aliases`` is true. If unspecified, the range will - use the default size. Set to /netmask (e.g. ``/14``) to have - a range chosen with a specific netmask. Set to a `CIDR - `__ notation (e.g. ``10.96.0.0/14``) from the - RFC-1918 private networks (e.g. ``10.0.0.0/8``, - ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific - range to use. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.IPAllocationPolicy) - ), -) -_sym_db.RegisterMessage(IPAllocationPolicy) - -Cluster = _reflection.GeneratedProtocolMessageType( - "Cluster", - (_message.Message,), - dict( - ResourceLabelsEntry=_reflection.GeneratedProtocolMessageType( - "ResourceLabelsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_CLUSTER_RESOURCELABELSENTRY, - __module__="google.cloud.container_v1.proto.cluster_service_pb2" - # @@protoc_insertion_point(class_scope:google.container.v1.Cluster.ResourceLabelsEntry) - ), - ), - DESCRIPTOR=_CLUSTER, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""A Google Kubernetes Engine cluster. - - - Attributes: - name: - The name of this cluster. The name must be unique within this - project and location (e.g. zone or region), and can be up to - 40 characters with the following restrictions: - Lowercase - letters, numbers, and hyphens only. - Must start with a - letter. - Must end with a number or a letter. - description: - An optional description of this cluster. - initial_node_count: - The number of nodes to create in this cluster. You must ensure - that your Compute Engine resource quota is sufficient for this - number of instances. You must also have available firewall and - routes quota. For requests, this field should only be used in - lieu of a "node\_pool" object, since this configuration (along - with the "node\_config") will be used to create a "NodePool" - object with an auto-generated name. Do not use this and a - node\_pool at the same time. This field is deprecated, use - node\_pool.initial\_node\_count instead. - node_config: - Parameters used in creating the cluster's nodes. For requests, - this field should only be used in lieu of a "node\_pool" - object, since this configuration (along with the - "initial\_node\_count") will be used to create a "NodePool" - object with an auto-generated name. Do not use this and a - node\_pool at the same time. For responses, this field will be - populated with the node configuration of the first node pool. - (For configuration of each node pool, see - ``node_pool.config``) If unspecified, the defaults are used. - This field is deprecated, use node\_pool.config instead. - master_auth: - The authentication information for accessing the master - endpoint. If unspecified, the defaults are used: For clusters - before v1.12, if master\_auth is unspecified, ``username`` - will be set to "admin", a random password will be generated, - and a client certificate will be issued. - logging_service: - The logging service the cluster should use to write logs. - Currently available options: - - "logging.googleapis.com/kubernetes" - the Google Cloud Logging - service with Kubernetes-native resource model - - ``logging.googleapis.com`` - the Google Cloud Logging service. - - ``none`` - no logs will be exported from the cluster. - if - left as an empty string,\ ``logging.googleapis.com`` will be - used. - monitoring_service: - The monitoring service the cluster should use to write - metrics. Currently available options: - - ``monitoring.googleapis.com`` - the Google Cloud Monitoring - service. - ``none`` - no metrics will be exported from the - cluster. - if left as an empty string, - ``monitoring.googleapis.com`` will be used. - network: - The name of the Google Compute Engine `network - `__ to which - the cluster is connected. If left unspecified, the ``default`` - network will be used. - cluster_ipv4_cidr: - The IP address range of the container pods in this cluster, in - `CIDR `__ notation (e.g. ``10.96.0.0/14``). Leave - blank to have one automatically chosen or specify a ``/14`` - block in ``10.0.0.0/8``. - addons_config: - Configurations for the various addons available to run in the - cluster. - subnetwork: - The name of the Google Compute Engine `subnetwork - `__ to which the cluster is - connected. - node_pools: - The node pools associated with this cluster. This field should - not be set if "node\_config" or "initial\_node\_count" are - specified. - locations: - The list of Google Compute Engine `zones - `__ in which the cluster's - nodes should be located. - enable_kubernetes_alpha: - Kubernetes alpha features are enabled on this cluster. This - includes alpha API groups (e.g. v1alpha1) and features that - may not be production ready in the kubernetes version of the - master and nodes. The cluster has no SLA for uptime and - master/node upgrades are disabled. Alpha enabled clusters are - automatically deleted thirty days after creation. - resource_labels: - The resource labels for the cluster to use to annotate any - related Google Compute Engine resources. - label_fingerprint: - The fingerprint of the set of labels for this cluster. - legacy_abac: - Configuration for the legacy ABAC authorization mode. - network_policy: - Configuration options for the NetworkPolicy feature. - ip_allocation_policy: - Configuration for cluster IP allocation. - master_authorized_networks_config: - The configuration options for master authorized networks - feature. - maintenance_policy: - Configure the maintenance policy for this cluster. - binary_authorization: - Configuration for Binary Authorization. - autoscaling: - Cluster-level autoscaling configuration. - network_config: - Configuration for cluster networking. - default_max_pods_constraint: - The default constraint on the maximum number of pods that can - be run simultaneously on a node in the node pool of this - cluster. Only honored if cluster created with IP Alias - support. - resource_usage_export_config: - Configuration for exporting resource usages. Resource usage - export is disabled when this config is unspecified. - authenticator_groups_config: - Configuration controlling RBAC group membership information. - private_cluster_config: - Configuration for private cluster. - database_encryption: - Configuration of etcd encryption. - vertical_pod_autoscaling: - Cluster-level Vertical Pod Autoscaling configuration. - self_link: - [Output only] Server-defined URL for the resource. - zone: - [Output only] The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field is deprecated, use location instead. - endpoint: - [Output only] The IP address of this cluster's master - endpoint. The endpoint can be accessed from the internet at - ``https://username:password@endpoint/``. See the - ``masterAuth`` property of this resource for username and - password information. - initial_cluster_version: - The initial Kubernetes version for this cluster. Valid - versions are those found in validMasterVersions returned by - getServerConfig. The version can be upgraded over time; such - upgrades are reflected in currentMasterVersion and - currentNodeVersion. Users may specify either explicit - versions offered by Kubernetes Engine or version aliases, - which have the following behavior: - "latest": picks the - highest valid Kubernetes version - "1.X": picks the highest - valid patch+gke.N patch in the 1.X version - "1.X.Y": picks - the highest valid gke.N patch in the 1.X.Y version - - "1.X.Y-gke.N": picks an explicit Kubernetes version - "","-": - picks the default Kubernetes version - current_master_version: - [Output only] The current software version of the master - endpoint. - current_node_version: - [Output only] Deprecated, use `NodePools.version `__ instead. The current version of the node software - components. If they are currently at multiple versions because - they're in the process of being upgraded, this reflects the - minimum version of all nodes. - create_time: - [Output only] The time the cluster was created, in `RFC3339 - `__ text format. - status: - [Output only] The current status of this cluster. - status_message: - [Output only] Additional information about the current status - of this cluster, if available. - node_ipv4_cidr_size: - [Output only] The size of the address space on each node for - hosting containers. This is provisioned from within the - ``container_ipv4_cidr`` range. This field will only be set - when cluster is in route-based network mode. - services_ipv4_cidr: - [Output only] The IP address range of the Kubernetes services - in this cluster, in `CIDR - `__ notation (e.g. ``1.2.3.4/29``). Service - addresses are typically put in the last ``/16`` from the - container CIDR. - instance_group_urls: - Deprecated. Use node\_pools.instance\_group\_urls. - current_node_count: - [Output only] The number of nodes currently in the cluster. - Deprecated. Call Kubernetes API directly to retrieve node - information. - expire_time: - [Output only] The time the cluster will be automatically - deleted in `RFC3339 `__ - text format. - location: - [Output only] The name of the Google Compute Engine `zone - `__ or - `region `__ in which the cluster resides. - enable_tpu: - Enable the ability to use Cloud TPUs in this cluster. - tpu_ipv4_cidr_block: - [Output only] The IP address range of the Cloud TPUs in this - cluster, in `CIDR - `__ notation (e.g. ``1.2.3.4/29``). - conditions: - Which conditions caused the current cluster state. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.Cluster) - ), -) -_sym_db.RegisterMessage(Cluster) -_sym_db.RegisterMessage(Cluster.ResourceLabelsEntry) - -ClusterUpdate = _reflection.GeneratedProtocolMessageType( - "ClusterUpdate", - (_message.Message,), - dict( - DESCRIPTOR=_CLUSTERUPDATE, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""ClusterUpdate describes an update to the cluster. Exactly one update can - be applied to a cluster with each request, so at most one field can be - provided. - - - Attributes: - desired_node_version: - The Kubernetes version to change the nodes to (typically an - upgrade). Users may specify either explicit versions offered - by Kubernetes Engine or version aliases, which have the - following behavior: - "latest": picks the highest valid - Kubernetes version - "1.X": picks the highest valid - patch+gke.N patch in the 1.X version - "1.X.Y": picks the - highest valid gke.N patch in the 1.X.Y version - - "1.X.Y-gke.N": picks an explicit Kubernetes version - "-": - picks the Kubernetes master version - desired_monitoring_service: - The monitoring service the cluster should use to write - metrics. Currently available options: - - "monitoring.googleapis.com/kubernetes" - the Google Cloud - Monitoring service with Kubernetes-native resource model - - "monitoring.googleapis.com" - the Google Cloud Monitoring - service - "none" - no metrics will be exported from the - cluster - desired_addons_config: - Configurations for the various addons available to run in the - cluster. - desired_node_pool_id: - The node pool to be upgraded. This field is mandatory if - "desired\_node\_version", "desired\_image\_family" or - "desired\_node\_pool\_autoscaling" is specified and there is - more than one node pool on the cluster. - desired_image_type: - The desired image type for the node pool. NOTE: Set the - "desired\_node\_pool" field as well. - desired_database_encryption: - Configuration of etcd encryption. - desired_node_pool_autoscaling: - Autoscaler configuration for the node pool specified in - desired\_node\_pool\_id. If there is only one pool in the - cluster and desired\_node\_pool\_id is not provided then the - change applies to that single node pool. - desired_locations: - The desired list of Google Compute Engine `zones - `__ in which the cluster's - nodes should be located. Changing the locations a cluster is - in will result in nodes being either created or removed from - the cluster, depending on whether locations are being added or - removed. This list must always include the cluster's primary - zone. - desired_master_authorized_networks_config: - The desired configuration options for master authorized - networks feature. - desired_cluster_autoscaling: - Cluster-level autoscaling configuration. - desired_binary_authorization: - The desired configuration options for the Binary Authorization - feature. - desired_logging_service: - The logging service the cluster should use to write logs. - Currently available options: - - "logging.googleapis.com/kubernetes" - the Google Cloud Logging - service with Kubernetes-native resource model - - "logging.googleapis.com" - the Google Cloud Logging service - - "none" - no logs will be exported from the cluster - desired_resource_usage_export_config: - The desired configuration for exporting resource usage. - desired_vertical_pod_autoscaling: - Cluster-level Vertical Pod Autoscaling configuration. - desired_intra_node_visibility_config: - The desired config of Intra-node visibility. - desired_master_version: - The Kubernetes version to change the master to. Users may - specify either explicit versions offered by Kubernetes Engine - or version aliases, which have the following behavior: - - "latest": picks the highest valid Kubernetes version - "1.X": - picks the highest valid patch+gke.N patch in the 1.X version - - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y - version - "1.X.Y-gke.N": picks an explicit Kubernetes version - - "-": picks the default Kubernetes version - """, - # @@protoc_insertion_point(class_scope:google.container.v1.ClusterUpdate) - ), -) -_sym_db.RegisterMessage(ClusterUpdate) - -Operation = _reflection.GeneratedProtocolMessageType( - "Operation", - (_message.Message,), - dict( - DESCRIPTOR=_OPERATION, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""This operation resource represents operations that may have happened or - are happening on the cluster. All fields are output only. - - - Attributes: - name: - The server-assigned ID for the operation. - zone: - The name of the Google Compute Engine `zone - `__ in which the operation is - taking place. This field is deprecated, use location instead. - operation_type: - The operation type. - status: - The current status of the operation. - detail: - Detailed operation progress, if available. - status_message: - If an error has occurred, a textual description of the error. - self_link: - Server-defined URL for the resource. - target_link: - Server-defined URL for the target of the operation. - location: - [Output only] The name of the Google Compute Engine `zone - `__ or - `region `__ in which the cluster resides. - start_time: - [Output only] The time the operation started, in `RFC3339 - `__ text format. - end_time: - [Output only] The time the operation completed, in `RFC3339 - `__ text format. - cluster_conditions: - Which conditions caused the current cluster state. - nodepool_conditions: - Which conditions caused the current node pool state. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.Operation) - ), -) -_sym_db.RegisterMessage(Operation) - -CreateClusterRequest = _reflection.GeneratedProtocolMessageType( - "CreateClusterRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATECLUSTERREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""CreateClusterRequest creates a cluster. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the parent field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - parent field. - cluster: - Required. A `cluster resource `__ - parent: - The parent (project and location) where the cluster will be - created. Specified in the format 'projects/*/locations/*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.CreateClusterRequest) - ), -) -_sym_db.RegisterMessage(CreateClusterRequest) - -GetClusterRequest = _reflection.GeneratedProtocolMessageType( - "GetClusterRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETCLUSTERREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""GetClusterRequest gets the settings of a cluster. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster to retrieve. - This field has been deprecated and replaced by the name field. - name: - The name (project, location, cluster) of the cluster to - retrieve. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.GetClusterRequest) - ), -) -_sym_db.RegisterMessage(GetClusterRequest) - -UpdateClusterRequest = _reflection.GeneratedProtocolMessageType( - "UpdateClusterRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATECLUSTERREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""UpdateClusterRequest updates the settings of a cluster. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster to upgrade. This - field has been deprecated and replaced by the name field. - update: - Required. A description of the update. - name: - The name (project, location, cluster) of the cluster to - update. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.UpdateClusterRequest) - ), -) -_sym_db.RegisterMessage(UpdateClusterRequest) - -UpdateNodePoolRequest = _reflection.GeneratedProtocolMessageType( - "UpdateNodePoolRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATENODEPOOLREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""UpdateNodePoolRequests update a node pool's image and/or version. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster to upgrade. This - field has been deprecated and replaced by the name field. - node_pool_id: - Required. Deprecated. The name of the node pool to upgrade. - This field has been deprecated and replaced by the name field. - node_version: - Required. The Kubernetes version to change the nodes to - (typically an upgrade). Users may specify either explicit - versions offered by Kubernetes Engine or version aliases, - which have the following behavior: - "latest": picks the - highest valid Kubernetes version - "1.X": picks the highest - valid patch+gke.N patch in the 1.X version - "1.X.Y": picks - the highest valid gke.N patch in the 1.X.Y version - - "1.X.Y-gke.N": picks an explicit Kubernetes version - "-": - picks the Kubernetes master version - image_type: - Required. The desired image type for the node pool. - name: - The name (project, location, cluster, node pool) of the node - pool to update. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.UpdateNodePoolRequest) - ), -) -_sym_db.RegisterMessage(UpdateNodePoolRequest) - -SetNodePoolAutoscalingRequest = _reflection.GeneratedProtocolMessageType( - "SetNodePoolAutoscalingRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETNODEPOOLAUTOSCALINGREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""SetNodePoolAutoscalingRequest sets the autoscaler settings of a node - pool. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster to upgrade. This - field has been deprecated and replaced by the name field. - node_pool_id: - Required. Deprecated. The name of the node pool to upgrade. - This field has been deprecated and replaced by the name field. - autoscaling: - Required. Autoscaling configuration for the node pool. - name: - The name (project, location, cluster, node pool) of the node - pool to set autoscaler settings. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.SetNodePoolAutoscalingRequest) - ), -) -_sym_db.RegisterMessage(SetNodePoolAutoscalingRequest) - -SetLoggingServiceRequest = _reflection.GeneratedProtocolMessageType( - "SetLoggingServiceRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETLOGGINGSERVICEREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""SetLoggingServiceRequest sets the logging service of a cluster. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster to upgrade. This - field has been deprecated and replaced by the name field. - logging_service: - Required. The logging service the cluster should use to write - metrics. Currently available options: - - "logging.googleapis.com" - the Google Cloud Logging service - - "none" - no metrics will be exported from the cluster - name: - The name (project, location, cluster) of the cluster to set - logging. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.SetLoggingServiceRequest) - ), -) -_sym_db.RegisterMessage(SetLoggingServiceRequest) - -SetMonitoringServiceRequest = _reflection.GeneratedProtocolMessageType( - "SetMonitoringServiceRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETMONITORINGSERVICEREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""SetMonitoringServiceRequest sets the monitoring service of a cluster. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster to upgrade. This - field has been deprecated and replaced by the name field. - monitoring_service: - Required. The monitoring service the cluster should use to - write metrics. Currently available options: - - "monitoring.googleapis.com/kubernetes" - the Google Cloud - Monitoring service with Kubernetes-native resource model - - "monitoring.googleapis.com" - the Google Cloud Monitoring - service - "none" - no metrics will be exported from the - cluster - name: - The name (project, location, cluster) of the cluster to set - monitoring. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.SetMonitoringServiceRequest) - ), -) -_sym_db.RegisterMessage(SetMonitoringServiceRequest) - -SetAddonsConfigRequest = _reflection.GeneratedProtocolMessageType( - "SetAddonsConfigRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETADDONSCONFIGREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""SetAddonsConfigRequest sets the addons associated with the cluster. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster to upgrade. This - field has been deprecated and replaced by the name field. - addons_config: - Required. The desired configurations for the various addons - available to run in the cluster. - name: - The name (project, location, cluster) of the cluster to set - addons. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.SetAddonsConfigRequest) - ), -) -_sym_db.RegisterMessage(SetAddonsConfigRequest) - -SetLocationsRequest = _reflection.GeneratedProtocolMessageType( - "SetLocationsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETLOCATIONSREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""SetLocationsRequest sets the locations of the cluster. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster to upgrade. This - field has been deprecated and replaced by the name field. - locations: - Required. The desired list of Google Compute Engine `zones - `__ in which the cluster's - nodes should be located. Changing the locations a cluster is - in will result in nodes being either created or removed from - the cluster, depending on whether locations are being added or - removed. This list must always include the cluster's primary - zone. - name: - The name (project, location, cluster) of the cluster to set - locations. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.SetLocationsRequest) - ), -) -_sym_db.RegisterMessage(SetLocationsRequest) - -UpdateMasterRequest = _reflection.GeneratedProtocolMessageType( - "UpdateMasterRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEMASTERREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""UpdateMasterRequest updates the master of the cluster. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster to upgrade. This - field has been deprecated and replaced by the name field. - master_version: - Required. The Kubernetes version to change the master to. - Users may specify either explicit versions offered by - Kubernetes Engine or version aliases, which have the following - behavior: - "latest": picks the highest valid Kubernetes - version - "1.X": picks the highest valid patch+gke.N patch in - the 1.X version - "1.X.Y": picks the highest valid gke.N - patch in the 1.X.Y version - "1.X.Y-gke.N": picks an explicit - Kubernetes version - "-": picks the default Kubernetes - version - name: - The name (project, location, cluster) of the cluster to - update. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.UpdateMasterRequest) - ), -) -_sym_db.RegisterMessage(UpdateMasterRequest) - -SetMasterAuthRequest = _reflection.GeneratedProtocolMessageType( - "SetMasterAuthRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETMASTERAUTHREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""SetMasterAuthRequest updates the admin password of a cluster. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster to upgrade. This - field has been deprecated and replaced by the name field. - action: - Required. The exact form of action to be taken on the master - auth. - update: - Required. A description of the update. - name: - The name (project, location, cluster) of the cluster to set - auth. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.SetMasterAuthRequest) - ), -) -_sym_db.RegisterMessage(SetMasterAuthRequest) - -DeleteClusterRequest = _reflection.GeneratedProtocolMessageType( - "DeleteClusterRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETECLUSTERREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""DeleteClusterRequest deletes a cluster. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster to delete. This - field has been deprecated and replaced by the name field. - name: - The name (project, location, cluster) of the cluster to - delete. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.DeleteClusterRequest) - ), -) -_sym_db.RegisterMessage(DeleteClusterRequest) - -ListClustersRequest = _reflection.GeneratedProtocolMessageType( - "ListClustersRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTCLUSTERSREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""ListClustersRequest lists clusters. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the parent field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides, or "-" for all zones. This field has been deprecated - and replaced by the parent field. - parent: - The parent (project and location) where the clusters will be - listed. Specified in the format 'projects/*/locations/*'. - Location "-" matches all zones and all regions. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.ListClustersRequest) - ), -) -_sym_db.RegisterMessage(ListClustersRequest) - -ListClustersResponse = _reflection.GeneratedProtocolMessageType( - "ListClustersResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTCLUSTERSRESPONSE, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""ListClustersResponse is the result of ListClustersRequest. - - - Attributes: - clusters: - A list of clusters in the project in the specified zone, or - across all ones. - missing_zones: - If any zones are listed here, the list of clusters returned - may be missing those zones. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.ListClustersResponse) - ), -) -_sym_db.RegisterMessage(ListClustersResponse) - -GetOperationRequest = _reflection.GeneratedProtocolMessageType( - "GetOperationRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETOPERATIONREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""GetOperationRequest gets a single operation. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - operation_id: - Required. Deprecated. The server-assigned ``name`` of the - operation. This field has been deprecated and replaced by the - name field. - name: - The name (project, location, operation id) of the operation to - get. Specified in the format - 'projects/*/locations/*/operations/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.GetOperationRequest) - ), -) -_sym_db.RegisterMessage(GetOperationRequest) - -ListOperationsRequest = _reflection.GeneratedProtocolMessageType( - "ListOperationsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTOPERATIONSREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""ListOperationsRequest lists operations. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the parent field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ to return operations - for, or ``-`` for all zones. This field has been deprecated - and replaced by the parent field. - parent: - The parent (project and location) where the operations will be - listed. Specified in the format 'projects/*/locations/*'. - Location "-" matches all zones and all regions. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.ListOperationsRequest) - ), -) -_sym_db.RegisterMessage(ListOperationsRequest) - -CancelOperationRequest = _reflection.GeneratedProtocolMessageType( - "CancelOperationRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CANCELOPERATIONREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""CancelOperationRequest cancels a single operation. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the - operation resides. This field has been deprecated and replaced - by the name field. - operation_id: - Required. Deprecated. The server-assigned ``name`` of the - operation. This field has been deprecated and replaced by the - name field. - name: - The name (project, location, operation id) of the operation to - cancel. Specified in the format - 'projects/*/locations/*/operations/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.CancelOperationRequest) - ), -) -_sym_db.RegisterMessage(CancelOperationRequest) - -ListOperationsResponse = _reflection.GeneratedProtocolMessageType( - "ListOperationsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTOPERATIONSRESPONSE, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""ListOperationsResponse is the result of ListOperationsRequest. - - - Attributes: - operations: - A list of operations in the project in the specified zone. - missing_zones: - If any zones are listed here, the list of operations returned - may be missing the operations from those zones. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.ListOperationsResponse) - ), -) -_sym_db.RegisterMessage(ListOperationsResponse) - -GetServerConfigRequest = _reflection.GeneratedProtocolMessageType( - "GetServerConfigRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETSERVERCONFIGREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Gets the current Kubernetes Engine service configuration. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ to return operations - for. This field has been deprecated and replaced by the name - field. - name: - The name (project and location) of the server config to get, - specified in the format 'projects/*/locations/*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.GetServerConfigRequest) - ), -) -_sym_db.RegisterMessage(GetServerConfigRequest) - -ServerConfig = _reflection.GeneratedProtocolMessageType( - "ServerConfig", - (_message.Message,), - dict( - DESCRIPTOR=_SERVERCONFIG, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Kubernetes Engine service configuration. - - - Attributes: - default_cluster_version: - Version of Kubernetes the service deploys by default. - valid_node_versions: - List of valid node upgrade target versions. - default_image_type: - Default image type. - valid_image_types: - List of valid image types. - valid_master_versions: - List of valid master versions. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.ServerConfig) - ), -) -_sym_db.RegisterMessage(ServerConfig) - -CreateNodePoolRequest = _reflection.GeneratedProtocolMessageType( - "CreateNodePoolRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATENODEPOOLREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""CreateNodePoolRequest creates a node pool for a cluster. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number `__. This field has been deprecated and - replaced by the parent field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - parent field. - cluster_id: - Required. Deprecated. The name of the cluster. This field has - been deprecated and replaced by the parent field. - node_pool: - Required. The node pool to create. - parent: - The parent (project, location, cluster id) where the node pool - will be created. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.CreateNodePoolRequest) - ), -) -_sym_db.RegisterMessage(CreateNodePoolRequest) - -DeleteNodePoolRequest = _reflection.GeneratedProtocolMessageType( - "DeleteNodePoolRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETENODEPOOLREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""DeleteNodePoolRequest deletes a node pool for a cluster. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number `__. This field has been deprecated and - replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster. This field has - been deprecated and replaced by the name field. - node_pool_id: - Required. Deprecated. The name of the node pool to delete. - This field has been deprecated and replaced by the name field. - name: - The name (project, location, cluster, node pool id) of the - node pool to delete. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.DeleteNodePoolRequest) - ), -) -_sym_db.RegisterMessage(DeleteNodePoolRequest) - -ListNodePoolsRequest = _reflection.GeneratedProtocolMessageType( - "ListNodePoolsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTNODEPOOLSREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""ListNodePoolsRequest lists the node pool(s) for a cluster. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number `__. This field has been deprecated and - replaced by the parent field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - parent field. - cluster_id: - Required. Deprecated. The name of the cluster. This field has - been deprecated and replaced by the parent field. - parent: - The parent (project, location, cluster id) where the node - pools will be listed. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.ListNodePoolsRequest) - ), -) -_sym_db.RegisterMessage(ListNodePoolsRequest) - -GetNodePoolRequest = _reflection.GeneratedProtocolMessageType( - "GetNodePoolRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETNODEPOOLREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""GetNodePoolRequest retrieves a node pool for a cluster. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number `__. This field has been deprecated and - replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster. This field has - been deprecated and replaced by the name field. - node_pool_id: - Required. Deprecated. The name of the node pool. This field - has been deprecated and replaced by the name field. - name: - The name (project, location, cluster, node pool id) of the - node pool to get. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.GetNodePoolRequest) - ), -) -_sym_db.RegisterMessage(GetNodePoolRequest) - -NodePool = _reflection.GeneratedProtocolMessageType( - "NodePool", - (_message.Message,), - dict( - DESCRIPTOR=_NODEPOOL, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""NodePool contains the name and configuration for a cluster's node pool. - Node pools are a set of nodes (i.e. VM's), with a common configuration - and specification, under the control of the cluster master. They may - have a set of Kubernetes labels applied to them, which may be used to - reference them during pod scheduling. They may also be resized up or - down, to accommodate the workload. - - - Attributes: - name: - The name of the node pool. - config: - The node configuration of the pool. - initial_node_count: - The initial node count for the pool. You must ensure that your - Compute Engine resource quota is sufficient for this number of - instances. You must also have available firewall and routes - quota. - self_link: - [Output only] Server-defined URL for the resource. - version: - The version of the Kubernetes of this node. - instance_group_urls: - [Output only] The resource URLs of the `managed instance - groups `__ associated with this node pool. - status: - [Output only] The status of the nodes in this pool instance. - status_message: - [Output only] Additional information about the current status - of this node pool instance, if available. - autoscaling: - Autoscaler configuration for this NodePool. Autoscaler is - enabled only if a valid configuration is present. - management: - NodeManagement configuration for this NodePool. - max_pods_constraint: - The constraint on the maximum number of pods that can be run - simultaneously on a node in the node pool. - conditions: - Which conditions caused the current node pool state. - pod_ipv4_cidr_size: - [Output only] The pod CIDR block size per node in this node - pool. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.NodePool) - ), -) -_sym_db.RegisterMessage(NodePool) - -NodeManagement = _reflection.GeneratedProtocolMessageType( - "NodeManagement", - (_message.Message,), - dict( - DESCRIPTOR=_NODEMANAGEMENT, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""NodeManagement defines the set of node management services turned on for - the node pool. - - - Attributes: - auto_upgrade: - A flag that specifies whether node auto-upgrade is enabled for - the node pool. If enabled, node auto-upgrade helps keep the - nodes in your node pool up to date with the latest release - version of Kubernetes. - auto_repair: - A flag that specifies whether the node auto-repair is enabled - for the node pool. If enabled, the nodes in this node pool - will be monitored and, if they fail health checks too many - times, an automatic repair action will be triggered. - upgrade_options: - Specifies the Auto Upgrade knobs for the node pool. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.NodeManagement) - ), -) -_sym_db.RegisterMessage(NodeManagement) - -AutoUpgradeOptions = _reflection.GeneratedProtocolMessageType( - "AutoUpgradeOptions", - (_message.Message,), - dict( - DESCRIPTOR=_AUTOUPGRADEOPTIONS, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""AutoUpgradeOptions defines the set of options for the user to control - how the Auto Upgrades will proceed. - - - Attributes: - auto_upgrade_start_time: - [Output only] This field is set when upgrades are about to - commence with the approximate start time for the upgrades, in - `RFC3339 `__ text - format. - description: - [Output only] This field is set when upgrades are about to - commence with the description of the upgrade. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.AutoUpgradeOptions) - ), -) -_sym_db.RegisterMessage(AutoUpgradeOptions) - -MaintenancePolicy = _reflection.GeneratedProtocolMessageType( - "MaintenancePolicy", - (_message.Message,), - dict( - DESCRIPTOR=_MAINTENANCEPOLICY, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""MaintenancePolicy defines the maintenance policy to be used for the - cluster. - - - Attributes: - window: - Specifies the maintenance window in which maintenance may be - performed. - resource_version: - A hash identifying the version of this policy, so that updates - to fields of the policy won't accidentally undo intermediate - changes (and so that users of the API unaware of some fields - won't accidentally remove other fields). Make a get() request - to the cluster to get the current resource version and include - it with requests to set the policy. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.MaintenancePolicy) - ), -) -_sym_db.RegisterMessage(MaintenancePolicy) - -MaintenanceWindow = _reflection.GeneratedProtocolMessageType( - "MaintenanceWindow", - (_message.Message,), - dict( - MaintenanceExclusionsEntry=_reflection.GeneratedProtocolMessageType( - "MaintenanceExclusionsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_MAINTENANCEWINDOW_MAINTENANCEEXCLUSIONSENTRY, - __module__="google.cloud.container_v1.proto.cluster_service_pb2" - # @@protoc_insertion_point(class_scope:google.container.v1.MaintenanceWindow.MaintenanceExclusionsEntry) - ), - ), - DESCRIPTOR=_MAINTENANCEWINDOW, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""MaintenanceWindow defines the maintenance window to be used for the - cluster. - - - Attributes: - daily_maintenance_window: - DailyMaintenanceWindow specifies a daily maintenance operation - window. - recurring_window: - RecurringWindow specifies some number of recurring time - periods for maintenance to occur. The time windows may be - overlapping. If no maintenance windows are set, maintenance - can occur at any time. - maintenance_exclusions: - Exceptions to maintenance window. Non-emergency maintenance - should not occur in these windows. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.MaintenanceWindow) - ), -) -_sym_db.RegisterMessage(MaintenanceWindow) -_sym_db.RegisterMessage(MaintenanceWindow.MaintenanceExclusionsEntry) - -TimeWindow = _reflection.GeneratedProtocolMessageType( - "TimeWindow", - (_message.Message,), - dict( - DESCRIPTOR=_TIMEWINDOW, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Represents an arbitrary window of time. - - - Attributes: - start_time: - The time that the window first starts. - end_time: - The time that the window ends. The end time should take place - after the start time. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.TimeWindow) - ), -) -_sym_db.RegisterMessage(TimeWindow) - -RecurringTimeWindow = _reflection.GeneratedProtocolMessageType( - "RecurringTimeWindow", - (_message.Message,), - dict( - DESCRIPTOR=_RECURRINGTIMEWINDOW, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Represents an arbitrary window of time that recurs. - - - Attributes: - window: - The window of the first recurrence. - recurrence: - An RRULE (https://tools.ietf.org/html/rfc5545#section-3.8.5.3) - for how this window reccurs. They go on for the span of time - between the start and end time. For example, to have - something repeat every weekday, you'd use: - FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR To repeat some window daily - (equivalent to the DailyMaintenanceWindow): FREQ=DAILY For the - first weekend of every month: - FREQ=MONTHLY;BYSETPOS=1;BYDAY=SA,SU This specifies how - frequently the window starts. Eg, if you wanted to have a 9-5 - UTC-4 window every weekday, you'd use something like: start - time = 2019-01-01T09:00:00-0400 end time = - 2019-01-01T17:00:00-0400 recurrence = - FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR Windows can span multiple - days. Eg, to make the window encompass every weekend from - midnight Saturday till the last minute of Sunday UTC: start - time = 2019-01-05T00:00:00Z end time = 2019-01-07T23:59:00Z - recurrence = FREQ=WEEKLY;BYDAY=SA Note the start and end - time's specific dates are largely arbitrary except to specify - duration of the window and when it first starts. The FREQ - values of HOURLY, MINUTELY, and SECONDLY are not supported. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.RecurringTimeWindow) - ), -) -_sym_db.RegisterMessage(RecurringTimeWindow) - -DailyMaintenanceWindow = _reflection.GeneratedProtocolMessageType( - "DailyMaintenanceWindow", - (_message.Message,), - dict( - DESCRIPTOR=_DAILYMAINTENANCEWINDOW, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Time window specified for daily maintenance operations. - - - Attributes: - start_time: - Time within the maintenance window to start the maintenance - operations. Time format should be in `RFC3339 - `__ format "HH:MM", - where HH : [00-23] and MM : [00-59] GMT. - duration: - [Output only] Duration of the time window, automatically - chosen to be smallest possible in the given scenario. Duration - will be in `RFC3339 `__ - format "PTnHnMnS". - """, - # @@protoc_insertion_point(class_scope:google.container.v1.DailyMaintenanceWindow) - ), -) -_sym_db.RegisterMessage(DailyMaintenanceWindow) - -SetNodePoolManagementRequest = _reflection.GeneratedProtocolMessageType( - "SetNodePoolManagementRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETNODEPOOLMANAGEMENTREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""SetNodePoolManagementRequest sets the node management properties of a - node pool. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster to update. This - field has been deprecated and replaced by the name field. - node_pool_id: - Required. Deprecated. The name of the node pool to update. - This field has been deprecated and replaced by the name field. - management: - Required. NodeManagement configuration for the node pool. - name: - The name (project, location, cluster, node pool id) of the - node pool to set management properties. Specified in the - format 'projects/*/locations/*/clusters/*/nodePools/*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.SetNodePoolManagementRequest) - ), -) -_sym_db.RegisterMessage(SetNodePoolManagementRequest) - -SetNodePoolSizeRequest = _reflection.GeneratedProtocolMessageType( - "SetNodePoolSizeRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETNODEPOOLSIZEREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""SetNodePoolSizeRequest sets the size a node pool. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster to update. This - field has been deprecated and replaced by the name field. - node_pool_id: - Required. Deprecated. The name of the node pool to update. - This field has been deprecated and replaced by the name field. - node_count: - Required. The desired node count for the pool. - name: - The name (project, location, cluster, node pool id) of the - node pool to set size. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.SetNodePoolSizeRequest) - ), -) -_sym_db.RegisterMessage(SetNodePoolSizeRequest) - -RollbackNodePoolUpgradeRequest = _reflection.GeneratedProtocolMessageType( - "RollbackNodePoolUpgradeRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ROLLBACKNODEPOOLUPGRADEREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or - Failed NodePool upgrade. This will be an no-op if the last upgrade - successfully completed. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster to rollback. - This field has been deprecated and replaced by the name field. - node_pool_id: - Required. Deprecated. The name of the node pool to rollback. - This field has been deprecated and replaced by the name field. - name: - The name (project, location, cluster, node pool id) of the - node poll to rollback upgrade. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.RollbackNodePoolUpgradeRequest) - ), -) -_sym_db.RegisterMessage(RollbackNodePoolUpgradeRequest) - -ListNodePoolsResponse = _reflection.GeneratedProtocolMessageType( - "ListNodePoolsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTNODEPOOLSRESPONSE, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""ListNodePoolsResponse is the result of ListNodePoolsRequest. - - - Attributes: - node_pools: - A list of node pools for a cluster. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.ListNodePoolsResponse) - ), -) -_sym_db.RegisterMessage(ListNodePoolsResponse) - -ClusterAutoscaling = _reflection.GeneratedProtocolMessageType( - "ClusterAutoscaling", - (_message.Message,), - dict( - DESCRIPTOR=_CLUSTERAUTOSCALING, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""ClusterAutoscaling contains global, per-cluster information required by - Cluster Autoscaler to automatically adjust the size of the cluster and - create/delete node pools based on the current needs. - - - Attributes: - enable_node_autoprovisioning: - Enables automatic node pool creation and deletion. - resource_limits: - Contains global constraints regarding minimum and maximum - amount of resources in the cluster. - autoprovisioning_node_pool_defaults: - AutoprovisioningNodePoolDefaults contains defaults for a node - pool created by NAP. - autoprovisioning_locations: - The list of Google Compute Engine `zones - `__ in which the NodePool's - nodes can be created by NAP. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.ClusterAutoscaling) - ), -) -_sym_db.RegisterMessage(ClusterAutoscaling) - -AutoprovisioningNodePoolDefaults = _reflection.GeneratedProtocolMessageType( - "AutoprovisioningNodePoolDefaults", - (_message.Message,), - dict( - DESCRIPTOR=_AUTOPROVISIONINGNODEPOOLDEFAULTS, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""AutoprovisioningNodePoolDefaults contains defaults for a node pool - created by NAP. - - - Attributes: - oauth_scopes: - Scopes that are used by NAP when creating node pools. If - oauth\_scopes are specified, service\_account should be empty. - service_account: - The Google Cloud Platform Service Account to be used by the - node VMs. If service\_account is specified, scopes should be - empty. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.AutoprovisioningNodePoolDefaults) - ), -) -_sym_db.RegisterMessage(AutoprovisioningNodePoolDefaults) - -ResourceLimit = _reflection.GeneratedProtocolMessageType( - "ResourceLimit", - (_message.Message,), - dict( - DESCRIPTOR=_RESOURCELIMIT, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Contains information about amount of some resource in the cluster. For - memory, value should be in GB. - - - Attributes: - resource_type: - Resource name "cpu", "memory" or gpu-specific string. - minimum: - Minimum amount of the resource in the cluster. - maximum: - Maximum amount of the resource in the cluster. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.ResourceLimit) - ), -) -_sym_db.RegisterMessage(ResourceLimit) - -NodePoolAutoscaling = _reflection.GeneratedProtocolMessageType( - "NodePoolAutoscaling", - (_message.Message,), - dict( - DESCRIPTOR=_NODEPOOLAUTOSCALING, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""NodePoolAutoscaling contains information required by cluster autoscaler - to adjust the size of the node pool to the current cluster usage. - - - Attributes: - enabled: - Is autoscaling enabled for this node pool. - min_node_count: - Minimum number of nodes in the NodePool. Must be >= 1 and <= - max\_node\_count. - max_node_count: - Maximum number of nodes in the NodePool. Must be >= - min\_node\_count. There has to enough quota to scale up the - cluster. - autoprovisioned: - Can this node pool be deleted automatically. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.NodePoolAutoscaling) - ), -) -_sym_db.RegisterMessage(NodePoolAutoscaling) - -SetLabelsRequest = _reflection.GeneratedProtocolMessageType( - "SetLabelsRequest", - (_message.Message,), - dict( - ResourceLabelsEntry=_reflection.GeneratedProtocolMessageType( - "ResourceLabelsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_SETLABELSREQUEST_RESOURCELABELSENTRY, - __module__="google.cloud.container_v1.proto.cluster_service_pb2" - # @@protoc_insertion_point(class_scope:google.container.v1.SetLabelsRequest.ResourceLabelsEntry) - ), - ), - DESCRIPTOR=_SETLABELSREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""SetLabelsRequest sets the Google Cloud Platform labels on a Google - Container Engine cluster, which will in turn set them for Google Compute - Engine resources used by that cluster - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number `__. This field has been deprecated and - replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster. This field has - been deprecated and replaced by the name field. - resource_labels: - Required. The labels to set for that cluster. - label_fingerprint: - Required. The fingerprint of the previous set of labels for - this resource, used to detect conflicts. The fingerprint is - initially generated by Kubernetes Engine and changes after - every request to modify or update labels. You must always - provide an up-to-date fingerprint hash when updating or - changing labels. Make a get() request to the resource to get - the latest fingerprint. - name: - The name (project, location, cluster id) of the cluster to set - labels. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.SetLabelsRequest) - ), -) -_sym_db.RegisterMessage(SetLabelsRequest) -_sym_db.RegisterMessage(SetLabelsRequest.ResourceLabelsEntry) - -SetLegacyAbacRequest = _reflection.GeneratedProtocolMessageType( - "SetLegacyAbacRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETLEGACYABACREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""SetLegacyAbacRequest enables or disables the ABAC authorization - mechanism for a cluster. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster to update. This - field has been deprecated and replaced by the name field. - enabled: - Required. Whether ABAC authorization will be enabled in the - cluster. - name: - The name (project, location, cluster id) of the cluster to set - legacy abac. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.SetLegacyAbacRequest) - ), -) -_sym_db.RegisterMessage(SetLegacyAbacRequest) - -StartIPRotationRequest = _reflection.GeneratedProtocolMessageType( - "StartIPRotationRequest", - (_message.Message,), - dict( - DESCRIPTOR=_STARTIPROTATIONREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""StartIPRotationRequest creates a new IP for the cluster and then - performs a node upgrade on each node pool to point to the new IP. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number `__. This field has been deprecated and - replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster. This field has - been deprecated and replaced by the name field. - name: - The name (project, location, cluster id) of the cluster to - start IP rotation. Specified in the format - 'projects/*/locations/*/clusters/\*'. - rotate_credentials: - Whether to rotate credentials during IP rotation. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.StartIPRotationRequest) - ), -) -_sym_db.RegisterMessage(StartIPRotationRequest) - -CompleteIPRotationRequest = _reflection.GeneratedProtocolMessageType( - "CompleteIPRotationRequest", - (_message.Message,), - dict( - DESCRIPTOR=_COMPLETEIPROTATIONREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""CompleteIPRotationRequest moves the cluster master back into single-IP - mode. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number `__. This field has been deprecated and - replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster. This field has - been deprecated and replaced by the name field. - name: - The name (project, location, cluster id) of the cluster to - complete IP rotation. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.CompleteIPRotationRequest) - ), -) -_sym_db.RegisterMessage(CompleteIPRotationRequest) - -AcceleratorConfig = _reflection.GeneratedProtocolMessageType( - "AcceleratorConfig", - (_message.Message,), - dict( - DESCRIPTOR=_ACCELERATORCONFIG, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""AcceleratorConfig represents a Hardware Accelerator request. - - - Attributes: - accelerator_count: - The number of the accelerator cards exposed to an instance. - accelerator_type: - The accelerator type resource name. List of supported - accelerators `here `__ - """, - # @@protoc_insertion_point(class_scope:google.container.v1.AcceleratorConfig) - ), -) -_sym_db.RegisterMessage(AcceleratorConfig) - -SetNetworkPolicyRequest = _reflection.GeneratedProtocolMessageType( - "SetNetworkPolicyRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETNETWORKPOLICYREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""SetNetworkPolicyRequest enables/disables network policy for a cluster. - - - Attributes: - project_id: - Required. Deprecated. The Google Developers Console `project - ID or project number `__. This field has been deprecated and - replaced by the name field. - zone: - Required. Deprecated. The name of the Google Compute Engine - `zone `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Required. Deprecated. The name of the cluster. This field has - been deprecated and replaced by the name field. - network_policy: - Required. Configuration options for the NetworkPolicy feature. - name: - The name (project, location, cluster id) of the cluster to set - networking policy. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.SetNetworkPolicyRequest) - ), -) -_sym_db.RegisterMessage(SetNetworkPolicyRequest) - -SetMaintenancePolicyRequest = _reflection.GeneratedProtocolMessageType( - "SetMaintenancePolicyRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETMAINTENANCEPOLICYREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""SetMaintenancePolicyRequest sets the maintenance policy for a cluster. - - - Attributes: - project_id: - Required. The Google Developers Console `project ID or project - number `__. - zone: - Required. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. - cluster_id: - Required. The name of the cluster to update. - maintenance_policy: - Required. The maintenance policy to be set for the cluster. An - empty field clears the existing maintenance policy. - name: - The name (project, location, cluster id) of the cluster to set - maintenance policy. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.SetMaintenancePolicyRequest) - ), -) -_sym_db.RegisterMessage(SetMaintenancePolicyRequest) - -StatusCondition = _reflection.GeneratedProtocolMessageType( - "StatusCondition", - (_message.Message,), - dict( - DESCRIPTOR=_STATUSCONDITION, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""StatusCondition describes why a cluster or a node pool has a certain - status (e.g., ERROR or DEGRADED). - - - Attributes: - code: - Machine-friendly representation of the condition - message: - Human-friendly representation of the condition - """, - # @@protoc_insertion_point(class_scope:google.container.v1.StatusCondition) - ), -) -_sym_db.RegisterMessage(StatusCondition) - -NetworkConfig = _reflection.GeneratedProtocolMessageType( - "NetworkConfig", - (_message.Message,), - dict( - DESCRIPTOR=_NETWORKCONFIG, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""NetworkConfig reports the relative names of network & subnetwork. - - - Attributes: - network: - Output only. The relative name of the Google Compute Engine [n - etwork][google.container.v1.NetworkConfig.network](/compute/do - cs/networks-and-firewalls#networks) to which the cluster is - connected. Example: projects/my-project/global/networks/my- - network - subnetwork: - Output only. The relative name of the Google Compute Engine - `subnetwork `__ to which the cluster is - connected. Example: projects/my-project/regions/us- - central1/subnetworks/my-subnet - enable_intra_node_visibility: - Whether Intra-node visibility is enabled for this cluster. - This makes same node pod to pod traffic visible for VPC - network. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.NetworkConfig) - ), -) -_sym_db.RegisterMessage(NetworkConfig) - -IntraNodeVisibilityConfig = _reflection.GeneratedProtocolMessageType( - "IntraNodeVisibilityConfig", - (_message.Message,), - dict( - DESCRIPTOR=_INTRANODEVISIBILITYCONFIG, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""IntraNodeVisibilityConfig contains the desired config of the intra-node - visibility on this cluster. - - - Attributes: - enabled: - Enables intra node visibility for this cluster. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.IntraNodeVisibilityConfig) - ), -) -_sym_db.RegisterMessage(IntraNodeVisibilityConfig) - -MaxPodsConstraint = _reflection.GeneratedProtocolMessageType( - "MaxPodsConstraint", - (_message.Message,), - dict( - DESCRIPTOR=_MAXPODSCONSTRAINT, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Constraints applied to pods. - - - Attributes: - max_pods_per_node: - Constraint enforced on the max num of pods per node. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.MaxPodsConstraint) - ), -) -_sym_db.RegisterMessage(MaxPodsConstraint) - -DatabaseEncryption = _reflection.GeneratedProtocolMessageType( - "DatabaseEncryption", - (_message.Message,), - dict( - DESCRIPTOR=_DATABASEENCRYPTION, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Configuration of etcd encryption. - - - Attributes: - state: - Denotes the state of etcd encryption. - key_name: - Name of CloudKMS key to use for the encryption of secrets in - etcd. Ex. projects/my-project/locations/global/keyRings/my- - ring/cryptoKeys/my-key - """, - # @@protoc_insertion_point(class_scope:google.container.v1.DatabaseEncryption) - ), -) -_sym_db.RegisterMessage(DatabaseEncryption) - -ListUsableSubnetworksRequest = _reflection.GeneratedProtocolMessageType( - "ListUsableSubnetworksRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTUSABLESUBNETWORKSREQUEST, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""ListUsableSubnetworksRequest requests the list of usable subnetworks - available to a user for creating clusters. - - - Attributes: - parent: - The parent project where subnetworks are usable. Specified in - the format 'projects/\*'. - filter: - Filtering currently only supports equality on the - networkProjectId and must be in the form: - "networkProjectId=[PROJECTID]", where ``networkProjectId`` is - the project which owns the listed subnetworks. This defaults - to the parent project ID. - page_size: - The max number of results per page that should be returned. If - the number of available results is larger than ``page_size``, - a ``next_page_token`` is returned which can be used to get the - next page of results in subsequent requests. Acceptable values - are 0 to 500, inclusive. (Default: 500) - page_token: - Specifies a page token to use. Set this to the nextPageToken - returned by previous list requests to get the next page of - results. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.ListUsableSubnetworksRequest) - ), -) -_sym_db.RegisterMessage(ListUsableSubnetworksRequest) - -ListUsableSubnetworksResponse = _reflection.GeneratedProtocolMessageType( - "ListUsableSubnetworksResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTUSABLESUBNETWORKSRESPONSE, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""ListUsableSubnetworksResponse is the response of - ListUsableSubnetworksRequest. - - - Attributes: - subnetworks: - A list of usable subnetworks in the specified network project. - next_page_token: - This token allows you to get the next page of results for list - requests. If the number of results is larger than - ``page_size``, use the ``next_page_token`` as a value for the - query parameter ``page_token`` in the next request. The value - will become empty when there are no more pages. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.ListUsableSubnetworksResponse) - ), -) -_sym_db.RegisterMessage(ListUsableSubnetworksResponse) - -UsableSubnetworkSecondaryRange = _reflection.GeneratedProtocolMessageType( - "UsableSubnetworkSecondaryRange", - (_message.Message,), - dict( - DESCRIPTOR=_USABLESUBNETWORKSECONDARYRANGE, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Secondary IP range of a usable subnetwork. - - - Attributes: - range_name: - The name associated with this subnetwork secondary range, used - when adding an alias IP range to a VM instance. - ip_cidr_range: - The range of IP addresses belonging to this subnetwork - secondary range. - status: - This field is to determine the status of the secondary range - programmably. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.UsableSubnetworkSecondaryRange) - ), -) -_sym_db.RegisterMessage(UsableSubnetworkSecondaryRange) - -UsableSubnetwork = _reflection.GeneratedProtocolMessageType( - "UsableSubnetwork", - (_message.Message,), - dict( - DESCRIPTOR=_USABLESUBNETWORK, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Network Name. Example: projects/my-project/global/networks/my-network - - - Attributes: - subnetwork: - Subnetwork Name. Example: projects/my-project/regions/us- - central1/subnetworks/my-subnet - ip_cidr_range: - The range of internal addresses that are owned by this - subnetwork. - secondary_ip_ranges: - Secondary IP ranges. - status_message: - A human readable status message representing the reasons for - cases where the caller cannot use the secondary ranges under - the subnet. For example if the secondary\_ip\_ranges is empty - due to a permission issue, an insufficient permission message - will be given by status\_message. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.UsableSubnetwork) - ), -) -_sym_db.RegisterMessage(UsableSubnetwork) - -ResourceUsageExportConfig = _reflection.GeneratedProtocolMessageType( - "ResourceUsageExportConfig", - (_message.Message,), - dict( - BigQueryDestination=_reflection.GeneratedProtocolMessageType( - "BigQueryDestination", - (_message.Message,), - dict( - DESCRIPTOR=_RESOURCEUSAGEEXPORTCONFIG_BIGQUERYDESTINATION, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Parameters for using BigQuery as the destination of resource usage - export. - - - Attributes: - dataset_id: - The ID of a BigQuery Dataset. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.ResourceUsageExportConfig.BigQueryDestination) - ), - ), - ConsumptionMeteringConfig=_reflection.GeneratedProtocolMessageType( - "ConsumptionMeteringConfig", - (_message.Message,), - dict( - DESCRIPTOR=_RESOURCEUSAGEEXPORTCONFIG_CONSUMPTIONMETERINGCONFIG, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Parameters for controlling consumption metering. - - - Attributes: - enabled: - Whether to enable consumption metering for this cluster. If - enabled, a second BigQuery table will be created to hold - resource consumption records. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.ResourceUsageExportConfig.ConsumptionMeteringConfig) - ), - ), - DESCRIPTOR=_RESOURCEUSAGEEXPORTCONFIG, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""Configuration for exporting cluster resource usages. - - - Attributes: - bigquery_destination: - Configuration to use BigQuery as usage export destination. - enable_network_egress_metering: - Whether to enable network egress metering for this cluster. If - enabled, a daemonset will be created in the cluster to meter - network egress traffic. - consumption_metering_config: - Configuration to enable resource consumption metering. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.ResourceUsageExportConfig) - ), -) -_sym_db.RegisterMessage(ResourceUsageExportConfig) -_sym_db.RegisterMessage(ResourceUsageExportConfig.BigQueryDestination) -_sym_db.RegisterMessage(ResourceUsageExportConfig.ConsumptionMeteringConfig) - -VerticalPodAutoscaling = _reflection.GeneratedProtocolMessageType( - "VerticalPodAutoscaling", - (_message.Message,), - dict( - DESCRIPTOR=_VERTICALPODAUTOSCALING, - __module__="google.cloud.container_v1.proto.cluster_service_pb2", - __doc__="""VerticalPodAutoscaling contains global, per-cluster information required - by Vertical Pod Autoscaler to automatically adjust the resources of pods - controlled by it. - - - Attributes: - enabled: - Enables vertical pod autoscaling. - """, - # @@protoc_insertion_point(class_scope:google.container.v1.VerticalPodAutoscaling) - ), -) -_sym_db.RegisterMessage(VerticalPodAutoscaling) - - -DESCRIPTOR._options = None -_NODECONFIG_METADATAENTRY._options = None -_NODECONFIG_LABELSENTRY._options = None -_ADDONSCONFIG.fields_by_name["kubernetes_dashboard"]._options = None -_IPALLOCATIONPOLICY.fields_by_name["cluster_ipv4_cidr"]._options = None -_IPALLOCATIONPOLICY.fields_by_name["node_ipv4_cidr"]._options = None -_IPALLOCATIONPOLICY.fields_by_name["services_ipv4_cidr"]._options = None -_CLUSTER_RESOURCELABELSENTRY._options = None -_CLUSTER.fields_by_name["initial_node_count"]._options = None -_CLUSTER.fields_by_name["node_config"]._options = None -_CLUSTER.fields_by_name["zone"]._options = None -_CLUSTER.fields_by_name["current_node_version"]._options = None -_CLUSTER.fields_by_name["instance_group_urls"]._options = None -_CLUSTER.fields_by_name["current_node_count"]._options = None -_OPERATION.fields_by_name["zone"]._options = None -_CREATECLUSTERREQUEST.fields_by_name["project_id"]._options = None -_CREATECLUSTERREQUEST.fields_by_name["zone"]._options = None -_CREATECLUSTERREQUEST.fields_by_name["cluster"]._options = None -_GETCLUSTERREQUEST.fields_by_name["project_id"]._options = None -_GETCLUSTERREQUEST.fields_by_name["zone"]._options = None -_GETCLUSTERREQUEST.fields_by_name["cluster_id"]._options = None -_UPDATECLUSTERREQUEST.fields_by_name["project_id"]._options = None -_UPDATECLUSTERREQUEST.fields_by_name["zone"]._options = None -_UPDATECLUSTERREQUEST.fields_by_name["cluster_id"]._options = None -_UPDATECLUSTERREQUEST.fields_by_name["update"]._options = None -_UPDATENODEPOOLREQUEST.fields_by_name["project_id"]._options = None -_UPDATENODEPOOLREQUEST.fields_by_name["zone"]._options = None -_UPDATENODEPOOLREQUEST.fields_by_name["cluster_id"]._options = None -_UPDATENODEPOOLREQUEST.fields_by_name["node_pool_id"]._options = None -_UPDATENODEPOOLREQUEST.fields_by_name["node_version"]._options = None -_UPDATENODEPOOLREQUEST.fields_by_name["image_type"]._options = None -_SETNODEPOOLAUTOSCALINGREQUEST.fields_by_name["project_id"]._options = None -_SETNODEPOOLAUTOSCALINGREQUEST.fields_by_name["zone"]._options = None -_SETNODEPOOLAUTOSCALINGREQUEST.fields_by_name["cluster_id"]._options = None -_SETNODEPOOLAUTOSCALINGREQUEST.fields_by_name["node_pool_id"]._options = None -_SETNODEPOOLAUTOSCALINGREQUEST.fields_by_name["autoscaling"]._options = None -_SETLOGGINGSERVICEREQUEST.fields_by_name["project_id"]._options = None -_SETLOGGINGSERVICEREQUEST.fields_by_name["zone"]._options = None -_SETLOGGINGSERVICEREQUEST.fields_by_name["cluster_id"]._options = None -_SETLOGGINGSERVICEREQUEST.fields_by_name["logging_service"]._options = None -_SETMONITORINGSERVICEREQUEST.fields_by_name["project_id"]._options = None -_SETMONITORINGSERVICEREQUEST.fields_by_name["zone"]._options = None -_SETMONITORINGSERVICEREQUEST.fields_by_name["cluster_id"]._options = None -_SETMONITORINGSERVICEREQUEST.fields_by_name["monitoring_service"]._options = None -_SETADDONSCONFIGREQUEST.fields_by_name["project_id"]._options = None -_SETADDONSCONFIGREQUEST.fields_by_name["zone"]._options = None -_SETADDONSCONFIGREQUEST.fields_by_name["cluster_id"]._options = None -_SETADDONSCONFIGREQUEST.fields_by_name["addons_config"]._options = None -_SETLOCATIONSREQUEST.fields_by_name["project_id"]._options = None -_SETLOCATIONSREQUEST.fields_by_name["zone"]._options = None -_SETLOCATIONSREQUEST.fields_by_name["cluster_id"]._options = None -_SETLOCATIONSREQUEST.fields_by_name["locations"]._options = None -_UPDATEMASTERREQUEST.fields_by_name["project_id"]._options = None -_UPDATEMASTERREQUEST.fields_by_name["zone"]._options = None -_UPDATEMASTERREQUEST.fields_by_name["cluster_id"]._options = None -_UPDATEMASTERREQUEST.fields_by_name["master_version"]._options = None -_SETMASTERAUTHREQUEST.fields_by_name["project_id"]._options = None -_SETMASTERAUTHREQUEST.fields_by_name["zone"]._options = None -_SETMASTERAUTHREQUEST.fields_by_name["cluster_id"]._options = None -_SETMASTERAUTHREQUEST.fields_by_name["action"]._options = None -_SETMASTERAUTHREQUEST.fields_by_name["update"]._options = None -_DELETECLUSTERREQUEST.fields_by_name["project_id"]._options = None -_DELETECLUSTERREQUEST.fields_by_name["zone"]._options = None -_DELETECLUSTERREQUEST.fields_by_name["cluster_id"]._options = None -_LISTCLUSTERSREQUEST.fields_by_name["project_id"]._options = None -_LISTCLUSTERSREQUEST.fields_by_name["zone"]._options = None -_GETOPERATIONREQUEST.fields_by_name["project_id"]._options = None -_GETOPERATIONREQUEST.fields_by_name["zone"]._options = None -_GETOPERATIONREQUEST.fields_by_name["operation_id"]._options = None -_LISTOPERATIONSREQUEST.fields_by_name["project_id"]._options = None -_LISTOPERATIONSREQUEST.fields_by_name["zone"]._options = None -_CANCELOPERATIONREQUEST.fields_by_name["project_id"]._options = None -_CANCELOPERATIONREQUEST.fields_by_name["zone"]._options = None -_CANCELOPERATIONREQUEST.fields_by_name["operation_id"]._options = None -_GETSERVERCONFIGREQUEST.fields_by_name["project_id"]._options = None -_GETSERVERCONFIGREQUEST.fields_by_name["zone"]._options = None -_CREATENODEPOOLREQUEST.fields_by_name["project_id"]._options = None -_CREATENODEPOOLREQUEST.fields_by_name["zone"]._options = None -_CREATENODEPOOLREQUEST.fields_by_name["cluster_id"]._options = None -_CREATENODEPOOLREQUEST.fields_by_name["node_pool"]._options = None -_DELETENODEPOOLREQUEST.fields_by_name["project_id"]._options = None -_DELETENODEPOOLREQUEST.fields_by_name["zone"]._options = None -_DELETENODEPOOLREQUEST.fields_by_name["cluster_id"]._options = None -_DELETENODEPOOLREQUEST.fields_by_name["node_pool_id"]._options = None -_LISTNODEPOOLSREQUEST.fields_by_name["project_id"]._options = None -_LISTNODEPOOLSREQUEST.fields_by_name["zone"]._options = None -_LISTNODEPOOLSREQUEST.fields_by_name["cluster_id"]._options = None -_GETNODEPOOLREQUEST.fields_by_name["project_id"]._options = None -_GETNODEPOOLREQUEST.fields_by_name["zone"]._options = None -_GETNODEPOOLREQUEST.fields_by_name["cluster_id"]._options = None -_GETNODEPOOLREQUEST.fields_by_name["node_pool_id"]._options = None -_MAINTENANCEWINDOW_MAINTENANCEEXCLUSIONSENTRY._options = None -_SETNODEPOOLMANAGEMENTREQUEST.fields_by_name["project_id"]._options = None -_SETNODEPOOLMANAGEMENTREQUEST.fields_by_name["zone"]._options = None -_SETNODEPOOLMANAGEMENTREQUEST.fields_by_name["cluster_id"]._options = None -_SETNODEPOOLMANAGEMENTREQUEST.fields_by_name["node_pool_id"]._options = None -_SETNODEPOOLMANAGEMENTREQUEST.fields_by_name["management"]._options = None -_SETNODEPOOLSIZEREQUEST.fields_by_name["project_id"]._options = None -_SETNODEPOOLSIZEREQUEST.fields_by_name["zone"]._options = None -_SETNODEPOOLSIZEREQUEST.fields_by_name["cluster_id"]._options = None -_SETNODEPOOLSIZEREQUEST.fields_by_name["node_pool_id"]._options = None -_SETNODEPOOLSIZEREQUEST.fields_by_name["node_count"]._options = None -_ROLLBACKNODEPOOLUPGRADEREQUEST.fields_by_name["project_id"]._options = None -_ROLLBACKNODEPOOLUPGRADEREQUEST.fields_by_name["zone"]._options = None -_ROLLBACKNODEPOOLUPGRADEREQUEST.fields_by_name["cluster_id"]._options = None -_ROLLBACKNODEPOOLUPGRADEREQUEST.fields_by_name["node_pool_id"]._options = None -_SETLABELSREQUEST_RESOURCELABELSENTRY._options = None -_SETLABELSREQUEST.fields_by_name["project_id"]._options = None -_SETLABELSREQUEST.fields_by_name["zone"]._options = None -_SETLABELSREQUEST.fields_by_name["cluster_id"]._options = None -_SETLABELSREQUEST.fields_by_name["resource_labels"]._options = None -_SETLABELSREQUEST.fields_by_name["label_fingerprint"]._options = None -_SETLEGACYABACREQUEST.fields_by_name["project_id"]._options = None -_SETLEGACYABACREQUEST.fields_by_name["zone"]._options = None -_SETLEGACYABACREQUEST.fields_by_name["cluster_id"]._options = None -_SETLEGACYABACREQUEST.fields_by_name["enabled"]._options = None -_STARTIPROTATIONREQUEST.fields_by_name["project_id"]._options = None -_STARTIPROTATIONREQUEST.fields_by_name["zone"]._options = None -_STARTIPROTATIONREQUEST.fields_by_name["cluster_id"]._options = None -_COMPLETEIPROTATIONREQUEST.fields_by_name["project_id"]._options = None -_COMPLETEIPROTATIONREQUEST.fields_by_name["zone"]._options = None -_COMPLETEIPROTATIONREQUEST.fields_by_name["cluster_id"]._options = None -_SETNETWORKPOLICYREQUEST.fields_by_name["project_id"]._options = None -_SETNETWORKPOLICYREQUEST.fields_by_name["zone"]._options = None -_SETNETWORKPOLICYREQUEST.fields_by_name["cluster_id"]._options = None -_SETNETWORKPOLICYREQUEST.fields_by_name["network_policy"]._options = None -_SETMAINTENANCEPOLICYREQUEST.fields_by_name["project_id"]._options = None -_SETMAINTENANCEPOLICYREQUEST.fields_by_name["zone"]._options = None -_SETMAINTENANCEPOLICYREQUEST.fields_by_name["cluster_id"]._options = None -_SETMAINTENANCEPOLICYREQUEST.fields_by_name["maintenance_policy"]._options = None - -_CLUSTERMANAGER = _descriptor.ServiceDescriptor( - name="ClusterManager", - full_name="google.container.v1.ClusterManager", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\030container.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=16211, - serialized_end=24692, - methods=[ - _descriptor.MethodDescriptor( - name="ListClusters", - full_name="google.container.v1.ClusterManager.ListClusters", - index=0, - containing_service=None, - input_type=_LISTCLUSTERSREQUEST, - output_type=_LISTCLUSTERSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002a\022,/v1/{parent=projects/*/locations/*}/clustersZ1\022//v1/projects/{project_id}/zones/{zone}/clusters\332A\017project_id,zone" - ), - ), - _descriptor.MethodDescriptor( - name="GetCluster", - full_name="google.container.v1.ClusterManager.GetCluster", - index=1, - containing_service=None, - input_type=_GETCLUSTERREQUEST, - output_type=_CLUSTER, - serialized_options=_b( - "\202\323\344\223\002n\022,/v1/{name=projects/*/locations/*/clusters/*}Z>\022*/v1/{name=projects/*/locations/*/clusters/*}:setResourceLabels:\001*ZP"K/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/resourceLabels:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="SetLegacyAbac", - full_name="google.container.v1.ClusterManager.SetLegacyAbac", - index=24, - containing_service=None, - input_type=_SETLEGACYABACREQUEST, - output_type=_OPERATION, - serialized_options=_b( - '\202\323\344\223\002\215\001":/v1/{name=projects/*/locations/*/clusters/*}:setLegacyAbac:\001*ZL"G/v1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/legacyAbac:\001*\332A"project_id,zone,cluster_id,enabled' - ), - ), - _descriptor.MethodDescriptor( - name="StartIPRotation", - full_name="google.container.v1.ClusterManager.StartIPRotation", - index=25, - containing_service=None, - input_type=_STARTIPROTATIONREQUEST, - output_type=_OPERATION, - serialized_options=_b( - '\202\323\344\223\002\224\001">> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> response = client.list_clusters(project_id, zone) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the parent field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides, or "-" for all zones. This field has been - deprecated and replaced by the parent field. - parent (str): The parent (project and location) where the clusters will be listed. - Specified in the format 'projects/*/locations/*'. Location "-" matches - all zones and all regions. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.ListClustersResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_clusters" not in self._inner_api_calls: - self._inner_api_calls[ - "list_clusters" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_clusters, - default_retry=self._method_configs["ListClusters"].retry, - default_timeout=self._method_configs["ListClusters"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.ListClustersRequest( - project_id=project_id, zone=zone, parent=parent - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["list_clusters"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_cluster( - self, - project_id, - zone, - cluster_id, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets the details for a specific cluster. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> response = client.get_cluster(project_id, zone, cluster_id) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster to retrieve. - This field has been deprecated and replaced by the name field. - name (str): The name (project, location, cluster) of the cluster to retrieve. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Cluster` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_cluster" not in self._inner_api_calls: - self._inner_api_calls[ - "get_cluster" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_cluster, - default_retry=self._method_configs["GetCluster"].retry, - default_timeout=self._method_configs["GetCluster"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.GetClusterRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id, name=name - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_cluster"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_cluster( - self, - project_id, - zone, - cluster, - parent=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a cluster, consisting of the specified number and type of Google - Compute Engine instances. - - By default, the cluster is created in the project's `default - network `__. - - One firewall is added for the cluster. After cluster creation, the - cluster creates routes for each node to allow the containers on that - node to communicate with all other instances in the cluster. - - Finally, an entry is added to the project's global metadata indicating - which CIDR range is being used by the cluster. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster`: - >>> cluster = {} - >>> - >>> response = client.create_cluster(project_id, zone, cluster) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the parent field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the parent field. - cluster (Union[dict, ~google.cloud.container_v1beta1.types.Cluster]): A `cluster - resource `__ - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.container_v1beta1.types.Cluster` - parent (str): The parent (project and location) where the cluster will be created. - Specified in the format 'projects/*/locations/*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_cluster" not in self._inner_api_calls: - self._inner_api_calls[ - "create_cluster" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_cluster, - default_retry=self._method_configs["CreateCluster"].retry, - default_timeout=self._method_configs["CreateCluster"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.CreateClusterRequest( - project_id=project_id, zone=zone, cluster=cluster, parent=parent - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_cluster"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_cluster( - self, - project_id, - zone, - cluster_id, - update, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates the settings for a specific cluster. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `update`: - >>> update = {} - >>> - >>> response = client.update_cluster(project_id, zone, cluster_id, update) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster to upgrade. - This field has been deprecated and replaced by the name field. - update (Union[dict, ~google.cloud.container_v1beta1.types.ClusterUpdate]): A description of the update. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.container_v1beta1.types.ClusterUpdate` - name (str): The name (project, location, cluster) of the cluster to update. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_cluster" not in self._inner_api_calls: - self._inner_api_calls[ - "update_cluster" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_cluster, - default_retry=self._method_configs["UpdateCluster"].retry, - default_timeout=self._method_configs["UpdateCluster"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.UpdateClusterRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - update=update, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_cluster"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_node_pool( - self, - project_id, - zone, - cluster_id, - node_pool_id, - node_version, - image_type, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates the version and/or image type of a specific node pool. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `node_pool_id`: - >>> node_pool_id = '' - >>> - >>> # TODO: Initialize `node_version`: - >>> node_version = '' - >>> - >>> # TODO: Initialize `image_type`: - >>> image_type = '' - >>> - >>> response = client.update_node_pool(project_id, zone, cluster_id, node_pool_id, node_version, image_type) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster to upgrade. - This field has been deprecated and replaced by the name field. - node_pool_id (str): Deprecated. The name of the node pool to upgrade. - This field has been deprecated and replaced by the name field. - node_version (str): The Kubernetes version to change the nodes to (typically an - upgrade). - - Users may specify either explicit versions offered by Kubernetes Engine or - version aliases, which have the following behavior: - - - "latest": picks the highest valid Kubernetes version - - "1.X": picks the highest valid patch+gke.N patch in the 1.X version - - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version - - "1.X.Y-gke.N": picks an explicit Kubernetes version - - "-": picks the Kubernetes master version - image_type (str): The desired image type for the node pool. - name (str): The name (project, location, cluster, node pool) of the node pool to - update. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_node_pool" not in self._inner_api_calls: - self._inner_api_calls[ - "update_node_pool" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_node_pool, - default_retry=self._method_configs["UpdateNodePool"].retry, - default_timeout=self._method_configs["UpdateNodePool"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.UpdateNodePoolRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - node_version=node_version, - image_type=image_type, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_node_pool"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_node_pool_autoscaling( - self, - project_id, - zone, - cluster_id, - node_pool_id, - autoscaling, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the autoscaling settings of a specific node pool. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `node_pool_id`: - >>> node_pool_id = '' - >>> - >>> # TODO: Initialize `autoscaling`: - >>> autoscaling = {} - >>> - >>> response = client.set_node_pool_autoscaling(project_id, zone, cluster_id, node_pool_id, autoscaling) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster to upgrade. - This field has been deprecated and replaced by the name field. - node_pool_id (str): Deprecated. The name of the node pool to upgrade. - This field has been deprecated and replaced by the name field. - autoscaling (Union[dict, ~google.cloud.container_v1beta1.types.NodePoolAutoscaling]): Autoscaling configuration for the node pool. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.container_v1beta1.types.NodePoolAutoscaling` - name (str): The name (project, location, cluster, node pool) of the node pool to set - autoscaler settings. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_node_pool_autoscaling" not in self._inner_api_calls: - self._inner_api_calls[ - "set_node_pool_autoscaling" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_node_pool_autoscaling, - default_retry=self._method_configs["SetNodePoolAutoscaling"].retry, - default_timeout=self._method_configs["SetNodePoolAutoscaling"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetNodePoolAutoscalingRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - autoscaling=autoscaling, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_node_pool_autoscaling"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_logging_service( - self, - project_id, - zone, - cluster_id, - logging_service, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the logging service for a specific cluster. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `logging_service`: - >>> logging_service = '' - >>> - >>> response = client.set_logging_service(project_id, zone, cluster_id, logging_service) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster to upgrade. - This field has been deprecated and replaced by the name field. - logging_service (str): The logging service the cluster should use to write metrics. Currently - available options: - - - "logging.googleapis.com" - the Google Cloud Logging service - - "none" - no metrics will be exported from the cluster - name (str): The name (project, location, cluster) of the cluster to set logging. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_logging_service" not in self._inner_api_calls: - self._inner_api_calls[ - "set_logging_service" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_logging_service, - default_retry=self._method_configs["SetLoggingService"].retry, - default_timeout=self._method_configs["SetLoggingService"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetLoggingServiceRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - logging_service=logging_service, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_logging_service"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_monitoring_service( - self, - project_id, - zone, - cluster_id, - monitoring_service, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the monitoring service for a specific cluster. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `monitoring_service`: - >>> monitoring_service = '' - >>> - >>> response = client.set_monitoring_service(project_id, zone, cluster_id, monitoring_service) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster to upgrade. - This field has been deprecated and replaced by the name field. - monitoring_service (str): The monitoring service the cluster should use to write metrics. - Currently available options: - - - "monitoring.googleapis.com" - the Google Cloud Monitoring service - - "none" - no metrics will be exported from the cluster - name (str): The name (project, location, cluster) of the cluster to set monitoring. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_monitoring_service" not in self._inner_api_calls: - self._inner_api_calls[ - "set_monitoring_service" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_monitoring_service, - default_retry=self._method_configs["SetMonitoringService"].retry, - default_timeout=self._method_configs["SetMonitoringService"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetMonitoringServiceRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - monitoring_service=monitoring_service, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_monitoring_service"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_addons_config( - self, - project_id, - zone, - cluster_id, - addons_config, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the addons for a specific cluster. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `addons_config`: - >>> addons_config = {} - >>> - >>> response = client.set_addons_config(project_id, zone, cluster_id, addons_config) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster to upgrade. - This field has been deprecated and replaced by the name field. - addons_config (Union[dict, ~google.cloud.container_v1beta1.types.AddonsConfig]): The desired configurations for the various addons available to run in the - cluster. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.container_v1beta1.types.AddonsConfig` - name (str): The name (project, location, cluster) of the cluster to set addons. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_addons_config" not in self._inner_api_calls: - self._inner_api_calls[ - "set_addons_config" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_addons_config, - default_retry=self._method_configs["SetAddonsConfig"].retry, - default_timeout=self._method_configs["SetAddonsConfig"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetAddonsConfigRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - addons_config=addons_config, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_addons_config"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_locations( - self, - project_id, - zone, - cluster_id, - locations, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the locations for a specific cluster. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `locations`: - >>> locations = [] - >>> - >>> response = client.set_locations(project_id, zone, cluster_id, locations) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster to upgrade. - This field has been deprecated and replaced by the name field. - locations (list[str]): The desired list of Google Compute Engine - `zones `__ in - which the cluster's nodes should be located. Changing the locations a - cluster is in will result in nodes being either created or removed from - the cluster, depending on whether locations are being added or removed. - - This list must always include the cluster's primary zone. - name (str): The name (project, location, cluster) of the cluster to set locations. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_locations" not in self._inner_api_calls: - self._inner_api_calls[ - "set_locations" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_locations, - default_retry=self._method_configs["SetLocations"].retry, - default_timeout=self._method_configs["SetLocations"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetLocationsRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - locations=locations, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_locations"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_master( - self, - project_id, - zone, - cluster_id, - master_version, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates the master for a specific cluster. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `master_version`: - >>> master_version = '' - >>> - >>> response = client.update_master(project_id, zone, cluster_id, master_version) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster to upgrade. - This field has been deprecated and replaced by the name field. - master_version (str): The Kubernetes version to change the master to. - - Users may specify either explicit versions offered by - Kubernetes Engine or version aliases, which have the following behavior: - - - "latest": picks the highest valid Kubernetes version - - "1.X": picks the highest valid patch+gke.N patch in the 1.X version - - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version - - "1.X.Y-gke.N": picks an explicit Kubernetes version - - "-": picks the default Kubernetes version - name (str): The name (project, location, cluster) of the cluster to update. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_master" not in self._inner_api_calls: - self._inner_api_calls[ - "update_master" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_master, - default_retry=self._method_configs["UpdateMaster"].retry, - default_timeout=self._method_configs["UpdateMaster"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.UpdateMasterRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - master_version=master_version, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_master"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_master_auth( - self, - project_id, - zone, - cluster_id, - action, - update, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Used to set master auth materials. Currently supports :- Changing the - admin password for a specific cluster. This can be either via password - generation or explicitly set. Modify basic\_auth.csv and reset the K8S - API server. - - Example: - >>> from google.cloud import container_v1beta1 - >>> from google.cloud.container_v1beta1 import enums - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `action`: - >>> action = enums.SetMasterAuthRequest.Action.UNKNOWN - >>> - >>> # TODO: Initialize `update`: - >>> update = {} - >>> - >>> response = client.set_master_auth(project_id, zone, cluster_id, action, update) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster to upgrade. - This field has been deprecated and replaced by the name field. - action (~google.cloud.container_v1beta1.types.Action): The exact form of action to be taken on the master auth. - update (Union[dict, ~google.cloud.container_v1beta1.types.MasterAuth]): A description of the update. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.container_v1beta1.types.MasterAuth` - name (str): The name (project, location, cluster) of the cluster to set auth. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_master_auth" not in self._inner_api_calls: - self._inner_api_calls[ - "set_master_auth" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_master_auth, - default_retry=self._method_configs["SetMasterAuth"].retry, - default_timeout=self._method_configs["SetMasterAuth"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetMasterAuthRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - action=action, - update=update, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_master_auth"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_cluster( - self, - project_id, - zone, - cluster_id, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes the cluster, including the Kubernetes endpoint and all worker - nodes. - - Firewalls and routes that were configured during cluster creation - are also deleted. - - Other Google Compute Engine resources that might be in use by the cluster - (e.g. load balancer resources) will not be deleted if they weren't present - at the initial create time. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> response = client.delete_cluster(project_id, zone, cluster_id) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster to delete. - This field has been deprecated and replaced by the name field. - name (str): The name (project, location, cluster) of the cluster to delete. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_cluster" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_cluster" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_cluster, - default_retry=self._method_configs["DeleteCluster"].retry, - default_timeout=self._method_configs["DeleteCluster"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.DeleteClusterRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id, name=name - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["delete_cluster"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_operations( - self, - project_id, - zone, - parent=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists all operations in a project in a specific zone or all zones. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> response = client.list_operations(project_id, zone) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the parent field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ to - return operations for, or ``-`` for all zones. This field has been - deprecated and replaced by the parent field. - parent (str): The parent (project and location) where the operations will be listed. - Specified in the format 'projects/*/locations/*'. Location "-" matches - all zones and all regions. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.ListOperationsResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_operations" not in self._inner_api_calls: - self._inner_api_calls[ - "list_operations" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_operations, - default_retry=self._method_configs["ListOperations"].retry, - default_timeout=self._method_configs["ListOperations"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.ListOperationsRequest( - project_id=project_id, zone=zone, parent=parent - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["list_operations"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_operation( - self, - project_id, - zone, - operation_id, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets the specified operation. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `operation_id`: - >>> operation_id = '' - >>> - >>> response = client.get_operation(project_id, zone, operation_id) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - operation_id (str): Deprecated. The server-assigned ``name`` of the operation. This field - has been deprecated and replaced by the name field. - name (str): The name (project, location, operation id) of the operation to get. - Specified in the format 'projects/*/locations/*/operations/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_operation" not in self._inner_api_calls: - self._inner_api_calls[ - "get_operation" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_operation, - default_retry=self._method_configs["GetOperation"].retry, - default_timeout=self._method_configs["GetOperation"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.GetOperationRequest( - project_id=project_id, zone=zone, operation_id=operation_id, name=name - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_operation"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def cancel_operation( - self, - project_id, - zone, - operation_id, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Cancels the specified operation. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `operation_id`: - >>> operation_id = '' - >>> - >>> client.cancel_operation(project_id, zone, operation_id) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the operation resides. This field has been deprecated and replaced - by the name field. - operation_id (str): Deprecated. The server-assigned ``name`` of the operation. This field - has been deprecated and replaced by the name field. - name (str): The name (project, location, operation id) of the operation to cancel. - Specified in the format 'projects/*/locations/*/operations/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "cancel_operation" not in self._inner_api_calls: - self._inner_api_calls[ - "cancel_operation" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.cancel_operation, - default_retry=self._method_configs["CancelOperation"].retry, - default_timeout=self._method_configs["CancelOperation"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.CancelOperationRequest( - project_id=project_id, zone=zone, operation_id=operation_id, name=name - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["cancel_operation"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_server_config( - self, - project_id, - zone, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Returns configuration info about the Kubernetes Engine service. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> response = client.get_server_config(project_id, zone) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ to - return operations for. This field has been deprecated and replaced by - the name field. - name (str): The name (project and location) of the server config to get Specified in - the format 'projects/*/locations/*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.ServerConfig` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_server_config" not in self._inner_api_calls: - self._inner_api_calls[ - "get_server_config" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_server_config, - default_retry=self._method_configs["GetServerConfig"].retry, - default_timeout=self._method_configs["GetServerConfig"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.GetServerConfigRequest( - project_id=project_id, zone=zone, name=name - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_server_config"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_node_pools( - self, - project_id, - zone, - cluster_id, - parent=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists the node pools for a cluster. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> response = client.list_node_pools(project_id, zone, cluster_id) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. - This field has been deprecated and replaced by the parent field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the parent field. - cluster_id (str): Deprecated. The name of the cluster. - This field has been deprecated and replaced by the parent field. - parent (str): The parent (project, location, cluster id) where the node pools will be - listed. Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.ListNodePoolsResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_node_pools" not in self._inner_api_calls: - self._inner_api_calls[ - "list_node_pools" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_node_pools, - default_retry=self._method_configs["ListNodePools"].retry, - default_timeout=self._method_configs["ListNodePools"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.ListNodePoolsRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id, parent=parent - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["list_node_pools"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_node_pool( - self, - project_id, - zone, - cluster_id, - node_pool_id, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Retrieves the node pool requested. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `node_pool_id`: - >>> node_pool_id = '' - >>> - >>> response = client.get_node_pool(project_id, zone, cluster_id, node_pool_id) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. - This field has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster. - This field has been deprecated and replaced by the name field. - node_pool_id (str): Deprecated. The name of the node pool. - This field has been deprecated and replaced by the name field. - name (str): The name (project, location, cluster, node pool id) of the node pool to - get. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.NodePool` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_node_pool" not in self._inner_api_calls: - self._inner_api_calls[ - "get_node_pool" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_node_pool, - default_retry=self._method_configs["GetNodePool"].retry, - default_timeout=self._method_configs["GetNodePool"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.GetNodePoolRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_node_pool"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_node_pool( - self, - project_id, - zone, - cluster_id, - node_pool, - parent=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a node pool for a cluster. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `node_pool`: - >>> node_pool = {} - >>> - >>> response = client.create_node_pool(project_id, zone, cluster_id, node_pool) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. - This field has been deprecated and replaced by the parent field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the parent field. - cluster_id (str): Deprecated. The name of the cluster. - This field has been deprecated and replaced by the parent field. - node_pool (Union[dict, ~google.cloud.container_v1beta1.types.NodePool]): The node pool to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.container_v1beta1.types.NodePool` - parent (str): The parent (project, location, cluster id) where the node pool will be - created. Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_node_pool" not in self._inner_api_calls: - self._inner_api_calls[ - "create_node_pool" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_node_pool, - default_retry=self._method_configs["CreateNodePool"].retry, - default_timeout=self._method_configs["CreateNodePool"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.CreateNodePoolRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool=node_pool, - parent=parent, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_node_pool"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_node_pool( - self, - project_id, - zone, - cluster_id, - node_pool_id, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a node pool from a cluster. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `node_pool_id`: - >>> node_pool_id = '' - >>> - >>> response = client.delete_node_pool(project_id, zone, cluster_id, node_pool_id) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. - This field has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster. - This field has been deprecated and replaced by the name field. - node_pool_id (str): Deprecated. The name of the node pool to delete. - This field has been deprecated and replaced by the name field. - name (str): The name (project, location, cluster, node pool id) of the node pool to - delete. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_node_pool" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_node_pool" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_node_pool, - default_retry=self._method_configs["DeleteNodePool"].retry, - default_timeout=self._method_configs["DeleteNodePool"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.DeleteNodePoolRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["delete_node_pool"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def rollback_node_pool_upgrade( - self, - project_id, - zone, - cluster_id, - node_pool_id, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Roll back the previously Aborted or Failed NodePool upgrade. - This will be an no-op if the last upgrade successfully completed. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `node_pool_id`: - >>> node_pool_id = '' - >>> - >>> response = client.rollback_node_pool_upgrade(project_id, zone, cluster_id, node_pool_id) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster to rollback. - This field has been deprecated and replaced by the name field. - node_pool_id (str): Deprecated. The name of the node pool to rollback. - This field has been deprecated and replaced by the name field. - name (str): The name (project, location, cluster, node pool id) of the node poll to - rollback upgrade. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "rollback_node_pool_upgrade" not in self._inner_api_calls: - self._inner_api_calls[ - "rollback_node_pool_upgrade" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.rollback_node_pool_upgrade, - default_retry=self._method_configs["RollbackNodePoolUpgrade"].retry, - default_timeout=self._method_configs["RollbackNodePoolUpgrade"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.RollbackNodePoolUpgradeRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["rollback_node_pool_upgrade"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_node_pool_management( - self, - project_id, - zone, - cluster_id, - node_pool_id, - management, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the NodeManagement options for a node pool. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `node_pool_id`: - >>> node_pool_id = '' - >>> - >>> # TODO: Initialize `management`: - >>> management = {} - >>> - >>> response = client.set_node_pool_management(project_id, zone, cluster_id, node_pool_id, management) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster to update. - This field has been deprecated and replaced by the name field. - node_pool_id (str): Deprecated. The name of the node pool to update. - This field has been deprecated and replaced by the name field. - management (Union[dict, ~google.cloud.container_v1beta1.types.NodeManagement]): NodeManagement configuration for the node pool. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.container_v1beta1.types.NodeManagement` - name (str): The name (project, location, cluster, node pool id) of the node pool to - set management properties. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_node_pool_management" not in self._inner_api_calls: - self._inner_api_calls[ - "set_node_pool_management" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_node_pool_management, - default_retry=self._method_configs["SetNodePoolManagement"].retry, - default_timeout=self._method_configs["SetNodePoolManagement"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetNodePoolManagementRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - management=management, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_node_pool_management"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_labels( - self, - project_id, - zone, - cluster_id, - resource_labels, - label_fingerprint, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets labels on a cluster. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `resource_labels`: - >>> resource_labels = {} - >>> - >>> # TODO: Initialize `label_fingerprint`: - >>> label_fingerprint = '' - >>> - >>> response = client.set_labels(project_id, zone, cluster_id, resource_labels, label_fingerprint) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. - This field has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster. - This field has been deprecated and replaced by the name field. - resource_labels (dict[str -> str]): The labels to set for that cluster. - label_fingerprint (str): The fingerprint of the previous set of labels for this resource, - used to detect conflicts. The fingerprint is initially generated by - Kubernetes Engine and changes after every request to modify or update - labels. You must always provide an up-to-date fingerprint hash when - updating or changing labels. Make a get() request to the - resource to get the latest fingerprint. - name (str): The name (project, location, cluster id) of the cluster to set labels. - Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_labels" not in self._inner_api_calls: - self._inner_api_calls[ - "set_labels" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_labels, - default_retry=self._method_configs["SetLabels"].retry, - default_timeout=self._method_configs["SetLabels"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetLabelsRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - resource_labels=resource_labels, - label_fingerprint=label_fingerprint, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_labels"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_legacy_abac( - self, - project_id, - zone, - cluster_id, - enabled, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Enables or disables the ABAC authorization mechanism on a cluster. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `enabled`: - >>> enabled = False - >>> - >>> response = client.set_legacy_abac(project_id, zone, cluster_id, enabled) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster to update. - This field has been deprecated and replaced by the name field. - enabled (bool): Whether ABAC authorization will be enabled in the cluster. - name (str): The name (project, location, cluster id) of the cluster to set legacy - abac. Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_legacy_abac" not in self._inner_api_calls: - self._inner_api_calls[ - "set_legacy_abac" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_legacy_abac, - default_retry=self._method_configs["SetLegacyAbac"].retry, - default_timeout=self._method_configs["SetLegacyAbac"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetLegacyAbacRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - enabled=enabled, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_legacy_abac"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def start_i_p_rotation( - self, - project_id, - zone, - cluster_id, - name=None, - rotate_credentials=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Start master IP rotation. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> response = client.start_i_p_rotation(project_id, zone, cluster_id) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. - This field has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster. - This field has been deprecated and replaced by the name field. - name (str): The name (project, location, cluster id) of the cluster to start IP - rotation. Specified in the format 'projects/*/locations/*/clusters/\*'. - rotate_credentials (bool): Whether to rotate credentials during IP rotation. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "start_i_p_rotation" not in self._inner_api_calls: - self._inner_api_calls[ - "start_i_p_rotation" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.start_i_p_rotation, - default_retry=self._method_configs["StartIPRotation"].retry, - default_timeout=self._method_configs["StartIPRotation"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.StartIPRotationRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - name=name, - rotate_credentials=rotate_credentials, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["start_i_p_rotation"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def complete_i_p_rotation( - self, - project_id, - zone, - cluster_id, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Completes master IP rotation. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> response = client.complete_i_p_rotation(project_id, zone, cluster_id) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. - This field has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster. - This field has been deprecated and replaced by the name field. - name (str): The name (project, location, cluster id) of the cluster to complete IP - rotation. Specified in the format 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "complete_i_p_rotation" not in self._inner_api_calls: - self._inner_api_calls[ - "complete_i_p_rotation" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.complete_i_p_rotation, - default_retry=self._method_configs["CompleteIPRotation"].retry, - default_timeout=self._method_configs["CompleteIPRotation"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.CompleteIPRotationRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id, name=name - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["complete_i_p_rotation"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_node_pool_size( - self, - project_id, - zone, - cluster_id, - node_pool_id, - node_count, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the size for a specific node pool. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `node_pool_id`: - >>> node_pool_id = '' - >>> - >>> # TODO: Initialize `node_count`: - >>> node_count = 0 - >>> - >>> response = client.set_node_pool_size(project_id, zone, cluster_id, node_pool_id, node_count) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. This field - has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster to update. - This field has been deprecated and replaced by the name field. - node_pool_id (str): Deprecated. The name of the node pool to update. - This field has been deprecated and replaced by the name field. - node_count (int): The desired node count for the pool. - name (str): The name (project, location, cluster, node pool id) of the node pool to - set size. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_node_pool_size" not in self._inner_api_calls: - self._inner_api_calls[ - "set_node_pool_size" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_node_pool_size, - default_retry=self._method_configs["SetNodePoolSize"].retry, - default_timeout=self._method_configs["SetNodePoolSize"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetNodePoolSizeRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - node_count=node_count, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_node_pool_size"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_network_policy( - self, - project_id, - zone, - cluster_id, - network_policy, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Enables/Disables Network Policy for a cluster. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `network_policy`: - >>> network_policy = {} - >>> - >>> response = client.set_network_policy(project_id, zone, cluster_id, network_policy) - - Args: - project_id (str): Deprecated. The Google Developers Console `project ID or project - number `__. - This field has been deprecated and replaced by the name field. - zone (str): Deprecated. The name of the Google Compute Engine - `zone `__ in - which the cluster resides. This field has been deprecated and replaced - by the name field. - cluster_id (str): Deprecated. The name of the cluster. - This field has been deprecated and replaced by the name field. - network_policy (Union[dict, ~google.cloud.container_v1beta1.types.NetworkPolicy]): Configuration options for the NetworkPolicy feature. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.container_v1beta1.types.NetworkPolicy` - name (str): The name (project, location, cluster id) of the cluster to set - networking policy. Specified in the format - 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_network_policy" not in self._inner_api_calls: - self._inner_api_calls[ - "set_network_policy" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_network_policy, - default_retry=self._method_configs["SetNetworkPolicy"].retry, - default_timeout=self._method_configs["SetNetworkPolicy"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetNetworkPolicyRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - network_policy=network_policy, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_network_policy"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_maintenance_policy( - self, - project_id, - zone, - cluster_id, - maintenance_policy, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the maintenance policy for a cluster. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `zone`: - >>> zone = '' - >>> - >>> # TODO: Initialize `cluster_id`: - >>> cluster_id = '' - >>> - >>> # TODO: Initialize `maintenance_policy`: - >>> maintenance_policy = {} - >>> - >>> response = client.set_maintenance_policy(project_id, zone, cluster_id, maintenance_policy) - - Args: - project_id (str): The Google Developers Console `project ID or project - number `__. - zone (str): The name of the Google Compute Engine - `zone `__ in - which the cluster resides. - cluster_id (str): The name of the cluster to update. - maintenance_policy (Union[dict, ~google.cloud.container_v1beta1.types.MaintenancePolicy]): The maintenance policy to be set for the cluster. An empty field - clears the existing maintenance policy. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.container_v1beta1.types.MaintenancePolicy` - name (str): The name (project, location, cluster id) of the cluster to set - maintenance policy. Specified in the format - 'projects/*/locations/*/clusters/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_maintenance_policy" not in self._inner_api_calls: - self._inner_api_calls[ - "set_maintenance_policy" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_maintenance_policy, - default_retry=self._method_configs["SetMaintenancePolicy"].retry, - default_timeout=self._method_configs["SetMaintenancePolicy"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.SetMaintenancePolicyRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - maintenance_policy=maintenance_policy, - name=name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_maintenance_policy"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_usable_subnetworks( - self, - parent, - filter_=None, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists subnetworks that are usable for creating clusters in a project. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `parent`: - >>> parent = '' - >>> - >>> # Iterate over all results - >>> for element in client.list_usable_subnetworks(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_usable_subnetworks(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): The parent project where subnetworks are usable. Specified in the format - 'projects/\*'. - filter_ (str): Filtering currently only supports equality on the networkProjectId and - must be in the form: "networkProjectId=[PROJECTID]", where - ``networkProjectId`` is the project which owns the listed subnetworks. - This defaults to the parent project ID. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.container_v1beta1.types.UsableSubnetwork` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_usable_subnetworks" not in self._inner_api_calls: - self._inner_api_calls[ - "list_usable_subnetworks" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_usable_subnetworks, - default_retry=self._method_configs["ListUsableSubnetworks"].retry, - default_timeout=self._method_configs["ListUsableSubnetworks"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.ListUsableSubnetworksRequest( - parent=parent, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_usable_subnetworks"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="subnetworks", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def list_locations( - self, - parent, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Used to fetch locations that offer GKE. - - Example: - >>> from google.cloud import container_v1beta1 - >>> - >>> client = container_v1beta1.ClusterManagerClient() - >>> - >>> # TODO: Initialize `parent`: - >>> parent = '' - >>> - >>> response = client.list_locations(parent) - - Args: - parent (str): Contains the name of the resource requested. Specified in the format - 'projects/\*'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.container_v1beta1.types.ListLocationsResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_locations" not in self._inner_api_calls: - self._inner_api_calls[ - "list_locations" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_locations, - default_retry=self._method_configs["ListLocations"].retry, - default_timeout=self._method_configs["ListLocations"].timeout, - client_info=self._client_info, - ) - - request = cluster_service_pb2.ListLocationsRequest(parent=parent) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["list_locations"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/container/google/cloud/container_v1beta1/gapic/cluster_manager_client_config.py b/container/google/cloud/container_v1beta1/gapic/cluster_manager_client_config.py deleted file mode 100644 index 18e6f5b58bb6..000000000000 --- a/container/google/cloud/container_v1beta1/gapic/cluster_manager_client_config.py +++ /dev/null @@ -1,183 +0,0 @@ -config = { - "interfaces": { - "google.container.v1beta1.ClusterManager": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "ListClusters": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetCluster": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateCluster": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateCluster": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateNodePool": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetNodePoolAutoscaling": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetLoggingService": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetMonitoringService": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetAddonsConfig": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetLocations": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateMaster": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetMasterAuth": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteCluster": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListOperations": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetOperation": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CancelOperation": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetServerConfig": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListNodePools": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetNodePool": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateNodePool": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteNodePool": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "RollbackNodePoolUpgrade": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetNodePoolManagement": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetLabels": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetLegacyAbac": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "StartIPRotation": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "CompleteIPRotation": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetNodePoolSize": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetNetworkPolicy": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetMaintenancePolicy": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListUsableSubnetworks": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListLocations": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/container/google/cloud/container_v1beta1/gapic/enums.py b/container/google/cloud/container_v1beta1/gapic/enums.py deleted file mode 100644 index f9663fc54d4c..000000000000 --- a/container/google/cloud/container_v1beta1/gapic/enums.py +++ /dev/null @@ -1,294 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class Cluster(object): - class Status(enum.IntEnum): - """ - The current status of the cluster. - - Attributes: - STATUS_UNSPECIFIED (int): Not set. - PROVISIONING (int): The PROVISIONING state indicates the cluster is being created. - RUNNING (int): The RUNNING state indicates the cluster has been created and is fully - usable. - RECONCILING (int): The RECONCILING state indicates that some work is actively being done on - the cluster, such as upgrading the master or node software. Details can - be found in the ``statusMessage`` field. - STOPPING (int): The STOPPING state indicates the cluster is being deleted. - ERROR (int): The ERROR state indicates the cluster may be unusable. Details can be - found in the ``statusMessage`` field. - DEGRADED (int): The DEGRADED state indicates the cluster requires user action to restore - full functionality. Details can be found in the ``statusMessage`` field. - """ - - STATUS_UNSPECIFIED = 0 - PROVISIONING = 1 - RUNNING = 2 - RECONCILING = 3 - STOPPING = 4 - ERROR = 5 - DEGRADED = 6 - - -class IstioConfig(object): - class IstioAuthMode(enum.IntEnum): - """ - Istio auth mode, https://istio.io/docs/concepts/security/mutual-tls.html - - Attributes: - AUTH_NONE (int): auth not enabled - AUTH_MUTUAL_TLS (int): auth mutual TLS enabled - """ - - AUTH_NONE = 0 - AUTH_MUTUAL_TLS = 1 - - -class Location(object): - class LocationType(enum.IntEnum): - """ - LocationType is the type of GKE location, regional or zonal. - - Attributes: - LOCATION_TYPE_UNSPECIFIED (int): LOCATION\_TYPE\_UNSPECIFIED means the location type was not determined. - ZONE (int): A GKE Location where Zonal clusters can be created. - REGION (int): A GKE Location where Regional clusters can be created. - """ - - LOCATION_TYPE_UNSPECIFIED = 0 - ZONE = 1 - REGION = 2 - - -class NetworkPolicy(object): - class Provider(enum.IntEnum): - """ - Allowed Network Policy providers. - - Attributes: - PROVIDER_UNSPECIFIED (int): Not set - CALICO (int): Tigera (Calico Felix). - """ - - PROVIDER_UNSPECIFIED = 0 - CALICO = 1 - - -class NodePool(object): - class Status(enum.IntEnum): - """ - The current status of the node pool instance. - - Attributes: - STATUS_UNSPECIFIED (int): Not set. - PROVISIONING (int): The PROVISIONING state indicates the node pool is being created. - RUNNING (int): The RUNNING state indicates the node pool has been created - and is fully usable. - RUNNING_WITH_ERROR (int): The RUNNING\_WITH\_ERROR state indicates the node pool has been created - and is partially usable. Some error state has occurred and some - functionality may be impaired. Customer may need to reissue a request or - trigger a new update. - RECONCILING (int): The RECONCILING state indicates that some work is actively being done on - the node pool, such as upgrading node software. Details can be found in - the ``statusMessage`` field. - STOPPING (int): The STOPPING state indicates the node pool is being deleted. - ERROR (int): The ERROR state indicates the node pool may be unusable. Details can be - found in the ``statusMessage`` field. - """ - - STATUS_UNSPECIFIED = 0 - PROVISIONING = 1 - RUNNING = 2 - RUNNING_WITH_ERROR = 3 - RECONCILING = 4 - STOPPING = 5 - ERROR = 6 - - -class NodeTaint(object): - class Effect(enum.IntEnum): - """ - Possible values for Effect in taint. - - Attributes: - EFFECT_UNSPECIFIED (int): Not set - NO_SCHEDULE (int): NoSchedule - PREFER_NO_SCHEDULE (int): PreferNoSchedule - NO_EXECUTE (int): NoExecute - """ - - EFFECT_UNSPECIFIED = 0 - NO_SCHEDULE = 1 - PREFER_NO_SCHEDULE = 2 - NO_EXECUTE = 3 - - -class Operation(object): - class Status(enum.IntEnum): - """ - Current status of the operation. - - Attributes: - STATUS_UNSPECIFIED (int): Not set. - PENDING (int): The operation has been created. - RUNNING (int): The operation is currently running. - DONE (int): The operation is done, either cancelled or completed. - ABORTING (int): The operation is aborting. - """ - - STATUS_UNSPECIFIED = 0 - PENDING = 1 - RUNNING = 2 - DONE = 3 - ABORTING = 4 - - class Type(enum.IntEnum): - """ - Operation type. - - Attributes: - TYPE_UNSPECIFIED (int): Not set. - CREATE_CLUSTER (int): Cluster create. - DELETE_CLUSTER (int): Cluster delete. - UPGRADE_MASTER (int): A master upgrade. - UPGRADE_NODES (int): A node upgrade. - REPAIR_CLUSTER (int): Cluster repair. - UPDATE_CLUSTER (int): Cluster update. - CREATE_NODE_POOL (int): Node pool create. - DELETE_NODE_POOL (int): Node pool delete. - SET_NODE_POOL_MANAGEMENT (int): Set node pool management. - AUTO_REPAIR_NODES (int): Automatic node pool repair. - AUTO_UPGRADE_NODES (int): Automatic node upgrade. - SET_LABELS (int): Set labels. - SET_MASTER_AUTH (int): Set/generate master auth materials - SET_NODE_POOL_SIZE (int): Set node pool size. - SET_NETWORK_POLICY (int): Updates network policy for a cluster. - SET_MAINTENANCE_POLICY (int): Set the maintenance policy. - """ - - TYPE_UNSPECIFIED = 0 - CREATE_CLUSTER = 1 - DELETE_CLUSTER = 2 - UPGRADE_MASTER = 3 - UPGRADE_NODES = 4 - REPAIR_CLUSTER = 5 - UPDATE_CLUSTER = 6 - CREATE_NODE_POOL = 7 - DELETE_NODE_POOL = 8 - SET_NODE_POOL_MANAGEMENT = 9 - AUTO_REPAIR_NODES = 10 - AUTO_UPGRADE_NODES = 11 - SET_LABELS = 12 - SET_MASTER_AUTH = 13 - SET_NODE_POOL_SIZE = 14 - SET_NETWORK_POLICY = 15 - SET_MAINTENANCE_POLICY = 16 - - -class SetMasterAuthRequest(object): - class Action(enum.IntEnum): - """ - Operation type: what type update to perform. - - Attributes: - UNKNOWN (int): Operation is unknown and will error out. - SET_PASSWORD (int): Set the password to a user generated value. - GENERATE_PASSWORD (int): Generate a new password and set it to that. - SET_USERNAME (int): Set the username. If an empty username is provided, basic authentication - is disabled for the cluster. If a non-empty username is provided, basic - authentication is enabled, with either a provided password or a generated - one. - """ - - UNKNOWN = 0 - SET_PASSWORD = 1 - GENERATE_PASSWORD = 2 - SET_USERNAME = 3 - - -class StatusCondition(object): - class Code(enum.IntEnum): - """ - Code for each condition - - Attributes: - UNKNOWN (int): UNKNOWN indicates a generic condition. - GCE_STOCKOUT (int): GCE\_STOCKOUT indicates a Google Compute Engine stockout. - GKE_SERVICE_ACCOUNT_DELETED (int): GKE\_SERVICE\_ACCOUNT\_DELETED indicates that the user deleted their - robot service account. - GCE_QUOTA_EXCEEDED (int): Google Compute Engine quota was exceeded. - SET_BY_OPERATOR (int): Cluster state was manually changed by an SRE due to a system logic error. - More codes TBA - """ - - UNKNOWN = 0 - GCE_STOCKOUT = 1 - GKE_SERVICE_ACCOUNT_DELETED = 2 - GCE_QUOTA_EXCEEDED = 3 - SET_BY_OPERATOR = 4 - - -class UsableSubnetworkSecondaryRange(object): - class Status(enum.IntEnum): - """ - Status shows the current usage of a secondary IP range. - - Attributes: - UNKNOWN (int): UNKNOWN is the zero value of the Status enum. It's not a valid status. - UNUSED (int): UNUSED denotes that this range is unclaimed by any cluster. - IN_USE_SERVICE (int): IN\_USE\_SERVICE denotes that this range is claimed by a cluster for - services. It cannot be used for other clusters. - IN_USE_SHAREABLE_POD (int): IN\_USE\_SHAREABLE\_POD denotes this range was created by the network - admin and is currently claimed by a cluster for pods. It can only be - used by other clusters as a pod range. - IN_USE_MANAGED_POD (int): IN\_USE\_MANAGED\_POD denotes this range was created by GKE and is - claimed for pods. It cannot be used for other clusters. - """ - - UNKNOWN = 0 - UNUSED = 1 - IN_USE_SERVICE = 2 - IN_USE_SHAREABLE_POD = 3 - IN_USE_MANAGED_POD = 4 - - -class WorkloadMetadataConfig(object): - class NodeMetadata(enum.IntEnum): - """ - NodeMetadata is the configuration for if and how to expose the node - metadata to the workload running on the node. - - Attributes: - UNSPECIFIED (int): Not set. - SECURE (int): Prevent workloads not in hostNetwork from accessing certain VM metadata, - specifically kube-env, which contains Kubelet credentials, and the - instance identity token. - - Metadata concealment is a temporary security solution available while the - bootstrapping process for cluster nodes is being redesigned with - significant security improvements. This feature is scheduled to be - deprecated in the future and later removed. - EXPOSE (int): Expose all VM metadata to pods. - """ - - UNSPECIFIED = 0 - SECURE = 1 - EXPOSE = 2 diff --git a/container/google/cloud/container_v1beta1/gapic/transports/__init__.py b/container/google/cloud/container_v1beta1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/container/google/cloud/container_v1beta1/gapic/transports/cluster_manager_grpc_transport.py b/container/google/cloud/container_v1beta1/gapic/transports/cluster_manager_grpc_transport.py deleted file mode 100644 index e0fb837b8486..000000000000 --- a/container/google/cloud/container_v1beta1/gapic/transports/cluster_manager_grpc_transport.py +++ /dev/null @@ -1,548 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers - -from google.cloud.container_v1beta1.proto import cluster_service_pb2_grpc - - -class ClusterManagerGrpcTransport(object): - """gRPC transport class providing stubs for - google.container.v1beta1 ClusterManager API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="container.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "cluster_manager_stub": cluster_service_pb2_grpc.ClusterManagerStub(channel) - } - - @classmethod - def create_channel( - cls, address="container.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def list_clusters(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.list_clusters`. - - Lists all clusters owned by a project in either the specified zone or all - zones. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].ListClusters - - @property - def get_cluster(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.get_cluster`. - - Gets the details for a specific cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].GetCluster - - @property - def create_cluster(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.create_cluster`. - - Creates a cluster, consisting of the specified number and type of Google - Compute Engine instances. - - By default, the cluster is created in the project's `default - network `__. - - One firewall is added for the cluster. After cluster creation, the - cluster creates routes for each node to allow the containers on that - node to communicate with all other instances in the cluster. - - Finally, an entry is added to the project's global metadata indicating - which CIDR range is being used by the cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].CreateCluster - - @property - def update_cluster(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.update_cluster`. - - Updates the settings for a specific cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].UpdateCluster - - @property - def update_node_pool(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.update_node_pool`. - - Updates the version and/or image type of a specific node pool. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].UpdateNodePool - - @property - def set_node_pool_autoscaling(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_node_pool_autoscaling`. - - Sets the autoscaling settings of a specific node pool. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetNodePoolAutoscaling - - @property - def set_logging_service(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_logging_service`. - - Sets the logging service for a specific cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetLoggingService - - @property - def set_monitoring_service(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_monitoring_service`. - - Sets the monitoring service for a specific cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetMonitoringService - - @property - def set_addons_config(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_addons_config`. - - Sets the addons for a specific cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetAddonsConfig - - @property - def set_locations(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_locations`. - - Sets the locations for a specific cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetLocations - - @property - def update_master(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.update_master`. - - Updates the master for a specific cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].UpdateMaster - - @property - def set_master_auth(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_master_auth`. - - Used to set master auth materials. Currently supports :- Changing the - admin password for a specific cluster. This can be either via password - generation or explicitly set. Modify basic\_auth.csv and reset the K8S - API server. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetMasterAuth - - @property - def delete_cluster(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.delete_cluster`. - - Deletes the cluster, including the Kubernetes endpoint and all worker - nodes. - - Firewalls and routes that were configured during cluster creation - are also deleted. - - Other Google Compute Engine resources that might be in use by the cluster - (e.g. load balancer resources) will not be deleted if they weren't present - at the initial create time. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].DeleteCluster - - @property - def list_operations(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.list_operations`. - - Lists all operations in a project in a specific zone or all zones. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].ListOperations - - @property - def get_operation(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.get_operation`. - - Gets the specified operation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].GetOperation - - @property - def cancel_operation(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.cancel_operation`. - - Cancels the specified operation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].CancelOperation - - @property - def get_server_config(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.get_server_config`. - - Returns configuration info about the Kubernetes Engine service. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].GetServerConfig - - @property - def list_node_pools(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.list_node_pools`. - - Lists the node pools for a cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].ListNodePools - - @property - def get_node_pool(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.get_node_pool`. - - Retrieves the node pool requested. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].GetNodePool - - @property - def create_node_pool(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.create_node_pool`. - - Creates a node pool for a cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].CreateNodePool - - @property - def delete_node_pool(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.delete_node_pool`. - - Deletes a node pool from a cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].DeleteNodePool - - @property - def rollback_node_pool_upgrade(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.rollback_node_pool_upgrade`. - - Roll back the previously Aborted or Failed NodePool upgrade. - This will be an no-op if the last upgrade successfully completed. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].RollbackNodePoolUpgrade - - @property - def set_node_pool_management(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_node_pool_management`. - - Sets the NodeManagement options for a node pool. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetNodePoolManagement - - @property - def set_labels(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_labels`. - - Sets labels on a cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetLabels - - @property - def set_legacy_abac(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_legacy_abac`. - - Enables or disables the ABAC authorization mechanism on a cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetLegacyAbac - - @property - def start_i_p_rotation(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.start_i_p_rotation`. - - Start master IP rotation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].StartIPRotation - - @property - def complete_i_p_rotation(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.complete_i_p_rotation`. - - Completes master IP rotation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].CompleteIPRotation - - @property - def set_node_pool_size(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_node_pool_size`. - - Sets the size for a specific node pool. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetNodePoolSize - - @property - def set_network_policy(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_network_policy`. - - Enables/Disables Network Policy for a cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetNetworkPolicy - - @property - def set_maintenance_policy(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.set_maintenance_policy`. - - Sets the maintenance policy for a cluster. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].SetMaintenancePolicy - - @property - def list_usable_subnetworks(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.list_usable_subnetworks`. - - Lists subnetworks that are usable for creating clusters in a project. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].ListUsableSubnetworks - - @property - def list_locations(self): - """Return the gRPC stub for :meth:`ClusterManagerClient.list_locations`. - - Used to fetch locations that offer GKE. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cluster_manager_stub"].ListLocations diff --git a/container/google/cloud/container_v1beta1/proto/__init__.py b/container/google/cloud/container_v1beta1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/container/google/cloud/container_v1beta1/proto/cluster_service.proto b/container/google/cloud/container_v1beta1/proto/cluster_service.proto deleted file mode 100644 index 37918d7c15a5..000000000000 --- a/container/google/cloud/container_v1beta1/proto/cluster_service.proto +++ /dev/null @@ -1,2740 +0,0 @@ -// Copyright 2018 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.container.v1beta1; - -import "google/api/annotations.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/protobuf/empty.proto"; - -option csharp_namespace = "Google.Cloud.Container.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/container/v1beta1;container"; -option java_multiple_files = true; -option java_outer_classname = "ClusterServiceProto"; -option java_package = "com.google.container.v1beta1"; -option php_namespace = "Google\\Cloud\\Container\\V1beta1"; - - -// Google Kubernetes Engine Cluster Manager v1beta1 -service ClusterManager { - // Lists all clusters owned by a project in either the specified zone or all - // zones. - rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/clusters" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters" - } - }; - } - - // Gets the details for a specific cluster. - rpc GetCluster(GetClusterRequest) returns (Cluster) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/clusters/*}" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - } - }; - } - - // Creates a cluster, consisting of the specified number and type of Google - // Compute Engine instances. - // - // By default, the cluster is created in the project's - // [default network](/compute/docs/networks-and-firewalls#networks). - // - // One firewall is added for the cluster. After cluster creation, - // the cluster creates routes for each node to allow the containers - // on that node to communicate with all other instances in the - // cluster. - // - // Finally, an entry is added to the project's global metadata indicating - // which CIDR range is being used by the cluster. - rpc CreateCluster(CreateClusterRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/clusters" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters" - body: "*" - } - }; - } - - // Updates the settings for a specific cluster. - rpc UpdateCluster(UpdateClusterRequest) returns (Operation) { - option (google.api.http) = { - put: "/v1beta1/{name=projects/*/locations/*/clusters/*}" - body: "*" - additional_bindings { - put: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - body: "*" - } - }; - } - - // Updates the version and/or image type of a specific node pool. - rpc UpdateNodePool(UpdateNodePoolRequest) returns (Operation) { - option (google.api.http) = { - put: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/update" - body: "*" - } - }; - } - - // Sets the autoscaling settings of a specific node pool. - rpc SetNodePoolAutoscaling(SetNodePoolAutoscalingRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setAutoscaling" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/autoscaling" - body: "*" - } - }; - } - - // Sets the logging service for a specific cluster. - rpc SetLoggingService(SetLoggingServiceRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setLogging" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/logging" - body: "*" - } - }; - } - - // Sets the monitoring service for a specific cluster. - rpc SetMonitoringService(SetMonitoringServiceRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setMonitoring" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/monitoring" - body: "*" - } - }; - } - - // Sets the addons for a specific cluster. - rpc SetAddonsConfig(SetAddonsConfigRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setAddons" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/addons" - body: "*" - } - }; - } - - // Sets the locations for a specific cluster. - rpc SetLocations(SetLocationsRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setLocations" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/locations" - body: "*" - } - }; - } - - // Updates the master for a specific cluster. - rpc UpdateMaster(UpdateMasterRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:updateMaster" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/master" - body: "*" - } - }; - } - - // Used to set master auth materials. Currently supports :- - // Changing the admin password for a specific cluster. - // This can be either via password generation or explicitly set. - // Modify basic_auth.csv and reset the K8S API server. - rpc SetMasterAuth(SetMasterAuthRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setMasterAuth" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMasterAuth" - body: "*" - } - }; - } - - // Deletes the cluster, including the Kubernetes endpoint and all worker - // nodes. - // - // Firewalls and routes that were configured during cluster creation - // are also deleted. - // - // Other Google Compute Engine resources that might be in use by the cluster - // (e.g. load balancer resources) will not be deleted if they weren't present - // at the initial create time. - rpc DeleteCluster(DeleteClusterRequest) returns (Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/clusters/*}" - additional_bindings { - delete: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - } - }; - } - - // Lists all operations in a project in a specific zone or all zones. - rpc ListOperations(ListOperationsRequest) returns (ListOperationsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/operations" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/operations" - } - }; - } - - // Gets the specified operation. - rpc GetOperation(GetOperationRequest) returns (Operation) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/operations/*}" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/operations/{operation_id}" - } - }; - } - - // Cancels the specified operation. - rpc CancelOperation(CancelOperationRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/operations/*}:cancel" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/operations/{operation_id}:cancel" - body: "*" - } - }; - } - - // Returns configuration info about the Kubernetes Engine service. - rpc GetServerConfig(GetServerConfigRequest) returns (ServerConfig) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*}/serverConfig" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/serverconfig" - } - }; - } - - // Lists the node pools for a cluster. - rpc ListNodePools(ListNodePoolsRequest) returns (ListNodePoolsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/clusters/*}/nodePools" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" - } - }; - } - - // Retrieves the node pool requested. - rpc GetNodePool(GetNodePoolRequest) returns (NodePool) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}" - additional_bindings { - get: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" - } - }; - } - - // Creates a node pool for a cluster. - rpc CreateNodePool(CreateNodePoolRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/clusters/*}/nodePools" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" - body: "*" - } - }; - } - - // Deletes a node pool from a cluster. - rpc DeleteNodePool(DeleteNodePoolRequest) returns (Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}" - additional_bindings { - delete: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" - } - }; - } - - // Roll back the previously Aborted or Failed NodePool upgrade. - // This will be an no-op if the last upgrade successfully completed. - rpc RollbackNodePoolUpgrade(RollbackNodePoolUpgradeRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:rollback" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}:rollback" - body: "*" - } - }; - } - - // Sets the NodeManagement options for a node pool. - rpc SetNodePoolManagement(SetNodePoolManagementRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setManagement" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setManagement" - body: "*" - } - }; - } - - // Sets labels on a cluster. - rpc SetLabels(SetLabelsRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setResourceLabels" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/resourceLabels" - body: "*" - } - }; - } - - // Enables or disables the ABAC authorization mechanism on a cluster. - rpc SetLegacyAbac(SetLegacyAbacRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setLegacyAbac" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/legacyAbac" - body: "*" - } - }; - } - - // Start master IP rotation. - rpc StartIPRotation(StartIPRotationRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:startIpRotation" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:startIpRotation" - body: "*" - } - }; - } - - // Completes master IP rotation. - rpc CompleteIPRotation(CompleteIPRotationRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:completeIpRotation" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:completeIpRotation" - body: "*" - } - }; - } - - // Sets the size for a specific node pool. - rpc SetNodePoolSize(SetNodePoolSizeRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setSize" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setSize" - body: "*" - } - }; - } - - // Enables/Disables Network Policy for a cluster. - rpc SetNetworkPolicy(SetNetworkPolicyRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setNetworkPolicy" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setNetworkPolicy" - body: "*" - } - }; - } - - // Sets the maintenance policy for a cluster. - rpc SetMaintenancePolicy(SetMaintenancePolicyRequest) returns (Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/clusters/*}:setMaintenancePolicy" - body: "*" - additional_bindings { - post: "/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMaintenancePolicy" - body: "*" - } - }; - } - - // Lists subnetworks that are usable for creating clusters in a project. - rpc ListUsableSubnetworks(ListUsableSubnetworksRequest) returns (ListUsableSubnetworksResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*}/aggregated/usableSubnetworks" - }; - } - - // Used to fetch locations that offer GKE. - rpc ListLocations(ListLocationsRequest) returns (ListLocationsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*}/locations" - }; - } -} - -// Parameters that describe the nodes in a cluster. -message NodeConfig { - // The name of a Google Compute Engine [machine - // type](/compute/docs/machine-types) (e.g. - // `n1-standard-1`). - // - // If unspecified, the default machine type is - // `n1-standard-1`. - string machine_type = 1; - - // Size of the disk attached to each node, specified in GB. - // The smallest allowed disk size is 10GB. - // - // If unspecified, the default disk size is 100GB. - int32 disk_size_gb = 2; - - // The set of Google API scopes to be made available on all of the - // node VMs under the "default" service account. - // - // The following scopes are recommended, but not required, and by default are - // not included: - // - // * `https://www.googleapis.com/auth/compute` is required for mounting - // persistent storage on your nodes. - // * `https://www.googleapis.com/auth/devstorage.read_only` is required for - // communicating with **gcr.io** - // (the [Google Container Registry](/container-registry/)). - // - // If unspecified, no scopes are added, unless Cloud Logging or Cloud - // Monitoring are enabled, in which case their required scopes will be added. - repeated string oauth_scopes = 3; - - // The Google Cloud Platform Service Account to be used by the node VMs. If - // no Service Account is specified, the "default" service account is used. - string service_account = 9; - - // The metadata key/value pairs assigned to instances in the cluster. - // - // Keys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes - // in length. These are reflected as part of a URL in the metadata server. - // Additionally, to avoid ambiguity, keys must not conflict with any other - // metadata keys for the project or be one of the reserved keys: - // "cluster-location" - // "cluster-name" - // "cluster-uid" - // "configure-sh" - // "enable-oslogin" - // "gci-ensure-gke-docker" - // "gci-update-strategy" - // "instance-template" - // "kube-env" - // "startup-script" - // "user-data" - // - // Values are free-form strings, and only have meaning as interpreted by - // the image running in the instance. The only restriction placed on them is - // that each value's size must be less than or equal to 32 KB. - // - // The total size of all keys and values must be less than 512 KB. - map metadata = 4; - - // The image type to use for this node. Note that for a given image type, - // the latest version of it will be used. - string image_type = 5; - - // The map of Kubernetes labels (key/value pairs) to be applied to each node. - // These will added in addition to any default label(s) that - // Kubernetes may apply to the node. - // In case of conflict in label keys, the applied set may differ depending on - // the Kubernetes version -- it's best to assume the behavior is undefined - // and conflicts should be avoided. - // For more information, including usage and the valid values, see: - // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - map labels = 6; - - // The number of local SSD disks to be attached to the node. - // - // The limit for this value is dependant upon the maximum number of - // disks available on a machine per zone. See: - // https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_limits - // for more information. - int32 local_ssd_count = 7; - - // The list of instance tags applied to all nodes. Tags are used to identify - // valid sources or targets for network firewalls and are specified by - // the client during cluster or node pool creation. Each tag within the list - // must comply with RFC1035. - repeated string tags = 8; - - // Whether the nodes are created as preemptible VM instances. See: - // https://cloud.google.com/compute/docs/instances/preemptible for more - // inforamtion about preemptible VM instances. - bool preemptible = 10; - - // A list of hardware accelerators to be attached to each node. - // See https://cloud.google.com/compute/docs/gpus for more information about - // support for GPUs. - repeated AcceleratorConfig accelerators = 11; - - // Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') - // - // If unspecified, the default disk type is 'pd-standard' - string disk_type = 12; - - // Minimum CPU platform to be used by this instance. The instance may be - // scheduled on the specified or newer CPU platform. Applicable values are the - // friendly names of CPU platforms, such as - // minCpuPlatform: "Intel Haswell" or - // minCpuPlatform: "Intel Sandy Bridge". For more - // information, read [how to specify min CPU - // platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) - string min_cpu_platform = 13; - - // The workload metadata configuration for this node. - WorkloadMetadataConfig workload_metadata_config = 14; - - // List of kubernetes taints to be applied to each node. - // - // For more information, including usage and the valid values, see: - // https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - repeated NodeTaint taints = 15; -} - -// Kubernetes taint is comprised of three fields: key, value, and effect. Effect -// can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. -// -// For more information, including usage and the valid values, see: -// https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ -message NodeTaint { - // Possible values for Effect in taint. - enum Effect { - // Not set - EFFECT_UNSPECIFIED = 0; - - // NoSchedule - NO_SCHEDULE = 1; - - // PreferNoSchedule - PREFER_NO_SCHEDULE = 2; - - // NoExecute - NO_EXECUTE = 3; - } - - // Key for taint. - string key = 1; - - // Value for taint. - string value = 2; - - // Effect for taint. - Effect effect = 3; -} - -// The authentication information for accessing the master endpoint. -// Authentication can be done using HTTP basic auth or using client -// certificates. -message MasterAuth { - // The username to use for HTTP basic authentication to the master endpoint. - // For clusters v1.6.0 and later, basic authentication can be disabled by - // leaving username unspecified (or setting it to the empty string). - string username = 1; - - // The password to use for HTTP basic authentication to the master endpoint. - // Because the master endpoint is open to the Internet, you should create a - // strong password. If a password is provided for cluster creation, username - // must be non-empty. - string password = 2; - - // Configuration for client certificate authentication on the cluster. For - // clusters before v1.12, if no configuration is specified, a client - // certificate is issued. - ClientCertificateConfig client_certificate_config = 3; - - // [Output only] Base64-encoded public certificate that is the root of - // trust for the cluster. - string cluster_ca_certificate = 100; - - // [Output only] Base64-encoded public certificate used by clients to - // authenticate to the cluster endpoint. - string client_certificate = 101; - - // [Output only] Base64-encoded private key used by clients to authenticate - // to the cluster endpoint. - string client_key = 102; -} - -// Configuration for client certificates on the cluster. -message ClientCertificateConfig { - // Issue a client certificate. - bool issue_client_certificate = 1; -} - -// Configuration for the addons that can be automatically spun up in the -// cluster, enabling additional functionality. -message AddonsConfig { - // Configuration for the HTTP (L7) load balancing controller addon, which - // makes it easy to set up HTTP load balancers for services in a cluster. - HttpLoadBalancing http_load_balancing = 1; - - // Configuration for the horizontal pod autoscaling feature, which - // increases or decreases the number of replica pods a replication controller - // has based on the resource usage of the existing pods. - HorizontalPodAutoscaling horizontal_pod_autoscaling = 2; - - // Configuration for the Kubernetes Dashboard. - KubernetesDashboard kubernetes_dashboard = 3; - - // Configuration for NetworkPolicy. This only tracks whether the addon - // is enabled or not on the Master, it does not track whether network policy - // is enabled for the nodes. - NetworkPolicyConfig network_policy_config = 4; - - // Configuration for Istio, an open platform to connect, manage, and secure - // microservices. - IstioConfig istio_config = 5; - - // Configuration for the Cloud Run addon. The `IstioConfig` addon must be - // enabled in order to enable Cloud Run addon. This option can only be enabled - // at cluster creation time. - CloudRunConfig cloud_run_config = 7; -} - -// Configuration options for the HTTP (L7) load balancing controller addon, -// which makes it easy to set up HTTP load balancers for services in a cluster. -message HttpLoadBalancing { - // Whether the HTTP Load Balancing controller is enabled in the cluster. - // When enabled, it runs a small pod in the cluster that manages the load - // balancers. - bool disabled = 1; -} - -// Configuration options for the horizontal pod autoscaling feature, which -// increases or decreases the number of replica pods a replication controller -// has based on the resource usage of the existing pods. -message HorizontalPodAutoscaling { - // Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. - // When enabled, it ensures that a Heapster pod is running in the cluster, - // which is also used by the Cloud Monitoring service. - bool disabled = 1; -} - -// Configuration for the Kubernetes Dashboard. -message KubernetesDashboard { - // Whether the Kubernetes Dashboard is enabled for this cluster. - bool disabled = 1; -} - -// Configuration for NetworkPolicy. This only tracks whether the addon -// is enabled or not on the Master, it does not track whether network policy -// is enabled for the nodes. -message NetworkPolicyConfig { - // Whether NetworkPolicy is enabled for this cluster. - bool disabled = 1; -} - -// Configuration options for private clusters. -message PrivateClusterConfig { - // Whether nodes have internal IP addresses only. If enabled, all nodes are - // given only RFC 1918 private addresses and communicate with the master via - // private networking. - bool enable_private_nodes = 1; - - // Whether the master's internal IP address is used as the cluster endpoint. - bool enable_private_endpoint = 2; - - // The IP range in CIDR notation to use for the hosted master network. This - // range will be used for assigning internal IP addresses to the master or - // set of masters, as well as the ILB VIP. This range must not overlap with - // any other ranges in use within the cluster's network. - string master_ipv4_cidr_block = 3; - - // Output only. The internal IP address of this cluster's master endpoint. - string private_endpoint = 4; - - // Output only. The external IP address of this cluster's master endpoint. - string public_endpoint = 5; -} - -// Configuration options for Istio addon. -message IstioConfig { - // Istio auth mode, https://istio.io/docs/concepts/security/mutual-tls.html - enum IstioAuthMode { - // auth not enabled - AUTH_NONE = 0; - - // auth mutual TLS enabled - AUTH_MUTUAL_TLS = 1; - } - - // Whether Istio is enabled for this cluster. - bool disabled = 1; - - // The specified Istio auth mode, either none, or mutual TLS. - IstioAuthMode auth = 2; -} - -// Configuration options for the Cloud Run feature. -message CloudRunConfig { - // Whether Cloud Run addon is enabled for this cluster. - bool disabled = 1; -} - -// Configuration options for the master authorized networks feature. Enabled -// master authorized networks will disallow all external traffic to access -// Kubernetes master through HTTPS except traffic from the given CIDR blocks, -// Google Compute Engine Public IPs and Google Prod IPs. -message MasterAuthorizedNetworksConfig { - // CidrBlock contains an optional name and one CIDR block. - message CidrBlock { - // display_name is an optional field for users to identify CIDR blocks. - string display_name = 1; - - // cidr_block must be specified in CIDR notation. - string cidr_block = 2; - } - - // Whether or not master authorized networks is enabled. - bool enabled = 1; - - // cidr_blocks define up to 10 external networks that could access - // Kubernetes master through HTTPS. - repeated CidrBlock cidr_blocks = 2; -} - -// Configuration for the legacy Attribute Based Access Control authorization -// mode. -message LegacyAbac { - // Whether the ABAC authorizer is enabled for this cluster. When enabled, - // identities in the system, including service accounts, nodes, and - // controllers, will have statically granted permissions beyond those - // provided by the RBAC configuration or IAM. - bool enabled = 1; -} - -// Configuration options for the NetworkPolicy feature. -// https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ -message NetworkPolicy { - // Allowed Network Policy providers. - enum Provider { - // Not set - PROVIDER_UNSPECIFIED = 0; - - // Tigera (Calico Felix). - CALICO = 1; - } - - // The selected network policy provider. - Provider provider = 1; - - // Whether network policy is enabled on the cluster. - bool enabled = 2; -} - -// Configuration for controlling how IPs are allocated in the cluster. -message IPAllocationPolicy { - // Whether alias IPs will be used for pod IPs in the cluster. - bool use_ip_aliases = 1; - - // Whether a new subnetwork will be created automatically for the cluster. - // - // This field is only applicable when `use_ip_aliases` is true. - bool create_subnetwork = 2; - - // A custom subnetwork name to be used if `create_subnetwork` is true. If - // this field is empty, then an automatic name will be chosen for the new - // subnetwork. - string subnetwork_name = 3; - - // This field is deprecated, use cluster_ipv4_cidr_block. - string cluster_ipv4_cidr = 4 [deprecated = true]; - - // This field is deprecated, use node_ipv4_cidr_block. - string node_ipv4_cidr = 5 [deprecated = true]; - - // This field is deprecated, use services_ipv4_cidr_block. - string services_ipv4_cidr = 6 [deprecated = true]; - - // The name of the secondary range to be used for the cluster CIDR - // block. The secondary range will be used for pod IP - // addresses. This must be an existing secondary range associated - // with the cluster subnetwork. - // - // This field is only applicable with use_ip_aliases and - // create_subnetwork is false. - string cluster_secondary_range_name = 7; - - // The name of the secondary range to be used as for the services - // CIDR block. The secondary range will be used for service - // ClusterIPs. This must be an existing secondary range associated - // with the cluster subnetwork. - // - // This field is only applicable with use_ip_aliases and - // create_subnetwork is false. - string services_secondary_range_name = 8; - - // The IP address range for the cluster pod IPs. If this field is set, then - // `cluster.cluster_ipv4_cidr` must be left blank. - // - // This field is only applicable when `use_ip_aliases` is true. - // - // Set to blank to have a range chosen with the default size. - // - // Set to /netmask (e.g. `/14`) to have a range chosen with a specific - // netmask. - // - // Set to a - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. - // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range - // to use. - string cluster_ipv4_cidr_block = 9; - - // The IP address range of the instance IPs in this cluster. - // - // This is applicable only if `create_subnetwork` is true. - // - // Set to blank to have a range chosen with the default size. - // - // Set to /netmask (e.g. `/14`) to have a range chosen with a specific - // netmask. - // - // Set to a - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. - // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range - // to use. - string node_ipv4_cidr_block = 10; - - // The IP address range of the services IPs in this cluster. If blank, a range - // will be automatically chosen with the default size. - // - // This field is only applicable when `use_ip_aliases` is true. - // - // Set to blank to have a range chosen with the default size. - // - // Set to /netmask (e.g. `/14`) to have a range chosen with a specific - // netmask. - // - // Set to a - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. - // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range - // to use. - string services_ipv4_cidr_block = 11; - - // If true, allow allocation of cluster CIDR ranges that overlap with certain - // kinds of network routes. By default we do not allow cluster CIDR ranges to - // intersect with any user declared routes. With allow_route_overlap == true, - // we allow overlapping with CIDR ranges that are larger than the cluster CIDR - // range. - // - // If this field is set to true, then cluster and services CIDRs must be - // fully-specified (e.g. `10.96.0.0/14`, but not `/14`), which means: - // 1) When `use_ip_aliases` is true, `cluster_ipv4_cidr_block` and - // `services_ipv4_cidr_block` must be fully-specified. - // 2) When `use_ip_aliases` is false, `cluster.cluster_ipv4_cidr` muse be - // fully-specified. - bool allow_route_overlap = 12; - - // The IP address range of the Cloud TPUs in this cluster. If unspecified, a - // range will be automatically chosen with the default size. - // - // This field is only applicable when `use_ip_aliases` is true. - // - // If unspecified, the range will use the default size. - // - // Set to /netmask (e.g. `/14`) to have a range chosen with a specific - // netmask. - // - // Set to a - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. - // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range - // to use. - string tpu_ipv4_cidr_block = 13; -} - -// Configuration for Binary Authorization. -message BinaryAuthorization { - // Enable Binary Authorization for this cluster. If enabled, all container - // images will be validated by Google Binauthz. - bool enabled = 1; -} - -// Configuration for the PodSecurityPolicy feature. -message PodSecurityPolicyConfig { - // Enable the PodSecurityPolicy controller for this cluster. If enabled, pods - // must be valid under a PodSecurityPolicy to be created. - bool enabled = 1; -} - -// A Google Kubernetes Engine cluster. -message Cluster { - // The current status of the cluster. - enum Status { - // Not set. - STATUS_UNSPECIFIED = 0; - - // The PROVISIONING state indicates the cluster is being created. - PROVISIONING = 1; - - // The RUNNING state indicates the cluster has been created and is fully - // usable. - RUNNING = 2; - - // The RECONCILING state indicates that some work is actively being done on - // the cluster, such as upgrading the master or node software. Details can - // be found in the `statusMessage` field. - RECONCILING = 3; - - // The STOPPING state indicates the cluster is being deleted. - STOPPING = 4; - - // The ERROR state indicates the cluster may be unusable. Details - // can be found in the `statusMessage` field. - ERROR = 5; - - // The DEGRADED state indicates the cluster requires user action to restore - // full functionality. Details can be found in the `statusMessage` field. - DEGRADED = 6; - } - - // The name of this cluster. The name must be unique within this project - // and zone, and can be up to 40 characters with the following restrictions: - // - // * Lowercase letters, numbers, and hyphens only. - // * Must start with a letter. - // * Must end with a number or a letter. - string name = 1; - - // An optional description of this cluster. - string description = 2; - - // The number of nodes to create in this cluster. You must ensure that your - // Compute Engine resource quota - // is sufficient for this number of instances. You must also have available - // firewall and routes quota. - // For requests, this field should only be used in lieu of a - // "node_pool" object, since this configuration (along with the - // "node_config") will be used to create a "NodePool" object with an - // auto-generated name. Do not use this and a node_pool at the same time. - int32 initial_node_count = 3; - - // Parameters used in creating the cluster's nodes. - // See `nodeConfig` for the description of its properties. - // For requests, this field should only be used in lieu of a - // "node_pool" object, since this configuration (along with the - // "initial_node_count") will be used to create a "NodePool" object with an - // auto-generated name. Do not use this and a node_pool at the same time. - // For responses, this field will be populated with the node configuration of - // the first node pool. - // - // If unspecified, the defaults are used. - NodeConfig node_config = 4; - - // The authentication information for accessing the master endpoint. - // If unspecified, the defaults are used: - // For clusters before v1.12, if master_auth is unspecified, `username` will - // be set to "admin", a random password will be generated, and a client - // certificate will be issued. - MasterAuth master_auth = 5; - - // The logging service the cluster should use to write logs. - // Currently available options: - // - // * `logging.googleapis.com` - the Google Cloud Logging service. - // * `none` - no logs will be exported from the cluster. - // * if left as an empty string,`logging.googleapis.com` will be used. - string logging_service = 6; - - // The monitoring service the cluster should use to write metrics. - // Currently available options: - // - // * `monitoring.googleapis.com` - the Google Cloud Monitoring service. - // * `none` - no metrics will be exported from the cluster. - // * if left as an empty string, `monitoring.googleapis.com` will be used. - string monitoring_service = 7; - - // The name of the Google Compute Engine - // [network](/compute/docs/networks-and-firewalls#networks) to which the - // cluster is connected. If left unspecified, the `default` network - // will be used. On output this shows the network ID instead of - // the name. - string network = 8; - - // The IP address range of the container pods in this cluster, in - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `10.96.0.0/14`). Leave blank to have - // one automatically chosen or specify a `/14` block in `10.0.0.0/8`. - string cluster_ipv4_cidr = 9; - - // Configurations for the various addons available to run in the cluster. - AddonsConfig addons_config = 10; - - // The name of the Google Compute Engine - // [subnetwork](/compute/docs/subnetworks) to which the - // cluster is connected. On output this shows the subnetwork ID instead of - // the name. - string subnetwork = 11; - - // The node pools associated with this cluster. - // This field should not be set if "node_config" or "initial_node_count" are - // specified. - repeated NodePool node_pools = 12; - - // The list of Google Compute Engine - // [zones](/compute/docs/zones#available) in which the cluster's nodes - // should be located. - repeated string locations = 13; - - // Kubernetes alpha features are enabled on this cluster. This includes alpha - // API groups (e.g. v1beta1) and features that may not be production ready in - // the kubernetes version of the master and nodes. - // The cluster has no SLA for uptime and master/node upgrades are disabled. - // Alpha enabled clusters are automatically deleted thirty days after - // creation. - bool enable_kubernetes_alpha = 14; - - // The resource labels for the cluster to use to annotate any related - // Google Compute Engine resources. - map resource_labels = 15; - - // The fingerprint of the set of labels for this cluster. - string label_fingerprint = 16; - - // Configuration for the legacy ABAC authorization mode. - LegacyAbac legacy_abac = 18; - - // Configuration options for the NetworkPolicy feature. - NetworkPolicy network_policy = 19; - - // Configuration for cluster IP allocation. - IPAllocationPolicy ip_allocation_policy = 20; - - // The configuration options for master authorized networks feature. - MasterAuthorizedNetworksConfig master_authorized_networks_config = 22; - - // Configure the maintenance policy for this cluster. - MaintenancePolicy maintenance_policy = 23; - - // Configuration for Binary Authorization. - BinaryAuthorization binary_authorization = 24; - - // Configuration for the PodSecurityPolicy feature. - PodSecurityPolicyConfig pod_security_policy_config = 25; - - // Cluster-level autoscaling configuration. - ClusterAutoscaling autoscaling = 26; - - // Configuration for cluster networking. - NetworkConfig network_config = 27; - - // If this is a private cluster setup. Private clusters are clusters that, by - // default have no external IP addresses on the nodes and where nodes and the - // master communicate over private IP addresses. - // This field is deprecated, use private_cluster_config.enable_private_nodes - // instead. - bool private_cluster = 28 [deprecated = true]; - - // The IP prefix in CIDR notation to use for the hosted master network. - // This prefix will be used for assigning private IP addresses to the - // master or set of masters, as well as the ILB VIP. - // This field is deprecated, use - // private_cluster_config.master_ipv4_cidr_block instead. - string master_ipv4_cidr_block = 29 [deprecated = true]; - - // The default constraint on the maximum number of pods that can be run - // simultaneously on a node in the node pool of this cluster. Only honored - // if cluster created with IP Alias support. - MaxPodsConstraint default_max_pods_constraint = 30; - - // Configuration for exporting resource usages. Resource usage export is - // disabled when this config unspecified. - ResourceUsageExportConfig resource_usage_export_config = 33; - - // Configuration for private cluster. - PrivateClusterConfig private_cluster_config = 37; - - // Cluster-level Vertical Pod Autoscaling configuration. - VerticalPodAutoscaling vertical_pod_autoscaling = 39; - - // [Output only] Server-defined URL for the resource. - string self_link = 100; - - // [Output only] The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field is deprecated, use location instead. - string zone = 101 [deprecated = true]; - - // [Output only] The IP address of this cluster's master endpoint. - // The endpoint can be accessed from the internet at - // `https://username:password@endpoint/`. - // - // See the `masterAuth` property of this resource for username and - // password information. - string endpoint = 102; - - // The initial Kubernetes version for this cluster. Valid versions are those - // found in validMasterVersions returned by getServerConfig. The version can - // be upgraded over time; such upgrades are reflected in - // currentMasterVersion and currentNodeVersion. - // - // Users may specify either explicit versions offered by - // Kubernetes Engine or version aliases, which have the following behavior: - // - // - "latest": picks the highest valid Kubernetes version - // - "1.X": picks the highest valid patch+gke.N patch in the 1.X version - // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version - // - "1.X.Y-gke.N": picks an explicit Kubernetes version - // - "","-": picks the default Kubernetes version - string initial_cluster_version = 103; - - // [Output only] The current software version of the master endpoint. - string current_master_version = 104; - - // [Output only] Deprecated, use - // [NodePool.version](/kubernetes-engine/docs/reference/rest/v1beta1/projects.zones.clusters.nodePool) - // instead. The current version of the node software components. - // If they are currently at multiple versions because they're in the process - // of being upgraded, this reflects the minimum version of all nodes. - string current_node_version = 105 [deprecated = true]; - - // [Output only] The time the cluster was created, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string create_time = 106; - - // [Output only] The current status of this cluster. - Status status = 107; - - // [Output only] Additional information about the current status of this - // cluster, if available. - string status_message = 108; - - // [Output only] The size of the address space on each node for hosting - // containers. This is provisioned from within the `container_ipv4_cidr` - // range. - int32 node_ipv4_cidr_size = 109; - - // [Output only] The IP address range of the Kubernetes services in - // this cluster, in - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `1.2.3.4/29`). Service addresses are - // typically put in the last `/16` from the container CIDR. - string services_ipv4_cidr = 110; - - // Deprecated. Use node_pools.instance_group_urls. - repeated string instance_group_urls = 111 [deprecated = true]; - - // [Output only] The number of nodes currently in the cluster. Deprecated. - // Call Kubernetes API directly to retrieve node information. - int32 current_node_count = 112 [deprecated = true]; - - // [Output only] The time the cluster will be automatically - // deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string expire_time = 113; - - // [Output only] The name of the Google Compute Engine - // [zone](/compute/docs/regions-zones/regions-zones#available) or - // [region](/compute/docs/regions-zones/regions-zones#available) in which - // the cluster resides. - string location = 114; - - // Enable the ability to use Cloud TPUs in this cluster. - bool enable_tpu = 115; - - // [Output only] The IP address range of the Cloud TPUs in this cluster, in - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `1.2.3.4/29`). - string tpu_ipv4_cidr_block = 116; - - // Which conditions caused the current cluster state. - repeated StatusCondition conditions = 118; -} - -// ClusterUpdate describes an update to the cluster. Exactly one update can -// be applied to a cluster with each request, so at most one field can be -// provided. -message ClusterUpdate { - // The Kubernetes version to change the nodes to (typically an - // upgrade). - // - // Users may specify either explicit versions offered by - // Kubernetes Engine or version aliases, which have the following behavior: - // - // - "latest": picks the highest valid Kubernetes version - // - "1.X": picks the highest valid patch+gke.N patch in the 1.X version - // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version - // - "1.X.Y-gke.N": picks an explicit Kubernetes version - // - "-": picks the Kubernetes master version - string desired_node_version = 4; - - // The monitoring service the cluster should use to write metrics. - // Currently available options: - // - // * "monitoring.googleapis.com/kubernetes" - the Google Cloud Monitoring - // service with Kubernetes-native resource model in Stackdriver - // * "monitoring.googleapis.com" - the Google Cloud Monitoring service - // * "none" - no metrics will be exported from the cluster - string desired_monitoring_service = 5; - - // Configurations for the various addons available to run in the cluster. - AddonsConfig desired_addons_config = 6; - - // The node pool to be upgraded. This field is mandatory if - // "desired_node_version", "desired_image_family" or - // "desired_node_pool_autoscaling" is specified and there is more than one - // node pool on the cluster. - string desired_node_pool_id = 7; - - // The desired image type for the node pool. - // NOTE: Set the "desired_node_pool" field as well. - string desired_image_type = 8; - - // Autoscaler configuration for the node pool specified in - // desired_node_pool_id. If there is only one pool in the - // cluster and desired_node_pool_id is not provided then - // the change applies to that single node pool. - NodePoolAutoscaling desired_node_pool_autoscaling = 9; - - // The desired list of Google Compute Engine - // [zones](/compute/docs/zones#available) in which the cluster's nodes - // should be located. Changing the locations a cluster is in will result - // in nodes being either created or removed from the cluster, depending on - // whether locations are being added or removed. - // - // This list must always include the cluster's primary zone. - repeated string desired_locations = 10; - - // The desired configuration options for master authorized networks feature. - MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12; - - // The desired configuration options for the PodSecurityPolicy feature. - PodSecurityPolicyConfig desired_pod_security_policy_config = 14; - - // Cluster-level autoscaling configuration. - ClusterAutoscaling desired_cluster_autoscaling = 15; - - // The desired configuration options for the Binary Authorization feature. - BinaryAuthorization desired_binary_authorization = 16; - - // The logging service the cluster should use to write metrics. - // Currently available options: - // - // * "logging.googleapis.com/kubernetes" - the Google Cloud Logging - // service with Kubernetes-native resource model in Stackdriver - // * "logging.googleapis.com" - the Google Cloud Logging service - // * "none" - no logs will be exported from the cluster - string desired_logging_service = 19; - - // The desired configuration for exporting resource usage. - ResourceUsageExportConfig desired_resource_usage_export_config = 21; - - // Cluster-level Vertical Pod Autoscaling configuration. - VerticalPodAutoscaling desired_vertical_pod_autoscaling = 22; - - // The Kubernetes version to change the master to. The only valid value is the - // latest supported version. - // - // Users may specify either explicit versions offered by - // Kubernetes Engine or version aliases, which have the following behavior: - // - // - "latest": picks the highest valid Kubernetes version - // - "1.X": picks the highest valid patch+gke.N patch in the 1.X version - // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version - // - "1.X.Y-gke.N": picks an explicit Kubernetes version - // - "-": picks the default Kubernetes version - string desired_master_version = 100; -} - -// This operation resource represents operations that may have happened or are -// happening on the cluster. All fields are output only. -message Operation { - // Current status of the operation. - enum Status { - // Not set. - STATUS_UNSPECIFIED = 0; - - // The operation has been created. - PENDING = 1; - - // The operation is currently running. - RUNNING = 2; - - // The operation is done, either cancelled or completed. - DONE = 3; - - // The operation is aborting. - ABORTING = 4; - } - - // Operation type. - enum Type { - // Not set. - TYPE_UNSPECIFIED = 0; - - // Cluster create. - CREATE_CLUSTER = 1; - - // Cluster delete. - DELETE_CLUSTER = 2; - - // A master upgrade. - UPGRADE_MASTER = 3; - - // A node upgrade. - UPGRADE_NODES = 4; - - // Cluster repair. - REPAIR_CLUSTER = 5; - - // Cluster update. - UPDATE_CLUSTER = 6; - - // Node pool create. - CREATE_NODE_POOL = 7; - - // Node pool delete. - DELETE_NODE_POOL = 8; - - // Set node pool management. - SET_NODE_POOL_MANAGEMENT = 9; - - // Automatic node pool repair. - AUTO_REPAIR_NODES = 10; - - // Automatic node upgrade. - AUTO_UPGRADE_NODES = 11; - - // Set labels. - SET_LABELS = 12; - - // Set/generate master auth materials - SET_MASTER_AUTH = 13; - - // Set node pool size. - SET_NODE_POOL_SIZE = 14; - - // Updates network policy for a cluster. - SET_NETWORK_POLICY = 15; - - // Set the maintenance policy. - SET_MAINTENANCE_POLICY = 16; - } - - // The server-assigned ID for the operation. - string name = 1; - - // The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the operation - // is taking place. - // This field is deprecated, use location instead. - string zone = 2 [deprecated = true]; - - // The operation type. - Type operation_type = 3; - - // The current status of the operation. - Status status = 4; - - // Detailed operation progress, if available. - string detail = 8; - - // If an error has occurred, a textual description of the error. - string status_message = 5; - - // Server-defined URL for the resource. - string self_link = 6; - - // Server-defined URL for the target of the operation. - string target_link = 7; - - // [Output only] The name of the Google Compute Engine - // [zone](/compute/docs/regions-zones/regions-zones#available) or - // [region](/compute/docs/regions-zones/regions-zones#available) in which - // the cluster resides. - string location = 9; - - // [Output only] The time the operation started, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string start_time = 10; - - // [Output only] The time the operation completed, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string end_time = 11; - - // [Output only] Progress information for an operation. - OperationProgress progress = 12; - - // Which conditions caused the current cluster state. - repeated StatusCondition cluster_conditions = 13; - - // Which conditions caused the current node pool state. - repeated StatusCondition nodepool_conditions = 14; -} - -// Information about operation (or operation stage) progress. -message OperationProgress { - // Progress metric is (string, int|float|string) pair. - message Metric { - // Metric name, required. - // e.g., "nodes total", "percent done" - string name = 1; - - // Strictly one of the values is required. - oneof value { - // For metrics with integer value. - int64 int_value = 2; - - // For metrics with floating point value. - double double_value = 3; - - // For metrics with custom values (ratios, visual progress, etc.). - string string_value = 4; - } - } - - // A non-parameterized string describing an operation stage. - // Unset for single-stage operations. - string name = 1; - - // Status of an operation stage. - // Unset for single-stage operations. - Operation.Status status = 2; - - // Progress metric bundle, for example: - // metrics: [{name: "nodes done", int_value: 15}, - // {name: "nodes total", int_value: 32}] - // or - // metrics: [{name: "progress", double_value: 0.56}, - // {name: "progress scale", double_value: 1.0}] - repeated Metric metrics = 3; - - // Substages of an operation or a stage. - repeated OperationProgress stages = 4; -} - -// CreateClusterRequest creates a cluster. -message CreateClusterRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the parent field. - string zone = 2 [deprecated = true]; - - // A [cluster - // resource](/container-engine/reference/rest/v1beta1/projects.zones.clusters) - Cluster cluster = 3; - - // The parent (project and location) where the cluster will be created. - // Specified in the format 'projects/*/locations/*'. - string parent = 5; -} - -// GetClusterRequest gets the settings of a cluster. -message GetClusterRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to retrieve. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // The name (project, location, cluster) of the cluster to retrieve. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 5; -} - -// UpdateClusterRequest updates the settings of a cluster. -message UpdateClusterRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // A description of the update. - ClusterUpdate update = 4; - - // The name (project, location, cluster) of the cluster to update. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 5; -} - -// SetNodePoolVersionRequest updates the version of a node pool. -message UpdateNodePoolRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool to upgrade. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // The Kubernetes version to change the nodes to (typically an - // upgrade). - // - // Users may specify either explicit versions offered by Kubernetes Engine or - // version aliases, which have the following behavior: - // - // - "latest": picks the highest valid Kubernetes version - // - "1.X": picks the highest valid patch+gke.N patch in the 1.X version - // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version - // - "1.X.Y-gke.N": picks an explicit Kubernetes version - // - "-": picks the Kubernetes master version - string node_version = 5; - - // The desired image type for the node pool. - string image_type = 6; - - // The name (project, location, cluster, node pool) of the node pool to - // update. Specified in the format - // 'projects/*/locations/*/clusters/*/nodePools/*'. - string name = 8; -} - -// SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. -message SetNodePoolAutoscalingRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool to upgrade. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // Autoscaling configuration for the node pool. - NodePoolAutoscaling autoscaling = 5; - - // The name (project, location, cluster, node pool) of the node pool to set - // autoscaler settings. Specified in the format - // 'projects/*/locations/*/clusters/*/nodePools/*'. - string name = 6; -} - -// SetLoggingServiceRequest sets the logging service of a cluster. -message SetLoggingServiceRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // The logging service the cluster should use to write metrics. - // Currently available options: - // - // * "logging.googleapis.com" - the Google Cloud Logging service - // * "none" - no metrics will be exported from the cluster - string logging_service = 4; - - // The name (project, location, cluster) of the cluster to set logging. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 5; -} - -// SetMonitoringServiceRequest sets the monitoring service of a cluster. -message SetMonitoringServiceRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // The monitoring service the cluster should use to write metrics. - // Currently available options: - // - // * "monitoring.googleapis.com" - the Google Cloud Monitoring service - // * "none" - no metrics will be exported from the cluster - string monitoring_service = 4; - - // The name (project, location, cluster) of the cluster to set monitoring. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 6; -} - -// SetAddonsRequest sets the addons associated with the cluster. -message SetAddonsConfigRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // The desired configurations for the various addons available to run in the - // cluster. - AddonsConfig addons_config = 4; - - // The name (project, location, cluster) of the cluster to set addons. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 6; -} - -// SetLocationsRequest sets the locations of the cluster. -message SetLocationsRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // The desired list of Google Compute Engine - // [zones](/compute/docs/zones#available) in which the cluster's nodes - // should be located. Changing the locations a cluster is in will result - // in nodes being either created or removed from the cluster, depending on - // whether locations are being added or removed. - // - // This list must always include the cluster's primary zone. - repeated string locations = 4; - - // The name (project, location, cluster) of the cluster to set locations. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 6; -} - -// UpdateMasterRequest updates the master of the cluster. -message UpdateMasterRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // The Kubernetes version to change the master to. - // - // Users may specify either explicit versions offered by - // Kubernetes Engine or version aliases, which have the following behavior: - // - // - "latest": picks the highest valid Kubernetes version - // - "1.X": picks the highest valid patch+gke.N patch in the 1.X version - // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version - // - "1.X.Y-gke.N": picks an explicit Kubernetes version - // - "-": picks the default Kubernetes version - string master_version = 4; - - // The name (project, location, cluster) of the cluster to update. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 7; -} - -// SetMasterAuthRequest updates the admin password of a cluster. -message SetMasterAuthRequest { - // Operation type: what type update to perform. - enum Action { - // Operation is unknown and will error out. - UNKNOWN = 0; - - // Set the password to a user generated value. - SET_PASSWORD = 1; - - // Generate a new password and set it to that. - GENERATE_PASSWORD = 2; - - // Set the username. If an empty username is provided, basic authentication - // is disabled for the cluster. If a non-empty username is provided, basic - // authentication is enabled, with either a provided password or a generated - // one. - SET_USERNAME = 3; - } - - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to upgrade. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // The exact form of action to be taken on the master auth. - Action action = 4; - - // A description of the update. - MasterAuth update = 5; - - // The name (project, location, cluster) of the cluster to set auth. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 7; -} - -// DeleteClusterRequest deletes a cluster. -message DeleteClusterRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to delete. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // The name (project, location, cluster) of the cluster to delete. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 4; -} - -// ListClustersRequest lists clusters. -message ListClustersRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides, or "-" for all zones. - // This field has been deprecated and replaced by the parent field. - string zone = 2 [deprecated = true]; - - // The parent (project and location) where the clusters will be listed. - // Specified in the format 'projects/*/locations/*'. - // Location "-" matches all zones and all regions. - string parent = 4; -} - -// ListClustersResponse is the result of ListClustersRequest. -message ListClustersResponse { - // A list of clusters in the project in the specified zone, or - // across all ones. - repeated Cluster clusters = 1; - - // If any zones are listed here, the list of clusters returned - // may be missing those zones. - repeated string missing_zones = 2; -} - -// GetOperationRequest gets a single operation. -message GetOperationRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The server-assigned `name` of the operation. - // This field has been deprecated and replaced by the name field. - string operation_id = 3 [deprecated = true]; - - // The name (project, location, operation id) of the operation to get. - // Specified in the format 'projects/*/locations/*/operations/*'. - string name = 5; -} - -// ListOperationsRequest lists operations. -message ListOperationsRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) to return operations for, or `-` for - // all zones. This field has been deprecated and replaced by the parent field. - string zone = 2 [deprecated = true]; - - // The parent (project and location) where the operations will be listed. - // Specified in the format 'projects/*/locations/*'. - // Location "-" matches all zones and all regions. - string parent = 4; -} - -// CancelOperationRequest cancels a single operation. -message CancelOperationRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the operation resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The server-assigned `name` of the operation. - // This field has been deprecated and replaced by the name field. - string operation_id = 3 [deprecated = true]; - - // The name (project, location, operation id) of the operation to cancel. - // Specified in the format 'projects/*/locations/*/operations/*'. - string name = 4; -} - -// ListOperationsResponse is the result of ListOperationsRequest. -message ListOperationsResponse { - // A list of operations in the project in the specified zone. - repeated Operation operations = 1; - - // If any zones are listed here, the list of operations returned - // may be missing the operations from those zones. - repeated string missing_zones = 2; -} - -// Gets the current Kubernetes Engine service configuration. -message GetServerConfigRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) to return operations for. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // The name (project and location) of the server config to get - // Specified in the format 'projects/*/locations/*'. - string name = 4; -} - -// Kubernetes Engine service configuration. -message ServerConfig { - // Version of Kubernetes the service deploys by default. - string default_cluster_version = 1; - - // List of valid node upgrade target versions. - repeated string valid_node_versions = 3; - - // Default image type. - string default_image_type = 4; - - // List of valid image types. - repeated string valid_image_types = 5; - - // List of valid master versions. - repeated string valid_master_versions = 6; -} - -// CreateNodePoolRequest creates a node pool for a cluster. -message CreateNodePoolRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://developers.google.com/console/help/new/#projectnumber). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the parent field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the parent field. - string cluster_id = 3 [deprecated = true]; - - // The node pool to create. - NodePool node_pool = 4; - - // The parent (project, location, cluster id) where the node pool will be - // created. Specified in the format - // 'projects/*/locations/*/clusters/*'. - string parent = 6; -} - -// DeleteNodePoolRequest deletes a node pool for a cluster. -message DeleteNodePoolRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://developers.google.com/console/help/new/#projectnumber). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool to delete. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // The name (project, location, cluster, node pool id) of the node pool to - // delete. Specified in the format - // 'projects/*/locations/*/clusters/*/nodePools/*'. - string name = 6; -} - -// ListNodePoolsRequest lists the node pool(s) for a cluster. -message ListNodePoolsRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://developers.google.com/console/help/new/#projectnumber). - // This field has been deprecated and replaced by the parent field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the parent field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the parent field. - string cluster_id = 3 [deprecated = true]; - - // The parent (project, location, cluster id) where the node pools will be - // listed. Specified in the format 'projects/*/locations/*/clusters/*'. - string parent = 5; -} - -// GetNodePoolRequest retrieves a node pool for a cluster. -message GetNodePoolRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://developers.google.com/console/help/new/#projectnumber). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // The name (project, location, cluster, node pool id) of the node pool to - // get. Specified in the format - // 'projects/*/locations/*/clusters/*/nodePools/*'. - string name = 6; -} - -// NodePool contains the name and configuration for a cluster's node pool. -// Node pools are a set of nodes (i.e. VM's), with a common configuration and -// specification, under the control of the cluster master. They may have a set -// of Kubernetes labels applied to them, which may be used to reference them -// during pod scheduling. They may also be resized up or down, to accommodate -// the workload. -message NodePool { - // The current status of the node pool instance. - enum Status { - // Not set. - STATUS_UNSPECIFIED = 0; - - // The PROVISIONING state indicates the node pool is being created. - PROVISIONING = 1; - - // The RUNNING state indicates the node pool has been created - // and is fully usable. - RUNNING = 2; - - // The RUNNING_WITH_ERROR state indicates the node pool has been created - // and is partially usable. Some error state has occurred and some - // functionality may be impaired. Customer may need to reissue a request - // or trigger a new update. - RUNNING_WITH_ERROR = 3; - - // The RECONCILING state indicates that some work is actively being done on - // the node pool, such as upgrading node software. Details can - // be found in the `statusMessage` field. - RECONCILING = 4; - - // The STOPPING state indicates the node pool is being deleted. - STOPPING = 5; - - // The ERROR state indicates the node pool may be unusable. Details - // can be found in the `statusMessage` field. - ERROR = 6; - } - - // The name of the node pool. - string name = 1; - - // The node configuration of the pool. - NodeConfig config = 2; - - // The initial node count for the pool. You must ensure that your - // Compute Engine resource quota - // is sufficient for this number of instances. You must also have available - // firewall and routes quota. - int32 initial_node_count = 3; - - // [Output only] Server-defined URL for the resource. - string self_link = 100; - - // The version of the Kubernetes of this node. - string version = 101; - - // [Output only] The resource URLs of the [managed instance - // groups](/compute/docs/instance-groups/creating-groups-of-managed-instances) - // associated with this node pool. - repeated string instance_group_urls = 102; - - // [Output only] The status of the nodes in this pool instance. - Status status = 103; - - // [Output only] Additional information about the current status of this - // node pool instance, if available. - string status_message = 104; - - // Autoscaler configuration for this NodePool. Autoscaler is enabled - // only if a valid configuration is present. - NodePoolAutoscaling autoscaling = 4; - - // NodeManagement configuration for this NodePool. - NodeManagement management = 5; - - // The constraint on the maximum number of pods that can be run - // simultaneously on a node in the node pool. - MaxPodsConstraint max_pods_constraint = 6; - - // Which conditions caused the current node pool state. - repeated StatusCondition conditions = 105; -} - -// NodeManagement defines the set of node management services turned on for the -// node pool. -message NodeManagement { - // Whether the nodes will be automatically upgraded. - bool auto_upgrade = 1; - - // Whether the nodes will be automatically repaired. - bool auto_repair = 2; - - // Specifies the Auto Upgrade knobs for the node pool. - AutoUpgradeOptions upgrade_options = 10; -} - -// AutoUpgradeOptions defines the set of options for the user to control how -// the Auto Upgrades will proceed. -message AutoUpgradeOptions { - // [Output only] This field is set when upgrades are about to commence - // with the approximate start time for the upgrades, in - // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - string auto_upgrade_start_time = 1; - - // [Output only] This field is set when upgrades are about to commence - // with the description of the upgrade. - string description = 2; -} - -// MaintenancePolicy defines the maintenance policy to be used for the cluster. -message MaintenancePolicy { - // Specifies the maintenance window in which maintenance may be performed. - MaintenanceWindow window = 1; -} - -// MaintenanceWindow defines the maintenance window to be used for the cluster. -message MaintenanceWindow { - // Unimplemented, reserved for future use. - // HourlyMaintenanceWindow hourly_maintenance_window = 1; - oneof policy { - // DailyMaintenanceWindow specifies a daily maintenance operation window. - DailyMaintenanceWindow daily_maintenance_window = 2; - } -} - -// Time window specified for daily maintenance operations. -message DailyMaintenanceWindow { - // Time within the maintenance window to start the maintenance operations. - // It must be in format "HH:MM”, where HH : [00-23] and MM : [00-59] GMT. - string start_time = 2; - - // [Output only] Duration of the time window, automatically chosen to be - // smallest possible in the given scenario. - string duration = 3; -} - -// SetNodePoolManagementRequest sets the node management properties of a node -// pool. -message SetNodePoolManagementRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to update. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool to update. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // NodeManagement configuration for the node pool. - NodeManagement management = 5; - - // The name (project, location, cluster, node pool id) of the node pool to set - // management properties. Specified in the format - // 'projects/*/locations/*/clusters/*/nodePools/*'. - string name = 7; -} - -// SetNodePoolSizeRequest sets the size a node -// pool. -message SetNodePoolSizeRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to update. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool to update. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // The desired node count for the pool. - int32 node_count = 5; - - // The name (project, location, cluster, node pool id) of the node pool to set - // size. - // Specified in the format 'projects/*/locations/*/clusters/*/nodePools/*'. - string name = 7; -} - -// RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed -// NodePool upgrade. This will be an no-op if the last upgrade successfully -// completed. -message RollbackNodePoolUpgradeRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to rollback. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Deprecated. The name of the node pool to rollback. - // This field has been deprecated and replaced by the name field. - string node_pool_id = 4 [deprecated = true]; - - // The name (project, location, cluster, node pool id) of the node poll to - // rollback upgrade. - // Specified in the format 'projects/*/locations/*/clusters/*/nodePools/*'. - string name = 6; -} - -// ListNodePoolsResponse is the result of ListNodePoolsRequest. -message ListNodePoolsResponse { - // A list of node pools for a cluster. - repeated NodePool node_pools = 1; -} - -// ClusterAutoscaling contains global, per-cluster information -// required by Cluster Autoscaler to automatically adjust -// the size of the cluster and create/delete -// node pools based on the current needs. -message ClusterAutoscaling { - // Enables automatic node pool creation and deletion. - bool enable_node_autoprovisioning = 1; - - // Contains global constraints regarding minimum and maximum - // amount of resources in the cluster. - repeated ResourceLimit resource_limits = 2; -} - -// Contains information about amount of some resource in the cluster. -// For memory, value should be in GB. -message ResourceLimit { - // Resource name "cpu", "memory" or gpu-specific string. - string resource_type = 1; - - // Minimum amount of the resource in the cluster. - int64 minimum = 2; - - // Maximum amount of the resource in the cluster. - int64 maximum = 3; -} - -// NodePoolAutoscaling contains information required by cluster autoscaler to -// adjust the size of the node pool to the current cluster usage. -message NodePoolAutoscaling { - // Is autoscaling enabled for this node pool. - bool enabled = 1; - - // Minimum number of nodes in the NodePool. Must be >= 1 and <= - // max_node_count. - int32 min_node_count = 2; - - // Maximum number of nodes in the NodePool. Must be >= min_node_count. There - // has to enough quota to scale up the cluster. - int32 max_node_count = 3; - - // Can this node pool be deleted automatically. - bool autoprovisioned = 4; -} - -// SetLabelsRequest sets the Google Cloud Platform labels on a Google Container -// Engine cluster, which will in turn set them for Google Compute Engine -// resources used by that cluster -message SetLabelsRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://developers.google.com/console/help/new/#projectnumber). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // The labels to set for that cluster. - map resource_labels = 4; - - // The fingerprint of the previous set of labels for this resource, - // used to detect conflicts. The fingerprint is initially generated by - // Kubernetes Engine and changes after every request to modify or update - // labels. You must always provide an up-to-date fingerprint hash when - // updating or changing labels. Make a get() request to the - // resource to get the latest fingerprint. - string label_fingerprint = 5; - - // The name (project, location, cluster id) of the cluster to set labels. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 7; -} - -// SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for -// a cluster. -message SetLegacyAbacRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster to update. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Whether ABAC authorization will be enabled in the cluster. - bool enabled = 4; - - // The name (project, location, cluster id) of the cluster to set legacy abac. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 6; -} - -// StartIPRotationRequest creates a new IP for the cluster and then performs -// a node upgrade on each node pool to point to the new IP. -message StartIPRotationRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://developers.google.com/console/help/new/#projectnumber). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // The name (project, location, cluster id) of the cluster to start IP - // rotation. Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 6; - - // Whether to rotate credentials during IP rotation. - bool rotate_credentials = 7; -} - -// CompleteIPRotationRequest moves the cluster master back into single-IP mode. -message CompleteIPRotationRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://developers.google.com/console/help/new/#projectnumber). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // The name (project, location, cluster id) of the cluster to complete IP - // rotation. Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 7; -} - -// AcceleratorConfig represents a Hardware Accelerator request. -message AcceleratorConfig { - // The number of the accelerator cards exposed to an instance. - int64 accelerator_count = 1; - - // The accelerator type resource name. List of supported accelerators - // [here](/compute/docs/gpus/#Introduction) - string accelerator_type = 2; -} - -// WorkloadMetadataConfig defines the metadata configuration to expose to -// workloads on the node pool. -message WorkloadMetadataConfig { - // NodeMetadata is the configuration for if and how to expose the node - // metadata to the workload running on the node. - enum NodeMetadata { - // Not set. - UNSPECIFIED = 0; - - // Prevent workloads not in hostNetwork from accessing certain VM metadata, - // specifically kube-env, which contains Kubelet credentials, and the - // instance identity token. - // - // Metadata concealment is a temporary security solution available while the - // bootstrapping process for cluster nodes is being redesigned with - // significant security improvements. This feature is scheduled to be - // deprecated in the future and later removed. - SECURE = 1; - - // Expose all VM metadata to pods. - EXPOSE = 2; - } - - // NodeMetadata is the configuration for how to expose the node metadata to - // the workload running on the node. - NodeMetadata node_metadata = 1; -} - -// SetNetworkPolicyRequest enables/disables network policy for a cluster. -message SetNetworkPolicyRequest { - // Deprecated. The Google Developers Console [project ID or project - // number](https://developers.google.com/console/help/new/#projectnumber). - // This field has been deprecated and replaced by the name field. - string project_id = 1 [deprecated = true]; - - // Deprecated. The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - // This field has been deprecated and replaced by the name field. - string zone = 2 [deprecated = true]; - - // Deprecated. The name of the cluster. - // This field has been deprecated and replaced by the name field. - string cluster_id = 3 [deprecated = true]; - - // Configuration options for the NetworkPolicy feature. - NetworkPolicy network_policy = 4; - - // The name (project, location, cluster id) of the cluster to set networking - // policy. Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 6; -} - -// SetMaintenancePolicyRequest sets the maintenance policy for a cluster. -message SetMaintenancePolicyRequest { - // The Google Developers Console [project ID or project - // number](https://support.google.com/cloud/answer/6158840). - string project_id = 1; - - // The name of the Google Compute Engine - // [zone](/compute/docs/zones#available) in which the cluster - // resides. - string zone = 2; - - // The name of the cluster to update. - string cluster_id = 3; - - // The maintenance policy to be set for the cluster. An empty field - // clears the existing maintenance policy. - MaintenancePolicy maintenance_policy = 4; - - // The name (project, location, cluster id) of the cluster to set maintenance - // policy. - // Specified in the format 'projects/*/locations/*/clusters/*'. - string name = 5; -} - -// ListLocationsRequest is used to request the locations that offer GKE. -message ListLocationsRequest { - // Contains the name of the resource requested. - // Specified in the format 'projects/*'. - string parent = 1; -} - -// ListLocationsResponse returns the list of all GKE locations and their -// recommendation state. -message ListLocationsResponse { - // A full list of GKE locations. - repeated Location locations = 1; - - // Only return ListLocationsResponse that occur after the page_token. This - // value should be populated from the ListLocationsResponse.next_page_token if - // that response token was set (which happens when listing more Locations than - // fit in a single ListLocationsResponse). - string next_page_token = 2; -} - -// Location returns the location name, and if the location is recommended -// for GKE cluster scheduling. -message Location { - // LocationType is the type of GKE location, regional or zonal. - enum LocationType { - // LOCATION_TYPE_UNSPECIFIED means the location type was not determined. - LOCATION_TYPE_UNSPECIFIED = 0; - - // A GKE Location where Zonal clusters can be created. - ZONE = 1; - - // A GKE Location where Regional clusters can be created. - REGION = 2; - } - - // Contains the type of location this Location is for. - // Regional or Zonal. - LocationType type = 1; - - // Contains the name of the resource requested. - // Specified in the format 'projects/*/locations/*'. - string name = 2; - - // Whether the location is recomended for GKE cluster scheduling. - bool recommended = 3; -} - -// StatusCondition describes why a cluster or a node pool has a certain status -// (e.g., ERROR or DEGRADED). -message StatusCondition { - // Code for each condition - enum Code { - // UNKNOWN indicates a generic condition. - UNKNOWN = 0; - - // GCE_STOCKOUT indicates a Google Compute Engine stockout. - GCE_STOCKOUT = 1; - - // GKE_SERVICE_ACCOUNT_DELETED indicates that the user deleted their robot - // service account. - GKE_SERVICE_ACCOUNT_DELETED = 2; - - // Google Compute Engine quota was exceeded. - GCE_QUOTA_EXCEEDED = 3; - - // Cluster state was manually changed by an SRE due to a system logic error. - // More codes TBA - SET_BY_OPERATOR = 4; - } - - // Machine-friendly representation of the condition - Code code = 1; - - // Human-friendly representation of the condition - string message = 2; -} - -// NetworkConfig reports the relative names of network & subnetwork. -message NetworkConfig { - // Output only. The relative name of the Google Compute Engine - // [network][google.container.v1beta1.NetworkConfig.network](/compute/docs/networks-and-firewalls#networks) to which - // the cluster is connected. - // Example: projects/my-project/global/networks/my-network - string network = 1; - - // Output only. The relative name of the Google Compute Engine - // [subnetwork](/compute/docs/vpc) to which the cluster is connected. - // Example: projects/my-project/regions/us-central1/subnetworks/my-subnet - string subnetwork = 2; -} - -// ListUsableSubnetworksRequest requests the list of usable subnetworks. -// available to a user for creating clusters. -message ListUsableSubnetworksRequest { - // The parent project where subnetworks are usable. - // Specified in the format 'projects/*'. - string parent = 1; - - // Filtering currently only supports equality on the networkProjectId and must - // be in the form: "networkProjectId=[PROJECTID]", where `networkProjectId` - // is the project which owns the listed subnetworks. This defaults to the - // parent project ID. - string filter = 2; - - // The max number of results per page that should be returned. If the number - // of available results is larger than `page_size`, a `next_page_token` is - // returned which can be used to get the next page of results in subsequent - // requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - int32 page_size = 3; - - // Specifies a page token to use. Set this to the nextPageToken returned by - // previous list requests to get the next page of results. - string page_token = 4; -} - -// ListUsableSubnetworksResponse is the response of -// ListUsableSubnetworksRequest. -message ListUsableSubnetworksResponse { - // A list of usable subnetworks in the specified network project. - repeated UsableSubnetwork subnetworks = 1; - - // This token allows you to get the next page of results for list requests. - // If the number of results is larger than `page_size`, use the - // `next_page_token` as a value for the query parameter `page_token` in the - // next request. The value will become empty when there are no more pages. - string next_page_token = 2; -} - -// Secondary IP range of a usable subnetwork. -message UsableSubnetworkSecondaryRange { - // Status shows the current usage of a secondary IP range. - enum Status { - // UNKNOWN is the zero value of the Status enum. It's not a valid status. - UNKNOWN = 0; - - // UNUSED denotes that this range is unclaimed by any cluster. - UNUSED = 1; - - // IN_USE_SERVICE denotes that this range is claimed by a cluster for - // services. It cannot be used for other clusters. - IN_USE_SERVICE = 2; - - // IN_USE_SHAREABLE_POD denotes this range was created by the network admin - // and is currently claimed by a cluster for pods. It can only be used by - // other clusters as a pod range. - IN_USE_SHAREABLE_POD = 3; - - // IN_USE_MANAGED_POD denotes this range was created by GKE and is claimed - // for pods. It cannot be used for other clusters. - IN_USE_MANAGED_POD = 4; - } - - // The name associated with this subnetwork secondary range, used when adding - // an alias IP range to a VM instance. - string range_name = 1; - - // The range of IP addresses belonging to this subnetwork secondary range. - string ip_cidr_range = 2; - - // This field is to determine the status of the secondary range programmably. - Status status = 3; -} - -// UsableSubnetwork resource returns the subnetwork name, its associated network -// and the primary CIDR range. -message UsableSubnetwork { - // Subnetwork Name. - // Example: projects/my-project/regions/us-central1/subnetworks/my-subnet - string subnetwork = 1; - - // Network Name. - // Example: projects/my-project/global/networks/my-network - string network = 2; - - // The range of internal addresses that are owned by this subnetwork. - string ip_cidr_range = 3; - - // Secondary IP ranges. - repeated UsableSubnetworkSecondaryRange secondary_ip_ranges = 4; - - // A human readable status message representing the reasons for cases where - // the caller cannot use the secondary ranges under the subnet. For example if - // the secondary_ip_ranges is empty due to a permission issue, an insufficient - // permission message will be given by status_message. - string status_message = 5; -} - -// VerticalPodAutoscaling contains global, per-cluster information -// required by Vertical Pod Autoscaler to automatically adjust -// the resources of pods controlled by it. -message VerticalPodAutoscaling { - // Enables vertical pod autoscaling. - bool enabled = 1; -} - -// Constraints applied to pods. -message MaxPodsConstraint { - // Constraint enforced on the max num of pods per node. - int64 max_pods_per_node = 1; -} - -// Configuration for exporting cluster resource usages. -message ResourceUsageExportConfig { - // Parameters for using BigQuery as the destination of resource usage export. - message BigQueryDestination { - // The ID of a BigQuery Dataset. - string dataset_id = 1; - } - - // Configuration to use BigQuery as usage export destination. - BigQueryDestination bigquery_destination = 1; - - // Whether to enable network egress metering for this cluster. If enabled, a - // daemonset will be created in the cluster to meter network egress traffic. - bool enable_network_egress_metering = 2; -} diff --git a/container/google/cloud/container_v1beta1/proto/cluster_service_pb2.py b/container/google/cloud/container_v1beta1/proto/cluster_service_pb2.py deleted file mode 100644 index d680c84594f8..000000000000 --- a/container/google/cloud/container_v1beta1/proto/cluster_service_pb2.py +++ /dev/null @@ -1,12672 +0,0 @@ -# -*- coding: utf-8 -*- -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/container_v1beta1/proto/cluster_service.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.iam.v1 import iam_policy_pb2 as google_dot_iam_dot_v1_dot_iam__policy__pb2 -from google.iam.v1 import policy_pb2 as google_dot_iam_dot_v1_dot_policy__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/container_v1beta1/proto/cluster_service.proto", - package="google.container.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\034com.google.container.v1beta1B\023ClusterServiceProtoP\001ZAgoogle.golang.org/genproto/googleapis/container/v1beta1;container\252\002\036Google.Cloud.Container.V1Beta1\312\002\036Google\\Cloud\\Container\\V1beta1" - ), - serialized_pb=_b( - '\n:google/cloud/container_v1beta1/proto/cluster_service.proto\x12\x18google.container.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto"\x98\x05\n\nNodeConfig\x12\x14\n\x0cmachine_type\x18\x01 \x01(\t\x12\x14\n\x0c\x64isk_size_gb\x18\x02 \x01(\x05\x12\x14\n\x0coauth_scopes\x18\x03 \x03(\t\x12\x17\n\x0fservice_account\x18\t \x01(\t\x12\x44\n\x08metadata\x18\x04 \x03(\x0b\x32\x32.google.container.v1beta1.NodeConfig.MetadataEntry\x12\x12\n\nimage_type\x18\x05 \x01(\t\x12@\n\x06labels\x18\x06 \x03(\x0b\x32\x30.google.container.v1beta1.NodeConfig.LabelsEntry\x12\x17\n\x0flocal_ssd_count\x18\x07 \x01(\x05\x12\x0c\n\x04tags\x18\x08 \x03(\t\x12\x13\n\x0bpreemptible\x18\n \x01(\x08\x12\x41\n\x0c\x61\x63\x63\x65lerators\x18\x0b \x03(\x0b\x32+.google.container.v1beta1.AcceleratorConfig\x12\x11\n\tdisk_type\x18\x0c \x01(\t\x12\x18\n\x10min_cpu_platform\x18\r \x01(\t\x12R\n\x18workload_metadata_config\x18\x0e \x01(\x0b\x32\x30.google.container.v1beta1.WorkloadMetadataConfig\x12\x33\n\x06taints\x18\x0f \x03(\x0b\x32#.google.container.v1beta1.NodeTaint\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\xbe\x01\n\tNodeTaint\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12:\n\x06\x65\x66\x66\x65\x63t\x18\x03 \x01(\x0e\x32*.google.container.v1beta1.NodeTaint.Effect"Y\n\x06\x45\x66\x66\x65\x63t\x12\x16\n\x12\x45\x46\x46\x45\x43T_UNSPECIFIED\x10\x00\x12\x0f\n\x0bNO_SCHEDULE\x10\x01\x12\x16\n\x12PREFER_NO_SCHEDULE\x10\x02\x12\x0e\n\nNO_EXECUTE\x10\x03"\xd6\x01\n\nMasterAuth\x12\x10\n\x08username\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\x12T\n\x19\x63lient_certificate_config\x18\x03 \x01(\x0b\x32\x31.google.container.v1beta1.ClientCertificateConfig\x12\x1e\n\x16\x63luster_ca_certificate\x18\x64 \x01(\t\x12\x1a\n\x12\x63lient_certificate\x18\x65 \x01(\t\x12\x12\n\nclient_key\x18\x66 \x01(\t";\n\x17\x43lientCertificateConfig\x12 \n\x18issue_client_certificate\x18\x01 \x01(\x08"\xcc\x03\n\x0c\x41\x64\x64onsConfig\x12H\n\x13http_load_balancing\x18\x01 \x01(\x0b\x32+.google.container.v1beta1.HttpLoadBalancing\x12V\n\x1ahorizontal_pod_autoscaling\x18\x02 \x01(\x0b\x32\x32.google.container.v1beta1.HorizontalPodAutoscaling\x12K\n\x14kubernetes_dashboard\x18\x03 \x01(\x0b\x32-.google.container.v1beta1.KubernetesDashboard\x12L\n\x15network_policy_config\x18\x04 \x01(\x0b\x32-.google.container.v1beta1.NetworkPolicyConfig\x12;\n\x0cistio_config\x18\x05 \x01(\x0b\x32%.google.container.v1beta1.IstioConfig\x12\x42\n\x10\x63loud_run_config\x18\x07 \x01(\x0b\x32(.google.container.v1beta1.CloudRunConfig"%\n\x11HttpLoadBalancing\x12\x10\n\x08\x64isabled\x18\x01 \x01(\x08",\n\x18HorizontalPodAutoscaling\x12\x10\n\x08\x64isabled\x18\x01 \x01(\x08"\'\n\x13KubernetesDashboard\x12\x10\n\x08\x64isabled\x18\x01 \x01(\x08"\'\n\x13NetworkPolicyConfig\x12\x10\n\x08\x64isabled\x18\x01 \x01(\x08"\xa8\x01\n\x14PrivateClusterConfig\x12\x1c\n\x14\x65nable_private_nodes\x18\x01 \x01(\x08\x12\x1f\n\x17\x65nable_private_endpoint\x18\x02 \x01(\x08\x12\x1e\n\x16master_ipv4_cidr_block\x18\x03 \x01(\t\x12\x18\n\x10private_endpoint\x18\x04 \x01(\t\x12\x17\n\x0fpublic_endpoint\x18\x05 \x01(\t"\x97\x01\n\x0bIstioConfig\x12\x10\n\x08\x64isabled\x18\x01 \x01(\x08\x12\x41\n\x04\x61uth\x18\x02 \x01(\x0e\x32\x33.google.container.v1beta1.IstioConfig.IstioAuthMode"3\n\rIstioAuthMode\x12\r\n\tAUTH_NONE\x10\x00\x12\x13\n\x0f\x41UTH_MUTUAL_TLS\x10\x01""\n\x0e\x43loudRunConfig\x12\x10\n\x08\x64isabled\x18\x01 \x01(\x08"\xc1\x01\n\x1eMasterAuthorizedNetworksConfig\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12W\n\x0b\x63idr_blocks\x18\x02 \x03(\x0b\x32\x42.google.container.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock\x1a\x35\n\tCidrBlock\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x12\n\ncidr_block\x18\x02 \x01(\t"\x1d\n\nLegacyAbac\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08"\x96\x01\n\rNetworkPolicy\x12\x42\n\x08provider\x18\x01 \x01(\x0e\x32\x30.google.container.v1beta1.NetworkPolicy.Provider\x12\x0f\n\x07\x65nabled\x18\x02 \x01(\x08"0\n\x08Provider\x12\x18\n\x14PROVIDER_UNSPECIFIED\x10\x00\x12\n\n\x06\x43\x41LICO\x10\x01"\xa3\x03\n\x12IPAllocationPolicy\x12\x16\n\x0euse_ip_aliases\x18\x01 \x01(\x08\x12\x19\n\x11\x63reate_subnetwork\x18\x02 \x01(\x08\x12\x17\n\x0fsubnetwork_name\x18\x03 \x01(\t\x12\x1d\n\x11\x63luster_ipv4_cidr\x18\x04 \x01(\tB\x02\x18\x01\x12\x1a\n\x0enode_ipv4_cidr\x18\x05 \x01(\tB\x02\x18\x01\x12\x1e\n\x12services_ipv4_cidr\x18\x06 \x01(\tB\x02\x18\x01\x12$\n\x1c\x63luster_secondary_range_name\x18\x07 \x01(\t\x12%\n\x1dservices_secondary_range_name\x18\x08 \x01(\t\x12\x1f\n\x17\x63luster_ipv4_cidr_block\x18\t \x01(\t\x12\x1c\n\x14node_ipv4_cidr_block\x18\n \x01(\t\x12 \n\x18services_ipv4_cidr_block\x18\x0b \x01(\t\x12\x1b\n\x13\x61llow_route_overlap\x18\x0c \x01(\x08\x12\x1b\n\x13tpu_ipv4_cidr_block\x18\r \x01(\t"&\n\x13\x42inaryAuthorization\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08"*\n\x17PodSecurityPolicyConfig\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08"\xbb\x12\n\x07\x43luster\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x1a\n\x12initial_node_count\x18\x03 \x01(\x05\x12\x39\n\x0bnode_config\x18\x04 \x01(\x0b\x32$.google.container.v1beta1.NodeConfig\x12\x39\n\x0bmaster_auth\x18\x05 \x01(\x0b\x32$.google.container.v1beta1.MasterAuth\x12\x17\n\x0flogging_service\x18\x06 \x01(\t\x12\x1a\n\x12monitoring_service\x18\x07 \x01(\t\x12\x0f\n\x07network\x18\x08 \x01(\t\x12\x19\n\x11\x63luster_ipv4_cidr\x18\t \x01(\t\x12=\n\raddons_config\x18\n \x01(\x0b\x32&.google.container.v1beta1.AddonsConfig\x12\x12\n\nsubnetwork\x18\x0b \x01(\t\x12\x36\n\nnode_pools\x18\x0c \x03(\x0b\x32".google.container.v1beta1.NodePool\x12\x11\n\tlocations\x18\r \x03(\t\x12\x1f\n\x17\x65nable_kubernetes_alpha\x18\x0e \x01(\x08\x12N\n\x0fresource_labels\x18\x0f \x03(\x0b\x32\x35.google.container.v1beta1.Cluster.ResourceLabelsEntry\x12\x19\n\x11label_fingerprint\x18\x10 \x01(\t\x12\x39\n\x0blegacy_abac\x18\x12 \x01(\x0b\x32$.google.container.v1beta1.LegacyAbac\x12?\n\x0enetwork_policy\x18\x13 \x01(\x0b\x32\'.google.container.v1beta1.NetworkPolicy\x12J\n\x14ip_allocation_policy\x18\x14 \x01(\x0b\x32,.google.container.v1beta1.IPAllocationPolicy\x12\x63\n!master_authorized_networks_config\x18\x16 \x01(\x0b\x32\x38.google.container.v1beta1.MasterAuthorizedNetworksConfig\x12G\n\x12maintenance_policy\x18\x17 \x01(\x0b\x32+.google.container.v1beta1.MaintenancePolicy\x12K\n\x14\x62inary_authorization\x18\x18 \x01(\x0b\x32-.google.container.v1beta1.BinaryAuthorization\x12U\n\x1apod_security_policy_config\x18\x19 \x01(\x0b\x32\x31.google.container.v1beta1.PodSecurityPolicyConfig\x12\x41\n\x0b\x61utoscaling\x18\x1a \x01(\x0b\x32,.google.container.v1beta1.ClusterAutoscaling\x12?\n\x0enetwork_config\x18\x1b \x01(\x0b\x32\'.google.container.v1beta1.NetworkConfig\x12\x1b\n\x0fprivate_cluster\x18\x1c \x01(\x08\x42\x02\x18\x01\x12"\n\x16master_ipv4_cidr_block\x18\x1d \x01(\tB\x02\x18\x01\x12P\n\x1b\x64\x65\x66\x61ult_max_pods_constraint\x18\x1e \x01(\x0b\x32+.google.container.v1beta1.MaxPodsConstraint\x12Y\n\x1cresource_usage_export_config\x18! \x01(\x0b\x32\x33.google.container.v1beta1.ResourceUsageExportConfig\x12N\n\x16private_cluster_config\x18% \x01(\x0b\x32..google.container.v1beta1.PrivateClusterConfig\x12R\n\x18vertical_pod_autoscaling\x18\' \x01(\x0b\x32\x30.google.container.v1beta1.VerticalPodAutoscaling\x12\x11\n\tself_link\x18\x64 \x01(\t\x12\x10\n\x04zone\x18\x65 \x01(\tB\x02\x18\x01\x12\x10\n\x08\x65ndpoint\x18\x66 \x01(\t\x12\x1f\n\x17initial_cluster_version\x18g \x01(\t\x12\x1e\n\x16\x63urrent_master_version\x18h \x01(\t\x12 \n\x14\x63urrent_node_version\x18i \x01(\tB\x02\x18\x01\x12\x13\n\x0b\x63reate_time\x18j \x01(\t\x12\x38\n\x06status\x18k \x01(\x0e\x32(.google.container.v1beta1.Cluster.Status\x12\x16\n\x0estatus_message\x18l \x01(\t\x12\x1b\n\x13node_ipv4_cidr_size\x18m \x01(\x05\x12\x1a\n\x12services_ipv4_cidr\x18n \x01(\t\x12\x1f\n\x13instance_group_urls\x18o \x03(\tB\x02\x18\x01\x12\x1e\n\x12\x63urrent_node_count\x18p \x01(\x05\x42\x02\x18\x01\x12\x13\n\x0b\x65xpire_time\x18q \x01(\t\x12\x10\n\x08location\x18r \x01(\t\x12\x12\n\nenable_tpu\x18s \x01(\x08\x12\x1b\n\x13tpu_ipv4_cidr_block\x18t \x01(\t\x12=\n\nconditions\x18v \x03(\x0b\x32).google.container.v1beta1.StatusCondition\x1a\x35\n\x13ResourceLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"w\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x10\n\x0cPROVISIONING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x0f\n\x0bRECONCILING\x10\x03\x12\x0c\n\x08STOPPING\x10\x04\x12\t\n\x05\x45RROR\x10\x05\x12\x0c\n\x08\x44\x45GRADED\x10\x06"\xb7\x07\n\rClusterUpdate\x12\x1c\n\x14\x64\x65sired_node_version\x18\x04 \x01(\t\x12"\n\x1a\x64\x65sired_monitoring_service\x18\x05 \x01(\t\x12\x45\n\x15\x64\x65sired_addons_config\x18\x06 \x01(\x0b\x32&.google.container.v1beta1.AddonsConfig\x12\x1c\n\x14\x64\x65sired_node_pool_id\x18\x07 \x01(\t\x12\x1a\n\x12\x64\x65sired_image_type\x18\x08 \x01(\t\x12T\n\x1d\x64\x65sired_node_pool_autoscaling\x18\t \x01(\x0b\x32-.google.container.v1beta1.NodePoolAutoscaling\x12\x19\n\x11\x64\x65sired_locations\x18\n \x03(\t\x12k\n)desired_master_authorized_networks_config\x18\x0c \x01(\x0b\x32\x38.google.container.v1beta1.MasterAuthorizedNetworksConfig\x12]\n"desired_pod_security_policy_config\x18\x0e \x01(\x0b\x32\x31.google.container.v1beta1.PodSecurityPolicyConfig\x12Q\n\x1b\x64\x65sired_cluster_autoscaling\x18\x0f \x01(\x0b\x32,.google.container.v1beta1.ClusterAutoscaling\x12S\n\x1c\x64\x65sired_binary_authorization\x18\x10 \x01(\x0b\x32-.google.container.v1beta1.BinaryAuthorization\x12\x1f\n\x17\x64\x65sired_logging_service\x18\x13 \x01(\t\x12\x61\n$desired_resource_usage_export_config\x18\x15 \x01(\x0b\x32\x33.google.container.v1beta1.ResourceUsageExportConfig\x12Z\n desired_vertical_pod_autoscaling\x18\x16 \x01(\x0b\x32\x30.google.container.v1beta1.VerticalPodAutoscaling\x12\x1e\n\x16\x64\x65sired_master_version\x18\x64 \x01(\t"\xd3\x07\n\tOperation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12@\n\x0eoperation_type\x18\x03 \x01(\x0e\x32(.google.container.v1beta1.Operation.Type\x12:\n\x06status\x18\x04 \x01(\x0e\x32*.google.container.v1beta1.Operation.Status\x12\x0e\n\x06\x64\x65tail\x18\x08 \x01(\t\x12\x16\n\x0estatus_message\x18\x05 \x01(\t\x12\x11\n\tself_link\x18\x06 \x01(\t\x12\x13\n\x0btarget_link\x18\x07 \x01(\t\x12\x10\n\x08location\x18\t \x01(\t\x12\x12\n\nstart_time\x18\n \x01(\t\x12\x10\n\x08\x65nd_time\x18\x0b \x01(\t\x12=\n\x08progress\x18\x0c \x01(\x0b\x32+.google.container.v1beta1.OperationProgress\x12\x45\n\x12\x63luster_conditions\x18\r \x03(\x0b\x32).google.container.v1beta1.StatusCondition\x12\x46\n\x13nodepool_conditions\x18\x0e \x03(\x0b\x32).google.container.v1beta1.StatusCondition"R\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\x12\x0c\n\x08\x41\x42ORTING\x10\x04"\xfd\x02\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x43REATE_CLUSTER\x10\x01\x12\x12\n\x0e\x44\x45LETE_CLUSTER\x10\x02\x12\x12\n\x0eUPGRADE_MASTER\x10\x03\x12\x11\n\rUPGRADE_NODES\x10\x04\x12\x12\n\x0eREPAIR_CLUSTER\x10\x05\x12\x12\n\x0eUPDATE_CLUSTER\x10\x06\x12\x14\n\x10\x43REATE_NODE_POOL\x10\x07\x12\x14\n\x10\x44\x45LETE_NODE_POOL\x10\x08\x12\x1c\n\x18SET_NODE_POOL_MANAGEMENT\x10\t\x12\x15\n\x11\x41UTO_REPAIR_NODES\x10\n\x12\x16\n\x12\x41UTO_UPGRADE_NODES\x10\x0b\x12\x0e\n\nSET_LABELS\x10\x0c\x12\x13\n\x0fSET_MASTER_AUTH\x10\r\x12\x16\n\x12SET_NODE_POOL_SIZE\x10\x0e\x12\x16\n\x12SET_NETWORK_POLICY\x10\x0f\x12\x1a\n\x16SET_MAINTENANCE_POLICY\x10\x10"\xc5\x02\n\x11OperationProgress\x12\x0c\n\x04name\x18\x01 \x01(\t\x12:\n\x06status\x18\x02 \x01(\x0e\x32*.google.container.v1beta1.Operation.Status\x12\x43\n\x07metrics\x18\x03 \x03(\x0b\x32\x32.google.container.v1beta1.OperationProgress.Metric\x12;\n\x06stages\x18\x04 \x03(\x0b\x32+.google.container.v1beta1.OperationProgress\x1a\x64\n\x06Metric\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\tint_value\x18\x02 \x01(\x03H\x00\x12\x16\n\x0c\x64ouble_value\x18\x03 \x01(\x01H\x00\x12\x16\n\x0cstring_value\x18\x04 \x01(\tH\x00\x42\x07\n\x05value"\x84\x01\n\x14\x43reateClusterRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x32\n\x07\x63luster\x18\x03 \x01(\x0b\x32!.google.container.v1beta1.Cluster\x12\x0e\n\x06parent\x18\x05 \x01(\t"c\n\x11GetClusterRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x0c\n\x04name\x18\x05 \x01(\t"\x9f\x01\n\x14UpdateClusterRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x37\n\x06update\x18\x04 \x01(\x0b\x32\'.google.container.v1beta1.ClusterUpdate\x12\x0c\n\x04name\x18\x05 \x01(\t"\xab\x01\n\x15UpdateNodePoolRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x18\n\x0cnode_pool_id\x18\x04 \x01(\tB\x02\x18\x01\x12\x14\n\x0cnode_version\x18\x05 \x01(\t\x12\x12\n\nimage_type\x18\x06 \x01(\t\x12\x0c\n\x04name\x18\x08 \x01(\t"\xcd\x01\n\x1dSetNodePoolAutoscalingRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x18\n\x0cnode_pool_id\x18\x04 \x01(\tB\x02\x18\x01\x12\x42\n\x0b\x61utoscaling\x18\x05 \x01(\x0b\x32-.google.container.v1beta1.NodePoolAutoscaling\x12\x0c\n\x04name\x18\x06 \x01(\t"\x7f\n\x18SetLoggingServiceRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x0c\n\x04zone\x18\x02 \x01(\t\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x17\n\x0flogging_service\x18\x04 \x01(\t\x12\x0c\n\x04name\x18\x05 \x01(\t"\x89\x01\n\x1bSetMonitoringServiceRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x1a\n\x12monitoring_service\x18\x04 \x01(\t\x12\x0c\n\x04name\x18\x06 \x01(\t"\xa7\x01\n\x16SetAddonsConfigRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12=\n\raddons_config\x18\x04 \x01(\x0b\x32&.google.container.v1beta1.AddonsConfig\x12\x0c\n\x04name\x18\x06 \x01(\t"x\n\x13SetLocationsRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x11\n\tlocations\x18\x04 \x03(\t\x12\x0c\n\x04name\x18\x06 \x01(\t"}\n\x13UpdateMasterRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x16\n\x0emaster_version\x18\x04 \x01(\t\x12\x0c\n\x04name\x18\x07 \x01(\t"\xb5\x02\n\x14SetMasterAuthRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x45\n\x06\x61\x63tion\x18\x04 \x01(\x0e\x32\x35.google.container.v1beta1.SetMasterAuthRequest.Action\x12\x34\n\x06update\x18\x05 \x01(\x0b\x32$.google.container.v1beta1.MasterAuth\x12\x0c\n\x04name\x18\x07 \x01(\t"P\n\x06\x41\x63tion\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x10\n\x0cSET_PASSWORD\x10\x01\x12\x15\n\x11GENERATE_PASSWORD\x10\x02\x12\x10\n\x0cSET_USERNAME\x10\x03"f\n\x14\x44\x65leteClusterRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x0c\n\x04name\x18\x04 \x01(\t"O\n\x13ListClustersRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x0e\n\x06parent\x18\x04 \x01(\t"b\n\x14ListClustersResponse\x12\x33\n\x08\x63lusters\x18\x01 \x03(\x0b\x32!.google.container.v1beta1.Cluster\x12\x15\n\rmissing_zones\x18\x02 \x03(\t"g\n\x13GetOperationRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x18\n\x0coperation_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x0c\n\x04name\x18\x05 \x01(\t"Q\n\x15ListOperationsRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x0e\n\x06parent\x18\x04 \x01(\t"j\n\x16\x43\x61ncelOperationRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x18\n\x0coperation_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x0c\n\x04name\x18\x04 \x01(\t"h\n\x16ListOperationsResponse\x12\x37\n\noperations\x18\x01 \x03(\x0b\x32#.google.container.v1beta1.Operation\x12\x15\n\rmissing_zones\x18\x02 \x03(\t"P\n\x16GetServerConfigRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x0c\n\x04name\x18\x04 \x01(\t"\xa2\x01\n\x0cServerConfig\x12\x1f\n\x17\x64\x65\x66\x61ult_cluster_version\x18\x01 \x01(\t\x12\x1b\n\x13valid_node_versions\x18\x03 \x03(\t\x12\x1a\n\x12\x64\x65\x66\x61ult_image_type\x18\x04 \x01(\t\x12\x19\n\x11valid_image_types\x18\x05 \x03(\t\x12\x1d\n\x15valid_master_versions\x18\x06 \x03(\t"\xa0\x01\n\x15\x43reateNodePoolRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x35\n\tnode_pool\x18\x04 \x01(\x0b\x32".google.container.v1beta1.NodePool\x12\x0e\n\x06parent\x18\x06 \x01(\t"\x81\x01\n\x15\x44\x65leteNodePoolRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x18\n\x0cnode_pool_id\x18\x04 \x01(\tB\x02\x18\x01\x12\x0c\n\x04name\x18\x06 \x01(\t"h\n\x14ListNodePoolsRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x0e\n\x06parent\x18\x05 \x01(\t"~\n\x12GetNodePoolRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x18\n\x0cnode_pool_id\x18\x04 \x01(\tB\x02\x18\x01\x12\x0c\n\x04name\x18\x06 \x01(\t"\x8d\x05\n\x08NodePool\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x06\x63onfig\x18\x02 \x01(\x0b\x32$.google.container.v1beta1.NodeConfig\x12\x1a\n\x12initial_node_count\x18\x03 \x01(\x05\x12\x11\n\tself_link\x18\x64 \x01(\t\x12\x0f\n\x07version\x18\x65 \x01(\t\x12\x1b\n\x13instance_group_urls\x18\x66 \x03(\t\x12\x39\n\x06status\x18g \x01(\x0e\x32).google.container.v1beta1.NodePool.Status\x12\x16\n\x0estatus_message\x18h \x01(\t\x12\x42\n\x0b\x61utoscaling\x18\x04 \x01(\x0b\x32-.google.container.v1beta1.NodePoolAutoscaling\x12<\n\nmanagement\x18\x05 \x01(\x0b\x32(.google.container.v1beta1.NodeManagement\x12H\n\x13max_pods_constraint\x18\x06 \x01(\x0b\x32+.google.container.v1beta1.MaxPodsConstraint\x12=\n\nconditions\x18i \x03(\x0b\x32).google.container.v1beta1.StatusCondition"\x81\x01\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x10\n\x0cPROVISIONING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x16\n\x12RUNNING_WITH_ERROR\x10\x03\x12\x0f\n\x0bRECONCILING\x10\x04\x12\x0c\n\x08STOPPING\x10\x05\x12\t\n\x05\x45RROR\x10\x06"\x82\x01\n\x0eNodeManagement\x12\x14\n\x0c\x61uto_upgrade\x18\x01 \x01(\x08\x12\x13\n\x0b\x61uto_repair\x18\x02 \x01(\x08\x12\x45\n\x0fupgrade_options\x18\n \x01(\x0b\x32,.google.container.v1beta1.AutoUpgradeOptions"J\n\x12\x41utoUpgradeOptions\x12\x1f\n\x17\x61uto_upgrade_start_time\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t"P\n\x11MaintenancePolicy\x12;\n\x06window\x18\x01 \x01(\x0b\x32+.google.container.v1beta1.MaintenanceWindow"s\n\x11MaintenanceWindow\x12T\n\x18\x64\x61ily_maintenance_window\x18\x02 \x01(\x0b\x32\x30.google.container.v1beta1.DailyMaintenanceWindowH\x00\x42\x08\n\x06policy">\n\x16\x44\x61ilyMaintenanceWindow\x12\x12\n\nstart_time\x18\x02 \x01(\t\x12\x10\n\x08\x64uration\x18\x03 \x01(\t"\xc6\x01\n\x1cSetNodePoolManagementRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x18\n\x0cnode_pool_id\x18\x04 \x01(\tB\x02\x18\x01\x12<\n\nmanagement\x18\x05 \x01(\x0b\x32(.google.container.v1beta1.NodeManagement\x12\x0c\n\x04name\x18\x07 \x01(\t"\x96\x01\n\x16SetNodePoolSizeRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x18\n\x0cnode_pool_id\x18\x04 \x01(\tB\x02\x18\x01\x12\x12\n\nnode_count\x18\x05 \x01(\x05\x12\x0c\n\x04name\x18\x07 \x01(\t"\x8a\x01\n\x1eRollbackNodePoolUpgradeRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x18\n\x0cnode_pool_id\x18\x04 \x01(\tB\x02\x18\x01\x12\x0c\n\x04name\x18\x06 \x01(\t"O\n\x15ListNodePoolsResponse\x12\x36\n\nnode_pools\x18\x01 \x03(\x0b\x32".google.container.v1beta1.NodePool"|\n\x12\x43lusterAutoscaling\x12$\n\x1c\x65nable_node_autoprovisioning\x18\x01 \x01(\x08\x12@\n\x0fresource_limits\x18\x02 \x03(\x0b\x32\'.google.container.v1beta1.ResourceLimit"H\n\rResourceLimit\x12\x15\n\rresource_type\x18\x01 \x01(\t\x12\x0f\n\x07minimum\x18\x02 \x01(\x03\x12\x0f\n\x07maximum\x18\x03 \x01(\x03"o\n\x13NodePoolAutoscaling\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x16\n\x0emin_node_count\x18\x02 \x01(\x05\x12\x16\n\x0emax_node_count\x18\x03 \x01(\x05\x12\x17\n\x0f\x61utoprovisioned\x18\x04 \x01(\x08"\x8d\x02\n\x10SetLabelsRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12W\n\x0fresource_labels\x18\x04 \x03(\x0b\x32>.google.container.v1beta1.SetLabelsRequest.ResourceLabelsEntry\x12\x19\n\x11label_fingerprint\x18\x05 \x01(\t\x12\x0c\n\x04name\x18\x07 \x01(\t\x1a\x35\n\x13ResourceLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"w\n\x14SetLegacyAbacRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x0f\n\x07\x65nabled\x18\x04 \x01(\x08\x12\x0c\n\x04name\x18\x06 \x01(\t"\x84\x01\n\x16StartIPRotationRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x0c\n\x04name\x18\x06 \x01(\t\x12\x1a\n\x12rotate_credentials\x18\x07 \x01(\x08"k\n\x19\x43ompleteIPRotationRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12\x0c\n\x04name\x18\x07 \x01(\t"H\n\x11\x41\x63\x63\x65leratorConfig\x12\x19\n\x11\x61\x63\x63\x65lerator_count\x18\x01 \x01(\x03\x12\x18\n\x10\x61\x63\x63\x65lerator_type\x18\x02 \x01(\t"\xa7\x01\n\x16WorkloadMetadataConfig\x12T\n\rnode_metadata\x18\x01 \x01(\x0e\x32=.google.container.v1beta1.WorkloadMetadataConfig.NodeMetadata"7\n\x0cNodeMetadata\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\n\n\x06SECURE\x10\x01\x12\n\n\x06\x45XPOSE\x10\x02"\xaa\x01\n\x17SetNetworkPolicyRequest\x12\x16\n\nproject_id\x18\x01 \x01(\tB\x02\x18\x01\x12\x10\n\x04zone\x18\x02 \x01(\tB\x02\x18\x01\x12\x16\n\ncluster_id\x18\x03 \x01(\tB\x02\x18\x01\x12?\n\x0enetwork_policy\x18\x04 \x01(\x0b\x32\'.google.container.v1beta1.NetworkPolicy\x12\x0c\n\x04name\x18\x06 \x01(\t"\xaa\x01\n\x1bSetMaintenancePolicyRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x0c\n\x04zone\x18\x02 \x01(\t\x12\x12\n\ncluster_id\x18\x03 \x01(\t\x12G\n\x12maintenance_policy\x18\x04 \x01(\x0b\x32+.google.container.v1beta1.MaintenancePolicy\x12\x0c\n\x04name\x18\x05 \x01(\t"&\n\x14ListLocationsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t"g\n\x15ListLocationsResponse\x12\x35\n\tlocations\x18\x01 \x03(\x0b\x32".google.container.v1beta1.Location\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\xb1\x01\n\x08Location\x12=\n\x04type\x18\x01 \x01(\x0e\x32/.google.container.v1beta1.Location.LocationType\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0brecommended\x18\x03 \x01(\x08"C\n\x0cLocationType\x12\x1d\n\x19LOCATION_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04ZONE\x10\x01\x12\n\n\x06REGION\x10\x02"\xd5\x01\n\x0fStatusCondition\x12<\n\x04\x63ode\x18\x01 \x01(\x0e\x32..google.container.v1beta1.StatusCondition.Code\x12\x0f\n\x07message\x18\x02 \x01(\t"s\n\x04\x43ode\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x10\n\x0cGCE_STOCKOUT\x10\x01\x12\x1f\n\x1bGKE_SERVICE_ACCOUNT_DELETED\x10\x02\x12\x16\n\x12GCE_QUOTA_EXCEEDED\x10\x03\x12\x13\n\x0fSET_BY_OPERATOR\x10\x04"4\n\rNetworkConfig\x12\x0f\n\x07network\x18\x01 \x01(\t\x12\x12\n\nsubnetwork\x18\x02 \x01(\t"e\n\x1cListUsableSubnetworksRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t"y\n\x1dListUsableSubnetworksResponse\x12?\n\x0bsubnetworks\x18\x01 \x03(\x0b\x32*.google.container.v1beta1.UsableSubnetwork\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\x85\x02\n\x1eUsableSubnetworkSecondaryRange\x12\x12\n\nrange_name\x18\x01 \x01(\t\x12\x15\n\rip_cidr_range\x18\x02 \x01(\t\x12O\n\x06status\x18\x03 \x01(\x0e\x32?.google.container.v1beta1.UsableSubnetworkSecondaryRange.Status"g\n\x06Status\x12\x0b\n\x07UNKNOWN\x10\x00\x12\n\n\x06UNUSED\x10\x01\x12\x12\n\x0eIN_USE_SERVICE\x10\x02\x12\x18\n\x14IN_USE_SHAREABLE_POD\x10\x03\x12\x16\n\x12IN_USE_MANAGED_POD\x10\x04"\xbd\x01\n\x10UsableSubnetwork\x12\x12\n\nsubnetwork\x18\x01 \x01(\t\x12\x0f\n\x07network\x18\x02 \x01(\t\x12\x15\n\rip_cidr_range\x18\x03 \x01(\t\x12U\n\x13secondary_ip_ranges\x18\x04 \x03(\x0b\x32\x38.google.container.v1beta1.UsableSubnetworkSecondaryRange\x12\x16\n\x0estatus_message\x18\x05 \x01(\t")\n\x16VerticalPodAutoscaling\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08".\n\x11MaxPodsConstraint\x12\x19\n\x11max_pods_per_node\x18\x01 \x01(\x03"\xd5\x01\n\x19ResourceUsageExportConfig\x12\x65\n\x14\x62igquery_destination\x18\x01 \x01(\x0b\x32G.google.container.v1beta1.ResourceUsageExportConfig.BigQueryDestination\x12&\n\x1e\x65nable_network_egress_metering\x18\x02 \x01(\x08\x1a)\n\x13\x42igQueryDestination\x12\x12\n\ndataset_id\x18\x01 \x01(\t2\x91\x41\n\x0e\x43lusterManager\x12\xe0\x01\n\x0cListClusters\x12-.google.container.v1beta1.ListClustersRequest\x1a..google.container.v1beta1.ListClustersResponse"q\x82\xd3\xe4\x93\x02k\x12\x31/v1beta1/{parent=projects/*/locations/*}/clustersZ6\x12\x34/v1beta1/projects/{project_id}/zones/{zone}/clusters\x12\xdc\x01\n\nGetCluster\x12+.google.container.v1beta1.GetClusterRequest\x1a!.google.container.v1beta1.Cluster"~\x82\xd3\xe4\x93\x02x\x12\x31/v1beta1/{name=projects/*/locations/*/clusters/*}ZC\x12\x41/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}\x12\xdd\x01\n\rCreateCluster\x12..google.container.v1beta1.CreateClusterRequest\x1a#.google.container.v1beta1.Operation"w\x82\xd3\xe4\x93\x02q"1/v1beta1/{parent=projects/*/locations/*}/clusters:\x01*Z9"4/v1beta1/projects/{project_id}/zones/{zone}/clusters:\x01*\x12\xeb\x01\n\rUpdateCluster\x12..google.container.v1beta1.UpdateClusterRequest\x1a#.google.container.v1beta1.Operation"\x84\x01\x82\xd3\xe4\x93\x02~\x1a\x31/v1beta1/{name=projects/*/locations/*/clusters/*}:\x01*ZF\x1a\x41/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:\x01*\x12\x9a\x02\n\x0eUpdateNodePool\x12/.google.container.v1beta1.UpdateNodePoolRequest\x1a#.google.container.v1beta1.Operation"\xb1\x01\x82\xd3\xe4\x93\x02\xaa\x01\x1a=/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:\x01*Zf"a/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/update:\x01*\x12\xbe\x02\n\x16SetNodePoolAutoscaling\x12\x37.google.container.v1beta1.SetNodePoolAutoscalingRequest\x1a#.google.container.v1beta1.Operation"\xc5\x01\x82\xd3\xe4\x93\x02\xbe\x01"L/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setAutoscaling:\x01*Zk"f/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/autoscaling:\x01*\x12\x87\x02\n\x11SetLoggingService\x12\x32.google.container.v1beta1.SetLoggingServiceRequest\x1a#.google.container.v1beta1.Operation"\x98\x01\x82\xd3\xe4\x93\x02\x91\x01"/v1beta1/{name=projects/*/locations/*/clusters/*}:setLocations:\x01*ZP"K/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/locations:\x01*\x12\xfe\x01\n\x0cUpdateMaster\x12-.google.container.v1beta1.UpdateMasterRequest\x1a#.google.container.v1beta1.Operation"\x99\x01\x82\xd3\xe4\x93\x02\x92\x01">/v1beta1/{name=projects/*/locations/*/clusters/*}:updateMaster:\x01*ZM"H/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/master:\x01*\x12\x88\x02\n\rSetMasterAuth\x12..google.container.v1beta1.SetMasterAuthRequest\x1a#.google.container.v1beta1.Operation"\xa1\x01\x82\xd3\xe4\x93\x02\x9a\x01"?/v1beta1/{name=projects/*/locations/*/clusters/*}:setMasterAuth:\x01*ZT"O/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMasterAuth:\x01*\x12\xe4\x01\n\rDeleteCluster\x12..google.container.v1beta1.DeleteClusterRequest\x1a#.google.container.v1beta1.Operation"~\x82\xd3\xe4\x93\x02x*1/v1beta1/{name=projects/*/locations/*/clusters/*}ZC*A/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}\x12\xea\x01\n\x0eListOperations\x12/.google.container.v1beta1.ListOperationsRequest\x1a\x30.google.container.v1beta1.ListOperationsResponse"u\x82\xd3\xe4\x93\x02o\x12\x33/v1beta1/{parent=projects/*/locations/*}/operationsZ8\x12\x36/v1beta1/projects/{project_id}/zones/{zone}/operations\x12\xe9\x01\n\x0cGetOperation\x12-.google.container.v1beta1.GetOperationRequest\x1a#.google.container.v1beta1.Operation"\x84\x01\x82\xd3\xe4\x93\x02~\x12\x33/v1beta1/{name=projects/*/locations/*/operations/*}ZG\x12\x45/v1beta1/projects/{project_id}/zones/{zone}/operations/{operation_id}\x12\xf7\x01\n\x0f\x43\x61ncelOperation\x12\x30.google.container.v1beta1.CancelOperationRequest\x1a\x16.google.protobuf.Empty"\x99\x01\x82\xd3\xe4\x93\x02\x92\x01":/v1beta1/{name=projects/*/locations/*/operations/*}:cancel:\x01*ZQ"L/v1beta1/projects/{project_id}/zones/{zone}/operations/{operation_id}:cancel:\x01*\x12\xe4\x01\n\x0fGetServerConfig\x12\x30.google.container.v1beta1.GetServerConfigRequest\x1a&.google.container.v1beta1.ServerConfig"w\x82\xd3\xe4\x93\x02q\x12\x33/v1beta1/{name=projects/*/locations/*}/serverConfigZ:\x12\x38/v1beta1/projects/{project_id}/zones/{zone}/serverconfig\x12\x88\x02\n\rListNodePools\x12..google.container.v1beta1.ListNodePoolsRequest\x1a/.google.container.v1beta1.ListNodePoolsResponse"\x95\x01\x82\xd3\xe4\x93\x02\x8e\x01\x12=/v1beta1/{parent=projects/*/locations/*/clusters/*}/nodePoolsZM\x12K/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools\x12\x86\x02\n\x0bGetNodePool\x12,.google.container.v1beta1.GetNodePoolRequest\x1a".google.container.v1beta1.NodePool"\xa4\x01\x82\xd3\xe4\x93\x02\x9d\x01\x12=/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}Z\\\x12Z/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}\x12\x84\x02\n\x0e\x43reateNodePool\x12/.google.container.v1beta1.CreateNodePoolRequest\x1a#.google.container.v1beta1.Operation"\x9b\x01\x82\xd3\xe4\x93\x02\x94\x01"=/v1beta1/{parent=projects/*/locations/*/clusters/*}/nodePools:\x01*ZP"K/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools:\x01*\x12\x8d\x02\n\x0e\x44\x65leteNodePool\x12/.google.container.v1beta1.DeleteNodePoolRequest\x1a#.google.container.v1beta1.Operation"\xa4\x01\x82\xd3\xe4\x93\x02\x9d\x01*=/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}Z\\*Z/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}\x12\xb7\x02\n\x17RollbackNodePoolUpgrade\x12\x38.google.container.v1beta1.RollbackNodePoolUpgradeRequest\x1a#.google.container.v1beta1.Operation"\xbc\x01\x82\xd3\xe4\x93\x02\xb5\x01"F/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:rollback:\x01*Zh"c/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}:rollback:\x01*\x12\xbd\x02\n\x15SetNodePoolManagement\x12\x36.google.container.v1beta1.SetNodePoolManagementRequest\x1a#.google.container.v1beta1.Operation"\xc6\x01\x82\xd3\xe4\x93\x02\xbf\x01"K/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setManagement:\x01*Zm"h/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setManagement:\x01*\x12\x85\x02\n\tSetLabels\x12*.google.container.v1beta1.SetLabelsRequest\x1a#.google.container.v1beta1.Operation"\xa6\x01\x82\xd3\xe4\x93\x02\x9f\x01"C/v1beta1/{name=projects/*/locations/*/clusters/*}:setResourceLabels:\x01*ZU"P/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/resourceLabels:\x01*\x12\x85\x02\n\rSetLegacyAbac\x12..google.container.v1beta1.SetLegacyAbacRequest\x1a#.google.container.v1beta1.Operation"\x9e\x01\x82\xd3\xe4\x93\x02\x97\x01"?/v1beta1/{name=projects/*/locations/*/clusters/*}:setLegacyAbac:\x01*ZQ"L/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/legacyAbac:\x01*\x12\x90\x02\n\x0fStartIPRotation\x12\x30.google.container.v1beta1.StartIPRotationRequest\x1a#.google.container.v1beta1.Operation"\xa5\x01\x82\xd3\xe4\x93\x02\x9e\x01"A/v1beta1/{name=projects/*/locations/*/clusters/*}:startIpRotation:\x01*ZV"Q/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:startIpRotation:\x01*\x12\x9c\x02\n\x12\x43ompleteIPRotation\x12\x33.google.container.v1beta1.CompleteIPRotationRequest\x1a#.google.container.v1beta1.Operation"\xab\x01\x82\xd3\xe4\x93\x02\xa4\x01"D/v1beta1/{name=projects/*/locations/*/clusters/*}:completeIpRotation:\x01*ZY"T/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:completeIpRotation:\x01*\x12\xa5\x02\n\x0fSetNodePoolSize\x12\x30.google.container.v1beta1.SetNodePoolSizeRequest\x1a#.google.container.v1beta1.Operation"\xba\x01\x82\xd3\xe4\x93\x02\xb3\x01"E/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setSize:\x01*Zg"b/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setSize:\x01*\x12\x94\x02\n\x10SetNetworkPolicy\x12\x31.google.container.v1beta1.SetNetworkPolicyRequest\x1a#.google.container.v1beta1.Operation"\xa7\x01\x82\xd3\xe4\x93\x02\xa0\x01"B/v1beta1/{name=projects/*/locations/*/clusters/*}:setNetworkPolicy:\x01*ZW"R/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setNetworkPolicy:\x01*\x12\xa4\x02\n\x14SetMaintenancePolicy\x12\x35.google.container.v1beta1.SetMaintenancePolicyRequest\x1a#.google.container.v1beta1.Operation"\xaf\x01\x82\xd3\xe4\x93\x02\xa8\x01"F/v1beta1/{name=projects/*/locations/*/clusters/*}:setMaintenancePolicy:\x01*Z["V/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMaintenancePolicy:\x01*\x12\xcb\x01\n\x15ListUsableSubnetworks\x12\x36.google.container.v1beta1.ListUsableSubnetworksRequest\x1a\x37.google.container.v1beta1.ListUsableSubnetworksResponse"A\x82\xd3\xe4\x93\x02;\x12\x39/v1beta1/{parent=projects/*}/aggregated/usableSubnetworks\x12\xa0\x01\n\rListLocations\x12..google.container.v1beta1.ListLocationsRequest\x1a/.google.container.v1beta1.ListLocationsResponse".\x82\xd3\xe4\x93\x02(\x12&/v1beta1/{parent=projects/*}/locationsB\xba\x01\n\x1c\x63om.google.container.v1beta1B\x13\x43lusterServiceProtoP\x01ZAgoogle.golang.org/genproto/googleapis/container/v1beta1;container\xaa\x02\x1eGoogle.Cloud.Container.V1Beta1\xca\x02\x1eGoogle\\Cloud\\Container\\V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_iam_dot_v1_dot_iam__policy__pb2.DESCRIPTOR, - google_dot_iam_dot_v1_dot_policy__pb2.DESCRIPTOR, - google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, - ], -) - - -_NODETAINT_EFFECT = _descriptor.EnumDescriptor( - name="Effect", - full_name="google.container.v1beta1.NodeTaint.Effect", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="EFFECT_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NO_SCHEDULE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PREFER_NO_SCHEDULE", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NO_EXECUTE", index=3, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=976, - serialized_end=1065, -) -_sym_db.RegisterEnumDescriptor(_NODETAINT_EFFECT) - -_ISTIOCONFIG_ISTIOAUTHMODE = _descriptor.EnumDescriptor( - name="IstioAuthMode", - full_name="google.container.v1beta1.IstioConfig.IstioAuthMode", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="AUTH_NONE", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="AUTH_MUTUAL_TLS", - index=1, - number=1, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2247, - serialized_end=2298, -) -_sym_db.RegisterEnumDescriptor(_ISTIOCONFIG_ISTIOAUTHMODE) - -_NETWORKPOLICY_PROVIDER = _descriptor.EnumDescriptor( - name="Provider", - full_name="google.container.v1beta1.NetworkPolicy.Provider", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="PROVIDER_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CALICO", index=1, number=1, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2666, - serialized_end=2714, -) -_sym_db.RegisterEnumDescriptor(_NETWORKPOLICY_PROVIDER) - -_CLUSTER_STATUS = _descriptor.EnumDescriptor( - name="Status", - full_name="google.container.v1beta1.Cluster.Status", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATUS_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="PROVISIONING", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RUNNING", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RECONCILING", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="STOPPING", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="ERROR", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DEGRADED", index=6, number=6, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=5467, - serialized_end=5586, -) -_sym_db.RegisterEnumDescriptor(_CLUSTER_STATUS) - -_OPERATION_STATUS = _descriptor.EnumDescriptor( - name="Status", - full_name="google.container.v1beta1.Operation.Status", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATUS_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="PENDING", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RUNNING", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DONE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="ABORTING", index=4, number=4, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=7056, - serialized_end=7138, -) -_sym_db.RegisterEnumDescriptor(_OPERATION_STATUS) - -_OPERATION_TYPE = _descriptor.EnumDescriptor( - name="Type", - full_name="google.container.v1beta1.Operation.Type", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CREATE_CLUSTER", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DELETE_CLUSTER", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UPGRADE_MASTER", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UPGRADE_NODES", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="REPAIR_CLUSTER", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UPDATE_CLUSTER", index=6, number=6, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CREATE_NODE_POOL", - index=7, - number=7, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="DELETE_NODE_POOL", - index=8, - number=8, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SET_NODE_POOL_MANAGEMENT", - index=9, - number=9, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="AUTO_REPAIR_NODES", - index=10, - number=10, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="AUTO_UPGRADE_NODES", - index=11, - number=11, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SET_LABELS", index=12, number=12, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SET_MASTER_AUTH", - index=13, - number=13, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SET_NODE_POOL_SIZE", - index=14, - number=14, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SET_NETWORK_POLICY", - index=15, - number=15, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SET_MAINTENANCE_POLICY", - index=16, - number=16, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=7141, - serialized_end=7522, -) -_sym_db.RegisterEnumDescriptor(_OPERATION_TYPE) - -_SETMASTERAUTHREQUEST_ACTION = _descriptor.EnumDescriptor( - name="Action", - full_name="google.container.v1beta1.SetMasterAuthRequest.Action", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SET_PASSWORD", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="GENERATE_PASSWORD", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SET_USERNAME", index=3, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=9550, - serialized_end=9630, -) -_sym_db.RegisterEnumDescriptor(_SETMASTERAUTHREQUEST_ACTION) - -_NODEPOOL_STATUS = _descriptor.EnumDescriptor( - name="Status", - full_name="google.container.v1beta1.NodePool.Status", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATUS_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="PROVISIONING", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RUNNING", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RUNNING_WITH_ERROR", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RECONCILING", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="STOPPING", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="ERROR", index=6, number=6, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=11620, - serialized_end=11749, -) -_sym_db.RegisterEnumDescriptor(_NODEPOOL_STATUS) - -_WORKLOADMETADATACONFIG_NODEMETADATA = _descriptor.EnumDescriptor( - name="NodeMetadata", - full_name="google.container.v1beta1.WorkloadMetadataConfig.NodeMetadata", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNSPECIFIED", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SECURE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="EXPOSE", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=13936, - serialized_end=13991, -) -_sym_db.RegisterEnumDescriptor(_WORKLOADMETADATACONFIG_NODEMETADATA) - -_LOCATION_LOCATIONTYPE = _descriptor.EnumDescriptor( - name="LocationType", - full_name="google.container.v1beta1.Location.LocationType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="LOCATION_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="ZONE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="REGION", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=14595, - serialized_end=14662, -) -_sym_db.RegisterEnumDescriptor(_LOCATION_LOCATIONTYPE) - -_STATUSCONDITION_CODE = _descriptor.EnumDescriptor( - name="Code", - full_name="google.container.v1beta1.StatusCondition.Code", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="GCE_STOCKOUT", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="GKE_SERVICE_ACCOUNT_DELETED", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="GCE_QUOTA_EXCEEDED", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SET_BY_OPERATOR", - index=4, - number=4, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=14763, - serialized_end=14878, -) -_sym_db.RegisterEnumDescriptor(_STATUSCONDITION_CODE) - -_USABLESUBNETWORKSECONDARYRANGE_STATUS = _descriptor.EnumDescriptor( - name="Status", - full_name="google.container.v1beta1.UsableSubnetworkSecondaryRange.Status", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UNUSED", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="IN_USE_SERVICE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="IN_USE_SHAREABLE_POD", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="IN_USE_MANAGED_POD", - index=4, - number=4, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=15319, - serialized_end=15422, -) -_sym_db.RegisterEnumDescriptor(_USABLESUBNETWORKSECONDARYRANGE_STATUS) - - -_NODECONFIG_METADATAENTRY = _descriptor.Descriptor( - name="MetadataEntry", - full_name="google.container.v1beta1.NodeConfig.MetadataEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.container.v1beta1.NodeConfig.MetadataEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.container.v1beta1.NodeConfig.MetadataEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=778, - serialized_end=825, -) - -_NODECONFIG_LABELSENTRY = _descriptor.Descriptor( - name="LabelsEntry", - full_name="google.container.v1beta1.NodeConfig.LabelsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.container.v1beta1.NodeConfig.LabelsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.container.v1beta1.NodeConfig.LabelsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=827, - serialized_end=872, -) - -_NODECONFIG = _descriptor.Descriptor( - name="NodeConfig", - full_name="google.container.v1beta1.NodeConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="machine_type", - full_name="google.container.v1beta1.NodeConfig.machine_type", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="disk_size_gb", - full_name="google.container.v1beta1.NodeConfig.disk_size_gb", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="oauth_scopes", - full_name="google.container.v1beta1.NodeConfig.oauth_scopes", - index=2, - number=3, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="service_account", - full_name="google.container.v1beta1.NodeConfig.service_account", - index=3, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="metadata", - full_name="google.container.v1beta1.NodeConfig.metadata", - index=4, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_type", - full_name="google.container.v1beta1.NodeConfig.image_type", - index=5, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="labels", - full_name="google.container.v1beta1.NodeConfig.labels", - index=6, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="local_ssd_count", - full_name="google.container.v1beta1.NodeConfig.local_ssd_count", - index=7, - number=7, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tags", - full_name="google.container.v1beta1.NodeConfig.tags", - index=8, - number=8, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="preemptible", - full_name="google.container.v1beta1.NodeConfig.preemptible", - index=9, - number=10, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="accelerators", - full_name="google.container.v1beta1.NodeConfig.accelerators", - index=10, - number=11, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="disk_type", - full_name="google.container.v1beta1.NodeConfig.disk_type", - index=11, - number=12, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="min_cpu_platform", - full_name="google.container.v1beta1.NodeConfig.min_cpu_platform", - index=12, - number=13, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="workload_metadata_config", - full_name="google.container.v1beta1.NodeConfig.workload_metadata_config", - index=13, - number=14, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="taints", - full_name="google.container.v1beta1.NodeConfig.taints", - index=14, - number=15, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_NODECONFIG_METADATAENTRY, _NODECONFIG_LABELSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=208, - serialized_end=872, -) - - -_NODETAINT = _descriptor.Descriptor( - name="NodeTaint", - full_name="google.container.v1beta1.NodeTaint", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.container.v1beta1.NodeTaint.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.container.v1beta1.NodeTaint.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="effect", - full_name="google.container.v1beta1.NodeTaint.effect", - index=2, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_NODETAINT_EFFECT], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=875, - serialized_end=1065, -) - - -_MASTERAUTH = _descriptor.Descriptor( - name="MasterAuth", - full_name="google.container.v1beta1.MasterAuth", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="username", - full_name="google.container.v1beta1.MasterAuth.username", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="password", - full_name="google.container.v1beta1.MasterAuth.password", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="client_certificate_config", - full_name="google.container.v1beta1.MasterAuth.client_certificate_config", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_ca_certificate", - full_name="google.container.v1beta1.MasterAuth.cluster_ca_certificate", - index=3, - number=100, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="client_certificate", - full_name="google.container.v1beta1.MasterAuth.client_certificate", - index=4, - number=101, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="client_key", - full_name="google.container.v1beta1.MasterAuth.client_key", - index=5, - number=102, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1068, - serialized_end=1282, -) - - -_CLIENTCERTIFICATECONFIG = _descriptor.Descriptor( - name="ClientCertificateConfig", - full_name="google.container.v1beta1.ClientCertificateConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="issue_client_certificate", - full_name="google.container.v1beta1.ClientCertificateConfig.issue_client_certificate", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1284, - serialized_end=1343, -) - - -_ADDONSCONFIG = _descriptor.Descriptor( - name="AddonsConfig", - full_name="google.container.v1beta1.AddonsConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="http_load_balancing", - full_name="google.container.v1beta1.AddonsConfig.http_load_balancing", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="horizontal_pod_autoscaling", - full_name="google.container.v1beta1.AddonsConfig.horizontal_pod_autoscaling", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="kubernetes_dashboard", - full_name="google.container.v1beta1.AddonsConfig.kubernetes_dashboard", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="network_policy_config", - full_name="google.container.v1beta1.AddonsConfig.network_policy_config", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="istio_config", - full_name="google.container.v1beta1.AddonsConfig.istio_config", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cloud_run_config", - full_name="google.container.v1beta1.AddonsConfig.cloud_run_config", - index=5, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1346, - serialized_end=1806, -) - - -_HTTPLOADBALANCING = _descriptor.Descriptor( - name="HttpLoadBalancing", - full_name="google.container.v1beta1.HttpLoadBalancing", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="disabled", - full_name="google.container.v1beta1.HttpLoadBalancing.disabled", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1808, - serialized_end=1845, -) - - -_HORIZONTALPODAUTOSCALING = _descriptor.Descriptor( - name="HorizontalPodAutoscaling", - full_name="google.container.v1beta1.HorizontalPodAutoscaling", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="disabled", - full_name="google.container.v1beta1.HorizontalPodAutoscaling.disabled", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1847, - serialized_end=1891, -) - - -_KUBERNETESDASHBOARD = _descriptor.Descriptor( - name="KubernetesDashboard", - full_name="google.container.v1beta1.KubernetesDashboard", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="disabled", - full_name="google.container.v1beta1.KubernetesDashboard.disabled", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1893, - serialized_end=1932, -) - - -_NETWORKPOLICYCONFIG = _descriptor.Descriptor( - name="NetworkPolicyConfig", - full_name="google.container.v1beta1.NetworkPolicyConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="disabled", - full_name="google.container.v1beta1.NetworkPolicyConfig.disabled", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1934, - serialized_end=1973, -) - - -_PRIVATECLUSTERCONFIG = _descriptor.Descriptor( - name="PrivateClusterConfig", - full_name="google.container.v1beta1.PrivateClusterConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="enable_private_nodes", - full_name="google.container.v1beta1.PrivateClusterConfig.enable_private_nodes", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enable_private_endpoint", - full_name="google.container.v1beta1.PrivateClusterConfig.enable_private_endpoint", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="master_ipv4_cidr_block", - full_name="google.container.v1beta1.PrivateClusterConfig.master_ipv4_cidr_block", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="private_endpoint", - full_name="google.container.v1beta1.PrivateClusterConfig.private_endpoint", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="public_endpoint", - full_name="google.container.v1beta1.PrivateClusterConfig.public_endpoint", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1976, - serialized_end=2144, -) - - -_ISTIOCONFIG = _descriptor.Descriptor( - name="IstioConfig", - full_name="google.container.v1beta1.IstioConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="disabled", - full_name="google.container.v1beta1.IstioConfig.disabled", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="auth", - full_name="google.container.v1beta1.IstioConfig.auth", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_ISTIOCONFIG_ISTIOAUTHMODE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2147, - serialized_end=2298, -) - - -_CLOUDRUNCONFIG = _descriptor.Descriptor( - name="CloudRunConfig", - full_name="google.container.v1beta1.CloudRunConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="disabled", - full_name="google.container.v1beta1.CloudRunConfig.disabled", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2300, - serialized_end=2334, -) - - -_MASTERAUTHORIZEDNETWORKSCONFIG_CIDRBLOCK = _descriptor.Descriptor( - name="CidrBlock", - full_name="google.container.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.container.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock.display_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cidr_block", - full_name="google.container.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock.cidr_block", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2477, - serialized_end=2530, -) - -_MASTERAUTHORIZEDNETWORKSCONFIG = _descriptor.Descriptor( - name="MasterAuthorizedNetworksConfig", - full_name="google.container.v1beta1.MasterAuthorizedNetworksConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="enabled", - full_name="google.container.v1beta1.MasterAuthorizedNetworksConfig.enabled", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cidr_blocks", - full_name="google.container.v1beta1.MasterAuthorizedNetworksConfig.cidr_blocks", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_MASTERAUTHORIZEDNETWORKSCONFIG_CIDRBLOCK], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2337, - serialized_end=2530, -) - - -_LEGACYABAC = _descriptor.Descriptor( - name="LegacyAbac", - full_name="google.container.v1beta1.LegacyAbac", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="enabled", - full_name="google.container.v1beta1.LegacyAbac.enabled", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2532, - serialized_end=2561, -) - - -_NETWORKPOLICY = _descriptor.Descriptor( - name="NetworkPolicy", - full_name="google.container.v1beta1.NetworkPolicy", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="provider", - full_name="google.container.v1beta1.NetworkPolicy.provider", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enabled", - full_name="google.container.v1beta1.NetworkPolicy.enabled", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_NETWORKPOLICY_PROVIDER], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2564, - serialized_end=2714, -) - - -_IPALLOCATIONPOLICY = _descriptor.Descriptor( - name="IPAllocationPolicy", - full_name="google.container.v1beta1.IPAllocationPolicy", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="use_ip_aliases", - full_name="google.container.v1beta1.IPAllocationPolicy.use_ip_aliases", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_subnetwork", - full_name="google.container.v1beta1.IPAllocationPolicy.create_subnetwork", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="subnetwork_name", - full_name="google.container.v1beta1.IPAllocationPolicy.subnetwork_name", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_ipv4_cidr", - full_name="google.container.v1beta1.IPAllocationPolicy.cluster_ipv4_cidr", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="node_ipv4_cidr", - full_name="google.container.v1beta1.IPAllocationPolicy.node_ipv4_cidr", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="services_ipv4_cidr", - full_name="google.container.v1beta1.IPAllocationPolicy.services_ipv4_cidr", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_secondary_range_name", - full_name="google.container.v1beta1.IPAllocationPolicy.cluster_secondary_range_name", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="services_secondary_range_name", - full_name="google.container.v1beta1.IPAllocationPolicy.services_secondary_range_name", - index=7, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_ipv4_cidr_block", - full_name="google.container.v1beta1.IPAllocationPolicy.cluster_ipv4_cidr_block", - index=8, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="node_ipv4_cidr_block", - full_name="google.container.v1beta1.IPAllocationPolicy.node_ipv4_cidr_block", - index=9, - number=10, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="services_ipv4_cidr_block", - full_name="google.container.v1beta1.IPAllocationPolicy.services_ipv4_cidr_block", - index=10, - number=11, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="allow_route_overlap", - full_name="google.container.v1beta1.IPAllocationPolicy.allow_route_overlap", - index=11, - number=12, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tpu_ipv4_cidr_block", - full_name="google.container.v1beta1.IPAllocationPolicy.tpu_ipv4_cidr_block", - index=12, - number=13, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2717, - serialized_end=3136, -) - - -_BINARYAUTHORIZATION = _descriptor.Descriptor( - name="BinaryAuthorization", - full_name="google.container.v1beta1.BinaryAuthorization", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="enabled", - full_name="google.container.v1beta1.BinaryAuthorization.enabled", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3138, - serialized_end=3176, -) - - -_PODSECURITYPOLICYCONFIG = _descriptor.Descriptor( - name="PodSecurityPolicyConfig", - full_name="google.container.v1beta1.PodSecurityPolicyConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="enabled", - full_name="google.container.v1beta1.PodSecurityPolicyConfig.enabled", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3178, - serialized_end=3220, -) - - -_CLUSTER_RESOURCELABELSENTRY = _descriptor.Descriptor( - name="ResourceLabelsEntry", - full_name="google.container.v1beta1.Cluster.ResourceLabelsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.container.v1beta1.Cluster.ResourceLabelsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.container.v1beta1.Cluster.ResourceLabelsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5412, - serialized_end=5465, -) - -_CLUSTER = _descriptor.Descriptor( - name="Cluster", - full_name="google.container.v1beta1.Cluster", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.Cluster.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.container.v1beta1.Cluster.description", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="initial_node_count", - full_name="google.container.v1beta1.Cluster.initial_node_count", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="node_config", - full_name="google.container.v1beta1.Cluster.node_config", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="master_auth", - full_name="google.container.v1beta1.Cluster.master_auth", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="logging_service", - full_name="google.container.v1beta1.Cluster.logging_service", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="monitoring_service", - full_name="google.container.v1beta1.Cluster.monitoring_service", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="network", - full_name="google.container.v1beta1.Cluster.network", - index=7, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_ipv4_cidr", - full_name="google.container.v1beta1.Cluster.cluster_ipv4_cidr", - index=8, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="addons_config", - full_name="google.container.v1beta1.Cluster.addons_config", - index=9, - number=10, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="subnetwork", - full_name="google.container.v1beta1.Cluster.subnetwork", - index=10, - number=11, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="node_pools", - full_name="google.container.v1beta1.Cluster.node_pools", - index=11, - number=12, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="locations", - full_name="google.container.v1beta1.Cluster.locations", - index=12, - number=13, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enable_kubernetes_alpha", - full_name="google.container.v1beta1.Cluster.enable_kubernetes_alpha", - index=13, - number=14, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="resource_labels", - full_name="google.container.v1beta1.Cluster.resource_labels", - index=14, - number=15, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="label_fingerprint", - full_name="google.container.v1beta1.Cluster.label_fingerprint", - index=15, - number=16, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="legacy_abac", - full_name="google.container.v1beta1.Cluster.legacy_abac", - index=16, - number=18, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="network_policy", - full_name="google.container.v1beta1.Cluster.network_policy", - index=17, - number=19, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ip_allocation_policy", - full_name="google.container.v1beta1.Cluster.ip_allocation_policy", - index=18, - number=20, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="master_authorized_networks_config", - full_name="google.container.v1beta1.Cluster.master_authorized_networks_config", - index=19, - number=22, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="maintenance_policy", - full_name="google.container.v1beta1.Cluster.maintenance_policy", - index=20, - number=23, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="binary_authorization", - full_name="google.container.v1beta1.Cluster.binary_authorization", - index=21, - number=24, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pod_security_policy_config", - full_name="google.container.v1beta1.Cluster.pod_security_policy_config", - index=22, - number=25, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="autoscaling", - full_name="google.container.v1beta1.Cluster.autoscaling", - index=23, - number=26, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="network_config", - full_name="google.container.v1beta1.Cluster.network_config", - index=24, - number=27, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="private_cluster", - full_name="google.container.v1beta1.Cluster.private_cluster", - index=25, - number=28, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="master_ipv4_cidr_block", - full_name="google.container.v1beta1.Cluster.master_ipv4_cidr_block", - index=26, - number=29, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="default_max_pods_constraint", - full_name="google.container.v1beta1.Cluster.default_max_pods_constraint", - index=27, - number=30, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="resource_usage_export_config", - full_name="google.container.v1beta1.Cluster.resource_usage_export_config", - index=28, - number=33, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="private_cluster_config", - full_name="google.container.v1beta1.Cluster.private_cluster_config", - index=29, - number=37, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="vertical_pod_autoscaling", - full_name="google.container.v1beta1.Cluster.vertical_pod_autoscaling", - index=30, - number=39, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="self_link", - full_name="google.container.v1beta1.Cluster.self_link", - index=31, - number=100, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.Cluster.zone", - index=32, - number=101, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="endpoint", - full_name="google.container.v1beta1.Cluster.endpoint", - index=33, - number=102, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="initial_cluster_version", - full_name="google.container.v1beta1.Cluster.initial_cluster_version", - index=34, - number=103, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="current_master_version", - full_name="google.container.v1beta1.Cluster.current_master_version", - index=35, - number=104, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="current_node_version", - full_name="google.container.v1beta1.Cluster.current_node_version", - index=36, - number=105, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.container.v1beta1.Cluster.create_time", - index=37, - number=106, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="status", - full_name="google.container.v1beta1.Cluster.status", - index=38, - number=107, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="status_message", - full_name="google.container.v1beta1.Cluster.status_message", - index=39, - number=108, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="node_ipv4_cidr_size", - full_name="google.container.v1beta1.Cluster.node_ipv4_cidr_size", - index=40, - number=109, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="services_ipv4_cidr", - full_name="google.container.v1beta1.Cluster.services_ipv4_cidr", - index=41, - number=110, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="instance_group_urls", - full_name="google.container.v1beta1.Cluster.instance_group_urls", - index=42, - number=111, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="current_node_count", - full_name="google.container.v1beta1.Cluster.current_node_count", - index=43, - number=112, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="expire_time", - full_name="google.container.v1beta1.Cluster.expire_time", - index=44, - number=113, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="location", - full_name="google.container.v1beta1.Cluster.location", - index=45, - number=114, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enable_tpu", - full_name="google.container.v1beta1.Cluster.enable_tpu", - index=46, - number=115, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tpu_ipv4_cidr_block", - full_name="google.container.v1beta1.Cluster.tpu_ipv4_cidr_block", - index=47, - number=116, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="conditions", - full_name="google.container.v1beta1.Cluster.conditions", - index=48, - number=118, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_CLUSTER_RESOURCELABELSENTRY], - enum_types=[_CLUSTER_STATUS], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3223, - serialized_end=5586, -) - - -_CLUSTERUPDATE = _descriptor.Descriptor( - name="ClusterUpdate", - full_name="google.container.v1beta1.ClusterUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="desired_node_version", - full_name="google.container.v1beta1.ClusterUpdate.desired_node_version", - index=0, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="desired_monitoring_service", - full_name="google.container.v1beta1.ClusterUpdate.desired_monitoring_service", - index=1, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="desired_addons_config", - full_name="google.container.v1beta1.ClusterUpdate.desired_addons_config", - index=2, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="desired_node_pool_id", - full_name="google.container.v1beta1.ClusterUpdate.desired_node_pool_id", - index=3, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="desired_image_type", - full_name="google.container.v1beta1.ClusterUpdate.desired_image_type", - index=4, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="desired_node_pool_autoscaling", - full_name="google.container.v1beta1.ClusterUpdate.desired_node_pool_autoscaling", - index=5, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="desired_locations", - full_name="google.container.v1beta1.ClusterUpdate.desired_locations", - index=6, - number=10, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="desired_master_authorized_networks_config", - full_name="google.container.v1beta1.ClusterUpdate.desired_master_authorized_networks_config", - index=7, - number=12, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="desired_pod_security_policy_config", - full_name="google.container.v1beta1.ClusterUpdate.desired_pod_security_policy_config", - index=8, - number=14, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="desired_cluster_autoscaling", - full_name="google.container.v1beta1.ClusterUpdate.desired_cluster_autoscaling", - index=9, - number=15, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="desired_binary_authorization", - full_name="google.container.v1beta1.ClusterUpdate.desired_binary_authorization", - index=10, - number=16, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="desired_logging_service", - full_name="google.container.v1beta1.ClusterUpdate.desired_logging_service", - index=11, - number=19, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="desired_resource_usage_export_config", - full_name="google.container.v1beta1.ClusterUpdate.desired_resource_usage_export_config", - index=12, - number=21, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="desired_vertical_pod_autoscaling", - full_name="google.container.v1beta1.ClusterUpdate.desired_vertical_pod_autoscaling", - index=13, - number=22, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="desired_master_version", - full_name="google.container.v1beta1.ClusterUpdate.desired_master_version", - index=14, - number=100, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5589, - serialized_end=6540, -) - - -_OPERATION = _descriptor.Descriptor( - name="Operation", - full_name="google.container.v1beta1.Operation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.Operation.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.Operation.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="operation_type", - full_name="google.container.v1beta1.Operation.operation_type", - index=2, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="status", - full_name="google.container.v1beta1.Operation.status", - index=3, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detail", - full_name="google.container.v1beta1.Operation.detail", - index=4, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="status_message", - full_name="google.container.v1beta1.Operation.status_message", - index=5, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="self_link", - full_name="google.container.v1beta1.Operation.self_link", - index=6, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="target_link", - full_name="google.container.v1beta1.Operation.target_link", - index=7, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="location", - full_name="google.container.v1beta1.Operation.location", - index=8, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.container.v1beta1.Operation.start_time", - index=9, - number=10, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.container.v1beta1.Operation.end_time", - index=10, - number=11, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="progress", - full_name="google.container.v1beta1.Operation.progress", - index=11, - number=12, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_conditions", - full_name="google.container.v1beta1.Operation.cluster_conditions", - index=12, - number=13, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="nodepool_conditions", - full_name="google.container.v1beta1.Operation.nodepool_conditions", - index=13, - number=14, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_OPERATION_STATUS, _OPERATION_TYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6543, - serialized_end=7522, -) - - -_OPERATIONPROGRESS_METRIC = _descriptor.Descriptor( - name="Metric", - full_name="google.container.v1beta1.OperationProgress.Metric", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.OperationProgress.Metric.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="int_value", - full_name="google.container.v1beta1.OperationProgress.Metric.int_value", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="double_value", - full_name="google.container.v1beta1.OperationProgress.Metric.double_value", - index=2, - number=3, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="string_value", - full_name="google.container.v1beta1.OperationProgress.Metric.string_value", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="value", - full_name="google.container.v1beta1.OperationProgress.Metric.value", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=7750, - serialized_end=7850, -) - -_OPERATIONPROGRESS = _descriptor.Descriptor( - name="OperationProgress", - full_name="google.container.v1beta1.OperationProgress", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.OperationProgress.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="status", - full_name="google.container.v1beta1.OperationProgress.status", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="metrics", - full_name="google.container.v1beta1.OperationProgress.metrics", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="stages", - full_name="google.container.v1beta1.OperationProgress.stages", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_OPERATIONPROGRESS_METRIC], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7525, - serialized_end=7850, -) - - -_CREATECLUSTERREQUEST = _descriptor.Descriptor( - name="CreateClusterRequest", - full_name="google.container.v1beta1.CreateClusterRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.CreateClusterRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.CreateClusterRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster", - full_name="google.container.v1beta1.CreateClusterRequest.cluster", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="parent", - full_name="google.container.v1beta1.CreateClusterRequest.parent", - index=3, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7853, - serialized_end=7985, -) - - -_GETCLUSTERREQUEST = _descriptor.Descriptor( - name="GetClusterRequest", - full_name="google.container.v1beta1.GetClusterRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.GetClusterRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.GetClusterRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.GetClusterRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.GetClusterRequest.name", - index=3, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7987, - serialized_end=8086, -) - - -_UPDATECLUSTERREQUEST = _descriptor.Descriptor( - name="UpdateClusterRequest", - full_name="google.container.v1beta1.UpdateClusterRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.UpdateClusterRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.UpdateClusterRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.UpdateClusterRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update", - full_name="google.container.v1beta1.UpdateClusterRequest.update", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.UpdateClusterRequest.name", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8089, - serialized_end=8248, -) - - -_UPDATENODEPOOLREQUEST = _descriptor.Descriptor( - name="UpdateNodePoolRequest", - full_name="google.container.v1beta1.UpdateNodePoolRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.UpdateNodePoolRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.UpdateNodePoolRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.UpdateNodePoolRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="node_pool_id", - full_name="google.container.v1beta1.UpdateNodePoolRequest.node_pool_id", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="node_version", - full_name="google.container.v1beta1.UpdateNodePoolRequest.node_version", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_type", - full_name="google.container.v1beta1.UpdateNodePoolRequest.image_type", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.UpdateNodePoolRequest.name", - index=6, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8251, - serialized_end=8422, -) - - -_SETNODEPOOLAUTOSCALINGREQUEST = _descriptor.Descriptor( - name="SetNodePoolAutoscalingRequest", - full_name="google.container.v1beta1.SetNodePoolAutoscalingRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.SetNodePoolAutoscalingRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.SetNodePoolAutoscalingRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.SetNodePoolAutoscalingRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="node_pool_id", - full_name="google.container.v1beta1.SetNodePoolAutoscalingRequest.node_pool_id", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="autoscaling", - full_name="google.container.v1beta1.SetNodePoolAutoscalingRequest.autoscaling", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.SetNodePoolAutoscalingRequest.name", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8425, - serialized_end=8630, -) - - -_SETLOGGINGSERVICEREQUEST = _descriptor.Descriptor( - name="SetLoggingServiceRequest", - full_name="google.container.v1beta1.SetLoggingServiceRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.SetLoggingServiceRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.SetLoggingServiceRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.SetLoggingServiceRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="logging_service", - full_name="google.container.v1beta1.SetLoggingServiceRequest.logging_service", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.SetLoggingServiceRequest.name", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8632, - serialized_end=8759, -) - - -_SETMONITORINGSERVICEREQUEST = _descriptor.Descriptor( - name="SetMonitoringServiceRequest", - full_name="google.container.v1beta1.SetMonitoringServiceRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.SetMonitoringServiceRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.SetMonitoringServiceRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.SetMonitoringServiceRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="monitoring_service", - full_name="google.container.v1beta1.SetMonitoringServiceRequest.monitoring_service", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.SetMonitoringServiceRequest.name", - index=4, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8762, - serialized_end=8899, -) - - -_SETADDONSCONFIGREQUEST = _descriptor.Descriptor( - name="SetAddonsConfigRequest", - full_name="google.container.v1beta1.SetAddonsConfigRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.SetAddonsConfigRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.SetAddonsConfigRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.SetAddonsConfigRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="addons_config", - full_name="google.container.v1beta1.SetAddonsConfigRequest.addons_config", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.SetAddonsConfigRequest.name", - index=4, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8902, - serialized_end=9069, -) - - -_SETLOCATIONSREQUEST = _descriptor.Descriptor( - name="SetLocationsRequest", - full_name="google.container.v1beta1.SetLocationsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.SetLocationsRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.SetLocationsRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.SetLocationsRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="locations", - full_name="google.container.v1beta1.SetLocationsRequest.locations", - index=3, - number=4, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.SetLocationsRequest.name", - index=4, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=9071, - serialized_end=9191, -) - - -_UPDATEMASTERREQUEST = _descriptor.Descriptor( - name="UpdateMasterRequest", - full_name="google.container.v1beta1.UpdateMasterRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.UpdateMasterRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.UpdateMasterRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.UpdateMasterRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="master_version", - full_name="google.container.v1beta1.UpdateMasterRequest.master_version", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.UpdateMasterRequest.name", - index=4, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=9193, - serialized_end=9318, -) - - -_SETMASTERAUTHREQUEST = _descriptor.Descriptor( - name="SetMasterAuthRequest", - full_name="google.container.v1beta1.SetMasterAuthRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.SetMasterAuthRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.SetMasterAuthRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.SetMasterAuthRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="action", - full_name="google.container.v1beta1.SetMasterAuthRequest.action", - index=3, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update", - full_name="google.container.v1beta1.SetMasterAuthRequest.update", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.SetMasterAuthRequest.name", - index=5, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_SETMASTERAUTHREQUEST_ACTION], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=9321, - serialized_end=9630, -) - - -_DELETECLUSTERREQUEST = _descriptor.Descriptor( - name="DeleteClusterRequest", - full_name="google.container.v1beta1.DeleteClusterRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.DeleteClusterRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.DeleteClusterRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.DeleteClusterRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.DeleteClusterRequest.name", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=9632, - serialized_end=9734, -) - - -_LISTCLUSTERSREQUEST = _descriptor.Descriptor( - name="ListClustersRequest", - full_name="google.container.v1beta1.ListClustersRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.ListClustersRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.ListClustersRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="parent", - full_name="google.container.v1beta1.ListClustersRequest.parent", - index=2, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=9736, - serialized_end=9815, -) - - -_LISTCLUSTERSRESPONSE = _descriptor.Descriptor( - name="ListClustersResponse", - full_name="google.container.v1beta1.ListClustersResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="clusters", - full_name="google.container.v1beta1.ListClustersResponse.clusters", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="missing_zones", - full_name="google.container.v1beta1.ListClustersResponse.missing_zones", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=9817, - serialized_end=9915, -) - - -_GETOPERATIONREQUEST = _descriptor.Descriptor( - name="GetOperationRequest", - full_name="google.container.v1beta1.GetOperationRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.GetOperationRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.GetOperationRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="operation_id", - full_name="google.container.v1beta1.GetOperationRequest.operation_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.GetOperationRequest.name", - index=3, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=9917, - serialized_end=10020, -) - - -_LISTOPERATIONSREQUEST = _descriptor.Descriptor( - name="ListOperationsRequest", - full_name="google.container.v1beta1.ListOperationsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.ListOperationsRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.ListOperationsRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="parent", - full_name="google.container.v1beta1.ListOperationsRequest.parent", - index=2, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10022, - serialized_end=10103, -) - - -_CANCELOPERATIONREQUEST = _descriptor.Descriptor( - name="CancelOperationRequest", - full_name="google.container.v1beta1.CancelOperationRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.CancelOperationRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.CancelOperationRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="operation_id", - full_name="google.container.v1beta1.CancelOperationRequest.operation_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.CancelOperationRequest.name", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10105, - serialized_end=10211, -) - - -_LISTOPERATIONSRESPONSE = _descriptor.Descriptor( - name="ListOperationsResponse", - full_name="google.container.v1beta1.ListOperationsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="operations", - full_name="google.container.v1beta1.ListOperationsResponse.operations", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="missing_zones", - full_name="google.container.v1beta1.ListOperationsResponse.missing_zones", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10213, - serialized_end=10317, -) - - -_GETSERVERCONFIGREQUEST = _descriptor.Descriptor( - name="GetServerConfigRequest", - full_name="google.container.v1beta1.GetServerConfigRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.GetServerConfigRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.GetServerConfigRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.GetServerConfigRequest.name", - index=2, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10319, - serialized_end=10399, -) - - -_SERVERCONFIG = _descriptor.Descriptor( - name="ServerConfig", - full_name="google.container.v1beta1.ServerConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="default_cluster_version", - full_name="google.container.v1beta1.ServerConfig.default_cluster_version", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="valid_node_versions", - full_name="google.container.v1beta1.ServerConfig.valid_node_versions", - index=1, - number=3, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="default_image_type", - full_name="google.container.v1beta1.ServerConfig.default_image_type", - index=2, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="valid_image_types", - full_name="google.container.v1beta1.ServerConfig.valid_image_types", - index=3, - number=5, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="valid_master_versions", - full_name="google.container.v1beta1.ServerConfig.valid_master_versions", - index=4, - number=6, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10402, - serialized_end=10564, -) - - -_CREATENODEPOOLREQUEST = _descriptor.Descriptor( - name="CreateNodePoolRequest", - full_name="google.container.v1beta1.CreateNodePoolRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.CreateNodePoolRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.CreateNodePoolRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.CreateNodePoolRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="node_pool", - full_name="google.container.v1beta1.CreateNodePoolRequest.node_pool", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="parent", - full_name="google.container.v1beta1.CreateNodePoolRequest.parent", - index=4, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10567, - serialized_end=10727, -) - - -_DELETENODEPOOLREQUEST = _descriptor.Descriptor( - name="DeleteNodePoolRequest", - full_name="google.container.v1beta1.DeleteNodePoolRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.DeleteNodePoolRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.DeleteNodePoolRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.DeleteNodePoolRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="node_pool_id", - full_name="google.container.v1beta1.DeleteNodePoolRequest.node_pool_id", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.DeleteNodePoolRequest.name", - index=4, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10730, - serialized_end=10859, -) - - -_LISTNODEPOOLSREQUEST = _descriptor.Descriptor( - name="ListNodePoolsRequest", - full_name="google.container.v1beta1.ListNodePoolsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.ListNodePoolsRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.ListNodePoolsRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.ListNodePoolsRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="parent", - full_name="google.container.v1beta1.ListNodePoolsRequest.parent", - index=3, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10861, - serialized_end=10965, -) - - -_GETNODEPOOLREQUEST = _descriptor.Descriptor( - name="GetNodePoolRequest", - full_name="google.container.v1beta1.GetNodePoolRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.GetNodePoolRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.GetNodePoolRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.GetNodePoolRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="node_pool_id", - full_name="google.container.v1beta1.GetNodePoolRequest.node_pool_id", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.GetNodePoolRequest.name", - index=4, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10967, - serialized_end=11093, -) - - -_NODEPOOL = _descriptor.Descriptor( - name="NodePool", - full_name="google.container.v1beta1.NodePool", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.NodePool.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="config", - full_name="google.container.v1beta1.NodePool.config", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="initial_node_count", - full_name="google.container.v1beta1.NodePool.initial_node_count", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="self_link", - full_name="google.container.v1beta1.NodePool.self_link", - index=3, - number=100, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="version", - full_name="google.container.v1beta1.NodePool.version", - index=4, - number=101, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="instance_group_urls", - full_name="google.container.v1beta1.NodePool.instance_group_urls", - index=5, - number=102, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="status", - full_name="google.container.v1beta1.NodePool.status", - index=6, - number=103, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="status_message", - full_name="google.container.v1beta1.NodePool.status_message", - index=7, - number=104, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="autoscaling", - full_name="google.container.v1beta1.NodePool.autoscaling", - index=8, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="management", - full_name="google.container.v1beta1.NodePool.management", - index=9, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_pods_constraint", - full_name="google.container.v1beta1.NodePool.max_pods_constraint", - index=10, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="conditions", - full_name="google.container.v1beta1.NodePool.conditions", - index=11, - number=105, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_NODEPOOL_STATUS], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=11096, - serialized_end=11749, -) - - -_NODEMANAGEMENT = _descriptor.Descriptor( - name="NodeManagement", - full_name="google.container.v1beta1.NodeManagement", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="auto_upgrade", - full_name="google.container.v1beta1.NodeManagement.auto_upgrade", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="auto_repair", - full_name="google.container.v1beta1.NodeManagement.auto_repair", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="upgrade_options", - full_name="google.container.v1beta1.NodeManagement.upgrade_options", - index=2, - number=10, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=11752, - serialized_end=11882, -) - - -_AUTOUPGRADEOPTIONS = _descriptor.Descriptor( - name="AutoUpgradeOptions", - full_name="google.container.v1beta1.AutoUpgradeOptions", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="auto_upgrade_start_time", - full_name="google.container.v1beta1.AutoUpgradeOptions.auto_upgrade_start_time", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.container.v1beta1.AutoUpgradeOptions.description", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=11884, - serialized_end=11958, -) - - -_MAINTENANCEPOLICY = _descriptor.Descriptor( - name="MaintenancePolicy", - full_name="google.container.v1beta1.MaintenancePolicy", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="window", - full_name="google.container.v1beta1.MaintenancePolicy.window", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=11960, - serialized_end=12040, -) - - -_MAINTENANCEWINDOW = _descriptor.Descriptor( - name="MaintenanceWindow", - full_name="google.container.v1beta1.MaintenanceWindow", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="daily_maintenance_window", - full_name="google.container.v1beta1.MaintenanceWindow.daily_maintenance_window", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="policy", - full_name="google.container.v1beta1.MaintenanceWindow.policy", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=12042, - serialized_end=12157, -) - - -_DAILYMAINTENANCEWINDOW = _descriptor.Descriptor( - name="DailyMaintenanceWindow", - full_name="google.container.v1beta1.DailyMaintenanceWindow", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.container.v1beta1.DailyMaintenanceWindow.start_time", - index=0, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="duration", - full_name="google.container.v1beta1.DailyMaintenanceWindow.duration", - index=1, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=12159, - serialized_end=12221, -) - - -_SETNODEPOOLMANAGEMENTREQUEST = _descriptor.Descriptor( - name="SetNodePoolManagementRequest", - full_name="google.container.v1beta1.SetNodePoolManagementRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.SetNodePoolManagementRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.SetNodePoolManagementRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.SetNodePoolManagementRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="node_pool_id", - full_name="google.container.v1beta1.SetNodePoolManagementRequest.node_pool_id", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="management", - full_name="google.container.v1beta1.SetNodePoolManagementRequest.management", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.SetNodePoolManagementRequest.name", - index=5, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=12224, - serialized_end=12422, -) - - -_SETNODEPOOLSIZEREQUEST = _descriptor.Descriptor( - name="SetNodePoolSizeRequest", - full_name="google.container.v1beta1.SetNodePoolSizeRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.SetNodePoolSizeRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.SetNodePoolSizeRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.SetNodePoolSizeRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="node_pool_id", - full_name="google.container.v1beta1.SetNodePoolSizeRequest.node_pool_id", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="node_count", - full_name="google.container.v1beta1.SetNodePoolSizeRequest.node_count", - index=4, - number=5, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.SetNodePoolSizeRequest.name", - index=5, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=12425, - serialized_end=12575, -) - - -_ROLLBACKNODEPOOLUPGRADEREQUEST = _descriptor.Descriptor( - name="RollbackNodePoolUpgradeRequest", - full_name="google.container.v1beta1.RollbackNodePoolUpgradeRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.RollbackNodePoolUpgradeRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.RollbackNodePoolUpgradeRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.RollbackNodePoolUpgradeRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="node_pool_id", - full_name="google.container.v1beta1.RollbackNodePoolUpgradeRequest.node_pool_id", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.RollbackNodePoolUpgradeRequest.name", - index=4, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=12578, - serialized_end=12716, -) - - -_LISTNODEPOOLSRESPONSE = _descriptor.Descriptor( - name="ListNodePoolsResponse", - full_name="google.container.v1beta1.ListNodePoolsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="node_pools", - full_name="google.container.v1beta1.ListNodePoolsResponse.node_pools", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=12718, - serialized_end=12797, -) - - -_CLUSTERAUTOSCALING = _descriptor.Descriptor( - name="ClusterAutoscaling", - full_name="google.container.v1beta1.ClusterAutoscaling", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="enable_node_autoprovisioning", - full_name="google.container.v1beta1.ClusterAutoscaling.enable_node_autoprovisioning", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="resource_limits", - full_name="google.container.v1beta1.ClusterAutoscaling.resource_limits", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=12799, - serialized_end=12923, -) - - -_RESOURCELIMIT = _descriptor.Descriptor( - name="ResourceLimit", - full_name="google.container.v1beta1.ResourceLimit", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="resource_type", - full_name="google.container.v1beta1.ResourceLimit.resource_type", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="minimum", - full_name="google.container.v1beta1.ResourceLimit.minimum", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="maximum", - full_name="google.container.v1beta1.ResourceLimit.maximum", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=12925, - serialized_end=12997, -) - - -_NODEPOOLAUTOSCALING = _descriptor.Descriptor( - name="NodePoolAutoscaling", - full_name="google.container.v1beta1.NodePoolAutoscaling", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="enabled", - full_name="google.container.v1beta1.NodePoolAutoscaling.enabled", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="min_node_count", - full_name="google.container.v1beta1.NodePoolAutoscaling.min_node_count", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_node_count", - full_name="google.container.v1beta1.NodePoolAutoscaling.max_node_count", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="autoprovisioned", - full_name="google.container.v1beta1.NodePoolAutoscaling.autoprovisioned", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=12999, - serialized_end=13110, -) - - -_SETLABELSREQUEST_RESOURCELABELSENTRY = _descriptor.Descriptor( - name="ResourceLabelsEntry", - full_name="google.container.v1beta1.SetLabelsRequest.ResourceLabelsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.container.v1beta1.SetLabelsRequest.ResourceLabelsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.container.v1beta1.SetLabelsRequest.ResourceLabelsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5412, - serialized_end=5465, -) - -_SETLABELSREQUEST = _descriptor.Descriptor( - name="SetLabelsRequest", - full_name="google.container.v1beta1.SetLabelsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.SetLabelsRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.SetLabelsRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.SetLabelsRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="resource_labels", - full_name="google.container.v1beta1.SetLabelsRequest.resource_labels", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="label_fingerprint", - full_name="google.container.v1beta1.SetLabelsRequest.label_fingerprint", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.SetLabelsRequest.name", - index=5, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_SETLABELSREQUEST_RESOURCELABELSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13113, - serialized_end=13382, -) - - -_SETLEGACYABACREQUEST = _descriptor.Descriptor( - name="SetLegacyAbacRequest", - full_name="google.container.v1beta1.SetLegacyAbacRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.SetLegacyAbacRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.SetLegacyAbacRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.SetLegacyAbacRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enabled", - full_name="google.container.v1beta1.SetLegacyAbacRequest.enabled", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.SetLegacyAbacRequest.name", - index=4, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13384, - serialized_end=13503, -) - - -_STARTIPROTATIONREQUEST = _descriptor.Descriptor( - name="StartIPRotationRequest", - full_name="google.container.v1beta1.StartIPRotationRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.StartIPRotationRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.StartIPRotationRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.StartIPRotationRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.StartIPRotationRequest.name", - index=3, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="rotate_credentials", - full_name="google.container.v1beta1.StartIPRotationRequest.rotate_credentials", - index=4, - number=7, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13506, - serialized_end=13638, -) - - -_COMPLETEIPROTATIONREQUEST = _descriptor.Descriptor( - name="CompleteIPRotationRequest", - full_name="google.container.v1beta1.CompleteIPRotationRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.CompleteIPRotationRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.CompleteIPRotationRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.CompleteIPRotationRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.CompleteIPRotationRequest.name", - index=3, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13640, - serialized_end=13747, -) - - -_ACCELERATORCONFIG = _descriptor.Descriptor( - name="AcceleratorConfig", - full_name="google.container.v1beta1.AcceleratorConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="accelerator_count", - full_name="google.container.v1beta1.AcceleratorConfig.accelerator_count", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="accelerator_type", - full_name="google.container.v1beta1.AcceleratorConfig.accelerator_type", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13749, - serialized_end=13821, -) - - -_WORKLOADMETADATACONFIG = _descriptor.Descriptor( - name="WorkloadMetadataConfig", - full_name="google.container.v1beta1.WorkloadMetadataConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="node_metadata", - full_name="google.container.v1beta1.WorkloadMetadataConfig.node_metadata", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[_WORKLOADMETADATACONFIG_NODEMETADATA], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13824, - serialized_end=13991, -) - - -_SETNETWORKPOLICYREQUEST = _descriptor.Descriptor( - name="SetNetworkPolicyRequest", - full_name="google.container.v1beta1.SetNetworkPolicyRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.SetNetworkPolicyRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.SetNetworkPolicyRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.SetNetworkPolicyRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="network_policy", - full_name="google.container.v1beta1.SetNetworkPolicyRequest.network_policy", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.SetNetworkPolicyRequest.name", - index=4, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13994, - serialized_end=14164, -) - - -_SETMAINTENANCEPOLICYREQUEST = _descriptor.Descriptor( - name="SetMaintenancePolicyRequest", - full_name="google.container.v1beta1.SetMaintenancePolicyRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.container.v1beta1.SetMaintenancePolicyRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="zone", - full_name="google.container.v1beta1.SetMaintenancePolicyRequest.zone", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cluster_id", - full_name="google.container.v1beta1.SetMaintenancePolicyRequest.cluster_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="maintenance_policy", - full_name="google.container.v1beta1.SetMaintenancePolicyRequest.maintenance_policy", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.SetMaintenancePolicyRequest.name", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14167, - serialized_end=14337, -) - - -_LISTLOCATIONSREQUEST = _descriptor.Descriptor( - name="ListLocationsRequest", - full_name="google.container.v1beta1.ListLocationsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.container.v1beta1.ListLocationsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14339, - serialized_end=14377, -) - - -_LISTLOCATIONSRESPONSE = _descriptor.Descriptor( - name="ListLocationsResponse", - full_name="google.container.v1beta1.ListLocationsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="locations", - full_name="google.container.v1beta1.ListLocationsResponse.locations", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.container.v1beta1.ListLocationsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14379, - serialized_end=14482, -) - - -_LOCATION = _descriptor.Descriptor( - name="Location", - full_name="google.container.v1beta1.Location", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.container.v1beta1.Location.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.container.v1beta1.Location.name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="recommended", - full_name="google.container.v1beta1.Location.recommended", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_LOCATION_LOCATIONTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14485, - serialized_end=14662, -) - - -_STATUSCONDITION = _descriptor.Descriptor( - name="StatusCondition", - full_name="google.container.v1beta1.StatusCondition", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="code", - full_name="google.container.v1beta1.StatusCondition.code", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="message", - full_name="google.container.v1beta1.StatusCondition.message", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_STATUSCONDITION_CODE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14665, - serialized_end=14878, -) - - -_NETWORKCONFIG = _descriptor.Descriptor( - name="NetworkConfig", - full_name="google.container.v1beta1.NetworkConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="network", - full_name="google.container.v1beta1.NetworkConfig.network", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="subnetwork", - full_name="google.container.v1beta1.NetworkConfig.subnetwork", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14880, - serialized_end=14932, -) - - -_LISTUSABLESUBNETWORKSREQUEST = _descriptor.Descriptor( - name="ListUsableSubnetworksRequest", - full_name="google.container.v1beta1.ListUsableSubnetworksRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.container.v1beta1.ListUsableSubnetworksRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.container.v1beta1.ListUsableSubnetworksRequest.filter", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.container.v1beta1.ListUsableSubnetworksRequest.page_size", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.container.v1beta1.ListUsableSubnetworksRequest.page_token", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14934, - serialized_end=15035, -) - - -_LISTUSABLESUBNETWORKSRESPONSE = _descriptor.Descriptor( - name="ListUsableSubnetworksResponse", - full_name="google.container.v1beta1.ListUsableSubnetworksResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="subnetworks", - full_name="google.container.v1beta1.ListUsableSubnetworksResponse.subnetworks", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.container.v1beta1.ListUsableSubnetworksResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15037, - serialized_end=15158, -) - - -_USABLESUBNETWORKSECONDARYRANGE = _descriptor.Descriptor( - name="UsableSubnetworkSecondaryRange", - full_name="google.container.v1beta1.UsableSubnetworkSecondaryRange", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="range_name", - full_name="google.container.v1beta1.UsableSubnetworkSecondaryRange.range_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ip_cidr_range", - full_name="google.container.v1beta1.UsableSubnetworkSecondaryRange.ip_cidr_range", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="status", - full_name="google.container.v1beta1.UsableSubnetworkSecondaryRange.status", - index=2, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_USABLESUBNETWORKSECONDARYRANGE_STATUS], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15161, - serialized_end=15422, -) - - -_USABLESUBNETWORK = _descriptor.Descriptor( - name="UsableSubnetwork", - full_name="google.container.v1beta1.UsableSubnetwork", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="subnetwork", - full_name="google.container.v1beta1.UsableSubnetwork.subnetwork", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="network", - full_name="google.container.v1beta1.UsableSubnetwork.network", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ip_cidr_range", - full_name="google.container.v1beta1.UsableSubnetwork.ip_cidr_range", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="secondary_ip_ranges", - full_name="google.container.v1beta1.UsableSubnetwork.secondary_ip_ranges", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="status_message", - full_name="google.container.v1beta1.UsableSubnetwork.status_message", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15425, - serialized_end=15614, -) - - -_VERTICALPODAUTOSCALING = _descriptor.Descriptor( - name="VerticalPodAutoscaling", - full_name="google.container.v1beta1.VerticalPodAutoscaling", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="enabled", - full_name="google.container.v1beta1.VerticalPodAutoscaling.enabled", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15616, - serialized_end=15657, -) - - -_MAXPODSCONSTRAINT = _descriptor.Descriptor( - name="MaxPodsConstraint", - full_name="google.container.v1beta1.MaxPodsConstraint", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="max_pods_per_node", - full_name="google.container.v1beta1.MaxPodsConstraint.max_pods_per_node", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15659, - serialized_end=15705, -) - - -_RESOURCEUSAGEEXPORTCONFIG_BIGQUERYDESTINATION = _descriptor.Descriptor( - name="BigQueryDestination", - full_name="google.container.v1beta1.ResourceUsageExportConfig.BigQueryDestination", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="dataset_id", - full_name="google.container.v1beta1.ResourceUsageExportConfig.BigQueryDestination.dataset_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15880, - serialized_end=15921, -) - -_RESOURCEUSAGEEXPORTCONFIG = _descriptor.Descriptor( - name="ResourceUsageExportConfig", - full_name="google.container.v1beta1.ResourceUsageExportConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bigquery_destination", - full_name="google.container.v1beta1.ResourceUsageExportConfig.bigquery_destination", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enable_network_egress_metering", - full_name="google.container.v1beta1.ResourceUsageExportConfig.enable_network_egress_metering", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_RESOURCEUSAGEEXPORTCONFIG_BIGQUERYDESTINATION], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15708, - serialized_end=15921, -) - -_NODECONFIG_METADATAENTRY.containing_type = _NODECONFIG -_NODECONFIG_LABELSENTRY.containing_type = _NODECONFIG -_NODECONFIG.fields_by_name["metadata"].message_type = _NODECONFIG_METADATAENTRY -_NODECONFIG.fields_by_name["labels"].message_type = _NODECONFIG_LABELSENTRY -_NODECONFIG.fields_by_name["accelerators"].message_type = _ACCELERATORCONFIG -_NODECONFIG.fields_by_name[ - "workload_metadata_config" -].message_type = _WORKLOADMETADATACONFIG -_NODECONFIG.fields_by_name["taints"].message_type = _NODETAINT -_NODETAINT.fields_by_name["effect"].enum_type = _NODETAINT_EFFECT -_NODETAINT_EFFECT.containing_type = _NODETAINT -_MASTERAUTH.fields_by_name[ - "client_certificate_config" -].message_type = _CLIENTCERTIFICATECONFIG -_ADDONSCONFIG.fields_by_name["http_load_balancing"].message_type = _HTTPLOADBALANCING -_ADDONSCONFIG.fields_by_name[ - "horizontal_pod_autoscaling" -].message_type = _HORIZONTALPODAUTOSCALING -_ADDONSCONFIG.fields_by_name["kubernetes_dashboard"].message_type = _KUBERNETESDASHBOARD -_ADDONSCONFIG.fields_by_name[ - "network_policy_config" -].message_type = _NETWORKPOLICYCONFIG -_ADDONSCONFIG.fields_by_name["istio_config"].message_type = _ISTIOCONFIG -_ADDONSCONFIG.fields_by_name["cloud_run_config"].message_type = _CLOUDRUNCONFIG -_ISTIOCONFIG.fields_by_name["auth"].enum_type = _ISTIOCONFIG_ISTIOAUTHMODE -_ISTIOCONFIG_ISTIOAUTHMODE.containing_type = _ISTIOCONFIG -_MASTERAUTHORIZEDNETWORKSCONFIG_CIDRBLOCK.containing_type = ( - _MASTERAUTHORIZEDNETWORKSCONFIG -) -_MASTERAUTHORIZEDNETWORKSCONFIG.fields_by_name[ - "cidr_blocks" -].message_type = _MASTERAUTHORIZEDNETWORKSCONFIG_CIDRBLOCK -_NETWORKPOLICY.fields_by_name["provider"].enum_type = _NETWORKPOLICY_PROVIDER -_NETWORKPOLICY_PROVIDER.containing_type = _NETWORKPOLICY -_CLUSTER_RESOURCELABELSENTRY.containing_type = _CLUSTER -_CLUSTER.fields_by_name["node_config"].message_type = _NODECONFIG -_CLUSTER.fields_by_name["master_auth"].message_type = _MASTERAUTH -_CLUSTER.fields_by_name["addons_config"].message_type = _ADDONSCONFIG -_CLUSTER.fields_by_name["node_pools"].message_type = _NODEPOOL -_CLUSTER.fields_by_name["resource_labels"].message_type = _CLUSTER_RESOURCELABELSENTRY -_CLUSTER.fields_by_name["legacy_abac"].message_type = _LEGACYABAC -_CLUSTER.fields_by_name["network_policy"].message_type = _NETWORKPOLICY -_CLUSTER.fields_by_name["ip_allocation_policy"].message_type = _IPALLOCATIONPOLICY -_CLUSTER.fields_by_name[ - "master_authorized_networks_config" -].message_type = _MASTERAUTHORIZEDNETWORKSCONFIG -_CLUSTER.fields_by_name["maintenance_policy"].message_type = _MAINTENANCEPOLICY -_CLUSTER.fields_by_name["binary_authorization"].message_type = _BINARYAUTHORIZATION -_CLUSTER.fields_by_name[ - "pod_security_policy_config" -].message_type = _PODSECURITYPOLICYCONFIG -_CLUSTER.fields_by_name["autoscaling"].message_type = _CLUSTERAUTOSCALING -_CLUSTER.fields_by_name["network_config"].message_type = _NETWORKCONFIG -_CLUSTER.fields_by_name["default_max_pods_constraint"].message_type = _MAXPODSCONSTRAINT -_CLUSTER.fields_by_name[ - "resource_usage_export_config" -].message_type = _RESOURCEUSAGEEXPORTCONFIG -_CLUSTER.fields_by_name["private_cluster_config"].message_type = _PRIVATECLUSTERCONFIG -_CLUSTER.fields_by_name[ - "vertical_pod_autoscaling" -].message_type = _VERTICALPODAUTOSCALING -_CLUSTER.fields_by_name["status"].enum_type = _CLUSTER_STATUS -_CLUSTER.fields_by_name["conditions"].message_type = _STATUSCONDITION -_CLUSTER_STATUS.containing_type = _CLUSTER -_CLUSTERUPDATE.fields_by_name["desired_addons_config"].message_type = _ADDONSCONFIG -_CLUSTERUPDATE.fields_by_name[ - "desired_node_pool_autoscaling" -].message_type = _NODEPOOLAUTOSCALING -_CLUSTERUPDATE.fields_by_name[ - "desired_master_authorized_networks_config" -].message_type = _MASTERAUTHORIZEDNETWORKSCONFIG -_CLUSTERUPDATE.fields_by_name[ - "desired_pod_security_policy_config" -].message_type = _PODSECURITYPOLICYCONFIG -_CLUSTERUPDATE.fields_by_name[ - "desired_cluster_autoscaling" -].message_type = _CLUSTERAUTOSCALING -_CLUSTERUPDATE.fields_by_name[ - "desired_binary_authorization" -].message_type = _BINARYAUTHORIZATION -_CLUSTERUPDATE.fields_by_name[ - "desired_resource_usage_export_config" -].message_type = _RESOURCEUSAGEEXPORTCONFIG -_CLUSTERUPDATE.fields_by_name[ - "desired_vertical_pod_autoscaling" -].message_type = _VERTICALPODAUTOSCALING -_OPERATION.fields_by_name["operation_type"].enum_type = _OPERATION_TYPE -_OPERATION.fields_by_name["status"].enum_type = _OPERATION_STATUS -_OPERATION.fields_by_name["progress"].message_type = _OPERATIONPROGRESS -_OPERATION.fields_by_name["cluster_conditions"].message_type = _STATUSCONDITION -_OPERATION.fields_by_name["nodepool_conditions"].message_type = _STATUSCONDITION -_OPERATION_STATUS.containing_type = _OPERATION -_OPERATION_TYPE.containing_type = _OPERATION -_OPERATIONPROGRESS_METRIC.containing_type = _OPERATIONPROGRESS -_OPERATIONPROGRESS_METRIC.oneofs_by_name["value"].fields.append( - _OPERATIONPROGRESS_METRIC.fields_by_name["int_value"] -) -_OPERATIONPROGRESS_METRIC.fields_by_name[ - "int_value" -].containing_oneof = _OPERATIONPROGRESS_METRIC.oneofs_by_name["value"] -_OPERATIONPROGRESS_METRIC.oneofs_by_name["value"].fields.append( - _OPERATIONPROGRESS_METRIC.fields_by_name["double_value"] -) -_OPERATIONPROGRESS_METRIC.fields_by_name[ - "double_value" -].containing_oneof = _OPERATIONPROGRESS_METRIC.oneofs_by_name["value"] -_OPERATIONPROGRESS_METRIC.oneofs_by_name["value"].fields.append( - _OPERATIONPROGRESS_METRIC.fields_by_name["string_value"] -) -_OPERATIONPROGRESS_METRIC.fields_by_name[ - "string_value" -].containing_oneof = _OPERATIONPROGRESS_METRIC.oneofs_by_name["value"] -_OPERATIONPROGRESS.fields_by_name["status"].enum_type = _OPERATION_STATUS -_OPERATIONPROGRESS.fields_by_name["metrics"].message_type = _OPERATIONPROGRESS_METRIC -_OPERATIONPROGRESS.fields_by_name["stages"].message_type = _OPERATIONPROGRESS -_CREATECLUSTERREQUEST.fields_by_name["cluster"].message_type = _CLUSTER -_UPDATECLUSTERREQUEST.fields_by_name["update"].message_type = _CLUSTERUPDATE -_SETNODEPOOLAUTOSCALINGREQUEST.fields_by_name[ - "autoscaling" -].message_type = _NODEPOOLAUTOSCALING -_SETADDONSCONFIGREQUEST.fields_by_name["addons_config"].message_type = _ADDONSCONFIG -_SETMASTERAUTHREQUEST.fields_by_name["action"].enum_type = _SETMASTERAUTHREQUEST_ACTION -_SETMASTERAUTHREQUEST.fields_by_name["update"].message_type = _MASTERAUTH -_SETMASTERAUTHREQUEST_ACTION.containing_type = _SETMASTERAUTHREQUEST -_LISTCLUSTERSRESPONSE.fields_by_name["clusters"].message_type = _CLUSTER -_LISTOPERATIONSRESPONSE.fields_by_name["operations"].message_type = _OPERATION -_CREATENODEPOOLREQUEST.fields_by_name["node_pool"].message_type = _NODEPOOL -_NODEPOOL.fields_by_name["config"].message_type = _NODECONFIG -_NODEPOOL.fields_by_name["status"].enum_type = _NODEPOOL_STATUS -_NODEPOOL.fields_by_name["autoscaling"].message_type = _NODEPOOLAUTOSCALING -_NODEPOOL.fields_by_name["management"].message_type = _NODEMANAGEMENT -_NODEPOOL.fields_by_name["max_pods_constraint"].message_type = _MAXPODSCONSTRAINT -_NODEPOOL.fields_by_name["conditions"].message_type = _STATUSCONDITION -_NODEPOOL_STATUS.containing_type = _NODEPOOL -_NODEMANAGEMENT.fields_by_name["upgrade_options"].message_type = _AUTOUPGRADEOPTIONS -_MAINTENANCEPOLICY.fields_by_name["window"].message_type = _MAINTENANCEWINDOW -_MAINTENANCEWINDOW.fields_by_name[ - "daily_maintenance_window" -].message_type = _DAILYMAINTENANCEWINDOW -_MAINTENANCEWINDOW.oneofs_by_name["policy"].fields.append( - _MAINTENANCEWINDOW.fields_by_name["daily_maintenance_window"] -) -_MAINTENANCEWINDOW.fields_by_name[ - "daily_maintenance_window" -].containing_oneof = _MAINTENANCEWINDOW.oneofs_by_name["policy"] -_SETNODEPOOLMANAGEMENTREQUEST.fields_by_name[ - "management" -].message_type = _NODEMANAGEMENT -_LISTNODEPOOLSRESPONSE.fields_by_name["node_pools"].message_type = _NODEPOOL -_CLUSTERAUTOSCALING.fields_by_name["resource_limits"].message_type = _RESOURCELIMIT -_SETLABELSREQUEST_RESOURCELABELSENTRY.containing_type = _SETLABELSREQUEST -_SETLABELSREQUEST.fields_by_name[ - "resource_labels" -].message_type = _SETLABELSREQUEST_RESOURCELABELSENTRY -_WORKLOADMETADATACONFIG.fields_by_name[ - "node_metadata" -].enum_type = _WORKLOADMETADATACONFIG_NODEMETADATA -_WORKLOADMETADATACONFIG_NODEMETADATA.containing_type = _WORKLOADMETADATACONFIG -_SETNETWORKPOLICYREQUEST.fields_by_name["network_policy"].message_type = _NETWORKPOLICY -_SETMAINTENANCEPOLICYREQUEST.fields_by_name[ - "maintenance_policy" -].message_type = _MAINTENANCEPOLICY -_LISTLOCATIONSRESPONSE.fields_by_name["locations"].message_type = _LOCATION -_LOCATION.fields_by_name["type"].enum_type = _LOCATION_LOCATIONTYPE -_LOCATION_LOCATIONTYPE.containing_type = _LOCATION -_STATUSCONDITION.fields_by_name["code"].enum_type = _STATUSCONDITION_CODE -_STATUSCONDITION_CODE.containing_type = _STATUSCONDITION -_LISTUSABLESUBNETWORKSRESPONSE.fields_by_name[ - "subnetworks" -].message_type = _USABLESUBNETWORK -_USABLESUBNETWORKSECONDARYRANGE.fields_by_name[ - "status" -].enum_type = _USABLESUBNETWORKSECONDARYRANGE_STATUS -_USABLESUBNETWORKSECONDARYRANGE_STATUS.containing_type = _USABLESUBNETWORKSECONDARYRANGE -_USABLESUBNETWORK.fields_by_name[ - "secondary_ip_ranges" -].message_type = _USABLESUBNETWORKSECONDARYRANGE -_RESOURCEUSAGEEXPORTCONFIG_BIGQUERYDESTINATION.containing_type = ( - _RESOURCEUSAGEEXPORTCONFIG -) -_RESOURCEUSAGEEXPORTCONFIG.fields_by_name[ - "bigquery_destination" -].message_type = _RESOURCEUSAGEEXPORTCONFIG_BIGQUERYDESTINATION -DESCRIPTOR.message_types_by_name["NodeConfig"] = _NODECONFIG -DESCRIPTOR.message_types_by_name["NodeTaint"] = _NODETAINT -DESCRIPTOR.message_types_by_name["MasterAuth"] = _MASTERAUTH -DESCRIPTOR.message_types_by_name["ClientCertificateConfig"] = _CLIENTCERTIFICATECONFIG -DESCRIPTOR.message_types_by_name["AddonsConfig"] = _ADDONSCONFIG -DESCRIPTOR.message_types_by_name["HttpLoadBalancing"] = _HTTPLOADBALANCING -DESCRIPTOR.message_types_by_name["HorizontalPodAutoscaling"] = _HORIZONTALPODAUTOSCALING -DESCRIPTOR.message_types_by_name["KubernetesDashboard"] = _KUBERNETESDASHBOARD -DESCRIPTOR.message_types_by_name["NetworkPolicyConfig"] = _NETWORKPOLICYCONFIG -DESCRIPTOR.message_types_by_name["PrivateClusterConfig"] = _PRIVATECLUSTERCONFIG -DESCRIPTOR.message_types_by_name["IstioConfig"] = _ISTIOCONFIG -DESCRIPTOR.message_types_by_name["CloudRunConfig"] = _CLOUDRUNCONFIG -DESCRIPTOR.message_types_by_name[ - "MasterAuthorizedNetworksConfig" -] = _MASTERAUTHORIZEDNETWORKSCONFIG -DESCRIPTOR.message_types_by_name["LegacyAbac"] = _LEGACYABAC -DESCRIPTOR.message_types_by_name["NetworkPolicy"] = _NETWORKPOLICY -DESCRIPTOR.message_types_by_name["IPAllocationPolicy"] = _IPALLOCATIONPOLICY -DESCRIPTOR.message_types_by_name["BinaryAuthorization"] = _BINARYAUTHORIZATION -DESCRIPTOR.message_types_by_name["PodSecurityPolicyConfig"] = _PODSECURITYPOLICYCONFIG -DESCRIPTOR.message_types_by_name["Cluster"] = _CLUSTER -DESCRIPTOR.message_types_by_name["ClusterUpdate"] = _CLUSTERUPDATE -DESCRIPTOR.message_types_by_name["Operation"] = _OPERATION -DESCRIPTOR.message_types_by_name["OperationProgress"] = _OPERATIONPROGRESS -DESCRIPTOR.message_types_by_name["CreateClusterRequest"] = _CREATECLUSTERREQUEST -DESCRIPTOR.message_types_by_name["GetClusterRequest"] = _GETCLUSTERREQUEST -DESCRIPTOR.message_types_by_name["UpdateClusterRequest"] = _UPDATECLUSTERREQUEST -DESCRIPTOR.message_types_by_name["UpdateNodePoolRequest"] = _UPDATENODEPOOLREQUEST -DESCRIPTOR.message_types_by_name[ - "SetNodePoolAutoscalingRequest" -] = _SETNODEPOOLAUTOSCALINGREQUEST -DESCRIPTOR.message_types_by_name["SetLoggingServiceRequest"] = _SETLOGGINGSERVICEREQUEST -DESCRIPTOR.message_types_by_name[ - "SetMonitoringServiceRequest" -] = _SETMONITORINGSERVICEREQUEST -DESCRIPTOR.message_types_by_name["SetAddonsConfigRequest"] = _SETADDONSCONFIGREQUEST -DESCRIPTOR.message_types_by_name["SetLocationsRequest"] = _SETLOCATIONSREQUEST -DESCRIPTOR.message_types_by_name["UpdateMasterRequest"] = _UPDATEMASTERREQUEST -DESCRIPTOR.message_types_by_name["SetMasterAuthRequest"] = _SETMASTERAUTHREQUEST -DESCRIPTOR.message_types_by_name["DeleteClusterRequest"] = _DELETECLUSTERREQUEST -DESCRIPTOR.message_types_by_name["ListClustersRequest"] = _LISTCLUSTERSREQUEST -DESCRIPTOR.message_types_by_name["ListClustersResponse"] = _LISTCLUSTERSRESPONSE -DESCRIPTOR.message_types_by_name["GetOperationRequest"] = _GETOPERATIONREQUEST -DESCRIPTOR.message_types_by_name["ListOperationsRequest"] = _LISTOPERATIONSREQUEST -DESCRIPTOR.message_types_by_name["CancelOperationRequest"] = _CANCELOPERATIONREQUEST -DESCRIPTOR.message_types_by_name["ListOperationsResponse"] = _LISTOPERATIONSRESPONSE -DESCRIPTOR.message_types_by_name["GetServerConfigRequest"] = _GETSERVERCONFIGREQUEST -DESCRIPTOR.message_types_by_name["ServerConfig"] = _SERVERCONFIG -DESCRIPTOR.message_types_by_name["CreateNodePoolRequest"] = _CREATENODEPOOLREQUEST -DESCRIPTOR.message_types_by_name["DeleteNodePoolRequest"] = _DELETENODEPOOLREQUEST -DESCRIPTOR.message_types_by_name["ListNodePoolsRequest"] = _LISTNODEPOOLSREQUEST -DESCRIPTOR.message_types_by_name["GetNodePoolRequest"] = _GETNODEPOOLREQUEST -DESCRIPTOR.message_types_by_name["NodePool"] = _NODEPOOL -DESCRIPTOR.message_types_by_name["NodeManagement"] = _NODEMANAGEMENT -DESCRIPTOR.message_types_by_name["AutoUpgradeOptions"] = _AUTOUPGRADEOPTIONS -DESCRIPTOR.message_types_by_name["MaintenancePolicy"] = _MAINTENANCEPOLICY -DESCRIPTOR.message_types_by_name["MaintenanceWindow"] = _MAINTENANCEWINDOW -DESCRIPTOR.message_types_by_name["DailyMaintenanceWindow"] = _DAILYMAINTENANCEWINDOW -DESCRIPTOR.message_types_by_name[ - "SetNodePoolManagementRequest" -] = _SETNODEPOOLMANAGEMENTREQUEST -DESCRIPTOR.message_types_by_name["SetNodePoolSizeRequest"] = _SETNODEPOOLSIZEREQUEST -DESCRIPTOR.message_types_by_name[ - "RollbackNodePoolUpgradeRequest" -] = _ROLLBACKNODEPOOLUPGRADEREQUEST -DESCRIPTOR.message_types_by_name["ListNodePoolsResponse"] = _LISTNODEPOOLSRESPONSE -DESCRIPTOR.message_types_by_name["ClusterAutoscaling"] = _CLUSTERAUTOSCALING -DESCRIPTOR.message_types_by_name["ResourceLimit"] = _RESOURCELIMIT -DESCRIPTOR.message_types_by_name["NodePoolAutoscaling"] = _NODEPOOLAUTOSCALING -DESCRIPTOR.message_types_by_name["SetLabelsRequest"] = _SETLABELSREQUEST -DESCRIPTOR.message_types_by_name["SetLegacyAbacRequest"] = _SETLEGACYABACREQUEST -DESCRIPTOR.message_types_by_name["StartIPRotationRequest"] = _STARTIPROTATIONREQUEST -DESCRIPTOR.message_types_by_name[ - "CompleteIPRotationRequest" -] = _COMPLETEIPROTATIONREQUEST -DESCRIPTOR.message_types_by_name["AcceleratorConfig"] = _ACCELERATORCONFIG -DESCRIPTOR.message_types_by_name["WorkloadMetadataConfig"] = _WORKLOADMETADATACONFIG -DESCRIPTOR.message_types_by_name["SetNetworkPolicyRequest"] = _SETNETWORKPOLICYREQUEST -DESCRIPTOR.message_types_by_name[ - "SetMaintenancePolicyRequest" -] = _SETMAINTENANCEPOLICYREQUEST -DESCRIPTOR.message_types_by_name["ListLocationsRequest"] = _LISTLOCATIONSREQUEST -DESCRIPTOR.message_types_by_name["ListLocationsResponse"] = _LISTLOCATIONSRESPONSE -DESCRIPTOR.message_types_by_name["Location"] = _LOCATION -DESCRIPTOR.message_types_by_name["StatusCondition"] = _STATUSCONDITION -DESCRIPTOR.message_types_by_name["NetworkConfig"] = _NETWORKCONFIG -DESCRIPTOR.message_types_by_name[ - "ListUsableSubnetworksRequest" -] = _LISTUSABLESUBNETWORKSREQUEST -DESCRIPTOR.message_types_by_name[ - "ListUsableSubnetworksResponse" -] = _LISTUSABLESUBNETWORKSRESPONSE -DESCRIPTOR.message_types_by_name[ - "UsableSubnetworkSecondaryRange" -] = _USABLESUBNETWORKSECONDARYRANGE -DESCRIPTOR.message_types_by_name["UsableSubnetwork"] = _USABLESUBNETWORK -DESCRIPTOR.message_types_by_name["VerticalPodAutoscaling"] = _VERTICALPODAUTOSCALING -DESCRIPTOR.message_types_by_name["MaxPodsConstraint"] = _MAXPODSCONSTRAINT -DESCRIPTOR.message_types_by_name[ - "ResourceUsageExportConfig" -] = _RESOURCEUSAGEEXPORTCONFIG -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -NodeConfig = _reflection.GeneratedProtocolMessageType( - "NodeConfig", - (_message.Message,), - dict( - MetadataEntry=_reflection.GeneratedProtocolMessageType( - "MetadataEntry", - (_message.Message,), - dict( - DESCRIPTOR=_NODECONFIG_METADATAENTRY, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2" - # @@protoc_insertion_point(class_scope:google.container.v1beta1.NodeConfig.MetadataEntry) - ), - ), - LabelsEntry=_reflection.GeneratedProtocolMessageType( - "LabelsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_NODECONFIG_LABELSENTRY, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2" - # @@protoc_insertion_point(class_scope:google.container.v1beta1.NodeConfig.LabelsEntry) - ), - ), - DESCRIPTOR=_NODECONFIG, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Parameters that describe the nodes in a cluster. - - - Attributes: - machine_type: - The name of a Google Compute Engine `machine type - `__ (e.g. ``n1-standard-1``). If - unspecified, the default machine type is ``n1-standard-1``. - disk_size_gb: - Size of the disk attached to each node, specified in GB. The - smallest allowed disk size is 10GB. If unspecified, the - default disk size is 100GB. - oauth_scopes: - The set of Google API scopes to be made available on all of - the node VMs under the "default" service account. The - following scopes are recommended, but not required, and by - default are not included: - - ``https://www.googleapis.com/auth/compute`` is required for - mounting persistent storage on your nodes. - - ``https://www.googleapis.com/auth/devstorage.read_only`` is - required for communicating with **gcr.io** (the `Google - Container Registry `__). If - unspecified, no scopes are added, unless Cloud Logging or - Cloud Monitoring are enabled, in which case their required - scopes will be added. - service_account: - The Google Cloud Platform Service Account to be used by the - node VMs. If no Service Account is specified, the "default" - service account is used. - metadata: - The metadata key/value pairs assigned to instances in the - cluster. Keys must conform to the regexp [a-zA-Z0-9-\_]+ and - be less than 128 bytes in length. These are reflected as part - of a URL in the metadata server. Additionally, to avoid - ambiguity, keys must not conflict with any other metadata keys - for the project or be one of the reserved keys: "cluster- - location" "cluster-name" "cluster-uid" "configure-sh" "enable- - oslogin" "gci-ensure-gke-docker" "gci-update-strategy" - "instance-template" "kube-env" "startup-script" "user-data" - Values are free-form strings, and only have meaning as - interpreted by the image running in the instance. The only - restriction placed on them is that each value's size must be - less than or equal to 32 KB. The total size of all keys and - values must be less than 512 KB. - image_type: - The image type to use for this node. Note that for a given - image type, the latest version of it will be used. - labels: - The map of Kubernetes labels (key/value pairs) to be applied - to each node. These will added in addition to any default - label(s) that Kubernetes may apply to the node. In case of - conflict in label keys, the applied set may differ depending - on the Kubernetes version -- it's best to assume the behavior - is undefined and conflicts should be avoided. For more - information, including usage and the valid values, see: - https://kubernetes.io/docs/concepts/overview/working-with- - objects/labels/ - local_ssd_count: - The number of local SSD disks to be attached to the node. The - limit for this value is dependant upon the maximum number of - disks available on a machine per zone. See: - https://cloud.google.com/compute/docs/disks/local- - ssd#local\_ssd\_limits for more information. - tags: - The list of instance tags applied to all nodes. Tags are used - to identify valid sources or targets for network firewalls and - are specified by the client during cluster or node pool - creation. Each tag within the list must comply with RFC1035. - preemptible: - Whether the nodes are created as preemptible VM instances. - See: - https://cloud.google.com/compute/docs/instances/preemptible - for more inforamtion about preemptible VM instances. - accelerators: - A list of hardware accelerators to be attached to each node. - See https://cloud.google.com/compute/docs/gpus for more - information about support for GPUs. - disk_type: - Type of the disk attached to each node (e.g. 'pd-standard' or - 'pd-ssd') If unspecified, the default disk type is 'pd- - standard' - min_cpu_platform: - Minimum CPU platform to be used by this instance. The instance - may be scheduled on the specified or newer CPU platform. - Applicable values are the friendly names of CPU platforms, - such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: - "Intel Sandy Bridge". For more information, read `how to - specify min CPU platform - `__ - workload_metadata_config: - The workload metadata configuration for this node. - taints: - List of kubernetes taints to be applied to each node. For - more information, including usage and the valid values, see: - https://kubernetes.io/docs/concepts/configuration/taint-and- - toleration/ - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.NodeConfig) - ), -) -_sym_db.RegisterMessage(NodeConfig) -_sym_db.RegisterMessage(NodeConfig.MetadataEntry) -_sym_db.RegisterMessage(NodeConfig.LabelsEntry) - -NodeTaint = _reflection.GeneratedProtocolMessageType( - "NodeTaint", - (_message.Message,), - dict( - DESCRIPTOR=_NODETAINT, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Kubernetes taint is comprised of three fields: key, value, and effect. - Effect can only be one of three types: NoSchedule, PreferNoSchedule or - NoExecute. - - For more information, including usage and the valid values, see: - https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - - - Attributes: - key: - Key for taint. - value: - Value for taint. - effect: - Effect for taint. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.NodeTaint) - ), -) -_sym_db.RegisterMessage(NodeTaint) - -MasterAuth = _reflection.GeneratedProtocolMessageType( - "MasterAuth", - (_message.Message,), - dict( - DESCRIPTOR=_MASTERAUTH, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""The authentication information for accessing the master endpoint. - Authentication can be done using HTTP basic auth or using client - certificates. - - - Attributes: - username: - The username to use for HTTP basic authentication to the - master endpoint. For clusters v1.6.0 and later, basic - authentication can be disabled by leaving username unspecified - (or setting it to the empty string). - password: - The password to use for HTTP basic authentication to the - master endpoint. Because the master endpoint is open to the - Internet, you should create a strong password. If a password - is provided for cluster creation, username must be non-empty. - client_certificate_config: - Configuration for client certificate authentication on the - cluster. For clusters before v1.12, if no configuration is - specified, a client certificate is issued. - cluster_ca_certificate: - [Output only] Base64-encoded public certificate that is the - root of trust for the cluster. - client_certificate: - [Output only] Base64-encoded public certificate used by - clients to authenticate to the cluster endpoint. - client_key: - [Output only] Base64-encoded private key used by clients to - authenticate to the cluster endpoint. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.MasterAuth) - ), -) -_sym_db.RegisterMessage(MasterAuth) - -ClientCertificateConfig = _reflection.GeneratedProtocolMessageType( - "ClientCertificateConfig", - (_message.Message,), - dict( - DESCRIPTOR=_CLIENTCERTIFICATECONFIG, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Configuration for client certificates on the cluster. - - - Attributes: - issue_client_certificate: - Issue a client certificate. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.ClientCertificateConfig) - ), -) -_sym_db.RegisterMessage(ClientCertificateConfig) - -AddonsConfig = _reflection.GeneratedProtocolMessageType( - "AddonsConfig", - (_message.Message,), - dict( - DESCRIPTOR=_ADDONSCONFIG, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Configuration for the addons that can be automatically spun up in the - cluster, enabling additional functionality. - - - Attributes: - http_load_balancing: - Configuration for the HTTP (L7) load balancing controller - addon, which makes it easy to set up HTTP load balancers for - services in a cluster. - horizontal_pod_autoscaling: - Configuration for the horizontal pod autoscaling feature, - which increases or decreases the number of replica pods a - replication controller has based on the resource usage of the - existing pods. - kubernetes_dashboard: - Configuration for the Kubernetes Dashboard. - network_policy_config: - Configuration for NetworkPolicy. This only tracks whether the - addon is enabled or not on the Master, it does not track - whether network policy is enabled for the nodes. - istio_config: - Configuration for Istio, an open platform to connect, manage, - and secure microservices. - cloud_run_config: - Configuration for the Cloud Run addon. The ``IstioConfig`` - addon must be enabled in order to enable Cloud Run addon. This - option can only be enabled at cluster creation time. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.AddonsConfig) - ), -) -_sym_db.RegisterMessage(AddonsConfig) - -HttpLoadBalancing = _reflection.GeneratedProtocolMessageType( - "HttpLoadBalancing", - (_message.Message,), - dict( - DESCRIPTOR=_HTTPLOADBALANCING, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Configuration options for the HTTP (L7) load balancing controller addon, - which makes it easy to set up HTTP load balancers for services in a - cluster. - - - Attributes: - disabled: - Whether the HTTP Load Balancing controller is enabled in the - cluster. When enabled, it runs a small pod in the cluster that - manages the load balancers. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.HttpLoadBalancing) - ), -) -_sym_db.RegisterMessage(HttpLoadBalancing) - -HorizontalPodAutoscaling = _reflection.GeneratedProtocolMessageType( - "HorizontalPodAutoscaling", - (_message.Message,), - dict( - DESCRIPTOR=_HORIZONTALPODAUTOSCALING, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Configuration options for the horizontal pod autoscaling feature, which - increases or decreases the number of replica pods a replication - controller has based on the resource usage of the existing pods. - - - Attributes: - disabled: - Whether the Horizontal Pod Autoscaling feature is enabled in - the cluster. When enabled, it ensures that a Heapster pod is - running in the cluster, which is also used by the Cloud - Monitoring service. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.HorizontalPodAutoscaling) - ), -) -_sym_db.RegisterMessage(HorizontalPodAutoscaling) - -KubernetesDashboard = _reflection.GeneratedProtocolMessageType( - "KubernetesDashboard", - (_message.Message,), - dict( - DESCRIPTOR=_KUBERNETESDASHBOARD, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Configuration for the Kubernetes Dashboard. - - - Attributes: - disabled: - Whether the Kubernetes Dashboard is enabled for this cluster. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.KubernetesDashboard) - ), -) -_sym_db.RegisterMessage(KubernetesDashboard) - -NetworkPolicyConfig = _reflection.GeneratedProtocolMessageType( - "NetworkPolicyConfig", - (_message.Message,), - dict( - DESCRIPTOR=_NETWORKPOLICYCONFIG, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Configuration for NetworkPolicy. This only tracks whether the addon is - enabled or not on the Master, it does not track whether network policy - is enabled for the nodes. - - - Attributes: - disabled: - Whether NetworkPolicy is enabled for this cluster. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.NetworkPolicyConfig) - ), -) -_sym_db.RegisterMessage(NetworkPolicyConfig) - -PrivateClusterConfig = _reflection.GeneratedProtocolMessageType( - "PrivateClusterConfig", - (_message.Message,), - dict( - DESCRIPTOR=_PRIVATECLUSTERCONFIG, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Configuration options for private clusters. - - - Attributes: - enable_private_nodes: - Whether nodes have internal IP addresses only. If enabled, all - nodes are given only RFC 1918 private addresses and - communicate with the master via private networking. - enable_private_endpoint: - Whether the master's internal IP address is used as the - cluster endpoint. - master_ipv4_cidr_block: - The IP range in CIDR notation to use for the hosted master - network. This range will be used for assigning internal IP - addresses to the master or set of masters, as well as the ILB - VIP. This range must not overlap with any other ranges in use - within the cluster's network. - private_endpoint: - Output only. The internal IP address of this cluster's master - endpoint. - public_endpoint: - Output only. The external IP address of this cluster's master - endpoint. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.PrivateClusterConfig) - ), -) -_sym_db.RegisterMessage(PrivateClusterConfig) - -IstioConfig = _reflection.GeneratedProtocolMessageType( - "IstioConfig", - (_message.Message,), - dict( - DESCRIPTOR=_ISTIOCONFIG, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Configuration options for Istio addon. - - - Attributes: - disabled: - Whether Istio is enabled for this cluster. - auth: - The specified Istio auth mode, either none, or mutual TLS. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.IstioConfig) - ), -) -_sym_db.RegisterMessage(IstioConfig) - -CloudRunConfig = _reflection.GeneratedProtocolMessageType( - "CloudRunConfig", - (_message.Message,), - dict( - DESCRIPTOR=_CLOUDRUNCONFIG, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Configuration options for the Cloud Run feature. - - - Attributes: - disabled: - Whether Cloud Run addon is enabled for this cluster. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.CloudRunConfig) - ), -) -_sym_db.RegisterMessage(CloudRunConfig) - -MasterAuthorizedNetworksConfig = _reflection.GeneratedProtocolMessageType( - "MasterAuthorizedNetworksConfig", - (_message.Message,), - dict( - CidrBlock=_reflection.GeneratedProtocolMessageType( - "CidrBlock", - (_message.Message,), - dict( - DESCRIPTOR=_MASTERAUTHORIZEDNETWORKSCONFIG_CIDRBLOCK, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""CidrBlock contains an optional name and one CIDR block. - - - Attributes: - display_name: - display\_name is an optional field for users to identify CIDR - blocks. - cidr_block: - cidr\_block must be specified in CIDR notation. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock) - ), - ), - DESCRIPTOR=_MASTERAUTHORIZEDNETWORKSCONFIG, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Configuration options for the master authorized networks feature. - Enabled master authorized networks will disallow all external traffic to - access Kubernetes master through HTTPS except traffic from the given - CIDR blocks, Google Compute Engine Public IPs and Google Prod IPs. - - - Attributes: - enabled: - Whether or not master authorized networks is enabled. - cidr_blocks: - cidr\_blocks define up to 10 external networks that could - access Kubernetes master through HTTPS. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.MasterAuthorizedNetworksConfig) - ), -) -_sym_db.RegisterMessage(MasterAuthorizedNetworksConfig) -_sym_db.RegisterMessage(MasterAuthorizedNetworksConfig.CidrBlock) - -LegacyAbac = _reflection.GeneratedProtocolMessageType( - "LegacyAbac", - (_message.Message,), - dict( - DESCRIPTOR=_LEGACYABAC, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Configuration for the legacy Attribute Based Access Control - authorization mode. - - - Attributes: - enabled: - Whether the ABAC authorizer is enabled for this cluster. When - enabled, identities in the system, including service accounts, - nodes, and controllers, will have statically granted - permissions beyond those provided by the RBAC configuration or - IAM. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.LegacyAbac) - ), -) -_sym_db.RegisterMessage(LegacyAbac) - -NetworkPolicy = _reflection.GeneratedProtocolMessageType( - "NetworkPolicy", - (_message.Message,), - dict( - DESCRIPTOR=_NETWORKPOLICY, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Configuration options for the NetworkPolicy feature. - https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ - - - Attributes: - provider: - The selected network policy provider. - enabled: - Whether network policy is enabled on the cluster. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.NetworkPolicy) - ), -) -_sym_db.RegisterMessage(NetworkPolicy) - -IPAllocationPolicy = _reflection.GeneratedProtocolMessageType( - "IPAllocationPolicy", - (_message.Message,), - dict( - DESCRIPTOR=_IPALLOCATIONPOLICY, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Configuration for controlling how IPs are allocated in the cluster. - - - Attributes: - use_ip_aliases: - Whether alias IPs will be used for pod IPs in the cluster. - create_subnetwork: - Whether a new subnetwork will be created automatically for the - cluster. This field is only applicable when - ``use_ip_aliases`` is true. - subnetwork_name: - A custom subnetwork name to be used if ``create_subnetwork`` - is true. If this field is empty, then an automatic name will - be chosen for the new subnetwork. - cluster_ipv4_cidr: - This field is deprecated, use cluster\_ipv4\_cidr\_block. - node_ipv4_cidr: - This field is deprecated, use node\_ipv4\_cidr\_block. - services_ipv4_cidr: - This field is deprecated, use services\_ipv4\_cidr\_block. - cluster_secondary_range_name: - The name of the secondary range to be used for the cluster - CIDR block. The secondary range will be used for pod IP - addresses. This must be an existing secondary range associated - with the cluster subnetwork. This field is only applicable - with use\_ip\_aliases and create\_subnetwork is false. - services_secondary_range_name: - The name of the secondary range to be used as for the services - CIDR block. The secondary range will be used for service - ClusterIPs. This must be an existing secondary range - associated with the cluster subnetwork. This field is only - applicable with use\_ip\_aliases and create\_subnetwork is - false. - cluster_ipv4_cidr_block: - The IP address range for the cluster pod IPs. If this field is - set, then ``cluster.cluster_ipv4_cidr`` must be left blank. - This field is only applicable when ``use_ip_aliases`` is true. - Set to blank to have a range chosen with the default size. - Set to /netmask (e.g. ``/14``) to have a range chosen with a - specific netmask. Set to a `CIDR - `__ notation (e.g. ``10.96.0.0/14``) from the - RFC-1918 private networks (e.g. ``10.0.0.0/8``, - ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific - range to use. - node_ipv4_cidr_block: - The IP address range of the instance IPs in this cluster. - This is applicable only if ``create_subnetwork`` is true. Set - to blank to have a range chosen with the default size. Set to - /netmask (e.g. ``/14``) to have a range chosen with a specific - netmask. Set to a `CIDR - `__ notation (e.g. ``10.96.0.0/14``) from the - RFC-1918 private networks (e.g. ``10.0.0.0/8``, - ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific - range to use. - services_ipv4_cidr_block: - The IP address range of the services IPs in this cluster. If - blank, a range will be automatically chosen with the default - size. This field is only applicable when ``use_ip_aliases`` - is true. Set to blank to have a range chosen with the default - size. Set to /netmask (e.g. ``/14``) to have a range chosen - with a specific netmask. Set to a `CIDR - `__ notation (e.g. ``10.96.0.0/14``) from the - RFC-1918 private networks (e.g. ``10.0.0.0/8``, - ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific - range to use. - allow_route_overlap: - If true, allow allocation of cluster CIDR ranges that overlap - with certain kinds of network routes. By default we do not - allow cluster CIDR ranges to intersect with any user declared - routes. With allow\_route\_overlap == true, we allow - overlapping with CIDR ranges that are larger than the cluster - CIDR range. If this field is set to true, then cluster and - services CIDRs must be fully-specified (e.g. ``10.96.0.0/14``, - but not ``/14``), which means: 1) When ``use_ip_aliases`` is - true, ``cluster_ipv4_cidr_block`` and - ``services_ipv4_cidr_block`` must be fully-specified. 2) When - ``use_ip_aliases`` is false, ``cluster.cluster_ipv4_cidr`` - muse be fully-specified. - tpu_ipv4_cidr_block: - The IP address range of the Cloud TPUs in this cluster. If - unspecified, a range will be automatically chosen with the - default size. This field is only applicable when - ``use_ip_aliases`` is true. If unspecified, the range will - use the default size. Set to /netmask (e.g. ``/14``) to have - a range chosen with a specific netmask. Set to a `CIDR - `__ notation (e.g. ``10.96.0.0/14``) from the - RFC-1918 private networks (e.g. ``10.0.0.0/8``, - ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific - range to use. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.IPAllocationPolicy) - ), -) -_sym_db.RegisterMessage(IPAllocationPolicy) - -BinaryAuthorization = _reflection.GeneratedProtocolMessageType( - "BinaryAuthorization", - (_message.Message,), - dict( - DESCRIPTOR=_BINARYAUTHORIZATION, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Configuration for Binary Authorization. - - - Attributes: - enabled: - Enable Binary Authorization for this cluster. If enabled, all - container images will be validated by Google Binauthz. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.BinaryAuthorization) - ), -) -_sym_db.RegisterMessage(BinaryAuthorization) - -PodSecurityPolicyConfig = _reflection.GeneratedProtocolMessageType( - "PodSecurityPolicyConfig", - (_message.Message,), - dict( - DESCRIPTOR=_PODSECURITYPOLICYCONFIG, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Configuration for the PodSecurityPolicy feature. - - - Attributes: - enabled: - Enable the PodSecurityPolicy controller for this cluster. If - enabled, pods must be valid under a PodSecurityPolicy to be - created. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.PodSecurityPolicyConfig) - ), -) -_sym_db.RegisterMessage(PodSecurityPolicyConfig) - -Cluster = _reflection.GeneratedProtocolMessageType( - "Cluster", - (_message.Message,), - dict( - ResourceLabelsEntry=_reflection.GeneratedProtocolMessageType( - "ResourceLabelsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_CLUSTER_RESOURCELABELSENTRY, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2" - # @@protoc_insertion_point(class_scope:google.container.v1beta1.Cluster.ResourceLabelsEntry) - ), - ), - DESCRIPTOR=_CLUSTER, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""A Google Kubernetes Engine cluster. - - - Attributes: - name: - The name of this cluster. The name must be unique within this - project and zone, and can be up to 40 characters with the - following restrictions: - Lowercase letters, numbers, and - hyphens only. - Must start with a letter. - Must end with a - number or a letter. - description: - An optional description of this cluster. - initial_node_count: - The number of nodes to create in this cluster. You must ensure - that your Compute Engine resource quota is sufficient for this - number of instances. You must also have available firewall and - routes quota. For requests, this field should only be used in - lieu of a "node\_pool" object, since this configuration (along - with the "node\_config") will be used to create a "NodePool" - object with an auto-generated name. Do not use this and a - node\_pool at the same time. - node_config: - Parameters used in creating the cluster's nodes. See - ``nodeConfig`` for the description of its properties. For - requests, this field should only be used in lieu of a - "node\_pool" object, since this configuration (along with the - "initial\_node\_count") will be used to create a "NodePool" - object with an auto-generated name. Do not use this and a - node\_pool at the same time. For responses, this field will be - populated with the node configuration of the first node pool. - If unspecified, the defaults are used. - master_auth: - The authentication information for accessing the master - endpoint. If unspecified, the defaults are used: For clusters - before v1.12, if master\_auth is unspecified, ``username`` - will be set to "admin", a random password will be generated, - and a client certificate will be issued. - logging_service: - The logging service the cluster should use to write logs. - Currently available options: - ``logging.googleapis.com`` - - the Google Cloud Logging service. - ``none`` - no logs will - be exported from the cluster. - if left as an empty string,\ - ``logging.googleapis.com`` will be used. - monitoring_service: - The monitoring service the cluster should use to write - metrics. Currently available options: - - ``monitoring.googleapis.com`` - the Google Cloud Monitoring - service. - ``none`` - no metrics will be exported from the - cluster. - if left as an empty string, - ``monitoring.googleapis.com`` will be used. - network: - The name of the Google Compute Engine `network - `__ to which - the cluster is connected. If left unspecified, the ``default`` - network will be used. On output this shows the network ID - instead of the name. - cluster_ipv4_cidr: - The IP address range of the container pods in this cluster, in - `CIDR `__ notation (e.g. ``10.96.0.0/14``). Leave - blank to have one automatically chosen or specify a ``/14`` - block in ``10.0.0.0/8``. - addons_config: - Configurations for the various addons available to run in the - cluster. - subnetwork: - The name of the Google Compute Engine `subnetwork - `__ to which the cluster is - connected. On output this shows the subnetwork ID instead of - the name. - node_pools: - The node pools associated with this cluster. This field should - not be set if "node\_config" or "initial\_node\_count" are - specified. - locations: - The list of Google Compute Engine `zones - `__ in which the cluster's - nodes should be located. - enable_kubernetes_alpha: - Kubernetes alpha features are enabled on this cluster. This - includes alpha API groups (e.g. v1beta1) and features that may - not be production ready in the kubernetes version of the - master and nodes. The cluster has no SLA for uptime and - master/node upgrades are disabled. Alpha enabled clusters are - automatically deleted thirty days after creation. - resource_labels: - The resource labels for the cluster to use to annotate any - related Google Compute Engine resources. - label_fingerprint: - The fingerprint of the set of labels for this cluster. - legacy_abac: - Configuration for the legacy ABAC authorization mode. - network_policy: - Configuration options for the NetworkPolicy feature. - ip_allocation_policy: - Configuration for cluster IP allocation. - master_authorized_networks_config: - The configuration options for master authorized networks - feature. - maintenance_policy: - Configure the maintenance policy for this cluster. - binary_authorization: - Configuration for Binary Authorization. - pod_security_policy_config: - Configuration for the PodSecurityPolicy feature. - autoscaling: - Cluster-level autoscaling configuration. - network_config: - Configuration for cluster networking. - private_cluster: - If this is a private cluster setup. Private clusters are - clusters that, by default have no external IP addresses on the - nodes and where nodes and the master communicate over private - IP addresses. This field is deprecated, use - private\_cluster\_config.enable\_private\_nodes instead. - master_ipv4_cidr_block: - The IP prefix in CIDR notation to use for the hosted master - network. This prefix will be used for assigning private IP - addresses to the master or set of masters, as well as the ILB - VIP. This field is deprecated, use - private\_cluster\_config.master\_ipv4\_cidr\_block instead. - default_max_pods_constraint: - The default constraint on the maximum number of pods that can - be run simultaneously on a node in the node pool of this - cluster. Only honored if cluster created with IP Alias - support. - resource_usage_export_config: - Configuration for exporting resource usages. Resource usage - export is disabled when this config unspecified. - private_cluster_config: - Configuration for private cluster. - vertical_pod_autoscaling: - Cluster-level Vertical Pod Autoscaling configuration. - self_link: - [Output only] Server-defined URL for the resource. - zone: - [Output only] The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field is deprecated, use location instead. - endpoint: - [Output only] The IP address of this cluster's master - endpoint. The endpoint can be accessed from the internet at - ``https://username:password@endpoint/``. See the - ``masterAuth`` property of this resource for username and - password information. - initial_cluster_version: - The initial Kubernetes version for this cluster. Valid - versions are those found in validMasterVersions returned by - getServerConfig. The version can be upgraded over time; such - upgrades are reflected in currentMasterVersion and - currentNodeVersion. Users may specify either explicit - versions offered by Kubernetes Engine or version aliases, - which have the following behavior: - "latest": picks the - highest valid Kubernetes version - "1.X": picks the highest - valid patch+gke.N patch in the 1.X version - "1.X.Y": picks - the highest valid gke.N patch in the 1.X.Y version - - "1.X.Y-gke.N": picks an explicit Kubernetes version - "","-": - picks the default Kubernetes version - current_master_version: - [Output only] The current software version of the master - endpoint. - current_node_version: - [Output only] Deprecated, use `NodePool.version `__ instead. The current version of the node software - components. If they are currently at multiple versions because - they're in the process of being upgraded, this reflects the - minimum version of all nodes. - create_time: - [Output only] The time the cluster was created, in `RFC3339 - `__ text format. - status: - [Output only] The current status of this cluster. - status_message: - [Output only] Additional information about the current status - of this cluster, if available. - node_ipv4_cidr_size: - [Output only] The size of the address space on each node for - hosting containers. This is provisioned from within the - ``container_ipv4_cidr`` range. - services_ipv4_cidr: - [Output only] The IP address range of the Kubernetes services - in this cluster, in `CIDR - `__ notation (e.g. ``1.2.3.4/29``). Service - addresses are typically put in the last ``/16`` from the - container CIDR. - instance_group_urls: - Deprecated. Use node\_pools.instance\_group\_urls. - current_node_count: - [Output only] The number of nodes currently in the cluster. - Deprecated. Call Kubernetes API directly to retrieve node - information. - expire_time: - [Output only] The time the cluster will be automatically - deleted in `RFC3339 `__ - text format. - location: - [Output only] The name of the Google Compute Engine `zone - `__ or - `region `__ in which the cluster resides. - enable_tpu: - Enable the ability to use Cloud TPUs in this cluster. - tpu_ipv4_cidr_block: - [Output only] The IP address range of the Cloud TPUs in this - cluster, in `CIDR - `__ notation (e.g. ``1.2.3.4/29``). - conditions: - Which conditions caused the current cluster state. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.Cluster) - ), -) -_sym_db.RegisterMessage(Cluster) -_sym_db.RegisterMessage(Cluster.ResourceLabelsEntry) - -ClusterUpdate = _reflection.GeneratedProtocolMessageType( - "ClusterUpdate", - (_message.Message,), - dict( - DESCRIPTOR=_CLUSTERUPDATE, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""ClusterUpdate describes an update to the cluster. Exactly one update can - be applied to a cluster with each request, so at most one field can be - provided. - - - Attributes: - desired_node_version: - The Kubernetes version to change the nodes to (typically an - upgrade). Users may specify either explicit versions offered - by Kubernetes Engine or version aliases, which have the - following behavior: - "latest": picks the highest valid - Kubernetes version - "1.X": picks the highest valid - patch+gke.N patch in the 1.X version - "1.X.Y": picks the - highest valid gke.N patch in the 1.X.Y version - - "1.X.Y-gke.N": picks an explicit Kubernetes version - "-": - picks the Kubernetes master version - desired_monitoring_service: - The monitoring service the cluster should use to write - metrics. Currently available options: - - "monitoring.googleapis.com/kubernetes" - the Google Cloud - Monitoring service with Kubernetes-native resource model in - Stackdriver - "monitoring.googleapis.com" - the Google Cloud - Monitoring service - "none" - no metrics will be exported - from the cluster - desired_addons_config: - Configurations for the various addons available to run in the - cluster. - desired_node_pool_id: - The node pool to be upgraded. This field is mandatory if - "desired\_node\_version", "desired\_image\_family" or - "desired\_node\_pool\_autoscaling" is specified and there is - more than one node pool on the cluster. - desired_image_type: - The desired image type for the node pool. NOTE: Set the - "desired\_node\_pool" field as well. - desired_node_pool_autoscaling: - Autoscaler configuration for the node pool specified in - desired\_node\_pool\_id. If there is only one pool in the - cluster and desired\_node\_pool\_id is not provided then the - change applies to that single node pool. - desired_locations: - The desired list of Google Compute Engine `zones - `__ in which the cluster's - nodes should be located. Changing the locations a cluster is - in will result in nodes being either created or removed from - the cluster, depending on whether locations are being added or - removed. This list must always include the cluster's primary - zone. - desired_master_authorized_networks_config: - The desired configuration options for master authorized - networks feature. - desired_pod_security_policy_config: - The desired configuration options for the PodSecurityPolicy - feature. - desired_cluster_autoscaling: - Cluster-level autoscaling configuration. - desired_binary_authorization: - The desired configuration options for the Binary Authorization - feature. - desired_logging_service: - The logging service the cluster should use to write metrics. - Currently available options: - - "logging.googleapis.com/kubernetes" - the Google Cloud Logging - service with Kubernetes-native resource model in Stackdriver - - "logging.googleapis.com" - the Google Cloud Logging service - - "none" - no logs will be exported from the cluster - desired_resource_usage_export_config: - The desired configuration for exporting resource usage. - desired_vertical_pod_autoscaling: - Cluster-level Vertical Pod Autoscaling configuration. - desired_master_version: - The Kubernetes version to change the master to. The only valid - value is the latest supported version. Users may specify - either explicit versions offered by Kubernetes Engine or - version aliases, which have the following behavior: - - "latest": picks the highest valid Kubernetes version - "1.X": - picks the highest valid patch+gke.N patch in the 1.X version - - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y - version - "1.X.Y-gke.N": picks an explicit Kubernetes version - - "-": picks the default Kubernetes version - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.ClusterUpdate) - ), -) -_sym_db.RegisterMessage(ClusterUpdate) - -Operation = _reflection.GeneratedProtocolMessageType( - "Operation", - (_message.Message,), - dict( - DESCRIPTOR=_OPERATION, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""This operation resource represents operations that may have happened or - are happening on the cluster. All fields are output only. - - - Attributes: - name: - The server-assigned ID for the operation. - zone: - The name of the Google Compute Engine `zone - `__ in which the operation is - taking place. This field is deprecated, use location instead. - operation_type: - The operation type. - status: - The current status of the operation. - detail: - Detailed operation progress, if available. - status_message: - If an error has occurred, a textual description of the error. - self_link: - Server-defined URL for the resource. - target_link: - Server-defined URL for the target of the operation. - location: - [Output only] The name of the Google Compute Engine `zone - `__ or - `region `__ in which the cluster resides. - start_time: - [Output only] The time the operation started, in `RFC3339 - `__ text format. - end_time: - [Output only] The time the operation completed, in `RFC3339 - `__ text format. - progress: - [Output only] Progress information for an operation. - cluster_conditions: - Which conditions caused the current cluster state. - nodepool_conditions: - Which conditions caused the current node pool state. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.Operation) - ), -) -_sym_db.RegisterMessage(Operation) - -OperationProgress = _reflection.GeneratedProtocolMessageType( - "OperationProgress", - (_message.Message,), - dict( - Metric=_reflection.GeneratedProtocolMessageType( - "Metric", - (_message.Message,), - dict( - DESCRIPTOR=_OPERATIONPROGRESS_METRIC, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Progress metric is (string, int\|float\|string) pair. - - - Attributes: - name: - Metric name, required. e.g., "nodes total", "percent done" - value: - Strictly one of the values is required. - int_value: - For metrics with integer value. - double_value: - For metrics with floating point value. - string_value: - For metrics with custom values (ratios, visual progress, - etc.). - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.OperationProgress.Metric) - ), - ), - DESCRIPTOR=_OPERATIONPROGRESS, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Information about operation (or operation stage) progress. - - - Attributes: - name: - A non-parameterized string describing an operation stage. - Unset for single-stage operations. - status: - Status of an operation stage. Unset for single-stage - operations. - metrics: - Progress metric bundle, for example: metrics: [{name: "nodes - done", int\_value: 15}, {name: "nodes total", int\_value: 32}] - or metrics: [{name: "progress", double\_value: 0.56}, {name: - "progress scale", double\_value: 1.0}] - stages: - Substages of an operation or a stage. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.OperationProgress) - ), -) -_sym_db.RegisterMessage(OperationProgress) -_sym_db.RegisterMessage(OperationProgress.Metric) - -CreateClusterRequest = _reflection.GeneratedProtocolMessageType( - "CreateClusterRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATECLUSTERREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""CreateClusterRequest creates a cluster. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the parent field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - parent field. - cluster: - A `cluster resource `__ - parent: - The parent (project and location) where the cluster will be - created. Specified in the format 'projects/*/locations/*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.CreateClusterRequest) - ), -) -_sym_db.RegisterMessage(CreateClusterRequest) - -GetClusterRequest = _reflection.GeneratedProtocolMessageType( - "GetClusterRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETCLUSTERREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""GetClusterRequest gets the settings of a cluster. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster to retrieve. This field - has been deprecated and replaced by the name field. - name: - The name (project, location, cluster) of the cluster to - retrieve. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.GetClusterRequest) - ), -) -_sym_db.RegisterMessage(GetClusterRequest) - -UpdateClusterRequest = _reflection.GeneratedProtocolMessageType( - "UpdateClusterRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATECLUSTERREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""UpdateClusterRequest updates the settings of a cluster. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster to upgrade. This field has - been deprecated and replaced by the name field. - update: - A description of the update. - name: - The name (project, location, cluster) of the cluster to - update. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.UpdateClusterRequest) - ), -) -_sym_db.RegisterMessage(UpdateClusterRequest) - -UpdateNodePoolRequest = _reflection.GeneratedProtocolMessageType( - "UpdateNodePoolRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATENODEPOOLREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""SetNodePoolVersionRequest updates the version of a node pool. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster to upgrade. This field has - been deprecated and replaced by the name field. - node_pool_id: - Deprecated. The name of the node pool to upgrade. This field - has been deprecated and replaced by the name field. - node_version: - The Kubernetes version to change the nodes to (typically an - upgrade). Users may specify either explicit versions offered - by Kubernetes Engine or version aliases, which have the - following behavior: - "latest": picks the highest valid - Kubernetes version - "1.X": picks the highest valid - patch+gke.N patch in the 1.X version - "1.X.Y": picks the - highest valid gke.N patch in the 1.X.Y version - - "1.X.Y-gke.N": picks an explicit Kubernetes version - "-": - picks the Kubernetes master version - image_type: - The desired image type for the node pool. - name: - The name (project, location, cluster, node pool) of the node - pool to update. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.UpdateNodePoolRequest) - ), -) -_sym_db.RegisterMessage(UpdateNodePoolRequest) - -SetNodePoolAutoscalingRequest = _reflection.GeneratedProtocolMessageType( - "SetNodePoolAutoscalingRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETNODEPOOLAUTOSCALINGREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""SetNodePoolAutoscalingRequest sets the autoscaler settings of a node - pool. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster to upgrade. This field has - been deprecated and replaced by the name field. - node_pool_id: - Deprecated. The name of the node pool to upgrade. This field - has been deprecated and replaced by the name field. - autoscaling: - Autoscaling configuration for the node pool. - name: - The name (project, location, cluster, node pool) of the node - pool to set autoscaler settings. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.SetNodePoolAutoscalingRequest) - ), -) -_sym_db.RegisterMessage(SetNodePoolAutoscalingRequest) - -SetLoggingServiceRequest = _reflection.GeneratedProtocolMessageType( - "SetLoggingServiceRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETLOGGINGSERVICEREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""SetLoggingServiceRequest sets the logging service of a cluster. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster to upgrade. This field has - been deprecated and replaced by the name field. - logging_service: - The logging service the cluster should use to write metrics. - Currently available options: - "logging.googleapis.com" - - the Google Cloud Logging service - "none" - no metrics will - be exported from the cluster - name: - The name (project, location, cluster) of the cluster to set - logging. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.SetLoggingServiceRequest) - ), -) -_sym_db.RegisterMessage(SetLoggingServiceRequest) - -SetMonitoringServiceRequest = _reflection.GeneratedProtocolMessageType( - "SetMonitoringServiceRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETMONITORINGSERVICEREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""SetMonitoringServiceRequest sets the monitoring service of a cluster. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster to upgrade. This field has - been deprecated and replaced by the name field. - monitoring_service: - The monitoring service the cluster should use to write - metrics. Currently available options: - - "monitoring.googleapis.com" - the Google Cloud Monitoring - service - "none" - no metrics will be exported from the - cluster - name: - The name (project, location, cluster) of the cluster to set - monitoring. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.SetMonitoringServiceRequest) - ), -) -_sym_db.RegisterMessage(SetMonitoringServiceRequest) - -SetAddonsConfigRequest = _reflection.GeneratedProtocolMessageType( - "SetAddonsConfigRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETADDONSCONFIGREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""SetAddonsRequest sets the addons associated with the cluster. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster to upgrade. This field has - been deprecated and replaced by the name field. - addons_config: - The desired configurations for the various addons available to - run in the cluster. - name: - The name (project, location, cluster) of the cluster to set - addons. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.SetAddonsConfigRequest) - ), -) -_sym_db.RegisterMessage(SetAddonsConfigRequest) - -SetLocationsRequest = _reflection.GeneratedProtocolMessageType( - "SetLocationsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETLOCATIONSREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""SetLocationsRequest sets the locations of the cluster. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster to upgrade. This field has - been deprecated and replaced by the name field. - locations: - The desired list of Google Compute Engine `zones - `__ in which the cluster's - nodes should be located. Changing the locations a cluster is - in will result in nodes being either created or removed from - the cluster, depending on whether locations are being added or - removed. This list must always include the cluster's primary - zone. - name: - The name (project, location, cluster) of the cluster to set - locations. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.SetLocationsRequest) - ), -) -_sym_db.RegisterMessage(SetLocationsRequest) - -UpdateMasterRequest = _reflection.GeneratedProtocolMessageType( - "UpdateMasterRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEMASTERREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""UpdateMasterRequest updates the master of the cluster. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster to upgrade. This field has - been deprecated and replaced by the name field. - master_version: - The Kubernetes version to change the master to. Users may - specify either explicit versions offered by Kubernetes Engine - or version aliases, which have the following behavior: - - "latest": picks the highest valid Kubernetes version - "1.X": - picks the highest valid patch+gke.N patch in the 1.X version - - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y - version - "1.X.Y-gke.N": picks an explicit Kubernetes version - - "-": picks the default Kubernetes version - name: - The name (project, location, cluster) of the cluster to - update. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.UpdateMasterRequest) - ), -) -_sym_db.RegisterMessage(UpdateMasterRequest) - -SetMasterAuthRequest = _reflection.GeneratedProtocolMessageType( - "SetMasterAuthRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETMASTERAUTHREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""SetMasterAuthRequest updates the admin password of a cluster. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster to upgrade. This field has - been deprecated and replaced by the name field. - action: - The exact form of action to be taken on the master auth. - update: - A description of the update. - name: - The name (project, location, cluster) of the cluster to set - auth. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.SetMasterAuthRequest) - ), -) -_sym_db.RegisterMessage(SetMasterAuthRequest) - -DeleteClusterRequest = _reflection.GeneratedProtocolMessageType( - "DeleteClusterRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETECLUSTERREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""DeleteClusterRequest deletes a cluster. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster to delete. This field has - been deprecated and replaced by the name field. - name: - The name (project, location, cluster) of the cluster to - delete. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.DeleteClusterRequest) - ), -) -_sym_db.RegisterMessage(DeleteClusterRequest) - -ListClustersRequest = _reflection.GeneratedProtocolMessageType( - "ListClustersRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTCLUSTERSREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""ListClustersRequest lists clusters. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the parent field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides, or "-" for all zones. This field has been deprecated - and replaced by the parent field. - parent: - The parent (project and location) where the clusters will be - listed. Specified in the format 'projects/*/locations/*'. - Location "-" matches all zones and all regions. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.ListClustersRequest) - ), -) -_sym_db.RegisterMessage(ListClustersRequest) - -ListClustersResponse = _reflection.GeneratedProtocolMessageType( - "ListClustersResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTCLUSTERSRESPONSE, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""ListClustersResponse is the result of ListClustersRequest. - - - Attributes: - clusters: - A list of clusters in the project in the specified zone, or - across all ones. - missing_zones: - If any zones are listed here, the list of clusters returned - may be missing those zones. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.ListClustersResponse) - ), -) -_sym_db.RegisterMessage(ListClustersResponse) - -GetOperationRequest = _reflection.GeneratedProtocolMessageType( - "GetOperationRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETOPERATIONREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""GetOperationRequest gets a single operation. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - operation_id: - Deprecated. The server-assigned ``name`` of the operation. - This field has been deprecated and replaced by the name field. - name: - The name (project, location, operation id) of the operation to - get. Specified in the format - 'projects/*/locations/*/operations/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.GetOperationRequest) - ), -) -_sym_db.RegisterMessage(GetOperationRequest) - -ListOperationsRequest = _reflection.GeneratedProtocolMessageType( - "ListOperationsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTOPERATIONSREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""ListOperationsRequest lists operations. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the parent field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ to return operations for, - or ``-`` for all zones. This field has been deprecated and - replaced by the parent field. - parent: - The parent (project and location) where the operations will be - listed. Specified in the format 'projects/*/locations/*'. - Location "-" matches all zones and all regions. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.ListOperationsRequest) - ), -) -_sym_db.RegisterMessage(ListOperationsRequest) - -CancelOperationRequest = _reflection.GeneratedProtocolMessageType( - "CancelOperationRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CANCELOPERATIONREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""CancelOperationRequest cancels a single operation. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the operation - resides. This field has been deprecated and replaced by the - name field. - operation_id: - Deprecated. The server-assigned ``name`` of the operation. - This field has been deprecated and replaced by the name field. - name: - The name (project, location, operation id) of the operation to - cancel. Specified in the format - 'projects/*/locations/*/operations/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.CancelOperationRequest) - ), -) -_sym_db.RegisterMessage(CancelOperationRequest) - -ListOperationsResponse = _reflection.GeneratedProtocolMessageType( - "ListOperationsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTOPERATIONSRESPONSE, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""ListOperationsResponse is the result of ListOperationsRequest. - - - Attributes: - operations: - A list of operations in the project in the specified zone. - missing_zones: - If any zones are listed here, the list of operations returned - may be missing the operations from those zones. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.ListOperationsResponse) - ), -) -_sym_db.RegisterMessage(ListOperationsResponse) - -GetServerConfigRequest = _reflection.GeneratedProtocolMessageType( - "GetServerConfigRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETSERVERCONFIGREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Gets the current Kubernetes Engine service configuration. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ to return operations for. - This field has been deprecated and replaced by the name field. - name: - The name (project and location) of the server config to get - Specified in the format 'projects/*/locations/*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.GetServerConfigRequest) - ), -) -_sym_db.RegisterMessage(GetServerConfigRequest) - -ServerConfig = _reflection.GeneratedProtocolMessageType( - "ServerConfig", - (_message.Message,), - dict( - DESCRIPTOR=_SERVERCONFIG, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Kubernetes Engine service configuration. - - - Attributes: - default_cluster_version: - Version of Kubernetes the service deploys by default. - valid_node_versions: - List of valid node upgrade target versions. - default_image_type: - Default image type. - valid_image_types: - List of valid image types. - valid_master_versions: - List of valid master versions. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.ServerConfig) - ), -) -_sym_db.RegisterMessage(ServerConfig) - -CreateNodePoolRequest = _reflection.GeneratedProtocolMessageType( - "CreateNodePoolRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATENODEPOOLREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""CreateNodePoolRequest creates a node pool for a cluster. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number `__. This field has been deprecated and - replaced by the parent field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - parent field. - cluster_id: - Deprecated. The name of the cluster. This field has been - deprecated and replaced by the parent field. - node_pool: - The node pool to create. - parent: - The parent (project, location, cluster id) where the node pool - will be created. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.CreateNodePoolRequest) - ), -) -_sym_db.RegisterMessage(CreateNodePoolRequest) - -DeleteNodePoolRequest = _reflection.GeneratedProtocolMessageType( - "DeleteNodePoolRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETENODEPOOLREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""DeleteNodePoolRequest deletes a node pool for a cluster. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number `__. This field has been deprecated and - replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster. This field has been - deprecated and replaced by the name field. - node_pool_id: - Deprecated. The name of the node pool to delete. This field - has been deprecated and replaced by the name field. - name: - The name (project, location, cluster, node pool id) of the - node pool to delete. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.DeleteNodePoolRequest) - ), -) -_sym_db.RegisterMessage(DeleteNodePoolRequest) - -ListNodePoolsRequest = _reflection.GeneratedProtocolMessageType( - "ListNodePoolsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTNODEPOOLSREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""ListNodePoolsRequest lists the node pool(s) for a cluster. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number `__. This field has been deprecated and - replaced by the parent field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - parent field. - cluster_id: - Deprecated. The name of the cluster. This field has been - deprecated and replaced by the parent field. - parent: - The parent (project, location, cluster id) where the node - pools will be listed. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.ListNodePoolsRequest) - ), -) -_sym_db.RegisterMessage(ListNodePoolsRequest) - -GetNodePoolRequest = _reflection.GeneratedProtocolMessageType( - "GetNodePoolRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETNODEPOOLREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""GetNodePoolRequest retrieves a node pool for a cluster. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number `__. This field has been deprecated and - replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster. This field has been - deprecated and replaced by the name field. - node_pool_id: - Deprecated. The name of the node pool. This field has been - deprecated and replaced by the name field. - name: - The name (project, location, cluster, node pool id) of the - node pool to get. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.GetNodePoolRequest) - ), -) -_sym_db.RegisterMessage(GetNodePoolRequest) - -NodePool = _reflection.GeneratedProtocolMessageType( - "NodePool", - (_message.Message,), - dict( - DESCRIPTOR=_NODEPOOL, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""NodePool contains the name and configuration for a cluster's node pool. - Node pools are a set of nodes (i.e. VM's), with a common configuration - and specification, under the control of the cluster master. They may - have a set of Kubernetes labels applied to them, which may be used to - reference them during pod scheduling. They may also be resized up or - down, to accommodate the workload. - - - Attributes: - name: - The name of the node pool. - config: - The node configuration of the pool. - initial_node_count: - The initial node count for the pool. You must ensure that your - Compute Engine resource quota is sufficient for this number of - instances. You must also have available firewall and routes - quota. - self_link: - [Output only] Server-defined URL for the resource. - version: - The version of the Kubernetes of this node. - instance_group_urls: - [Output only] The resource URLs of the `managed instance - groups `__ associated with this node pool. - status: - [Output only] The status of the nodes in this pool instance. - status_message: - [Output only] Additional information about the current status - of this node pool instance, if available. - autoscaling: - Autoscaler configuration for this NodePool. Autoscaler is - enabled only if a valid configuration is present. - management: - NodeManagement configuration for this NodePool. - max_pods_constraint: - The constraint on the maximum number of pods that can be run - simultaneously on a node in the node pool. - conditions: - Which conditions caused the current node pool state. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.NodePool) - ), -) -_sym_db.RegisterMessage(NodePool) - -NodeManagement = _reflection.GeneratedProtocolMessageType( - "NodeManagement", - (_message.Message,), - dict( - DESCRIPTOR=_NODEMANAGEMENT, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""NodeManagement defines the set of node management services turned on for - the node pool. - - - Attributes: - auto_upgrade: - Whether the nodes will be automatically upgraded. - auto_repair: - Whether the nodes will be automatically repaired. - upgrade_options: - Specifies the Auto Upgrade knobs for the node pool. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.NodeManagement) - ), -) -_sym_db.RegisterMessage(NodeManagement) - -AutoUpgradeOptions = _reflection.GeneratedProtocolMessageType( - "AutoUpgradeOptions", - (_message.Message,), - dict( - DESCRIPTOR=_AUTOUPGRADEOPTIONS, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""AutoUpgradeOptions defines the set of options for the user to control - how the Auto Upgrades will proceed. - - - Attributes: - auto_upgrade_start_time: - [Output only] This field is set when upgrades are about to - commence with the approximate start time for the upgrades, in - `RFC3339 `__ text - format. - description: - [Output only] This field is set when upgrades are about to - commence with the description of the upgrade. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.AutoUpgradeOptions) - ), -) -_sym_db.RegisterMessage(AutoUpgradeOptions) - -MaintenancePolicy = _reflection.GeneratedProtocolMessageType( - "MaintenancePolicy", - (_message.Message,), - dict( - DESCRIPTOR=_MAINTENANCEPOLICY, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""MaintenancePolicy defines the maintenance policy to be used for the - cluster. - - - Attributes: - window: - Specifies the maintenance window in which maintenance may be - performed. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.MaintenancePolicy) - ), -) -_sym_db.RegisterMessage(MaintenancePolicy) - -MaintenanceWindow = _reflection.GeneratedProtocolMessageType( - "MaintenanceWindow", - (_message.Message,), - dict( - DESCRIPTOR=_MAINTENANCEWINDOW, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""MaintenanceWindow defines the maintenance window to be used for the - cluster. - - - Attributes: - policy: - Unimplemented, reserved for future use. - HourlyMaintenanceWindow hourly\_maintenance\_window = 1; - daily_maintenance_window: - DailyMaintenanceWindow specifies a daily maintenance operation - window. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.MaintenanceWindow) - ), -) -_sym_db.RegisterMessage(MaintenanceWindow) - -DailyMaintenanceWindow = _reflection.GeneratedProtocolMessageType( - "DailyMaintenanceWindow", - (_message.Message,), - dict( - DESCRIPTOR=_DAILYMAINTENANCEWINDOW, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Time window specified for daily maintenance operations. - - - Attributes: - start_time: - Time within the maintenance window to start the maintenance - operations. It must be in format "HH:MM”, where HH : [00-23] - and MM : [00-59] GMT. - duration: - [Output only] Duration of the time window, automatically - chosen to be smallest possible in the given scenario. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.DailyMaintenanceWindow) - ), -) -_sym_db.RegisterMessage(DailyMaintenanceWindow) - -SetNodePoolManagementRequest = _reflection.GeneratedProtocolMessageType( - "SetNodePoolManagementRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETNODEPOOLMANAGEMENTREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""SetNodePoolManagementRequest sets the node management properties of a - node pool. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster to update. This field has - been deprecated and replaced by the name field. - node_pool_id: - Deprecated. The name of the node pool to update. This field - has been deprecated and replaced by the name field. - management: - NodeManagement configuration for the node pool. - name: - The name (project, location, cluster, node pool id) of the - node pool to set management properties. Specified in the - format 'projects/*/locations/*/clusters/*/nodePools/*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.SetNodePoolManagementRequest) - ), -) -_sym_db.RegisterMessage(SetNodePoolManagementRequest) - -SetNodePoolSizeRequest = _reflection.GeneratedProtocolMessageType( - "SetNodePoolSizeRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETNODEPOOLSIZEREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""SetNodePoolSizeRequest sets the size a node pool. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster to update. This field has - been deprecated and replaced by the name field. - node_pool_id: - Deprecated. The name of the node pool to update. This field - has been deprecated and replaced by the name field. - node_count: - The desired node count for the pool. - name: - The name (project, location, cluster, node pool id) of the - node pool to set size. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.SetNodePoolSizeRequest) - ), -) -_sym_db.RegisterMessage(SetNodePoolSizeRequest) - -RollbackNodePoolUpgradeRequest = _reflection.GeneratedProtocolMessageType( - "RollbackNodePoolUpgradeRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ROLLBACKNODEPOOLUPGRADEREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or - Failed NodePool upgrade. This will be an no-op if the last upgrade - successfully completed. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster to rollback. This field - has been deprecated and replaced by the name field. - node_pool_id: - Deprecated. The name of the node pool to rollback. This field - has been deprecated and replaced by the name field. - name: - The name (project, location, cluster, node pool id) of the - node poll to rollback upgrade. Specified in the format - 'projects/*/locations/*/clusters/*/nodePools/*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.RollbackNodePoolUpgradeRequest) - ), -) -_sym_db.RegisterMessage(RollbackNodePoolUpgradeRequest) - -ListNodePoolsResponse = _reflection.GeneratedProtocolMessageType( - "ListNodePoolsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTNODEPOOLSRESPONSE, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""ListNodePoolsResponse is the result of ListNodePoolsRequest. - - - Attributes: - node_pools: - A list of node pools for a cluster. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.ListNodePoolsResponse) - ), -) -_sym_db.RegisterMessage(ListNodePoolsResponse) - -ClusterAutoscaling = _reflection.GeneratedProtocolMessageType( - "ClusterAutoscaling", - (_message.Message,), - dict( - DESCRIPTOR=_CLUSTERAUTOSCALING, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""ClusterAutoscaling contains global, per-cluster information required by - Cluster Autoscaler to automatically adjust the size of the cluster and - create/delete node pools based on the current needs. - - - Attributes: - enable_node_autoprovisioning: - Enables automatic node pool creation and deletion. - resource_limits: - Contains global constraints regarding minimum and maximum - amount of resources in the cluster. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.ClusterAutoscaling) - ), -) -_sym_db.RegisterMessage(ClusterAutoscaling) - -ResourceLimit = _reflection.GeneratedProtocolMessageType( - "ResourceLimit", - (_message.Message,), - dict( - DESCRIPTOR=_RESOURCELIMIT, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Contains information about amount of some resource in the cluster. For - memory, value should be in GB. - - - Attributes: - resource_type: - Resource name "cpu", "memory" or gpu-specific string. - minimum: - Minimum amount of the resource in the cluster. - maximum: - Maximum amount of the resource in the cluster. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.ResourceLimit) - ), -) -_sym_db.RegisterMessage(ResourceLimit) - -NodePoolAutoscaling = _reflection.GeneratedProtocolMessageType( - "NodePoolAutoscaling", - (_message.Message,), - dict( - DESCRIPTOR=_NODEPOOLAUTOSCALING, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""NodePoolAutoscaling contains information required by cluster autoscaler - to adjust the size of the node pool to the current cluster usage. - - - Attributes: - enabled: - Is autoscaling enabled for this node pool. - min_node_count: - Minimum number of nodes in the NodePool. Must be >= 1 and <= - max\_node\_count. - max_node_count: - Maximum number of nodes in the NodePool. Must be >= - min\_node\_count. There has to enough quota to scale up the - cluster. - autoprovisioned: - Can this node pool be deleted automatically. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.NodePoolAutoscaling) - ), -) -_sym_db.RegisterMessage(NodePoolAutoscaling) - -SetLabelsRequest = _reflection.GeneratedProtocolMessageType( - "SetLabelsRequest", - (_message.Message,), - dict( - ResourceLabelsEntry=_reflection.GeneratedProtocolMessageType( - "ResourceLabelsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_SETLABELSREQUEST_RESOURCELABELSENTRY, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2" - # @@protoc_insertion_point(class_scope:google.container.v1beta1.SetLabelsRequest.ResourceLabelsEntry) - ), - ), - DESCRIPTOR=_SETLABELSREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""SetLabelsRequest sets the Google Cloud Platform labels on a Google - Container Engine cluster, which will in turn set them for Google Compute - Engine resources used by that cluster - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number `__. This field has been deprecated and - replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster. This field has been - deprecated and replaced by the name field. - resource_labels: - The labels to set for that cluster. - label_fingerprint: - The fingerprint of the previous set of labels for this - resource, used to detect conflicts. The fingerprint is - initially generated by Kubernetes Engine and changes after - every request to modify or update labels. You must always - provide an up-to-date fingerprint hash when updating or - changing labels. Make a get() request to the resource to get - the latest fingerprint. - name: - The name (project, location, cluster id) of the cluster to set - labels. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.SetLabelsRequest) - ), -) -_sym_db.RegisterMessage(SetLabelsRequest) -_sym_db.RegisterMessage(SetLabelsRequest.ResourceLabelsEntry) - -SetLegacyAbacRequest = _reflection.GeneratedProtocolMessageType( - "SetLegacyAbacRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETLEGACYABACREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""SetLegacyAbacRequest enables or disables the ABAC authorization - mechanism for a cluster. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number - `__. This - field has been deprecated and replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster to update. This field has - been deprecated and replaced by the name field. - enabled: - Whether ABAC authorization will be enabled in the cluster. - name: - The name (project, location, cluster id) of the cluster to set - legacy abac. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.SetLegacyAbacRequest) - ), -) -_sym_db.RegisterMessage(SetLegacyAbacRequest) - -StartIPRotationRequest = _reflection.GeneratedProtocolMessageType( - "StartIPRotationRequest", - (_message.Message,), - dict( - DESCRIPTOR=_STARTIPROTATIONREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""StartIPRotationRequest creates a new IP for the cluster and then - performs a node upgrade on each node pool to point to the new IP. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number `__. This field has been deprecated and - replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster. This field has been - deprecated and replaced by the name field. - name: - The name (project, location, cluster id) of the cluster to - start IP rotation. Specified in the format - 'projects/*/locations/*/clusters/\*'. - rotate_credentials: - Whether to rotate credentials during IP rotation. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.StartIPRotationRequest) - ), -) -_sym_db.RegisterMessage(StartIPRotationRequest) - -CompleteIPRotationRequest = _reflection.GeneratedProtocolMessageType( - "CompleteIPRotationRequest", - (_message.Message,), - dict( - DESCRIPTOR=_COMPLETEIPROTATIONREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""CompleteIPRotationRequest moves the cluster master back into single-IP - mode. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number `__. This field has been deprecated and - replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster. This field has been - deprecated and replaced by the name field. - name: - The name (project, location, cluster id) of the cluster to - complete IP rotation. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.CompleteIPRotationRequest) - ), -) -_sym_db.RegisterMessage(CompleteIPRotationRequest) - -AcceleratorConfig = _reflection.GeneratedProtocolMessageType( - "AcceleratorConfig", - (_message.Message,), - dict( - DESCRIPTOR=_ACCELERATORCONFIG, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""AcceleratorConfig represents a Hardware Accelerator request. - - - Attributes: - accelerator_count: - The number of the accelerator cards exposed to an instance. - accelerator_type: - The accelerator type resource name. List of supported - accelerators `here `__ - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.AcceleratorConfig) - ), -) -_sym_db.RegisterMessage(AcceleratorConfig) - -WorkloadMetadataConfig = _reflection.GeneratedProtocolMessageType( - "WorkloadMetadataConfig", - (_message.Message,), - dict( - DESCRIPTOR=_WORKLOADMETADATACONFIG, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""WorkloadMetadataConfig defines the metadata configuration to expose to - workloads on the node pool. - - - Attributes: - node_metadata: - NodeMetadata is the configuration for how to expose the node - metadata to the workload running on the node. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.WorkloadMetadataConfig) - ), -) -_sym_db.RegisterMessage(WorkloadMetadataConfig) - -SetNetworkPolicyRequest = _reflection.GeneratedProtocolMessageType( - "SetNetworkPolicyRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETNETWORKPOLICYREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""SetNetworkPolicyRequest enables/disables network policy for a cluster. - - - Attributes: - project_id: - Deprecated. The Google Developers Console `project ID or - project number `__. This field has been deprecated and - replaced by the name field. - zone: - Deprecated. The name of the Google Compute Engine `zone - `__ in which the cluster - resides. This field has been deprecated and replaced by the - name field. - cluster_id: - Deprecated. The name of the cluster. This field has been - deprecated and replaced by the name field. - network_policy: - Configuration options for the NetworkPolicy feature. - name: - The name (project, location, cluster id) of the cluster to set - networking policy. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.SetNetworkPolicyRequest) - ), -) -_sym_db.RegisterMessage(SetNetworkPolicyRequest) - -SetMaintenancePolicyRequest = _reflection.GeneratedProtocolMessageType( - "SetMaintenancePolicyRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SETMAINTENANCEPOLICYREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""SetMaintenancePolicyRequest sets the maintenance policy for a cluster. - - - Attributes: - project_id: - The Google Developers Console `project ID or project number - `__. - zone: - The name of the Google Compute Engine `zone - `__ in which the cluster - resides. - cluster_id: - The name of the cluster to update. - maintenance_policy: - The maintenance policy to be set for the cluster. An empty - field clears the existing maintenance policy. - name: - The name (project, location, cluster id) of the cluster to set - maintenance policy. Specified in the format - 'projects/*/locations/*/clusters/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.SetMaintenancePolicyRequest) - ), -) -_sym_db.RegisterMessage(SetMaintenancePolicyRequest) - -ListLocationsRequest = _reflection.GeneratedProtocolMessageType( - "ListLocationsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTLOCATIONSREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""ListLocationsRequest is used to request the locations that offer GKE. - - - Attributes: - parent: - Contains the name of the resource requested. Specified in the - format 'projects/\*'. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.ListLocationsRequest) - ), -) -_sym_db.RegisterMessage(ListLocationsRequest) - -ListLocationsResponse = _reflection.GeneratedProtocolMessageType( - "ListLocationsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTLOCATIONSRESPONSE, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""ListLocationsResponse returns the list of all GKE locations and their - recommendation state. - - - Attributes: - locations: - A full list of GKE locations. - next_page_token: - Only return ListLocationsResponse that occur after the - page\_token. This value should be populated from the - ListLocationsResponse.next\_page\_token if that response token - was set (which happens when listing more Locations than fit in - a single ListLocationsResponse). - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.ListLocationsResponse) - ), -) -_sym_db.RegisterMessage(ListLocationsResponse) - -Location = _reflection.GeneratedProtocolMessageType( - "Location", - (_message.Message,), - dict( - DESCRIPTOR=_LOCATION, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Location returns the location name, and if the location is recommended - for GKE cluster scheduling. - - - Attributes: - type: - Contains the type of location this Location is for. Regional - or Zonal. - name: - Contains the name of the resource requested. Specified in the - format 'projects/*/locations/*'. - recommended: - Whether the location is recomended for GKE cluster scheduling. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.Location) - ), -) -_sym_db.RegisterMessage(Location) - -StatusCondition = _reflection.GeneratedProtocolMessageType( - "StatusCondition", - (_message.Message,), - dict( - DESCRIPTOR=_STATUSCONDITION, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""StatusCondition describes why a cluster or a node pool has a certain - status (e.g., ERROR or DEGRADED). - - - Attributes: - code: - Machine-friendly representation of the condition - message: - Human-friendly representation of the condition - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.StatusCondition) - ), -) -_sym_db.RegisterMessage(StatusCondition) - -NetworkConfig = _reflection.GeneratedProtocolMessageType( - "NetworkConfig", - (_message.Message,), - dict( - DESCRIPTOR=_NETWORKCONFIG, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""NetworkConfig reports the relative names of network & subnetwork. - - - Attributes: - network: - Output only. The relative name of the Google Compute Engine [n - etwork][google.container.v1beta1.NetworkConfig.network](/compu - te/docs/networks-and-firewalls#networks) to which the cluster - is connected. Example: projects/my-project/global/networks/my- - network - subnetwork: - Output only. The relative name of the Google Compute Engine - `subnetwork `__ to which the cluster is - connected. Example: projects/my-project/regions/us- - central1/subnetworks/my-subnet - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.NetworkConfig) - ), -) -_sym_db.RegisterMessage(NetworkConfig) - -ListUsableSubnetworksRequest = _reflection.GeneratedProtocolMessageType( - "ListUsableSubnetworksRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTUSABLESUBNETWORKSREQUEST, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""ListUsableSubnetworksRequest requests the list of usable subnetworks. - available to a user for creating clusters. - - - Attributes: - parent: - The parent project where subnetworks are usable. Specified in - the format 'projects/\*'. - filter: - Filtering currently only supports equality on the - networkProjectId and must be in the form: - "networkProjectId=[PROJECTID]", where ``networkProjectId`` is - the project which owns the listed subnetworks. This defaults - to the parent project ID. - page_size: - The max number of results per page that should be returned. If - the number of available results is larger than ``page_size``, - a ``next_page_token`` is returned which can be used to get the - next page of results in subsequent requests. Acceptable values - are 0 to 500, inclusive. (Default: 500) - page_token: - Specifies a page token to use. Set this to the nextPageToken - returned by previous list requests to get the next page of - results. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.ListUsableSubnetworksRequest) - ), -) -_sym_db.RegisterMessage(ListUsableSubnetworksRequest) - -ListUsableSubnetworksResponse = _reflection.GeneratedProtocolMessageType( - "ListUsableSubnetworksResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTUSABLESUBNETWORKSRESPONSE, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""ListUsableSubnetworksResponse is the response of - ListUsableSubnetworksRequest. - - - Attributes: - subnetworks: - A list of usable subnetworks in the specified network project. - next_page_token: - This token allows you to get the next page of results for list - requests. If the number of results is larger than - ``page_size``, use the ``next_page_token`` as a value for the - query parameter ``page_token`` in the next request. The value - will become empty when there are no more pages. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.ListUsableSubnetworksResponse) - ), -) -_sym_db.RegisterMessage(ListUsableSubnetworksResponse) - -UsableSubnetworkSecondaryRange = _reflection.GeneratedProtocolMessageType( - "UsableSubnetworkSecondaryRange", - (_message.Message,), - dict( - DESCRIPTOR=_USABLESUBNETWORKSECONDARYRANGE, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Secondary IP range of a usable subnetwork. - - - Attributes: - range_name: - The name associated with this subnetwork secondary range, used - when adding an alias IP range to a VM instance. - ip_cidr_range: - The range of IP addresses belonging to this subnetwork - secondary range. - status: - This field is to determine the status of the secondary range - programmably. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.UsableSubnetworkSecondaryRange) - ), -) -_sym_db.RegisterMessage(UsableSubnetworkSecondaryRange) - -UsableSubnetwork = _reflection.GeneratedProtocolMessageType( - "UsableSubnetwork", - (_message.Message,), - dict( - DESCRIPTOR=_USABLESUBNETWORK, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Network Name. Example: projects/my-project/global/networks/my-network - - - Attributes: - subnetwork: - Subnetwork Name. Example: projects/my-project/regions/us- - central1/subnetworks/my-subnet - ip_cidr_range: - The range of internal addresses that are owned by this - subnetwork. - secondary_ip_ranges: - Secondary IP ranges. - status_message: - A human readable status message representing the reasons for - cases where the caller cannot use the secondary ranges under - the subnet. For example if the secondary\_ip\_ranges is empty - due to a permission issue, an insufficient permission message - will be given by status\_message. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.UsableSubnetwork) - ), -) -_sym_db.RegisterMessage(UsableSubnetwork) - -VerticalPodAutoscaling = _reflection.GeneratedProtocolMessageType( - "VerticalPodAutoscaling", - (_message.Message,), - dict( - DESCRIPTOR=_VERTICALPODAUTOSCALING, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""VerticalPodAutoscaling contains global, per-cluster information required - by Vertical Pod Autoscaler to automatically adjust the resources of pods - controlled by it. - - - Attributes: - enabled: - Enables vertical pod autoscaling. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.VerticalPodAutoscaling) - ), -) -_sym_db.RegisterMessage(VerticalPodAutoscaling) - -MaxPodsConstraint = _reflection.GeneratedProtocolMessageType( - "MaxPodsConstraint", - (_message.Message,), - dict( - DESCRIPTOR=_MAXPODSCONSTRAINT, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Constraints applied to pods. - - - Attributes: - max_pods_per_node: - Constraint enforced on the max num of pods per node. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.MaxPodsConstraint) - ), -) -_sym_db.RegisterMessage(MaxPodsConstraint) - -ResourceUsageExportConfig = _reflection.GeneratedProtocolMessageType( - "ResourceUsageExportConfig", - (_message.Message,), - dict( - BigQueryDestination=_reflection.GeneratedProtocolMessageType( - "BigQueryDestination", - (_message.Message,), - dict( - DESCRIPTOR=_RESOURCEUSAGEEXPORTCONFIG_BIGQUERYDESTINATION, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Parameters for using BigQuery as the destination of resource usage - export. - - - Attributes: - dataset_id: - The ID of a BigQuery Dataset. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.ResourceUsageExportConfig.BigQueryDestination) - ), - ), - DESCRIPTOR=_RESOURCEUSAGEEXPORTCONFIG, - __module__="google.cloud.container_v1beta1.proto.cluster_service_pb2", - __doc__="""Configuration for exporting cluster resource usages. - - - Attributes: - bigquery_destination: - Configuration to use BigQuery as usage export destination. - enable_network_egress_metering: - Whether to enable network egress metering for this cluster. If - enabled, a daemonset will be created in the cluster to meter - network egress traffic. - """, - # @@protoc_insertion_point(class_scope:google.container.v1beta1.ResourceUsageExportConfig) - ), -) -_sym_db.RegisterMessage(ResourceUsageExportConfig) -_sym_db.RegisterMessage(ResourceUsageExportConfig.BigQueryDestination) - - -DESCRIPTOR._options = None -_NODECONFIG_METADATAENTRY._options = None -_NODECONFIG_LABELSENTRY._options = None -_IPALLOCATIONPOLICY.fields_by_name["cluster_ipv4_cidr"]._options = None -_IPALLOCATIONPOLICY.fields_by_name["node_ipv4_cidr"]._options = None -_IPALLOCATIONPOLICY.fields_by_name["services_ipv4_cidr"]._options = None -_CLUSTER_RESOURCELABELSENTRY._options = None -_CLUSTER.fields_by_name["private_cluster"]._options = None -_CLUSTER.fields_by_name["master_ipv4_cidr_block"]._options = None -_CLUSTER.fields_by_name["zone"]._options = None -_CLUSTER.fields_by_name["current_node_version"]._options = None -_CLUSTER.fields_by_name["instance_group_urls"]._options = None -_CLUSTER.fields_by_name["current_node_count"]._options = None -_OPERATION.fields_by_name["zone"]._options = None -_CREATECLUSTERREQUEST.fields_by_name["project_id"]._options = None -_CREATECLUSTERREQUEST.fields_by_name["zone"]._options = None -_GETCLUSTERREQUEST.fields_by_name["project_id"]._options = None -_GETCLUSTERREQUEST.fields_by_name["zone"]._options = None -_GETCLUSTERREQUEST.fields_by_name["cluster_id"]._options = None -_UPDATECLUSTERREQUEST.fields_by_name["project_id"]._options = None -_UPDATECLUSTERREQUEST.fields_by_name["zone"]._options = None -_UPDATECLUSTERREQUEST.fields_by_name["cluster_id"]._options = None -_UPDATENODEPOOLREQUEST.fields_by_name["project_id"]._options = None -_UPDATENODEPOOLREQUEST.fields_by_name["zone"]._options = None -_UPDATENODEPOOLREQUEST.fields_by_name["cluster_id"]._options = None -_UPDATENODEPOOLREQUEST.fields_by_name["node_pool_id"]._options = None -_SETNODEPOOLAUTOSCALINGREQUEST.fields_by_name["project_id"]._options = None -_SETNODEPOOLAUTOSCALINGREQUEST.fields_by_name["zone"]._options = None -_SETNODEPOOLAUTOSCALINGREQUEST.fields_by_name["cluster_id"]._options = None -_SETNODEPOOLAUTOSCALINGREQUEST.fields_by_name["node_pool_id"]._options = None -_SETLOGGINGSERVICEREQUEST.fields_by_name["project_id"]._options = None -_SETLOGGINGSERVICEREQUEST.fields_by_name["cluster_id"]._options = None -_SETMONITORINGSERVICEREQUEST.fields_by_name["project_id"]._options = None -_SETMONITORINGSERVICEREQUEST.fields_by_name["zone"]._options = None -_SETMONITORINGSERVICEREQUEST.fields_by_name["cluster_id"]._options = None -_SETADDONSCONFIGREQUEST.fields_by_name["project_id"]._options = None -_SETADDONSCONFIGREQUEST.fields_by_name["zone"]._options = None -_SETADDONSCONFIGREQUEST.fields_by_name["cluster_id"]._options = None -_SETLOCATIONSREQUEST.fields_by_name["project_id"]._options = None -_SETLOCATIONSREQUEST.fields_by_name["zone"]._options = None -_SETLOCATIONSREQUEST.fields_by_name["cluster_id"]._options = None -_UPDATEMASTERREQUEST.fields_by_name["project_id"]._options = None -_UPDATEMASTERREQUEST.fields_by_name["zone"]._options = None -_UPDATEMASTERREQUEST.fields_by_name["cluster_id"]._options = None -_SETMASTERAUTHREQUEST.fields_by_name["project_id"]._options = None -_SETMASTERAUTHREQUEST.fields_by_name["zone"]._options = None -_SETMASTERAUTHREQUEST.fields_by_name["cluster_id"]._options = None -_DELETECLUSTERREQUEST.fields_by_name["project_id"]._options = None -_DELETECLUSTERREQUEST.fields_by_name["zone"]._options = None -_DELETECLUSTERREQUEST.fields_by_name["cluster_id"]._options = None -_LISTCLUSTERSREQUEST.fields_by_name["project_id"]._options = None -_LISTCLUSTERSREQUEST.fields_by_name["zone"]._options = None -_GETOPERATIONREQUEST.fields_by_name["project_id"]._options = None -_GETOPERATIONREQUEST.fields_by_name["zone"]._options = None -_GETOPERATIONREQUEST.fields_by_name["operation_id"]._options = None -_LISTOPERATIONSREQUEST.fields_by_name["project_id"]._options = None -_LISTOPERATIONSREQUEST.fields_by_name["zone"]._options = None -_CANCELOPERATIONREQUEST.fields_by_name["project_id"]._options = None -_CANCELOPERATIONREQUEST.fields_by_name["zone"]._options = None -_CANCELOPERATIONREQUEST.fields_by_name["operation_id"]._options = None -_GETSERVERCONFIGREQUEST.fields_by_name["project_id"]._options = None -_GETSERVERCONFIGREQUEST.fields_by_name["zone"]._options = None -_CREATENODEPOOLREQUEST.fields_by_name["project_id"]._options = None -_CREATENODEPOOLREQUEST.fields_by_name["zone"]._options = None -_CREATENODEPOOLREQUEST.fields_by_name["cluster_id"]._options = None -_DELETENODEPOOLREQUEST.fields_by_name["project_id"]._options = None -_DELETENODEPOOLREQUEST.fields_by_name["zone"]._options = None -_DELETENODEPOOLREQUEST.fields_by_name["cluster_id"]._options = None -_DELETENODEPOOLREQUEST.fields_by_name["node_pool_id"]._options = None -_LISTNODEPOOLSREQUEST.fields_by_name["project_id"]._options = None -_LISTNODEPOOLSREQUEST.fields_by_name["zone"]._options = None -_LISTNODEPOOLSREQUEST.fields_by_name["cluster_id"]._options = None -_GETNODEPOOLREQUEST.fields_by_name["project_id"]._options = None -_GETNODEPOOLREQUEST.fields_by_name["zone"]._options = None -_GETNODEPOOLREQUEST.fields_by_name["cluster_id"]._options = None -_GETNODEPOOLREQUEST.fields_by_name["node_pool_id"]._options = None -_SETNODEPOOLMANAGEMENTREQUEST.fields_by_name["project_id"]._options = None -_SETNODEPOOLMANAGEMENTREQUEST.fields_by_name["zone"]._options = None -_SETNODEPOOLMANAGEMENTREQUEST.fields_by_name["cluster_id"]._options = None -_SETNODEPOOLMANAGEMENTREQUEST.fields_by_name["node_pool_id"]._options = None -_SETNODEPOOLSIZEREQUEST.fields_by_name["project_id"]._options = None -_SETNODEPOOLSIZEREQUEST.fields_by_name["zone"]._options = None -_SETNODEPOOLSIZEREQUEST.fields_by_name["cluster_id"]._options = None -_SETNODEPOOLSIZEREQUEST.fields_by_name["node_pool_id"]._options = None -_ROLLBACKNODEPOOLUPGRADEREQUEST.fields_by_name["project_id"]._options = None -_ROLLBACKNODEPOOLUPGRADEREQUEST.fields_by_name["zone"]._options = None -_ROLLBACKNODEPOOLUPGRADEREQUEST.fields_by_name["cluster_id"]._options = None -_ROLLBACKNODEPOOLUPGRADEREQUEST.fields_by_name["node_pool_id"]._options = None -_SETLABELSREQUEST_RESOURCELABELSENTRY._options = None -_SETLABELSREQUEST.fields_by_name["project_id"]._options = None -_SETLABELSREQUEST.fields_by_name["zone"]._options = None -_SETLABELSREQUEST.fields_by_name["cluster_id"]._options = None -_SETLEGACYABACREQUEST.fields_by_name["project_id"]._options = None -_SETLEGACYABACREQUEST.fields_by_name["zone"]._options = None -_SETLEGACYABACREQUEST.fields_by_name["cluster_id"]._options = None -_STARTIPROTATIONREQUEST.fields_by_name["project_id"]._options = None -_STARTIPROTATIONREQUEST.fields_by_name["zone"]._options = None -_STARTIPROTATIONREQUEST.fields_by_name["cluster_id"]._options = None -_COMPLETEIPROTATIONREQUEST.fields_by_name["project_id"]._options = None -_COMPLETEIPROTATIONREQUEST.fields_by_name["zone"]._options = None -_COMPLETEIPROTATIONREQUEST.fields_by_name["cluster_id"]._options = None -_SETNETWORKPOLICYREQUEST.fields_by_name["project_id"]._options = None -_SETNETWORKPOLICYREQUEST.fields_by_name["zone"]._options = None -_SETNETWORKPOLICYREQUEST.fields_by_name["cluster_id"]._options = None - -_CLUSTERMANAGER = _descriptor.ServiceDescriptor( - name="ClusterManager", - full_name="google.container.v1beta1.ClusterManager", - file=DESCRIPTOR, - index=0, - serialized_options=None, - serialized_start=15924, - serialized_end=24261, - methods=[ - _descriptor.MethodDescriptor( - name="ListClusters", - full_name="google.container.v1beta1.ClusterManager.ListClusters", - index=0, - containing_service=None, - input_type=_LISTCLUSTERSREQUEST, - output_type=_LISTCLUSTERSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002k\0221/v1beta1/{parent=projects/*/locations/*}/clustersZ6\0224/v1beta1/projects/{project_id}/zones/{zone}/clusters" - ), - ), - _descriptor.MethodDescriptor( - name="GetCluster", - full_name="google.container.v1beta1.ClusterManager.GetCluster", - index=1, - containing_service=None, - input_type=_GETCLUSTERREQUEST, - output_type=_CLUSTER, - serialized_options=_b( - "\202\323\344\223\002x\0221/v1beta1/{name=projects/*/locations/*/clusters/*}ZC\022A/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - ), - ), - _descriptor.MethodDescriptor( - name="CreateCluster", - full_name="google.container.v1beta1.ClusterManager.CreateCluster", - index=2, - containing_service=None, - input_type=_CREATECLUSTERREQUEST, - output_type=_OPERATION, - serialized_options=_b( - '\202\323\344\223\002q"1/v1beta1/{parent=projects/*/locations/*}/clusters:\001*Z9"4/v1beta1/projects/{project_id}/zones/{zone}/clusters:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="UpdateCluster", - full_name="google.container.v1beta1.ClusterManager.UpdateCluster", - index=3, - containing_service=None, - input_type=_UPDATECLUSTERREQUEST, - output_type=_OPERATION, - serialized_options=_b( - "\202\323\344\223\002~\0321/v1beta1/{name=projects/*/locations/*/clusters/*}:\001*ZF\032A/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:\001*" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateNodePool", - full_name="google.container.v1beta1.ClusterManager.UpdateNodePool", - index=4, - containing_service=None, - input_type=_UPDATENODEPOOLREQUEST, - output_type=_OPERATION, - serialized_options=_b( - '\202\323\344\223\002\252\001\032=/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:\001*Zf"a/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/update:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="SetNodePoolAutoscaling", - full_name="google.container.v1beta1.ClusterManager.SetNodePoolAutoscaling", - index=5, - containing_service=None, - input_type=_SETNODEPOOLAUTOSCALINGREQUEST, - output_type=_OPERATION, - serialized_options=_b( - '\202\323\344\223\002\276\001"L/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setAutoscaling:\001*Zk"f/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/autoscaling:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="SetLoggingService", - full_name="google.container.v1beta1.ClusterManager.SetLoggingService", - index=6, - containing_service=None, - input_type=_SETLOGGINGSERVICEREQUEST, - output_type=_OPERATION, - serialized_options=_b( - '\202\323\344\223\002\221\001"/v1beta1/{name=projects/*/locations/*/clusters/*}:setLocations:\001*ZP"K/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/locations:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="UpdateMaster", - full_name="google.container.v1beta1.ClusterManager.UpdateMaster", - index=10, - containing_service=None, - input_type=_UPDATEMASTERREQUEST, - output_type=_OPERATION, - serialized_options=_b( - '\202\323\344\223\002\222\001">/v1beta1/{name=projects/*/locations/*/clusters/*}:updateMaster:\001*ZM"H/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/master:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="SetMasterAuth", - full_name="google.container.v1beta1.ClusterManager.SetMasterAuth", - index=11, - containing_service=None, - input_type=_SETMASTERAUTHREQUEST, - output_type=_OPERATION, - serialized_options=_b( - '\202\323\344\223\002\232\001"?/v1beta1/{name=projects/*/locations/*/clusters/*}:setMasterAuth:\001*ZT"O/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMasterAuth:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="DeleteCluster", - full_name="google.container.v1beta1.ClusterManager.DeleteCluster", - index=12, - containing_service=None, - input_type=_DELETECLUSTERREQUEST, - output_type=_OPERATION, - serialized_options=_b( - "\202\323\344\223\002x*1/v1beta1/{name=projects/*/locations/*/clusters/*}ZC*A/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}" - ), - ), - _descriptor.MethodDescriptor( - name="ListOperations", - full_name="google.container.v1beta1.ClusterManager.ListOperations", - index=13, - containing_service=None, - input_type=_LISTOPERATIONSREQUEST, - output_type=_LISTOPERATIONSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002o\0223/v1beta1/{parent=projects/*/locations/*}/operationsZ8\0226/v1beta1/projects/{project_id}/zones/{zone}/operations" - ), - ), - _descriptor.MethodDescriptor( - name="GetOperation", - full_name="google.container.v1beta1.ClusterManager.GetOperation", - index=14, - containing_service=None, - input_type=_GETOPERATIONREQUEST, - output_type=_OPERATION, - serialized_options=_b( - "\202\323\344\223\002~\0223/v1beta1/{name=projects/*/locations/*/operations/*}ZG\022E/v1beta1/projects/{project_id}/zones/{zone}/operations/{operation_id}" - ), - ), - _descriptor.MethodDescriptor( - name="CancelOperation", - full_name="google.container.v1beta1.ClusterManager.CancelOperation", - index=15, - containing_service=None, - input_type=_CANCELOPERATIONREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - '\202\323\344\223\002\222\001":/v1beta1/{name=projects/*/locations/*/operations/*}:cancel:\001*ZQ"L/v1beta1/projects/{project_id}/zones/{zone}/operations/{operation_id}:cancel:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="GetServerConfig", - full_name="google.container.v1beta1.ClusterManager.GetServerConfig", - index=16, - containing_service=None, - input_type=_GETSERVERCONFIGREQUEST, - output_type=_SERVERCONFIG, - serialized_options=_b( - "\202\323\344\223\002q\0223/v1beta1/{name=projects/*/locations/*}/serverConfigZ:\0228/v1beta1/projects/{project_id}/zones/{zone}/serverconfig" - ), - ), - _descriptor.MethodDescriptor( - name="ListNodePools", - full_name="google.container.v1beta1.ClusterManager.ListNodePools", - index=17, - containing_service=None, - input_type=_LISTNODEPOOLSREQUEST, - output_type=_LISTNODEPOOLSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002\216\001\022=/v1beta1/{parent=projects/*/locations/*/clusters/*}/nodePoolsZM\022K/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools" - ), - ), - _descriptor.MethodDescriptor( - name="GetNodePool", - full_name="google.container.v1beta1.ClusterManager.GetNodePool", - index=18, - containing_service=None, - input_type=_GETNODEPOOLREQUEST, - output_type=_NODEPOOL, - serialized_options=_b( - "\202\323\344\223\002\235\001\022=/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}Z\\\022Z/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" - ), - ), - _descriptor.MethodDescriptor( - name="CreateNodePool", - full_name="google.container.v1beta1.ClusterManager.CreateNodePool", - index=19, - containing_service=None, - input_type=_CREATENODEPOOLREQUEST, - output_type=_OPERATION, - serialized_options=_b( - '\202\323\344\223\002\224\001"=/v1beta1/{parent=projects/*/locations/*/clusters/*}/nodePools:\001*ZP"K/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="DeleteNodePool", - full_name="google.container.v1beta1.ClusterManager.DeleteNodePool", - index=20, - containing_service=None, - input_type=_DELETENODEPOOLREQUEST, - output_type=_OPERATION, - serialized_options=_b( - "\202\323\344\223\002\235\001*=/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}Z\\*Z/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}" - ), - ), - _descriptor.MethodDescriptor( - name="RollbackNodePoolUpgrade", - full_name="google.container.v1beta1.ClusterManager.RollbackNodePoolUpgrade", - index=21, - containing_service=None, - input_type=_ROLLBACKNODEPOOLUPGRADEREQUEST, - output_type=_OPERATION, - serialized_options=_b( - '\202\323\344\223\002\265\001"F/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:rollback:\001*Zh"c/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}:rollback:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="SetNodePoolManagement", - full_name="google.container.v1beta1.ClusterManager.SetNodePoolManagement", - index=22, - containing_service=None, - input_type=_SETNODEPOOLMANAGEMENTREQUEST, - output_type=_OPERATION, - serialized_options=_b( - '\202\323\344\223\002\277\001"K/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setManagement:\001*Zm"h/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setManagement:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="SetLabels", - full_name="google.container.v1beta1.ClusterManager.SetLabels", - index=23, - containing_service=None, - input_type=_SETLABELSREQUEST, - output_type=_OPERATION, - serialized_options=_b( - '\202\323\344\223\002\237\001"C/v1beta1/{name=projects/*/locations/*/clusters/*}:setResourceLabels:\001*ZU"P/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/resourceLabels:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="SetLegacyAbac", - full_name="google.container.v1beta1.ClusterManager.SetLegacyAbac", - index=24, - containing_service=None, - input_type=_SETLEGACYABACREQUEST, - output_type=_OPERATION, - serialized_options=_b( - '\202\323\344\223\002\227\001"?/v1beta1/{name=projects/*/locations/*/clusters/*}:setLegacyAbac:\001*ZQ"L/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/legacyAbac:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="StartIPRotation", - full_name="google.container.v1beta1.ClusterManager.StartIPRotation", - index=25, - containing_service=None, - input_type=_STARTIPROTATIONREQUEST, - output_type=_OPERATION, - serialized_options=_b( - '\202\323\344\223\002\236\001"A/v1beta1/{name=projects/*/locations/*/clusters/*}:startIpRotation:\001*ZV"Q/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:startIpRotation:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="CompleteIPRotation", - full_name="google.container.v1beta1.ClusterManager.CompleteIPRotation", - index=26, - containing_service=None, - input_type=_COMPLETEIPROTATIONREQUEST, - output_type=_OPERATION, - serialized_options=_b( - '\202\323\344\223\002\244\001"D/v1beta1/{name=projects/*/locations/*/clusters/*}:completeIpRotation:\001*ZY"T/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:completeIpRotation:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="SetNodePoolSize", - full_name="google.container.v1beta1.ClusterManager.SetNodePoolSize", - index=27, - containing_service=None, - input_type=_SETNODEPOOLSIZEREQUEST, - output_type=_OPERATION, - serialized_options=_b( - '\202\323\344\223\002\263\001"E/v1beta1/{name=projects/*/locations/*/clusters/*/nodePools/*}:setSize:\001*Zg"b/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}/nodePools/{node_pool_id}/setSize:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="SetNetworkPolicy", - full_name="google.container.v1beta1.ClusterManager.SetNetworkPolicy", - index=28, - containing_service=None, - input_type=_SETNETWORKPOLICYREQUEST, - output_type=_OPERATION, - serialized_options=_b( - '\202\323\344\223\002\240\001"B/v1beta1/{name=projects/*/locations/*/clusters/*}:setNetworkPolicy:\001*ZW"R/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setNetworkPolicy:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="SetMaintenancePolicy", - full_name="google.container.v1beta1.ClusterManager.SetMaintenancePolicy", - index=29, - containing_service=None, - input_type=_SETMAINTENANCEPOLICYREQUEST, - output_type=_OPERATION, - serialized_options=_b( - '\202\323\344\223\002\250\001"F/v1beta1/{name=projects/*/locations/*/clusters/*}:setMaintenancePolicy:\001*Z["V/v1beta1/projects/{project_id}/zones/{zone}/clusters/{cluster_id}:setMaintenancePolicy:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="ListUsableSubnetworks", - full_name="google.container.v1beta1.ClusterManager.ListUsableSubnetworks", - index=30, - containing_service=None, - input_type=_LISTUSABLESUBNETWORKSREQUEST, - output_type=_LISTUSABLESUBNETWORKSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002;\0229/v1beta1/{parent=projects/*}/aggregated/usableSubnetworks" - ), - ), - _descriptor.MethodDescriptor( - name="ListLocations", - full_name="google.container.v1beta1.ClusterManager.ListLocations", - index=31, - containing_service=None, - input_type=_LISTLOCATIONSREQUEST, - output_type=_LISTLOCATIONSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002(\022&/v1beta1/{parent=projects/*}/locations" - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_CLUSTERMANAGER) - -DESCRIPTOR.services_by_name["ClusterManager"] = _CLUSTERMANAGER - -# @@protoc_insertion_point(module_scope) diff --git a/container/google/cloud/container_v1beta1/proto/cluster_service_pb2_grpc.py b/container/google/cloud/container_v1beta1/proto/cluster_service_pb2_grpc.py deleted file mode 100644 index f722b4a81338..000000000000 --- a/container/google/cloud/container_v1beta1/proto/cluster_service_pb2_grpc.py +++ /dev/null @@ -1,602 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.container_v1beta1.proto import ( - cluster_service_pb2 as google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class ClusterManagerStub(object): - """Google Kubernetes Engine Cluster Manager v1beta1 - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ListClusters = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/ListClusters", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListClustersRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListClustersResponse.FromString, - ) - self.GetCluster = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/GetCluster", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.GetClusterRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Cluster.FromString, - ) - self.CreateCluster = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/CreateCluster", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.CreateClusterRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.UpdateCluster = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/UpdateCluster", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.UpdateClusterRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.UpdateNodePool = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/UpdateNodePool", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.UpdateNodePoolRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.SetNodePoolAutoscaling = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/SetNodePoolAutoscaling", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetNodePoolAutoscalingRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.SetLoggingService = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/SetLoggingService", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetLoggingServiceRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.SetMonitoringService = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/SetMonitoringService", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetMonitoringServiceRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.SetAddonsConfig = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/SetAddonsConfig", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetAddonsConfigRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.SetLocations = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/SetLocations", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetLocationsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.UpdateMaster = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/UpdateMaster", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.UpdateMasterRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.SetMasterAuth = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/SetMasterAuth", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetMasterAuthRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.DeleteCluster = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/DeleteCluster", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.DeleteClusterRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.ListOperations = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/ListOperations", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListOperationsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListOperationsResponse.FromString, - ) - self.GetOperation = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/GetOperation", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.GetOperationRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.CancelOperation = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/CancelOperation", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.CancelOperationRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.GetServerConfig = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/GetServerConfig", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.GetServerConfigRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ServerConfig.FromString, - ) - self.ListNodePools = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/ListNodePools", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListNodePoolsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListNodePoolsResponse.FromString, - ) - self.GetNodePool = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/GetNodePool", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.GetNodePoolRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.NodePool.FromString, - ) - self.CreateNodePool = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/CreateNodePool", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.CreateNodePoolRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.DeleteNodePool = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/DeleteNodePool", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.DeleteNodePoolRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.RollbackNodePoolUpgrade = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/RollbackNodePoolUpgrade", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.RollbackNodePoolUpgradeRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.SetNodePoolManagement = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/SetNodePoolManagement", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetNodePoolManagementRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.SetLabels = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/SetLabels", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetLabelsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.SetLegacyAbac = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/SetLegacyAbac", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetLegacyAbacRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.StartIPRotation = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/StartIPRotation", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.StartIPRotationRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.CompleteIPRotation = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/CompleteIPRotation", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.CompleteIPRotationRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.SetNodePoolSize = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/SetNodePoolSize", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetNodePoolSizeRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.SetNetworkPolicy = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/SetNetworkPolicy", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetNetworkPolicyRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.SetMaintenancePolicy = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/SetMaintenancePolicy", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetMaintenancePolicyRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.FromString, - ) - self.ListUsableSubnetworks = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/ListUsableSubnetworks", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListUsableSubnetworksRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListUsableSubnetworksResponse.FromString, - ) - self.ListLocations = channel.unary_unary( - "/google.container.v1beta1.ClusterManager/ListLocations", - request_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListLocationsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListLocationsResponse.FromString, - ) - - -class ClusterManagerServicer(object): - """Google Kubernetes Engine Cluster Manager v1beta1 - """ - - def ListClusters(self, request, context): - """Lists all clusters owned by a project in either the specified zone or all - zones. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetCluster(self, request, context): - """Gets the details for a specific cluster. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateCluster(self, request, context): - """Creates a cluster, consisting of the specified number and type of Google - Compute Engine instances. - - By default, the cluster is created in the project's - [default network](/compute/docs/networks-and-firewalls#networks). - - One firewall is added for the cluster. After cluster creation, - the cluster creates routes for each node to allow the containers - on that node to communicate with all other instances in the - cluster. - - Finally, an entry is added to the project's global metadata indicating - which CIDR range is being used by the cluster. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateCluster(self, request, context): - """Updates the settings for a specific cluster. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateNodePool(self, request, context): - """Updates the version and/or image type of a specific node pool. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SetNodePoolAutoscaling(self, request, context): - """Sets the autoscaling settings of a specific node pool. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SetLoggingService(self, request, context): - """Sets the logging service for a specific cluster. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SetMonitoringService(self, request, context): - """Sets the monitoring service for a specific cluster. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SetAddonsConfig(self, request, context): - """Sets the addons for a specific cluster. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SetLocations(self, request, context): - """Sets the locations for a specific cluster. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateMaster(self, request, context): - """Updates the master for a specific cluster. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SetMasterAuth(self, request, context): - """Used to set master auth materials. Currently supports :- - Changing the admin password for a specific cluster. - This can be either via password generation or explicitly set. - Modify basic_auth.csv and reset the K8S API server. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteCluster(self, request, context): - """Deletes the cluster, including the Kubernetes endpoint and all worker - nodes. - - Firewalls and routes that were configured during cluster creation - are also deleted. - - Other Google Compute Engine resources that might be in use by the cluster - (e.g. load balancer resources) will not be deleted if they weren't present - at the initial create time. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListOperations(self, request, context): - """Lists all operations in a project in a specific zone or all zones. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetOperation(self, request, context): - """Gets the specified operation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CancelOperation(self, request, context): - """Cancels the specified operation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetServerConfig(self, request, context): - """Returns configuration info about the Kubernetes Engine service. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListNodePools(self, request, context): - """Lists the node pools for a cluster. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetNodePool(self, request, context): - """Retrieves the node pool requested. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateNodePool(self, request, context): - """Creates a node pool for a cluster. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteNodePool(self, request, context): - """Deletes a node pool from a cluster. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def RollbackNodePoolUpgrade(self, request, context): - """Roll back the previously Aborted or Failed NodePool upgrade. - This will be an no-op if the last upgrade successfully completed. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SetNodePoolManagement(self, request, context): - """Sets the NodeManagement options for a node pool. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SetLabels(self, request, context): - """Sets labels on a cluster. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SetLegacyAbac(self, request, context): - """Enables or disables the ABAC authorization mechanism on a cluster. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def StartIPRotation(self, request, context): - """Start master IP rotation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CompleteIPRotation(self, request, context): - """Completes master IP rotation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SetNodePoolSize(self, request, context): - """Sets the size for a specific node pool. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SetNetworkPolicy(self, request, context): - """Enables/Disables Network Policy for a cluster. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SetMaintenancePolicy(self, request, context): - """Sets the maintenance policy for a cluster. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListUsableSubnetworks(self, request, context): - """Lists subnetworks that are usable for creating clusters in a project. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListLocations(self, request, context): - """Used to fetch locations that offer GKE. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_ClusterManagerServicer_to_server(servicer, server): - rpc_method_handlers = { - "ListClusters": grpc.unary_unary_rpc_method_handler( - servicer.ListClusters, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListClustersRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListClustersResponse.SerializeToString, - ), - "GetCluster": grpc.unary_unary_rpc_method_handler( - servicer.GetCluster, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.GetClusterRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Cluster.SerializeToString, - ), - "CreateCluster": grpc.unary_unary_rpc_method_handler( - servicer.CreateCluster, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.CreateClusterRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "UpdateCluster": grpc.unary_unary_rpc_method_handler( - servicer.UpdateCluster, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.UpdateClusterRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "UpdateNodePool": grpc.unary_unary_rpc_method_handler( - servicer.UpdateNodePool, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.UpdateNodePoolRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "SetNodePoolAutoscaling": grpc.unary_unary_rpc_method_handler( - servicer.SetNodePoolAutoscaling, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetNodePoolAutoscalingRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "SetLoggingService": grpc.unary_unary_rpc_method_handler( - servicer.SetLoggingService, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetLoggingServiceRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "SetMonitoringService": grpc.unary_unary_rpc_method_handler( - servicer.SetMonitoringService, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetMonitoringServiceRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "SetAddonsConfig": grpc.unary_unary_rpc_method_handler( - servicer.SetAddonsConfig, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetAddonsConfigRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "SetLocations": grpc.unary_unary_rpc_method_handler( - servicer.SetLocations, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetLocationsRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "UpdateMaster": grpc.unary_unary_rpc_method_handler( - servicer.UpdateMaster, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.UpdateMasterRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "SetMasterAuth": grpc.unary_unary_rpc_method_handler( - servicer.SetMasterAuth, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetMasterAuthRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "DeleteCluster": grpc.unary_unary_rpc_method_handler( - servicer.DeleteCluster, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.DeleteClusterRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "ListOperations": grpc.unary_unary_rpc_method_handler( - servicer.ListOperations, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListOperationsRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListOperationsResponse.SerializeToString, - ), - "GetOperation": grpc.unary_unary_rpc_method_handler( - servicer.GetOperation, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.GetOperationRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "CancelOperation": grpc.unary_unary_rpc_method_handler( - servicer.CancelOperation, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.CancelOperationRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "GetServerConfig": grpc.unary_unary_rpc_method_handler( - servicer.GetServerConfig, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.GetServerConfigRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ServerConfig.SerializeToString, - ), - "ListNodePools": grpc.unary_unary_rpc_method_handler( - servicer.ListNodePools, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListNodePoolsRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListNodePoolsResponse.SerializeToString, - ), - "GetNodePool": grpc.unary_unary_rpc_method_handler( - servicer.GetNodePool, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.GetNodePoolRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.NodePool.SerializeToString, - ), - "CreateNodePool": grpc.unary_unary_rpc_method_handler( - servicer.CreateNodePool, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.CreateNodePoolRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "DeleteNodePool": grpc.unary_unary_rpc_method_handler( - servicer.DeleteNodePool, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.DeleteNodePoolRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "RollbackNodePoolUpgrade": grpc.unary_unary_rpc_method_handler( - servicer.RollbackNodePoolUpgrade, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.RollbackNodePoolUpgradeRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "SetNodePoolManagement": grpc.unary_unary_rpc_method_handler( - servicer.SetNodePoolManagement, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetNodePoolManagementRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "SetLabels": grpc.unary_unary_rpc_method_handler( - servicer.SetLabels, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetLabelsRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "SetLegacyAbac": grpc.unary_unary_rpc_method_handler( - servicer.SetLegacyAbac, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetLegacyAbacRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "StartIPRotation": grpc.unary_unary_rpc_method_handler( - servicer.StartIPRotation, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.StartIPRotationRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "CompleteIPRotation": grpc.unary_unary_rpc_method_handler( - servicer.CompleteIPRotation, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.CompleteIPRotationRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "SetNodePoolSize": grpc.unary_unary_rpc_method_handler( - servicer.SetNodePoolSize, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetNodePoolSizeRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "SetNetworkPolicy": grpc.unary_unary_rpc_method_handler( - servicer.SetNetworkPolicy, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetNetworkPolicyRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "SetMaintenancePolicy": grpc.unary_unary_rpc_method_handler( - servicer.SetMaintenancePolicy, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.SetMaintenancePolicyRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.Operation.SerializeToString, - ), - "ListUsableSubnetworks": grpc.unary_unary_rpc_method_handler( - servicer.ListUsableSubnetworks, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListUsableSubnetworksRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListUsableSubnetworksResponse.SerializeToString, - ), - "ListLocations": grpc.unary_unary_rpc_method_handler( - servicer.ListLocations, - request_deserializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListLocationsRequest.FromString, - response_serializer=google_dot_cloud_dot_container__v1beta1_dot_proto_dot_cluster__service__pb2.ListLocationsResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.container.v1beta1.ClusterManager", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/container/google/cloud/container_v1beta1/types.py b/container/google/cloud/container_v1beta1/types.py deleted file mode 100644 index 9f3f9da25b8a..000000000000 --- a/container/google/cloud/container_v1beta1/types.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.container_v1beta1.proto import cluster_service_pb2 -from google.protobuf import empty_pb2 - - -_shared_modules = [empty_pb2] - -_local_modules = [cluster_service_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.container_v1beta1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/container/noxfile.py b/container/noxfile.py deleted file mode 100644 index 60796a84144b..000000000000 --- a/container/noxfile.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=70") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/container/setup.cfg b/container/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/container/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/container/setup.py b/container/setup.py deleted file mode 100644 index 389099256960..000000000000 --- a/container/setup.py +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import io -import os - -import setuptools - - -# Package metadata. - -name = "google-cloud-container" -description = "Google Container Engine API client library" -version = "0.3.0" -# Should be one of: -# 'Development Status :: 3 - Alpha' -# 'Development Status :: 4 - Beta' -# 'Development Status :: 5 - Production/Stable' -release_status = "Development Status :: 3 - Alpha" -dependencies = [ - "google-api-core[grpc] >= 1.14.0, < 2.0.0dev", - "grpc-google-iam-v1 >= 0.12.3, < 0.13dev", -] -extras = {} - - -# Setup boilerplate below this line. - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -# Only include packages under the 'google' namespace. Do not include tests, -# benchmarks, etc. -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -# Determine which namespaces are needed. -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") - - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/GoogleCloudPlatform/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - extras_require=extras, - python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", - include_package_data=True, - zip_safe=False, -) diff --git a/container/synth.metadata b/container/synth.metadata deleted file mode 100644 index 9edf7454a3db..000000000000 --- a/container/synth.metadata +++ /dev/null @@ -1,49 +0,0 @@ -{ - "updateTime": "2019-11-12T13:20:40.037999Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.41.1", - "dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f69562be0608904932bdcfbc5ad8b9a22d9dceb8", - "internalRef": "279774957" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "container", - "apiVersion": "v1beta1", - "language": "python", - "generator": "gapic", - "config": "google/container/artman_container_v1beta1.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "container", - "apiVersion": "v1", - "language": "python", - "generator": "gapic", - "config": "google/container/artman_container_v1.yaml" - } - } - ] -} \ No newline at end of file diff --git a/container/synth.py b/container/synth.py deleted file mode 100644 index b5cb4733dcf6..000000000000 --- a/container/synth.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated parts of this library.""" -import synthtool as s -from synthtool import gcp - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() -versions = ["v1beta1", "v1"] - -# ---------------------------------------------------------------------------- -# Generate container GAPIC layer -# ---------------------------------------------------------------------------- -for version in versions: - library = gapic.py_library( - "container", - version, - config_path=f"/google/container/artman_container_{version}.yaml", - artman_output_name=f"container-{version}", - include_protos=True, - ) - - s.move(library / f"google/cloud/container_{version}") - s.move(library / f"tests/unit/gapic/{version}") - -# Use the highest version library to generate import alias. -s.move(library / "google/cloud/container.py") - -# Issues exist where python files should define the source encoding -# https://github.com/googleapis/gapic-generator/issues/2097 -s.replace( - "google/**/proto/*_pb2.py", - r"(^.*$\n)*", - r"# -*- coding: utf-8 -*-\n\g<0>") - - -# Workaround https://github.com/googleapis/gapic-generator/issues/2449 -s.replace( - "google/**/proto/cluster_service_pb2.py", - r"nodePool>\n", - r"nodePool>`__\n", -) -s.replace( - "google/**/proto/cluster_service_pb2.py", - r"(\s+)`__ instead", - r"\g<1>instead", -) - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = common.py_library(unit_cov_level=0, cov_level=70) -s.move(templated_files) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/container/tests/system/gapic/v1/test_system_cluster_manager_v1.py b/container/tests/system/gapic/v1/test_system_cluster_manager_v1.py deleted file mode 100644 index edd29d99dfae..000000000000 --- a/container/tests/system/gapic/v1/test_system_cluster_manager_v1.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import time - -from google.cloud import container_v1 -from google.cloud.container_v1.proto import cluster_service_pb2 - - -class TestSystemClusterManager(object): - def test_list_clusters(self): - project_id = os.environ["PROJECT_ID"] - - client = container_v1.ClusterManagerClient() - project_id_2 = project_id - zone = "us-central1-a" - response = client.list_clusters(project_id_2, zone) diff --git a/container/tests/unit/gapic/v1/test_cluster_manager_client_v1.py b/container/tests/unit/gapic/v1/test_cluster_manager_client_v1.py deleted file mode 100644 index 4e0cad470be4..000000000000 --- a/container/tests/unit/gapic/v1/test_cluster_manager_client_v1.py +++ /dev/null @@ -1,2035 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import container_v1 -from google.cloud.container_v1 import enums -from google.cloud.container_v1.proto import cluster_service_pb2 -from google.protobuf import empty_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestClusterManagerClient(object): - def test_list_clusters(self): - # Setup Expected Response - expected_response = {} - expected_response = cluster_service_pb2.ListClustersResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - - response = client.list_clusters(project_id, zone) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.ListClustersRequest( - project_id=project_id, zone=zone - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_clusters_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - - with pytest.raises(CustomException): - client.list_clusters(project_id, zone) - - def test_get_cluster(self): - # Setup Expected Response - name = "name3373707" - description = "description-1724546052" - initial_node_count = 1682564205 - logging_service = "loggingService-1700501035" - monitoring_service = "monitoringService1469270462" - network = "network1843485230" - cluster_ipv4_cidr = "clusterIpv4Cidr-141875831" - subnetwork = "subnetwork-1302785042" - enable_kubernetes_alpha = False - label_fingerprint = "labelFingerprint714995737" - self_link = "selfLink-1691268851" - zone_2 = "zone2-696322977" - endpoint = "endpoint1741102485" - initial_cluster_version = "initialClusterVersion-276373352" - current_master_version = "currentMasterVersion-920953983" - current_node_version = "currentNodeVersion-407476063" - create_time = "createTime-493574096" - status_message = "statusMessage-239442758" - node_ipv4_cidr_size = 1181176815 - services_ipv4_cidr = "servicesIpv4Cidr1966438125" - current_node_count = 178977560 - expire_time = "expireTime-96179731" - location = "location1901043637" - enable_tpu = False - tpu_ipv4_cidr_block = "tpuIpv4CidrBlock1137906646" - expected_response = { - "name": name, - "description": description, - "initial_node_count": initial_node_count, - "logging_service": logging_service, - "monitoring_service": monitoring_service, - "network": network, - "cluster_ipv4_cidr": cluster_ipv4_cidr, - "subnetwork": subnetwork, - "enable_kubernetes_alpha": enable_kubernetes_alpha, - "label_fingerprint": label_fingerprint, - "self_link": self_link, - "zone": zone_2, - "endpoint": endpoint, - "initial_cluster_version": initial_cluster_version, - "current_master_version": current_master_version, - "current_node_version": current_node_version, - "create_time": create_time, - "status_message": status_message, - "node_ipv4_cidr_size": node_ipv4_cidr_size, - "services_ipv4_cidr": services_ipv4_cidr, - "current_node_count": current_node_count, - "expire_time": expire_time, - "location": location, - "enable_tpu": enable_tpu, - "tpu_ipv4_cidr_block": tpu_ipv4_cidr_block, - } - expected_response = cluster_service_pb2.Cluster(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - response = client.get_cluster(project_id, zone, cluster_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.GetClusterRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_cluster_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - with pytest.raises(CustomException): - client.get_cluster(project_id, zone, cluster_id) - - def test_create_cluster(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster = {} - - response = client.create_cluster(project_id, zone, cluster) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.CreateClusterRequest( - project_id=project_id, zone=zone, cluster=cluster - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_cluster_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster = {} - - with pytest.raises(CustomException): - client.create_cluster(project_id, zone, cluster) - - def test_update_cluster(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - update = {} - - response = client.update_cluster(project_id, zone, cluster_id, update) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.UpdateClusterRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id, update=update - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_cluster_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - update = {} - - with pytest.raises(CustomException): - client.update_cluster(project_id, zone, cluster_id, update) - - def test_update_node_pool(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - node_version = "nodeVersion1790136219" - image_type = "imageType-1442758754" - - response = client.update_node_pool( - project_id, zone, cluster_id, node_pool_id, node_version, image_type - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.UpdateNodePoolRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - node_version=node_version, - image_type=image_type, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_node_pool_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - node_version = "nodeVersion1790136219" - image_type = "imageType-1442758754" - - with pytest.raises(CustomException): - client.update_node_pool( - project_id, zone, cluster_id, node_pool_id, node_version, image_type - ) - - def test_set_node_pool_autoscaling(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - autoscaling = {} - - response = client.set_node_pool_autoscaling( - project_id, zone, cluster_id, node_pool_id, autoscaling - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetNodePoolAutoscalingRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - autoscaling=autoscaling, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_node_pool_autoscaling_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - autoscaling = {} - - with pytest.raises(CustomException): - client.set_node_pool_autoscaling( - project_id, zone, cluster_id, node_pool_id, autoscaling - ) - - def test_set_logging_service(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - logging_service = "loggingService-1700501035" - - response = client.set_logging_service( - project_id, zone, cluster_id, logging_service - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetLoggingServiceRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - logging_service=logging_service, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_logging_service_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - logging_service = "loggingService-1700501035" - - with pytest.raises(CustomException): - client.set_logging_service(project_id, zone, cluster_id, logging_service) - - def test_set_monitoring_service(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - monitoring_service = "monitoringService1469270462" - - response = client.set_monitoring_service( - project_id, zone, cluster_id, monitoring_service - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetMonitoringServiceRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - monitoring_service=monitoring_service, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_monitoring_service_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - monitoring_service = "monitoringService1469270462" - - with pytest.raises(CustomException): - client.set_monitoring_service( - project_id, zone, cluster_id, monitoring_service - ) - - def test_set_addons_config(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - addons_config = {} - - response = client.set_addons_config(project_id, zone, cluster_id, addons_config) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetAddonsConfigRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - addons_config=addons_config, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_addons_config_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - addons_config = {} - - with pytest.raises(CustomException): - client.set_addons_config(project_id, zone, cluster_id, addons_config) - - def test_set_locations(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - locations = [] - - response = client.set_locations(project_id, zone, cluster_id, locations) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetLocationsRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id, locations=locations - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_locations_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - locations = [] - - with pytest.raises(CustomException): - client.set_locations(project_id, zone, cluster_id, locations) - - def test_update_master(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - master_version = "masterVersion-2139460613" - - response = client.update_master(project_id, zone, cluster_id, master_version) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.UpdateMasterRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - master_version=master_version, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_master_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - master_version = "masterVersion-2139460613" - - with pytest.raises(CustomException): - client.update_master(project_id, zone, cluster_id, master_version) - - def test_set_master_auth(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - action = enums.SetMasterAuthRequest.Action.UNKNOWN - update = {} - - response = client.set_master_auth(project_id, zone, cluster_id, action, update) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetMasterAuthRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - action=action, - update=update, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_master_auth_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - action = enums.SetMasterAuthRequest.Action.UNKNOWN - update = {} - - with pytest.raises(CustomException): - client.set_master_auth(project_id, zone, cluster_id, action, update) - - def test_delete_cluster(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - response = client.delete_cluster(project_id, zone, cluster_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.DeleteClusterRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_cluster_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - with pytest.raises(CustomException): - client.delete_cluster(project_id, zone, cluster_id) - - def test_list_operations(self): - # Setup Expected Response - expected_response = {} - expected_response = cluster_service_pb2.ListOperationsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - - response = client.list_operations(project_id, zone) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.ListOperationsRequest( - project_id=project_id, zone=zone - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_operations_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - - with pytest.raises(CustomException): - client.list_operations(project_id, zone) - - def test_get_operation(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - operation_id = "operationId-274116877" - - response = client.get_operation(project_id, zone, operation_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.GetOperationRequest( - project_id=project_id, zone=zone, operation_id=operation_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_operation_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - operation_id = "operationId-274116877" - - with pytest.raises(CustomException): - client.get_operation(project_id, zone, operation_id) - - def test_cancel_operation(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - operation_id = "operationId-274116877" - - client.cancel_operation(project_id, zone, operation_id) - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.CancelOperationRequest( - project_id=project_id, zone=zone, operation_id=operation_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_cancel_operation_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - operation_id = "operationId-274116877" - - with pytest.raises(CustomException): - client.cancel_operation(project_id, zone, operation_id) - - def test_get_server_config(self): - # Setup Expected Response - default_cluster_version = "defaultClusterVersion111003029" - default_image_type = "defaultImageType-918225828" - expected_response = { - "default_cluster_version": default_cluster_version, - "default_image_type": default_image_type, - } - expected_response = cluster_service_pb2.ServerConfig(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - - response = client.get_server_config(project_id, zone) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.GetServerConfigRequest( - project_id=project_id, zone=zone - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_server_config_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - - with pytest.raises(CustomException): - client.get_server_config(project_id, zone) - - def test_list_node_pools(self): - # Setup Expected Response - expected_response = {} - expected_response = cluster_service_pb2.ListNodePoolsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - response = client.list_node_pools(project_id, zone, cluster_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.ListNodePoolsRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_node_pools_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - with pytest.raises(CustomException): - client.list_node_pools(project_id, zone, cluster_id) - - def test_get_node_pool(self): - # Setup Expected Response - name = "name3373707" - initial_node_count = 1682564205 - self_link = "selfLink-1691268851" - version = "version351608024" - status_message = "statusMessage-239442758" - pod_ipv4_cidr_size = 1098768716 - expected_response = { - "name": name, - "initial_node_count": initial_node_count, - "self_link": self_link, - "version": version, - "status_message": status_message, - "pod_ipv4_cidr_size": pod_ipv4_cidr_size, - } - expected_response = cluster_service_pb2.NodePool(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - - response = client.get_node_pool(project_id, zone, cluster_id, node_pool_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.GetNodePoolRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_node_pool_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - - with pytest.raises(CustomException): - client.get_node_pool(project_id, zone, cluster_id, node_pool_id) - - def test_create_node_pool(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool = {} - - response = client.create_node_pool(project_id, zone, cluster_id, node_pool) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.CreateNodePoolRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id, node_pool=node_pool - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_node_pool_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool = {} - - with pytest.raises(CustomException): - client.create_node_pool(project_id, zone, cluster_id, node_pool) - - def test_delete_node_pool(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - - response = client.delete_node_pool(project_id, zone, cluster_id, node_pool_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.DeleteNodePoolRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_node_pool_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - - with pytest.raises(CustomException): - client.delete_node_pool(project_id, zone, cluster_id, node_pool_id) - - def test_rollback_node_pool_upgrade(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - - response = client.rollback_node_pool_upgrade( - project_id, zone, cluster_id, node_pool_id - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.RollbackNodePoolUpgradeRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_rollback_node_pool_upgrade_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - - with pytest.raises(CustomException): - client.rollback_node_pool_upgrade( - project_id, zone, cluster_id, node_pool_id - ) - - def test_set_node_pool_management(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - management = {} - - response = client.set_node_pool_management( - project_id, zone, cluster_id, node_pool_id, management - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetNodePoolManagementRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - management=management, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_node_pool_management_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - management = {} - - with pytest.raises(CustomException): - client.set_node_pool_management( - project_id, zone, cluster_id, node_pool_id, management - ) - - def test_set_labels(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - resource_labels = {} - label_fingerprint = "labelFingerprint714995737" - - response = client.set_labels( - project_id, zone, cluster_id, resource_labels, label_fingerprint - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetLabelsRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - resource_labels=resource_labels, - label_fingerprint=label_fingerprint, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_labels_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - resource_labels = {} - label_fingerprint = "labelFingerprint714995737" - - with pytest.raises(CustomException): - client.set_labels( - project_id, zone, cluster_id, resource_labels, label_fingerprint - ) - - def test_set_legacy_abac(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - enabled = False - - response = client.set_legacy_abac(project_id, zone, cluster_id, enabled) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetLegacyAbacRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id, enabled=enabled - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_legacy_abac_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - enabled = False - - with pytest.raises(CustomException): - client.set_legacy_abac(project_id, zone, cluster_id, enabled) - - def test_start_i_p_rotation(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - response = client.start_i_p_rotation(project_id, zone, cluster_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.StartIPRotationRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_start_i_p_rotation_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - with pytest.raises(CustomException): - client.start_i_p_rotation(project_id, zone, cluster_id) - - def test_complete_i_p_rotation(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - response = client.complete_i_p_rotation(project_id, zone, cluster_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.CompleteIPRotationRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_complete_i_p_rotation_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - with pytest.raises(CustomException): - client.complete_i_p_rotation(project_id, zone, cluster_id) - - def test_set_node_pool_size(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - node_count = 1539922066 - - response = client.set_node_pool_size( - project_id, zone, cluster_id, node_pool_id, node_count - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetNodePoolSizeRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - node_count=node_count, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_node_pool_size_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - node_count = 1539922066 - - with pytest.raises(CustomException): - client.set_node_pool_size( - project_id, zone, cluster_id, node_pool_id, node_count - ) - - def test_set_network_policy(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - network_policy = {} - - response = client.set_network_policy( - project_id, zone, cluster_id, network_policy - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetNetworkPolicyRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - network_policy=network_policy, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_network_policy_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - network_policy = {} - - with pytest.raises(CustomException): - client.set_network_policy(project_id, zone, cluster_id, network_policy) - - def test_set_maintenance_policy(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - maintenance_policy = {} - - response = client.set_maintenance_policy( - project_id, zone, cluster_id, maintenance_policy - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetMaintenancePolicyRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - maintenance_policy=maintenance_policy, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_maintenance_policy_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - maintenance_policy = {} - - with pytest.raises(CustomException): - client.set_maintenance_policy( - project_id, zone, cluster_id, maintenance_policy - ) - - def test_list_usable_subnetworks(self): - # Setup Expected Response - next_page_token = "" - subnetworks_element = {} - subnetworks = [subnetworks_element] - expected_response = { - "next_page_token": next_page_token, - "subnetworks": subnetworks, - } - expected_response = cluster_service_pb2.ListUsableSubnetworksResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - paged_list_response = client.list_usable_subnetworks() - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.subnetworks[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.ListUsableSubnetworksRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_usable_subnetworks_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1.ClusterManagerClient() - - paged_list_response = client.list_usable_subnetworks() - with pytest.raises(CustomException): - list(paged_list_response) diff --git a/container/tests/unit/gapic/v1beta1/test_cluster_manager_client_v1beta1.py b/container/tests/unit/gapic/v1beta1/test_cluster_manager_client_v1beta1.py deleted file mode 100644 index 0e02294c9d7a..000000000000 --- a/container/tests/unit/gapic/v1beta1/test_cluster_manager_client_v1beta1.py +++ /dev/null @@ -1,2085 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import container_v1beta1 -from google.cloud.container_v1beta1 import enums -from google.cloud.container_v1beta1.proto import cluster_service_pb2 -from google.protobuf import empty_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestClusterManagerClient(object): - def test_list_clusters(self): - # Setup Expected Response - expected_response = {} - expected_response = cluster_service_pb2.ListClustersResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - - response = client.list_clusters(project_id, zone) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.ListClustersRequest( - project_id=project_id, zone=zone - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_clusters_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - - with pytest.raises(CustomException): - client.list_clusters(project_id, zone) - - def test_get_cluster(self): - # Setup Expected Response - name = "name3373707" - description = "description-1724546052" - initial_node_count = 1682564205 - logging_service = "loggingService-1700501035" - monitoring_service = "monitoringService1469270462" - network = "network1843485230" - cluster_ipv4_cidr = "clusterIpv4Cidr-141875831" - subnetwork = "subnetwork-1302785042" - enable_kubernetes_alpha = False - label_fingerprint = "labelFingerprint714995737" - private_cluster = True - master_ipv4_cidr_block = "masterIpv4CidrBlock-97940801" - self_link = "selfLink-1691268851" - zone_2 = "zone2-696322977" - endpoint = "endpoint1741102485" - initial_cluster_version = "initialClusterVersion-276373352" - current_master_version = "currentMasterVersion-920953983" - current_node_version = "currentNodeVersion-407476063" - create_time = "createTime-493574096" - status_message = "statusMessage-239442758" - node_ipv4_cidr_size = 1181176815 - services_ipv4_cidr = "servicesIpv4Cidr1966438125" - current_node_count = 178977560 - expire_time = "expireTime-96179731" - location = "location1901043637" - enable_tpu = False - tpu_ipv4_cidr_block = "tpuIpv4CidrBlock1137906646" - expected_response = { - "name": name, - "description": description, - "initial_node_count": initial_node_count, - "logging_service": logging_service, - "monitoring_service": monitoring_service, - "network": network, - "cluster_ipv4_cidr": cluster_ipv4_cidr, - "subnetwork": subnetwork, - "enable_kubernetes_alpha": enable_kubernetes_alpha, - "label_fingerprint": label_fingerprint, - "private_cluster": private_cluster, - "master_ipv4_cidr_block": master_ipv4_cidr_block, - "self_link": self_link, - "zone": zone_2, - "endpoint": endpoint, - "initial_cluster_version": initial_cluster_version, - "current_master_version": current_master_version, - "current_node_version": current_node_version, - "create_time": create_time, - "status_message": status_message, - "node_ipv4_cidr_size": node_ipv4_cidr_size, - "services_ipv4_cidr": services_ipv4_cidr, - "current_node_count": current_node_count, - "expire_time": expire_time, - "location": location, - "enable_tpu": enable_tpu, - "tpu_ipv4_cidr_block": tpu_ipv4_cidr_block, - } - expected_response = cluster_service_pb2.Cluster(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - response = client.get_cluster(project_id, zone, cluster_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.GetClusterRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_cluster_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - with pytest.raises(CustomException): - client.get_cluster(project_id, zone, cluster_id) - - def test_create_cluster(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster = {} - - response = client.create_cluster(project_id, zone, cluster) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.CreateClusterRequest( - project_id=project_id, zone=zone, cluster=cluster - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_cluster_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster = {} - - with pytest.raises(CustomException): - client.create_cluster(project_id, zone, cluster) - - def test_update_cluster(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - update = {} - - response = client.update_cluster(project_id, zone, cluster_id, update) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.UpdateClusterRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id, update=update - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_cluster_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - update = {} - - with pytest.raises(CustomException): - client.update_cluster(project_id, zone, cluster_id, update) - - def test_update_node_pool(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - node_version = "nodeVersion1790136219" - image_type = "imageType-1442758754" - - response = client.update_node_pool( - project_id, zone, cluster_id, node_pool_id, node_version, image_type - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.UpdateNodePoolRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - node_version=node_version, - image_type=image_type, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_node_pool_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - node_version = "nodeVersion1790136219" - image_type = "imageType-1442758754" - - with pytest.raises(CustomException): - client.update_node_pool( - project_id, zone, cluster_id, node_pool_id, node_version, image_type - ) - - def test_set_node_pool_autoscaling(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - autoscaling = {} - - response = client.set_node_pool_autoscaling( - project_id, zone, cluster_id, node_pool_id, autoscaling - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetNodePoolAutoscalingRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - autoscaling=autoscaling, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_node_pool_autoscaling_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - autoscaling = {} - - with pytest.raises(CustomException): - client.set_node_pool_autoscaling( - project_id, zone, cluster_id, node_pool_id, autoscaling - ) - - def test_set_logging_service(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - logging_service = "loggingService-1700501035" - - response = client.set_logging_service( - project_id, zone, cluster_id, logging_service - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetLoggingServiceRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - logging_service=logging_service, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_logging_service_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - logging_service = "loggingService-1700501035" - - with pytest.raises(CustomException): - client.set_logging_service(project_id, zone, cluster_id, logging_service) - - def test_set_monitoring_service(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - monitoring_service = "monitoringService1469270462" - - response = client.set_monitoring_service( - project_id, zone, cluster_id, monitoring_service - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetMonitoringServiceRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - monitoring_service=monitoring_service, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_monitoring_service_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - monitoring_service = "monitoringService1469270462" - - with pytest.raises(CustomException): - client.set_monitoring_service( - project_id, zone, cluster_id, monitoring_service - ) - - def test_set_addons_config(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - addons_config = {} - - response = client.set_addons_config(project_id, zone, cluster_id, addons_config) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetAddonsConfigRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - addons_config=addons_config, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_addons_config_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - addons_config = {} - - with pytest.raises(CustomException): - client.set_addons_config(project_id, zone, cluster_id, addons_config) - - def test_set_locations(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - locations = [] - - response = client.set_locations(project_id, zone, cluster_id, locations) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetLocationsRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id, locations=locations - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_locations_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - locations = [] - - with pytest.raises(CustomException): - client.set_locations(project_id, zone, cluster_id, locations) - - def test_update_master(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - master_version = "masterVersion-2139460613" - - response = client.update_master(project_id, zone, cluster_id, master_version) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.UpdateMasterRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - master_version=master_version, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_master_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - master_version = "masterVersion-2139460613" - - with pytest.raises(CustomException): - client.update_master(project_id, zone, cluster_id, master_version) - - def test_set_master_auth(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - action = enums.SetMasterAuthRequest.Action.UNKNOWN - update = {} - - response = client.set_master_auth(project_id, zone, cluster_id, action, update) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetMasterAuthRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - action=action, - update=update, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_master_auth_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - action = enums.SetMasterAuthRequest.Action.UNKNOWN - update = {} - - with pytest.raises(CustomException): - client.set_master_auth(project_id, zone, cluster_id, action, update) - - def test_delete_cluster(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - response = client.delete_cluster(project_id, zone, cluster_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.DeleteClusterRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_cluster_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - with pytest.raises(CustomException): - client.delete_cluster(project_id, zone, cluster_id) - - def test_list_operations(self): - # Setup Expected Response - expected_response = {} - expected_response = cluster_service_pb2.ListOperationsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - - response = client.list_operations(project_id, zone) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.ListOperationsRequest( - project_id=project_id, zone=zone - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_operations_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - - with pytest.raises(CustomException): - client.list_operations(project_id, zone) - - def test_get_operation(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - operation_id = "operationId-274116877" - - response = client.get_operation(project_id, zone, operation_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.GetOperationRequest( - project_id=project_id, zone=zone, operation_id=operation_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_operation_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - operation_id = "operationId-274116877" - - with pytest.raises(CustomException): - client.get_operation(project_id, zone, operation_id) - - def test_cancel_operation(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - operation_id = "operationId-274116877" - - client.cancel_operation(project_id, zone, operation_id) - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.CancelOperationRequest( - project_id=project_id, zone=zone, operation_id=operation_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_cancel_operation_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - operation_id = "operationId-274116877" - - with pytest.raises(CustomException): - client.cancel_operation(project_id, zone, operation_id) - - def test_get_server_config(self): - # Setup Expected Response - default_cluster_version = "defaultClusterVersion111003029" - default_image_type = "defaultImageType-918225828" - expected_response = { - "default_cluster_version": default_cluster_version, - "default_image_type": default_image_type, - } - expected_response = cluster_service_pb2.ServerConfig(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - - response = client.get_server_config(project_id, zone) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.GetServerConfigRequest( - project_id=project_id, zone=zone - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_server_config_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - - with pytest.raises(CustomException): - client.get_server_config(project_id, zone) - - def test_list_node_pools(self): - # Setup Expected Response - expected_response = {} - expected_response = cluster_service_pb2.ListNodePoolsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - response = client.list_node_pools(project_id, zone, cluster_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.ListNodePoolsRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_node_pools_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - with pytest.raises(CustomException): - client.list_node_pools(project_id, zone, cluster_id) - - def test_get_node_pool(self): - # Setup Expected Response - name = "name3373707" - initial_node_count = 1682564205 - self_link = "selfLink-1691268851" - version = "version351608024" - status_message = "statusMessage-239442758" - expected_response = { - "name": name, - "initial_node_count": initial_node_count, - "self_link": self_link, - "version": version, - "status_message": status_message, - } - expected_response = cluster_service_pb2.NodePool(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - - response = client.get_node_pool(project_id, zone, cluster_id, node_pool_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.GetNodePoolRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_node_pool_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - - with pytest.raises(CustomException): - client.get_node_pool(project_id, zone, cluster_id, node_pool_id) - - def test_create_node_pool(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool = {} - - response = client.create_node_pool(project_id, zone, cluster_id, node_pool) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.CreateNodePoolRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id, node_pool=node_pool - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_node_pool_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool = {} - - with pytest.raises(CustomException): - client.create_node_pool(project_id, zone, cluster_id, node_pool) - - def test_delete_node_pool(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - - response = client.delete_node_pool(project_id, zone, cluster_id, node_pool_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.DeleteNodePoolRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_node_pool_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - - with pytest.raises(CustomException): - client.delete_node_pool(project_id, zone, cluster_id, node_pool_id) - - def test_rollback_node_pool_upgrade(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - - response = client.rollback_node_pool_upgrade( - project_id, zone, cluster_id, node_pool_id - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.RollbackNodePoolUpgradeRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_rollback_node_pool_upgrade_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - - with pytest.raises(CustomException): - client.rollback_node_pool_upgrade( - project_id, zone, cluster_id, node_pool_id - ) - - def test_set_node_pool_management(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - management = {} - - response = client.set_node_pool_management( - project_id, zone, cluster_id, node_pool_id, management - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetNodePoolManagementRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - management=management, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_node_pool_management_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - management = {} - - with pytest.raises(CustomException): - client.set_node_pool_management( - project_id, zone, cluster_id, node_pool_id, management - ) - - def test_set_labels(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - resource_labels = {} - label_fingerprint = "labelFingerprint714995737" - - response = client.set_labels( - project_id, zone, cluster_id, resource_labels, label_fingerprint - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetLabelsRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - resource_labels=resource_labels, - label_fingerprint=label_fingerprint, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_labels_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - resource_labels = {} - label_fingerprint = "labelFingerprint714995737" - - with pytest.raises(CustomException): - client.set_labels( - project_id, zone, cluster_id, resource_labels, label_fingerprint - ) - - def test_set_legacy_abac(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - enabled = False - - response = client.set_legacy_abac(project_id, zone, cluster_id, enabled) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetLegacyAbacRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id, enabled=enabled - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_legacy_abac_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - enabled = False - - with pytest.raises(CustomException): - client.set_legacy_abac(project_id, zone, cluster_id, enabled) - - def test_start_i_p_rotation(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - response = client.start_i_p_rotation(project_id, zone, cluster_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.StartIPRotationRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_start_i_p_rotation_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - with pytest.raises(CustomException): - client.start_i_p_rotation(project_id, zone, cluster_id) - - def test_complete_i_p_rotation(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - response = client.complete_i_p_rotation(project_id, zone, cluster_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.CompleteIPRotationRequest( - project_id=project_id, zone=zone, cluster_id=cluster_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_complete_i_p_rotation_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - - with pytest.raises(CustomException): - client.complete_i_p_rotation(project_id, zone, cluster_id) - - def test_set_node_pool_size(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - node_count = 1539922066 - - response = client.set_node_pool_size( - project_id, zone, cluster_id, node_pool_id, node_count - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetNodePoolSizeRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - node_pool_id=node_pool_id, - node_count=node_count, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_node_pool_size_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - node_pool_id = "nodePoolId1043384033" - node_count = 1539922066 - - with pytest.raises(CustomException): - client.set_node_pool_size( - project_id, zone, cluster_id, node_pool_id, node_count - ) - - def test_set_network_policy(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - network_policy = {} - - response = client.set_network_policy( - project_id, zone, cluster_id, network_policy - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetNetworkPolicyRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - network_policy=network_policy, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_network_policy_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - network_policy = {} - - with pytest.raises(CustomException): - client.set_network_policy(project_id, zone, cluster_id, network_policy) - - def test_set_maintenance_policy(self): - # Setup Expected Response - name = "name3373707" - zone_2 = "zone2-696322977" - detail = "detail-1335224239" - status_message = "statusMessage-239442758" - self_link = "selfLink-1691268851" - target_link = "targetLink-2084812312" - location = "location1901043637" - start_time = "startTime-1573145462" - end_time = "endTime1725551537" - expected_response = { - "name": name, - "zone": zone_2, - "detail": detail, - "status_message": status_message, - "self_link": self_link, - "target_link": target_link, - "location": location, - "start_time": start_time, - "end_time": end_time, - } - expected_response = cluster_service_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - maintenance_policy = {} - - response = client.set_maintenance_policy( - project_id, zone, cluster_id, maintenance_policy - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.SetMaintenancePolicyRequest( - project_id=project_id, - zone=zone, - cluster_id=cluster_id, - maintenance_policy=maintenance_policy, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_maintenance_policy_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - project_id = "projectId-1969970175" - zone = "zone3744684" - cluster_id = "clusterId240280960" - maintenance_policy = {} - - with pytest.raises(CustomException): - client.set_maintenance_policy( - project_id, zone, cluster_id, maintenance_policy - ) - - def test_list_usable_subnetworks(self): - # Setup Expected Response - next_page_token = "" - subnetworks_element = {} - subnetworks = [subnetworks_element] - expected_response = { - "next_page_token": next_page_token, - "subnetworks": subnetworks, - } - expected_response = cluster_service_pb2.ListUsableSubnetworksResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - parent = "parent-995424086" - - paged_list_response = client.list_usable_subnetworks(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.subnetworks[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.ListUsableSubnetworksRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_usable_subnetworks_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - parent = "parent-995424086" - - paged_list_response = client.list_usable_subnetworks(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_list_locations(self): - # Setup Expected Response - next_page_token = "nextPageToken-1530815211" - expected_response = {"next_page_token": next_page_token} - expected_response = cluster_service_pb2.ListLocationsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup Request - parent = "parent-995424086" - - response = client.list_locations(parent) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cluster_service_pb2.ListLocationsRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_locations_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = container_v1beta1.ClusterManagerClient() - - # Setup request - parent = "parent-995424086" - - with pytest.raises(CustomException): - client.list_locations(parent) diff --git a/containeranalysis/.coveragerc b/containeranalysis/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/containeranalysis/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/containeranalysis/.flake8 b/containeranalysis/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/containeranalysis/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/containeranalysis/.repo-metadata.json b/containeranalysis/.repo-metadata.json deleted file mode 100644 index 8e24dd81f175..000000000000 --- a/containeranalysis/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "containeranalysis", - "name_pretty": "Cloud Container Analysis", - "product_documentation": "https://cloud.google.com/container-registry/docs/container-analysis", - "client_documentation": "https://googleapis.dev/python/containeranalysis/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559777", - "release_level": "ga", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-containeranalysis", - "api_id": "containeranalysis.googleapis.com", - "requires_billing": false -} diff --git a/containeranalysis/CHANGELOG.md b/containeranalysis/CHANGELOG.md deleted file mode 100644 index 2ea3a2c00eaf..000000000000 --- a/containeranalysis/CHANGELOG.md +++ /dev/null @@ -1,56 +0,0 @@ -# Changelog - -## 0.3.1 - -11-07-2019 11:08 PST - -**NOTE**: Please upgrade to this version if you will also be using `google-cloud-build`. - -### Implementation Changes -- Make google.cloud.devtools a namespace ([#9606](https://github.com/googleapis/google-cloud-python/pull/9606)) - -### Documentation -- Change requests intersphinx ref (via synth) -- Fix intersphinx reference to requests ([#9294](https://github.com/googleapis/google-cloud-python/pull/9294)) -- Remove CI for gh-pages, use googleapis.dev for `api_core` refs. ([#9085](https://github.com/googleapis/google-cloud-python/pull/9085)) - -## 0.3.0 - -08-12-2019 13:53 PDT - -### Implementation Changes -- Remove send/recv msg size limit (via synth). ([#8948](https://github.com/googleapis/google-cloud-python/pull/8948)) - -### Dependencies -- Bump minimum version for google-api-core to 1.14.0. ([#8709](https://github.com/googleapis/google-cloud-python/pull/8709)) - -### Documentation -- Normalize docs. ([#8994](https://github.com/googleapis/google-cloud-python/pull/8994)) -- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705)) -- Update intersphinx mapping for requests. ([#8805](https://github.com/googleapis/google-cloud-python/pull/8805)) - -## 0.2.0 - -07-12-2019 16:56 PDT - -### New Features -- Add 'client_options' support (via synth). ([#8502](https://github.com/googleapis/google-cloud-python/pull/8502)) -- Add 'options_' argument to clients' 'get_iam_policy'; pin black version (via synth). ([#8653](https://github.com/googleapis/google-cloud-python/pull/8653)) - -### Dependencies -- Update pin for 'grpc-google-iam-v1' to 0.12.3+. ([#8647](https://github.com/googleapis/google-cloud-python/pull/8647)) - -### Documentation -- Update READMEs. ([#8456](https://github.com/googleapis/google-cloud-python/pull/8456)) - -### Internal / Testing Changes -- Fix language in repo metadata. ([#8537](https://github.com/googleapis/google-cloud-python/pull/8537)) -- Add docs job to publish to googleapis.dev. ([#8464](https://github.com/googleapis/google-cloud-python/pull/8464)) - -## 0.1.0 - -06-19-2019 11:02 PDT - -### New Features -- Initial release of Container Analysis client library. ([#8381](https://github.com/googleapis/google-cloud-python/pull/8381)) - diff --git a/containeranalysis/LICENSE b/containeranalysis/LICENSE deleted file mode 100644 index a8ee855de2aa..000000000000 --- a/containeranalysis/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/containeranalysis/MANIFEST.in b/containeranalysis/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/containeranalysis/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/containeranalysis/README.rst b/containeranalysis/README.rst deleted file mode 100644 index 4a59b581c499..000000000000 --- a/containeranalysis/README.rst +++ /dev/null @@ -1,76 +0,0 @@ -Python Client for Container Analysis API (`Alpha`_) -=================================================== - -`Container Analysis API`_: An implementation of the Grafeas API, which stores, and enables querying -and retrieval of critical metadata about all of your software artifacts. - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. _Alpha: https://github.com/googleapis/google-cloud-python/blob/master/README.rst -.. _Container Analysis API: https://cloud.google.com/container-registry/docs/container-analysis -.. _Client Library Documentation: https://googleapis.dev/python/containeranalysis/latest -.. _Product Documentation: https://cloud.google.com/container-registry/docs/container-analysis - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the Container Analysis API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Container Analysis API.: https://cloud.google.com/container-registry/docs/container-analysis -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-containeranalysis - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-containeranalysis - -Next Steps -~~~~~~~~~~ - -- Read the `Client Library Documentation`_ for Container Analysis API - API to see other available methods on the client. -- Read the `Container Analysis API Product documentation`_ to learn - more about the product and see How-to Guides. -- View this `repository’s main README`_ to see the full list of Cloud - APIs that we cover. - -.. _Container Analysis API Product documentation: https://cloud.google.com/container-registry/docs/container-analysis -.. _repository’s main README: https://github.com/googleapis/google-cloud-python/blob/master/README.rst diff --git a/containeranalysis/docs/README.rst b/containeranalysis/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/containeranalysis/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/containeranalysis/docs/_static/custom.css b/containeranalysis/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/containeranalysis/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/containeranalysis/docs/_templates/layout.html b/containeranalysis/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/containeranalysis/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/containeranalysis/docs/changelog.md b/containeranalysis/docs/changelog.md deleted file mode 120000 index 04c99a55caae..000000000000 --- a/containeranalysis/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../CHANGELOG.md \ No newline at end of file diff --git a/containeranalysis/docs/conf.py b/containeranalysis/docs/conf.py deleted file mode 100644 index 825c07de2771..000000000000 --- a/containeranalysis/docs/conf.py +++ /dev/null @@ -1,363 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-containeranalysis documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-containeranalysis" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-containeranalysis-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-containeranalysis.tex", - u"google-cloud-containeranalysis Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - master_doc, - "google-cloud-containeranalysis", - u"google-cloud-containeranalysis Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-containeranalysis", - u"google-cloud-containeranalysis Documentation", - author, - "google-cloud-containeranalysis", - "GAPIC library for the {metadata.shortName} v1 service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/master/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/containeranalysis/docs/gapic/v1/api.rst b/containeranalysis/docs/gapic/v1/api.rst deleted file mode 100644 index 60a1b16a6927..000000000000 --- a/containeranalysis/docs/gapic/v1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Container Analysis API -================================= - -.. automodule:: google.cloud.devtools.containeranalysis_v1 - :members: - :inherited-members: \ No newline at end of file diff --git a/containeranalysis/docs/gapic/v1/types.rst b/containeranalysis/docs/gapic/v1/types.rst deleted file mode 100644 index 3940e6aeee95..000000000000 --- a/containeranalysis/docs/gapic/v1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Container Analysis API Client -======================================= - -.. automodule:: google.cloud.devtools.containeranalysis_v1.types - :members: \ No newline at end of file diff --git a/containeranalysis/docs/index.rst b/containeranalysis/docs/index.rst deleted file mode 100644 index 51824979bb1b..000000000000 --- a/containeranalysis/docs/index.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. include:: README.rst - -Api Reference -------------- -.. toctree:: - :maxdepth: 2 - - gapic/v1/api - gapic/v1/types - - -Changelog ----------- - -For all previous ``google-cloud-containeranalysis`` releases: - -.. toctree:: - :maxdepth: 2 - - changelog \ No newline at end of file diff --git a/containeranalysis/google/__init__.py b/containeranalysis/google/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/containeranalysis/google/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/containeranalysis/google/cloud/__init__.py b/containeranalysis/google/cloud/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/containeranalysis/google/cloud/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/containeranalysis/google/cloud/containeranalysis_v1/proto/containeranalysis.proto b/containeranalysis/google/cloud/containeranalysis_v1/proto/containeranalysis.proto deleted file mode 100644 index 5c855acbd5ee..000000000000 --- a/containeranalysis/google/cloud/containeranalysis_v1/proto/containeranalysis.proto +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.devtools.containeranalysis.v1; - -import "google/api/annotations.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.DevTools.ContainerAnalysis.V1"; -option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1;containeranalysis"; -option java_multiple_files = true; -option java_package = "com.google.containeranalysis.v1"; -option objc_class_prefix = "GCA"; - -// Retrieves analysis results of Cloud components such as Docker container -// images. The Container Analysis API is an implementation of the -// [Grafeas](grafeas.io) API. -// -// Analysis results are stored as a series of occurrences. An `Occurrence` -// contains information about a specific analysis instance on a resource. An -// occurrence refers to a `Note`. A note contains details describing the -// analysis and is generally stored in a separate project, called a `Provider`. -// Multiple occurrences can refer to the same note. -// -// For example, an SSL vulnerability could affect multiple images. In this case, -// there would be one note for the vulnerability and an occurrence for each -// image with the vulnerability referring to that note. -service ContainerAnalysis { - // Sets the access control policy on the specified note or occurrence. - // Requires `containeranalysis.notes.setIamPolicy` or - // `containeranalysis.occurrences.setIamPolicy` permission if the resource is - // a note or an occurrence, respectively. - // - // The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for - // notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for - // occurrences. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/notes/*}:setIamPolicy" - body: "*" - additional_bindings { - post: "/v1/{resource=projects/*/occurrences/*}:setIamPolicy" - body: "*" - } - }; - } - - // Gets the access control policy for a note or an occurrence resource. - // Requires `containeranalysis.notes.setIamPolicy` or - // `containeranalysis.occurrences.setIamPolicy` permission if the resource is - // a note or occurrence, respectively. - // - // The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for - // notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for - // occurrences. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/notes/*}:getIamPolicy" - body: "*" - additional_bindings { - post: "/v1/{resource=projects/*/occurrences/*}:getIamPolicy" - body: "*" - } - }; - } - - // Returns the permissions that a caller has on the specified note or - // occurrence. Requires list permission on the project (for example, - // `containeranalysis.notes.list`). - // - // The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for - // notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for - // occurrences. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/notes/*}:testIamPermissions" - body: "*" - additional_bindings { - post: "/v1/{resource=projects/*/occurrences/*}:testIamPermissions" - body: "*" - } - }; - } -} diff --git a/containeranalysis/google/cloud/devtools/__init__.py b/containeranalysis/google/cloud/devtools/__init__.py deleted file mode 100644 index 8fcc60e2b9c6..000000000000 --- a/containeranalysis/google/cloud/devtools/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/containeranalysis/google/cloud/devtools/containeranalysis.py b/containeranalysis/google/cloud/devtools/containeranalysis.py deleted file mode 100644 index 25720e43e880..000000000000 --- a/containeranalysis/google/cloud/devtools/containeranalysis.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import - -from google.cloud.devtools.containeranalysis_v1 import ContainerAnalysisClient -from google.cloud.devtools.containeranalysis_v1 import types - - -__all__ = ("types", "ContainerAnalysisClient") diff --git a/containeranalysis/google/cloud/devtools/containeranalysis_v1/__init__.py b/containeranalysis/google/cloud/devtools/containeranalysis_v1/__init__.py deleted file mode 100644 index 8e9632014210..000000000000 --- a/containeranalysis/google/cloud/devtools/containeranalysis_v1/__init__.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.devtools.containeranalysis_v1 import types -from google.cloud.devtools.containeranalysis_v1.gapic import container_analysis_client - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class ContainerAnalysisClient(container_analysis_client.ContainerAnalysisClient): - __doc__ = container_analysis_client.ContainerAnalysisClient.__doc__ - - -__all__ = ("types", "ContainerAnalysisClient") diff --git a/containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/__init__.py b/containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/container_analysis_client.py b/containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/container_analysis_client.py deleted file mode 100644 index 7ef6c4913350..000000000000 --- a/containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/container_analysis_client.py +++ /dev/null @@ -1,495 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.devtools.containeranalysis.v1 ContainerAnalysis API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.path_template -import grpc - -from google.cloud.devtools.containeranalysis_v1.gapic import ( - container_analysis_client_config, -) -from google.cloud.devtools.containeranalysis_v1.gapic.transports import ( - container_analysis_grpc_transport, -) -from google.cloud.devtools.containeranalysis_v1.proto import containeranalysis_pb2_grpc -from google.iam.v1 import iam_policy_pb2 -from google.iam.v1 import options_pb2 -from google.iam.v1 import policy_pb2 - - -from grafeas import grafeas_v1 -from grafeas.grafeas_v1.gapic.transports import grafeas_grpc_transport - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-containeranalysis" -).version - - -class ContainerAnalysisClient(object): - """ - Retrieves analysis results of Cloud components such as Docker container - images. The Container Analysis API is an implementation of the - `Grafeas `__ API. - - Analysis results are stored as a series of occurrences. An - ``Occurrence`` contains information about a specific analysis instance - on a resource. An occurrence refers to a ``Note``. A note contains - details describing the analysis and is generally stored in a separate - project, called a ``Provider``. Multiple occurrences can refer to the - same note. - - For example, an SSL vulnerability could affect multiple images. In this - case, there would be one note for the vulnerability and an occurrence - for each image with the vulnerability referring to that note. - """ - - SERVICE_ADDRESS = "containeranalysis.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.devtools.containeranalysis.v1.ContainerAnalysis" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - ContainerAnalysisClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def note_path(cls, project, note): - """Return a fully-qualified note string.""" - return google.api_core.path_template.expand( - "projects/{project}/notes/{note}", project=project, note=note - ) - - @classmethod - def occurrence_path(cls, project, occurrence): - """Return a fully-qualified occurrence string.""" - return google.api_core.path_template.expand( - "projects/{project}/occurrences/{occurrence}", - project=project, - occurrence=occurrence, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.ContainerAnalysisGrpcTransport, - Callable[[~.Credentials, type], ~.ContainerAnalysisGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = container_analysis_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=container_analysis_grpc_transport.ContainerAnalysisGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = container_analysis_grpc_transport.ContainerAnalysisGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - def get_grafeas_client(self): - """Returns an equivalent grafeas client. - - Returns: - A :class:`~grafeas.grafeas_v1.GrafeasClient` instance. - """ - grafeas_transport = grafeas_grpc_transport.GrafeasGrpcTransport( - self.SERVICE_ADDRESS, self.transport._OAUTH_SCOPES - ) - - return grafeas_v1.GrafeasClient(grafeas_transport) - - # Service calls - def set_iam_policy( - self, - resource, - policy, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the access control policy on the specified note or occurrence. - Requires ``containeranalysis.notes.setIamPolicy`` or - ``containeranalysis.occurrences.setIamPolicy`` permission if the - resource is a note or an occurrence, respectively. - - The resource takes the format ``projects/[PROJECT_ID]/notes/[NOTE_ID]`` - for notes and ``projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`` for - occurrences. - - Example: - >>> from google.cloud.devtools import containeranalysis_v1 - >>> - >>> client = containeranalysis_v1.ContainerAnalysisClient() - >>> - >>> resource = client.note_path('[PROJECT]', '[NOTE]') - >>> - >>> # TODO: Initialize `policy`: - >>> policy = {} - >>> - >>> response = client.set_iam_policy(resource, policy) - - Args: - resource (str): REQUIRED: The resource for which the policy is being specified. - See the operation documentation for the appropriate value for this field. - policy (Union[dict, ~google.cloud.devtools.containeranalysis_v1.types.Policy]): REQUIRED: The complete policy to be applied to the ``resource``. The - size of the policy is limited to a few 10s of KB. An empty policy is a - valid policy but certain Cloud Platform services (such as Projects) - might reject them. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.devtools.containeranalysis_v1.types.Policy` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.devtools.containeranalysis_v1.types.Policy` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_iam_policy" not in self._inner_api_calls: - self._inner_api_calls[ - "set_iam_policy" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_iam_policy, - default_retry=self._method_configs["SetIamPolicy"].retry, - default_timeout=self._method_configs["SetIamPolicy"].timeout, - client_info=self._client_info, - ) - - request = iam_policy_pb2.SetIamPolicyRequest(resource=resource, policy=policy) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("resource", resource)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_iam_policy"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_iam_policy( - self, - resource, - options_=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets the access control policy for a note or an occurrence resource. - Requires ``containeranalysis.notes.setIamPolicy`` or - ``containeranalysis.occurrences.setIamPolicy`` permission if the - resource is a note or occurrence, respectively. - - The resource takes the format ``projects/[PROJECT_ID]/notes/[NOTE_ID]`` - for notes and ``projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`` for - occurrences. - - Example: - >>> from google.cloud.devtools import containeranalysis_v1 - >>> - >>> client = containeranalysis_v1.ContainerAnalysisClient() - >>> - >>> resource = client.note_path('[PROJECT]', '[NOTE]') - >>> - >>> response = client.get_iam_policy(resource) - - Args: - resource (str): REQUIRED: The resource for which the policy is being requested. - See the operation documentation for the appropriate value for this field. - options_ (Union[dict, ~google.cloud.devtools.containeranalysis_v1.types.GetPolicyOptions]): OPTIONAL: A ``GetPolicyOptions`` object for specifying options to - ``GetIamPolicy``. This field is only used by Cloud IAM. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.devtools.containeranalysis_v1.types.GetPolicyOptions` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.devtools.containeranalysis_v1.types.Policy` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_iam_policy" not in self._inner_api_calls: - self._inner_api_calls[ - "get_iam_policy" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_iam_policy, - default_retry=self._method_configs["GetIamPolicy"].retry, - default_timeout=self._method_configs["GetIamPolicy"].timeout, - client_info=self._client_info, - ) - - request = iam_policy_pb2.GetIamPolicyRequest( - resource=resource, options=options_ - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("resource", resource)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_iam_policy"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def test_iam_permissions( - self, - resource, - permissions, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Returns the permissions that a caller has on the specified note or - occurrence. Requires list permission on the project (for example, - ``containeranalysis.notes.list``). - - The resource takes the format ``projects/[PROJECT_ID]/notes/[NOTE_ID]`` - for notes and ``projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`` for - occurrences. - - Example: - >>> from google.cloud.devtools import containeranalysis_v1 - >>> - >>> client = containeranalysis_v1.ContainerAnalysisClient() - >>> - >>> resource = client.note_path('[PROJECT]', '[NOTE]') - >>> - >>> # TODO: Initialize `permissions`: - >>> permissions = [] - >>> - >>> response = client.test_iam_permissions(resource, permissions) - - Args: - resource (str): REQUIRED: The resource for which the policy detail is being requested. - See the operation documentation for the appropriate value for this field. - permissions (list[str]): The set of permissions to check for the ``resource``. Permissions with - wildcards (such as '*' or 'storage.*') are not allowed. For more - information see `IAM - Overview `__. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.devtools.containeranalysis_v1.types.TestIamPermissionsResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "test_iam_permissions" not in self._inner_api_calls: - self._inner_api_calls[ - "test_iam_permissions" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.test_iam_permissions, - default_retry=self._method_configs["TestIamPermissions"].retry, - default_timeout=self._method_configs["TestIamPermissions"].timeout, - client_info=self._client_info, - ) - - request = iam_policy_pb2.TestIamPermissionsRequest( - resource=resource, permissions=permissions - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("resource", resource)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["test_iam_permissions"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/container_analysis_client_config.py b/containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/container_analysis_client_config.py deleted file mode 100644 index f7e39b653e04..000000000000 --- a/containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/container_analysis_client_config.py +++ /dev/null @@ -1,38 +0,0 @@ -config = { - "interfaces": { - "google.devtools.containeranalysis.v1.ContainerAnalysis": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "SetIamPolicy": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetIamPolicy": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "TestIamPermissions": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/transports/__init__.py b/containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/transports/container_analysis_grpc_transport.py b/containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/transports/container_analysis_grpc_transport.py deleted file mode 100644 index 575663ae498f..000000000000 --- a/containeranalysis/google/cloud/devtools/containeranalysis_v1/gapic/transports/container_analysis_grpc_transport.py +++ /dev/null @@ -1,172 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers - -from google.cloud.devtools.containeranalysis_v1.proto import containeranalysis_pb2_grpc - - -class ContainerAnalysisGrpcTransport(object): - """gRPC transport class providing stubs for - google.devtools.containeranalysis.v1 ContainerAnalysis API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, - channel=None, - credentials=None, - address="containeranalysis.googleapis.com:443", - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "container_analysis_stub": containeranalysis_pb2_grpc.ContainerAnalysisStub( - channel - ) - } - - @classmethod - def create_channel( - cls, address="containeranalysis.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def set_iam_policy(self): - """Return the gRPC stub for :meth:`ContainerAnalysisClient.set_iam_policy`. - - Sets the access control policy on the specified note or occurrence. - Requires ``containeranalysis.notes.setIamPolicy`` or - ``containeranalysis.occurrences.setIamPolicy`` permission if the - resource is a note or an occurrence, respectively. - - The resource takes the format ``projects/[PROJECT_ID]/notes/[NOTE_ID]`` - for notes and ``projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`` for - occurrences. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["container_analysis_stub"].SetIamPolicy - - @property - def get_iam_policy(self): - """Return the gRPC stub for :meth:`ContainerAnalysisClient.get_iam_policy`. - - Gets the access control policy for a note or an occurrence resource. - Requires ``containeranalysis.notes.setIamPolicy`` or - ``containeranalysis.occurrences.setIamPolicy`` permission if the - resource is a note or occurrence, respectively. - - The resource takes the format ``projects/[PROJECT_ID]/notes/[NOTE_ID]`` - for notes and ``projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`` for - occurrences. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["container_analysis_stub"].GetIamPolicy - - @property - def test_iam_permissions(self): - """Return the gRPC stub for :meth:`ContainerAnalysisClient.test_iam_permissions`. - - Returns the permissions that a caller has on the specified note or - occurrence. Requires list permission on the project (for example, - ``containeranalysis.notes.list``). - - The resource takes the format ``projects/[PROJECT_ID]/notes/[NOTE_ID]`` - for notes and ``projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`` for - occurrences. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["container_analysis_stub"].TestIamPermissions diff --git a/containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/__init__.py b/containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis.proto b/containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis.proto deleted file mode 100644 index 55b842a00b2b..000000000000 --- a/containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis.proto +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.devtools.containeranalysis.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.DevTools.ContainerAnalysis.V1"; -option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1;containeranalysis"; -option java_multiple_files = true; -option java_package = "com.google.containeranalysis.v1"; -option objc_class_prefix = "GCA"; -option ruby_package = "Google::Cloud::ContainerAnalysis::V1"; - -// Retrieves analysis results of Cloud components such as Docker container -// images. The Container Analysis API is an implementation of the -// [Grafeas](https://grafeas.io) API. -// -// Analysis results are stored as a series of occurrences. An `Occurrence` -// contains information about a specific analysis instance on a resource. An -// occurrence refers to a `Note`. A note contains details describing the -// analysis and is generally stored in a separate project, called a `Provider`. -// Multiple occurrences can refer to the same note. -// -// For example, an SSL vulnerability could affect multiple images. In this case, -// there would be one note for the vulnerability and an occurrence for each -// image with the vulnerability referring to that note. -service ContainerAnalysis { - option (google.api.default_host) = "containeranalysis.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Sets the access control policy on the specified note or occurrence. - // Requires `containeranalysis.notes.setIamPolicy` or - // `containeranalysis.occurrences.setIamPolicy` permission if the resource is - // a note or an occurrence, respectively. - // - // The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for - // notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for - // occurrences. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/notes/*}:setIamPolicy" - body: "*" - additional_bindings { - post: "/v1/{resource=projects/*/occurrences/*}:setIamPolicy" - body: "*" - } - }; - option (google.api.method_signature) = "resource,policy"; - } - - // Gets the access control policy for a note or an occurrence resource. - // Requires `containeranalysis.notes.setIamPolicy` or - // `containeranalysis.occurrences.setIamPolicy` permission if the resource is - // a note or occurrence, respectively. - // - // The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for - // notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for - // occurrences. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/notes/*}:getIamPolicy" - body: "*" - additional_bindings { - post: "/v1/{resource=projects/*/occurrences/*}:getIamPolicy" - body: "*" - } - }; - option (google.api.method_signature) = "resource"; - } - - // Returns the permissions that a caller has on the specified note or - // occurrence. Requires list permission on the project (for example, - // `containeranalysis.notes.list`). - // - // The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for - // notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for - // occurrences. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { - post: "/v1/{resource=projects/*/notes/*}:testIamPermissions" - body: "*" - additional_bindings { - post: "/v1/{resource=projects/*/occurrences/*}:testIamPermissions" - body: "*" - } - }; - option (google.api.method_signature) = "resource,permissions"; - } -} diff --git a/containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis_pb2.py b/containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis_pb2.py deleted file mode 100644 index 466f1baa4075..000000000000 --- a/containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis_pb2.py +++ /dev/null @@ -1,100 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/devtools/containeranalysis_v1/proto/containeranalysis.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.iam.v1 import iam_policy_pb2 as google_dot_iam_dot_v1_dot_iam__policy__pb2 -from google.iam.v1 import policy_pb2 as google_dot_iam_dot_v1_dot_policy__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/devtools/containeranalysis_v1/proto/containeranalysis.proto", - package="google.devtools.containeranalysis.v1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.containeranalysis.v1P\001ZUgoogle.golang.org/genproto/googleapis/devtools/containeranalysis/v1;containeranalysis\242\002\003GCA\252\002*Google.Cloud.DevTools.ContainerAnalysis.V1\352\002$Google::Cloud::ContainerAnalysis::V1" - ), - serialized_pb=_b( - '\nHgoogle/cloud/devtools/containeranalysis_v1/proto/containeranalysis.proto\x12$google.devtools.containeranalysis.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1fgoogle/protobuf/timestamp.proto2\x91\x06\n\x11\x43ontainerAnalysis\x12\xd2\x01\n\x0cSetIamPolicy\x12".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"\x86\x01\x82\xd3\xe4\x93\x02n"./v1/{resource=projects/*/notes/*}:setIamPolicy:\x01*Z9"4/v1/{resource=projects/*/occurrences/*}:setIamPolicy:\x01*\xda\x41\x0fresource,policy\x12\xca\x01\n\x0cGetIamPolicy\x12".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"\x7f\x82\xd3\xe4\x93\x02n"./v1/{resource=projects/*/notes/*}:getIamPolicy:\x01*Z9"4/v1/{resource=projects/*/occurrences/*}:getIamPolicy:\x01*\xda\x41\x08resource\x12\x83\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse"\x97\x01\x82\xd3\xe4\x93\x02z"4/v1/{resource=projects/*/notes/*}:testIamPermissions:\x01*Z?":/v1/{resource=projects/*/occurrences/*}:testIamPermissions:\x01*\xda\x41\x14resource,permissions\x1aT\xca\x41 containeranalysis.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd4\x01\n\x1f\x63om.google.containeranalysis.v1P\x01ZUgoogle.golang.org/genproto/googleapis/devtools/containeranalysis/v1;containeranalysis\xa2\x02\x03GCA\xaa\x02*Google.Cloud.DevTools.ContainerAnalysis.V1\xea\x02$Google::Cloud::ContainerAnalysis::V1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_iam_dot_v1_dot_iam__policy__pb2.DESCRIPTOR, - google_dot_iam_dot_v1_dot_policy__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - -DESCRIPTOR._options = None - -_CONTAINERANALYSIS = _descriptor.ServiceDescriptor( - name="ContainerAnalysis", - full_name="google.devtools.containeranalysis.v1.ContainerAnalysis", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A containeranalysis.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=263, - serialized_end=1048, - methods=[ - _descriptor.MethodDescriptor( - name="SetIamPolicy", - full_name="google.devtools.containeranalysis.v1.ContainerAnalysis.SetIamPolicy", - index=0, - containing_service=None, - input_type=google_dot_iam_dot_v1_dot_iam__policy__pb2._SETIAMPOLICYREQUEST, - output_type=google_dot_iam_dot_v1_dot_policy__pb2._POLICY, - serialized_options=_b( - '\202\323\344\223\002n"./v1/{resource=projects/*/notes/*}:setIamPolicy:\001*Z9"4/v1/{resource=projects/*/occurrences/*}:setIamPolicy:\001*\332A\017resource,policy' - ), - ), - _descriptor.MethodDescriptor( - name="GetIamPolicy", - full_name="google.devtools.containeranalysis.v1.ContainerAnalysis.GetIamPolicy", - index=1, - containing_service=None, - input_type=google_dot_iam_dot_v1_dot_iam__policy__pb2._GETIAMPOLICYREQUEST, - output_type=google_dot_iam_dot_v1_dot_policy__pb2._POLICY, - serialized_options=_b( - '\202\323\344\223\002n"./v1/{resource=projects/*/notes/*}:getIamPolicy:\001*Z9"4/v1/{resource=projects/*/occurrences/*}:getIamPolicy:\001*\332A\010resource' - ), - ), - _descriptor.MethodDescriptor( - name="TestIamPermissions", - full_name="google.devtools.containeranalysis.v1.ContainerAnalysis.TestIamPermissions", - index=2, - containing_service=None, - input_type=google_dot_iam_dot_v1_dot_iam__policy__pb2._TESTIAMPERMISSIONSREQUEST, - output_type=google_dot_iam_dot_v1_dot_iam__policy__pb2._TESTIAMPERMISSIONSRESPONSE, - serialized_options=_b( - '\202\323\344\223\002z"4/v1/{resource=projects/*/notes/*}:testIamPermissions:\001*Z?":/v1/{resource=projects/*/occurrences/*}:testIamPermissions:\001*\332A\024resource,permissions' - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_CONTAINERANALYSIS) - -DESCRIPTOR.services_by_name["ContainerAnalysis"] = _CONTAINERANALYSIS - -# @@protoc_insertion_point(module_scope) diff --git a/containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis_pb2_grpc.py b/containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis_pb2_grpc.py deleted file mode 100644 index e7de182bc727..000000000000 --- a/containeranalysis/google/cloud/devtools/containeranalysis_v1/proto/containeranalysis_pb2_grpc.py +++ /dev/null @@ -1,126 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.iam.v1 import iam_policy_pb2 as google_dot_iam_dot_v1_dot_iam__policy__pb2 -from google.iam.v1 import policy_pb2 as google_dot_iam_dot_v1_dot_policy__pb2 - - -class ContainerAnalysisStub(object): - """Retrieves analysis results of Cloud components such as Docker container - images. The Container Analysis API is an implementation of the - [Grafeas](https://grafeas.io) API. - - Analysis results are stored as a series of occurrences. An `Occurrence` - contains information about a specific analysis instance on a resource. An - occurrence refers to a `Note`. A note contains details describing the - analysis and is generally stored in a separate project, called a `Provider`. - Multiple occurrences can refer to the same note. - - For example, an SSL vulnerability could affect multiple images. In this case, - there would be one note for the vulnerability and an occurrence for each - image with the vulnerability referring to that note. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.SetIamPolicy = channel.unary_unary( - "/google.devtools.containeranalysis.v1.ContainerAnalysis/SetIamPolicy", - request_serializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.SetIamPolicyRequest.SerializeToString, - response_deserializer=google_dot_iam_dot_v1_dot_policy__pb2.Policy.FromString, - ) - self.GetIamPolicy = channel.unary_unary( - "/google.devtools.containeranalysis.v1.ContainerAnalysis/GetIamPolicy", - request_serializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.GetIamPolicyRequest.SerializeToString, - response_deserializer=google_dot_iam_dot_v1_dot_policy__pb2.Policy.FromString, - ) - self.TestIamPermissions = channel.unary_unary( - "/google.devtools.containeranalysis.v1.ContainerAnalysis/TestIamPermissions", - request_serializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.TestIamPermissionsRequest.SerializeToString, - response_deserializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.TestIamPermissionsResponse.FromString, - ) - - -class ContainerAnalysisServicer(object): - """Retrieves analysis results of Cloud components such as Docker container - images. The Container Analysis API is an implementation of the - [Grafeas](https://grafeas.io) API. - - Analysis results are stored as a series of occurrences. An `Occurrence` - contains information about a specific analysis instance on a resource. An - occurrence refers to a `Note`. A note contains details describing the - analysis and is generally stored in a separate project, called a `Provider`. - Multiple occurrences can refer to the same note. - - For example, an SSL vulnerability could affect multiple images. In this case, - there would be one note for the vulnerability and an occurrence for each - image with the vulnerability referring to that note. - """ - - def SetIamPolicy(self, request, context): - """Sets the access control policy on the specified note or occurrence. - Requires `containeranalysis.notes.setIamPolicy` or - `containeranalysis.occurrences.setIamPolicy` permission if the resource is - a note or an occurrence, respectively. - - The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for - notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for - occurrences. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetIamPolicy(self, request, context): - """Gets the access control policy for a note or an occurrence resource. - Requires `containeranalysis.notes.setIamPolicy` or - `containeranalysis.occurrences.setIamPolicy` permission if the resource is - a note or occurrence, respectively. - - The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for - notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for - occurrences. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def TestIamPermissions(self, request, context): - """Returns the permissions that a caller has on the specified note or - occurrence. Requires list permission on the project (for example, - `containeranalysis.notes.list`). - - The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for - notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for - occurrences. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_ContainerAnalysisServicer_to_server(servicer, server): - rpc_method_handlers = { - "SetIamPolicy": grpc.unary_unary_rpc_method_handler( - servicer.SetIamPolicy, - request_deserializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.SetIamPolicyRequest.FromString, - response_serializer=google_dot_iam_dot_v1_dot_policy__pb2.Policy.SerializeToString, - ), - "GetIamPolicy": grpc.unary_unary_rpc_method_handler( - servicer.GetIamPolicy, - request_deserializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.GetIamPolicyRequest.FromString, - response_serializer=google_dot_iam_dot_v1_dot_policy__pb2.Policy.SerializeToString, - ), - "TestIamPermissions": grpc.unary_unary_rpc_method_handler( - servicer.TestIamPermissions, - request_deserializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.TestIamPermissionsRequest.FromString, - response_serializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.TestIamPermissionsResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.devtools.containeranalysis.v1.ContainerAnalysis", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/containeranalysis/google/cloud/devtools/containeranalysis_v1/types.py b/containeranalysis/google/cloud/devtools/containeranalysis_v1/types.py deleted file mode 100644 index 89770238f100..000000000000 --- a/containeranalysis/google/cloud/devtools/containeranalysis_v1/types.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.iam.v1 import iam_policy_pb2 -from google.iam.v1 import options_pb2 -from google.iam.v1 import policy_pb2 -from google.type import expr_pb2 - - -_shared_modules = [iam_policy_pb2, options_pb2, policy_pb2, expr_pb2] - -_local_modules = [] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.devtools.containeranalysis_v1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/containeranalysis/noxfile.py b/containeranalysis/noxfile.py deleted file mode 100644 index 7c7465173f47..000000000000 --- a/containeranalysis/noxfile.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=45") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/containeranalysis/setup.cfg b/containeranalysis/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/containeranalysis/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/containeranalysis/setup.py b/containeranalysis/setup.py deleted file mode 100644 index 47054094b76c..000000000000 --- a/containeranalysis/setup.py +++ /dev/null @@ -1,81 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import io -import os - -import setuptools - - -name = "google-cloud-containeranalysis" -description = "Container Analysis API API client library" -version = "0.3.1" -release_status = "Development Status :: 3 - Alpha" -dependencies = [ - "google-api-core[grpc] >= 1.14.0, < 2.0.0dev", - "grpc-google-iam-v1 >= 0.12.3, < 0.13dev", - 'enum34; python_version < "3.4"', - "grafeas", -] - - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") -if "google.cloud.devtools" in packages: - namespaces.append("google.cloud.devtools") - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/googleapis/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", - include_package_data=True, - zip_safe=False, -) diff --git a/containeranalysis/synth.metadata b/containeranalysis/synth.metadata deleted file mode 100644 index 2f2a433dc8d8..000000000000 --- a/containeranalysis/synth.metadata +++ /dev/null @@ -1,153 +0,0 @@ -{ - "updateTime": "2020-01-30T13:18:35.273871Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c1246a29e22b0f98e800a536b5b0da2d933a55f2", - "internalRef": "292310790", - "log": "c1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\ncf3b61102ed5f36b827bc82ec39be09525f018c8\n Fix to protos for v1p1beta1 release of Cloud Security Command Center\n\nPiperOrigin-RevId: 292034635\n\n4e1cfaa7c0fede9e65d64213ca3da1b1255816c0\nUpdate the public proto to support UTF-8 encoded id for CatalogService API, increase the ListCatalogItems deadline to 300s and some minor documentation change\n\nPiperOrigin-RevId: 292030970\n\n9c483584f8fd5a1b862ae07973f4cc7bb3e46648\nasset: add annotations to v1p1beta1\n\nPiperOrigin-RevId: 292009868\n\ne19209fac29731d0baf6d9ac23da1164f7bdca24\nAdd the google.rpc.context.AttributeContext message to the open source\ndirectories.\n\nPiperOrigin-RevId: 291999930\n\nae5662960573f279502bf98a108a35ba1175e782\noslogin API: move file level option on top of the file to avoid protobuf.js bug.\n\nPiperOrigin-RevId: 291990506\n\neba3897fff7c49ed85d3c47fc96fe96e47f6f684\nAdd cc_proto_library and cc_grpc_library targets for Spanner and IAM protos.\n\nPiperOrigin-RevId: 291988651\n\n8e981acfd9b97ea2f312f11bbaa7b6c16e412dea\nBeta launch for PersonDetection and FaceDetection features.\n\nPiperOrigin-RevId: 291821782\n\n994e067fae3b21e195f7da932b08fff806d70b5d\nasset: add annotations to v1p2beta1\n\nPiperOrigin-RevId: 291815259\n\n244e1d2c89346ca2e0701b39e65552330d68545a\nAdd Playable Locations service\n\nPiperOrigin-RevId: 291806349\n\n909f8f67963daf45dd88d020877fb9029b76788d\nasset: add annotations to v1beta2\n\nPiperOrigin-RevId: 291805301\n\n3c39a1d6e23c1ef63c7fba4019c25e76c40dfe19\nKMS: add file-level message for CryptoKeyPath, it is defined in gapic yaml but not\nin proto files.\n\nPiperOrigin-RevId: 291420695\n\nc6f3f350b8387f8d1b85ed4506f30187ebaaddc3\ncontaineranalysis: update v1beta1 and bazel build with annotations\n\nPiperOrigin-RevId: 291401900\n\n92887d74b44e4e636252b7b8477d0d2570cd82db\nfix: fix the location of grpc config file.\n\nPiperOrigin-RevId: 291396015\n\ne26cab8afd19d396b929039dac5d874cf0b5336c\nexpr: add default_host and method_signature annotations to CelService\n\nPiperOrigin-RevId: 291240093\n\n06093ae3952441c34ec176d1f7431b8765cec0be\nirm: fix v1alpha2 bazel build by adding missing proto imports\n\nPiperOrigin-RevId: 291227940\n\na8a2514af326e4673063f9a3c9d0ef1091c87e6c\nAdd proto annotation for cloud/irm API\n\nPiperOrigin-RevId: 291217859\n\n8d16f76de065f530d395a4c7eabbf766d6a120fd\nGenerate Memcache v1beta2 API protos and gRPC ServiceConfig files\n\nPiperOrigin-RevId: 291008516\n\n3af1dabd93df9a9f17bf3624d3b875c11235360b\ngrafeas: Add containeranalysis default_host to Grafeas service\n\nPiperOrigin-RevId: 290965849\n\nbe2663fa95e31cba67d0cd62611a6674db9f74b7\nfix(google/maps/roads): add missing opening bracket\n\nPiperOrigin-RevId: 290964086\n\nfacc26550a0af0696e0534bc9cae9df14275aa7c\nUpdating v2 protos with the latest inline documentation (in comments) and adding a per-service .yaml file.\n\nPiperOrigin-RevId: 290952261\n\ncda99c1f7dc5e4ca9b1caeae1dc330838cbc1461\nChange api_name to 'asset' for v1p1beta1\n\nPiperOrigin-RevId: 290800639\n\n94e9e90c303a820ce40643d9129e7f0d2054e8a1\nAdds Google Maps Road service\n\nPiperOrigin-RevId: 290795667\n\na3b23dcb2eaecce98c600c7d009451bdec52dbda\nrpc: new message ErrorInfo, other comment updates\n\nPiperOrigin-RevId: 290781668\n\n26420ef4e46c37f193c0fbe53d6ebac481de460e\nAdd proto definition for Org Policy v1.\n\nPiperOrigin-RevId: 290771923\n\n7f0dab8177cf371ae019a082e2512de7ac102888\nPublish Routes Preferred API v1 service definitions.\n\nPiperOrigin-RevId: 290326986\n\nad6e508d0728e1d1bca6e3f328cd562718cb772d\nFix: Qualify resource type references with \"jobs.googleapis.com/\"\n\nPiperOrigin-RevId: 290285762\n\n58e770d568a2b78168ddc19a874178fee8265a9d\ncts client library\n\nPiperOrigin-RevId: 290146169\n\naf9daa4c3b4c4a8b7133b81588dd9ffd37270af2\nAdd more programming language options to public proto\n\nPiperOrigin-RevId: 290144091\n\nd9f2bbf2df301ef84641d4cec7c828736a0bd907\ntalent: add missing resource.proto dep to Bazel build target\n\nPiperOrigin-RevId: 290143164\n\n3b3968237451d027b42471cd28884a5a1faed6c7\nAnnotate Talent API.\nAdd gRPC service config for retry.\nUpdate bazel file with google.api.resource dependency.\n\nPiperOrigin-RevId: 290125172\n\n0735b4b096872960568d1f366bfa75b7b0e1f1a3\nWeekly library update.\n\nPiperOrigin-RevId: 289939042\n\n8760d3d9a4543d7f9c0d1c7870aca08b116e4095\nWeekly library update.\n\nPiperOrigin-RevId: 289939020\n\n8607df842f782a901805187e02fff598145b0b0e\nChange Talent API timeout to 30s.\n\nPiperOrigin-RevId: 289912621\n\n908155991fe32570653bcb72ecfdcfc896642f41\nAdd Recommendations AI V1Beta1\n\nPiperOrigin-RevId: 289901914\n\n5c9a8c2bebd8b71aa66d1cc473edfaac837a2c78\nAdding no-arg method signatures for ListBillingAccounts and ListServices\n\nPiperOrigin-RevId: 289891136\n\n50b0e8286ac988b0593bd890eb31fef6ea2f5767\nlongrunning: add grpc service config and default_host annotation to operations.proto\n\nPiperOrigin-RevId: 289876944\n\n6cac27dabe51c54807b0401698c32d34998948a9\n Updating default deadline for Cloud Security Command Center's v1 APIs.\n\nPiperOrigin-RevId: 289875412\n\nd99df0d67057a233c711187e0689baa4f8e6333d\nFix: Correct spelling in C# namespace option\n\nPiperOrigin-RevId: 289709813\n\n2fa8d48165cc48e35b0c62e6f7bdade12229326c\nfeat: Publish Recommender v1 to GitHub.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289619243\n\n9118db63d1ab493a2e44a3b4973fde810a835c49\nfirestore: don't retry reads that fail with Aborted\n\nFor transaction reads that fail with ABORTED, we need to rollback and start a new transaction. Our current configuration makes it so that GAPIC retries ABORTED reads multiple times without making any progress. Instead, we should retry at the transaction level.\n\nPiperOrigin-RevId: 289532382\n\n1dbfd3fe4330790b1e99c0bb20beb692f1e20b8a\nFix bazel build\nAdd other langauges (Java was already there) for bigquery/storage/v1alpha2 api.\n\nPiperOrigin-RevId: 289519766\n\nc06599cdd7d11f8d3fd25f8d3249e5bb1a3d5d73\nInitial commit of google.cloud.policytroubleshooter API, The API helps in troubleshooting GCP policies. Refer https://cloud.google.com/iam/docs/troubleshooting-access for more information\n\nPiperOrigin-RevId: 289491444\n\nfce7d80fa16ea241e87f7bc33d68595422e94ecd\nDo not pass samples option for Artman config of recommender v1 API.\n\nPiperOrigin-RevId: 289477403\n\nef179e8c61436297e6bb124352e47e45c8c80cb1\nfix: Address missing Bazel dependency.\n\nBazel builds stopped working in 06ec6d5 because\nthe google/longrunning/operations.proto file took\nan import from google/api/client.proto, but that\nimport was not added to BUILD.bazel.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289446074\n\n8841655b242c84fd691d77d7bcf21b61044f01ff\nMigrate Data Labeling v1beta1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289446026\n\n06ec6d5d053fff299eaa6eaa38afdd36c5e2fc68\nAdd annotations to google.longrunning.v1\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289413169\n\n0480cf40be1d3cc231f4268a2fdb36a8dd60e641\nMigrate IAM Admin v1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289411084\n\n1017173e9adeb858587639af61889ad970c728b1\nSpecify a C# namespace for BigQuery Connection v1beta1\n\nPiperOrigin-RevId: 289396763\n\nb08714b378e8e5b0c4ecdde73f92c36d6303b4b6\nfix: Integrate latest proto-docs-plugin fix.\nFixes dialogflow v2\n\nPiperOrigin-RevId: 289189004\n\n51217a67e79255ee1f2e70a6a3919df082513327\nCreate BUILD file for recommender v1\n\nPiperOrigin-RevId: 289183234\n\nacacd87263c0a60e458561b8b8ce9f67c760552a\nGenerate recommender v1 API protos and gRPC ServiceConfig files\n\nPiperOrigin-RevId: 289177510\n\n9d2f7133b97720b1fa3601f6dcd30760ba6d8a1e\nFix kokoro build script\n\nPiperOrigin-RevId: 289166315\n\nc43a67530d2a47a0220cad20ca8de39b3fbaf2c5\ncloudtasks: replace missing RPC timeout config for v2beta2 and v2beta3\n\nPiperOrigin-RevId: 289162391\n\n4cefc229a9197236fc0adf02d69b71c0c5cf59de\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 289158456\n\n56f263fe959c50786dab42e3c61402d32d1417bd\nCatalog API: Adding config necessary to build client libraries\n\nPiperOrigin-RevId: 289149879\n\n4543762b23a57fc3c53d409efc3a9affd47b6ab3\nFix Bazel build\nbilling/v1 and dialogflow/v2 remain broken (not bazel-related issues).\nBilling has wrong configuration, dialogflow failure is caused by a bug in documentation plugin.\n\nPiperOrigin-RevId: 289140194\n\nc9dce519127b97e866ca133a01157f4ce27dcceb\nUpdate Bigtable docs\n\nPiperOrigin-RevId: 289114419\n\n802c5c5f2bf94c3facb011267d04e71942e0d09f\nMigrate DLP to proto annotations (but not GAPIC v2).\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289102579\n\n6357f30f2ec3cff1d8239d18b707ff9d438ea5da\nRemove gRPC configuration file that was in the wrong place.\n\nPiperOrigin-RevId: 289096111\n\n360a8792ed62f944109d7e22d613a04a010665b4\n Protos for v1p1beta1 release of Cloud Security Command Center\n\nPiperOrigin-RevId: 289011995\n\na79211c20c4f2807eec524d00123bf7c06ad3d6e\nRoll back containeranalysis v1 to GAPIC v1.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288999068\n\n9e60345ba603e03484a8aaa33ce5ffa19c1c652b\nPublish Routes Preferred API v1 proto definitions.\n\nPiperOrigin-RevId: 288941399\n\nd52885b642ad2aa1f42b132ee62dbf49a73e1e24\nMigrate the service management API to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288909426\n\n6ace586805c08896fef43e28a261337fcf3f022b\ncloudtasks: replace missing RPC timeout config\n\nPiperOrigin-RevId: 288783603\n\n51d906cabee4876b12497054b15b05d4a50ad027\nImport of Grafeas from Github.\n\nUpdate BUILD.bazel accordingly.\n\nPiperOrigin-RevId: 288783426\n\n5ef42bcd363ba0440f0ee65b3c80b499e9067ede\nMigrate Recommender v1beta1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288713066\n\n94f986afd365b7d7e132315ddcd43d7af0e652fb\nMigrate Container Analysis v1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288708382\n\n7a751a279184970d3b6ba90e4dd4d22a382a0747\nRemove Container Analysis v1alpha1 (nobody publishes it).\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288707473\n\n3c0d9c71242e70474b2b640e15bb0a435fd06ff0\nRemove specious annotation from BigQuery Data Transfer before\nanyone accidentally does anything that uses it.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288701604\n\n1af307a4764bd415ef942ac5187fa1def043006f\nMigrate BigQuery Connection to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288698681\n\n" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "containeranalysis", - "apiVersion": "v1", - "language": "python", - "generator": "gapic", - "config": "google/devtools/containeranalysis/artman_containeranalysis_v1.yaml" - } - } - ], - "newFiles": [ - { - "path": ".coveragerc" - }, - { - "path": ".flake8" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "LICENSE" - }, - { - "path": "MANIFEST.in" - }, - { - "path": "README.rst" - }, - { - "path": "docs/README.rst" - }, - { - "path": "docs/_static/custom.css" - }, - { - "path": "docs/_templates/layout.html" - }, - { - "path": "docs/changelog.md" - }, - { - "path": "docs/conf.py" - }, - { - "path": "docs/gapic/v1/api.rst" - }, - { - "path": "docs/gapic/v1/types.rst" - }, - { - "path": "docs/index.rst" - }, - { - "path": "google/__init__.py" - }, - { - "path": "google/cloud/__init__.py" - }, - { - "path": "google/cloud/containeranalysis_v1/proto/containeranalysis.proto" - }, - { - "path": "google/cloud/devtools/__init__.py" - }, - { - "path": "google/cloud/devtools/containeranalysis.py" - }, - { - "path": "google/cloud/devtools/containeranalysis_v1/__init__.py" - }, - { - "path": "google/cloud/devtools/containeranalysis_v1/gapic/__init__.py" - }, - { - "path": "google/cloud/devtools/containeranalysis_v1/gapic/container_analysis_client.py" - }, - { - "path": "google/cloud/devtools/containeranalysis_v1/gapic/container_analysis_client_config.py" - }, - { - "path": "google/cloud/devtools/containeranalysis_v1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/devtools/containeranalysis_v1/gapic/transports/container_analysis_grpc_transport.py" - }, - { - "path": "google/cloud/devtools/containeranalysis_v1/proto/__init__.py" - }, - { - "path": "google/cloud/devtools/containeranalysis_v1/proto/containeranalysis.proto" - }, - { - "path": "google/cloud/devtools/containeranalysis_v1/proto/containeranalysis_pb2.py" - }, - { - "path": "google/cloud/devtools/containeranalysis_v1/proto/containeranalysis_pb2_grpc.py" - }, - { - "path": "google/cloud/devtools/containeranalysis_v1/types.py" - }, - { - "path": "noxfile.py" - }, - { - "path": "setup.cfg" - }, - { - "path": "setup.py" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "tests/unit/gapic/v1/test_container_analysis_client_v1.py" - } - ] -} \ No newline at end of file diff --git a/containeranalysis/synth.py b/containeranalysis/synth.py deleted file mode 100644 index 9d1c6d3d6945..000000000000 --- a/containeranalysis/synth.py +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -import synthtool.gcp as gcp -import logging - -logging.basicConfig(level=logging.DEBUG) - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() - -# ---------------------------------------------------------------------------- -# Generate Container Analysis GAPIC layer -# ---------------------------------------------------------------------------- -library = gapic.py_library( - "containeranalysis", - "v1", - config_path="/google/devtools/containeranalysis/artman_containeranalysis_v1.yaml", - include_protos=True, -) - -excludes = [ - "nox.py", - "setup.py", - "google/cloud/containeranalysis_v1/proto", - "google/cloud/devtools/__init__.py", # other packages also use this namespace - "README.rst", - "docs/index.rst", -] - -s.move(library, excludes=excludes) -# .proto files end up in the wrong place by default -s.move( - library / "google/cloud/containeranalysis_v1/proto", - "google/cloud/devtools/containeranalysis_v1/proto", -) - -# Insert helper method to get grafeas client -s.replace( - "google/**/container_analysis_client.py", - r"""_GAPIC_LIBRARY_VERSION = pkg_resources\.get_distribution\( - 'google-cloud-containeranalysis', -\)\.version""", - r"""from grafeas import grafeas_v1 -from grafeas.grafeas_v1.gapic.transports import grafeas_grpc_transport - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-containeranalysis" -).version -""", -) - -s.replace( - "google/**/container_analysis_client.py", - r""" \# Service calls - def set_iam_policy\(""", - r''' def get_grafeas_client(self): - """Returns an equivalent grafeas client. - - Returns: - A :class:`~grafeas.grafeas_v1.GrafeasClient` instance. - """ - grafeas_transport = grafeas_grpc_transport.GrafeasGrpcTransport( - self.SERVICE_ADDRESS, - self.transport._OAUTH_SCOPES) - - return grafeas_v1.GrafeasClient(grafeas_transport) - - # Service calls - def set_iam_policy(''', -) -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = common.py_library(unit_cov_level=45, cov_level=45) -s.move(templated_files) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/containeranalysis/tests/unit/gapic/v1/test_container_analysis_client_v1.py b/containeranalysis/tests/unit/gapic/v1/test_container_analysis_client_v1.py deleted file mode 100644 index 4be204b8d865..000000000000 --- a/containeranalysis/tests/unit/gapic/v1/test_container_analysis_client_v1.py +++ /dev/null @@ -1,187 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud.devtools import containeranalysis_v1 -from google.iam.v1 import iam_policy_pb2 -from google.iam.v1 import policy_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestContainerAnalysisClient(object): - def test_set_iam_policy(self): - # Setup Expected Response - version = 351608024 - etag = b"21" - expected_response = {"version": version, "etag": etag} - expected_response = policy_pb2.Policy(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = containeranalysis_v1.ContainerAnalysisClient() - - # Setup Request - resource = client.note_path("[PROJECT]", "[NOTE]") - policy = {} - - response = client.set_iam_policy(resource, policy) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = iam_policy_pb2.SetIamPolicyRequest( - resource=resource, policy=policy - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_iam_policy_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = containeranalysis_v1.ContainerAnalysisClient() - - # Setup request - resource = client.note_path("[PROJECT]", "[NOTE]") - policy = {} - - with pytest.raises(CustomException): - client.set_iam_policy(resource, policy) - - def test_get_iam_policy(self): - # Setup Expected Response - version = 351608024 - etag = b"21" - expected_response = {"version": version, "etag": etag} - expected_response = policy_pb2.Policy(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = containeranalysis_v1.ContainerAnalysisClient() - - # Setup Request - resource = client.note_path("[PROJECT]", "[NOTE]") - - response = client.get_iam_policy(resource) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = iam_policy_pb2.GetIamPolicyRequest(resource=resource) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_iam_policy_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = containeranalysis_v1.ContainerAnalysisClient() - - # Setup request - resource = client.note_path("[PROJECT]", "[NOTE]") - - with pytest.raises(CustomException): - client.get_iam_policy(resource) - - def test_test_iam_permissions(self): - # Setup Expected Response - expected_response = {} - expected_response = iam_policy_pb2.TestIamPermissionsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = containeranalysis_v1.ContainerAnalysisClient() - - # Setup Request - resource = client.note_path("[PROJECT]", "[NOTE]") - permissions = [] - - response = client.test_iam_permissions(resource, permissions) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = iam_policy_pb2.TestIamPermissionsRequest( - resource=resource, permissions=permissions - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_test_iam_permissions_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = containeranalysis_v1.ContainerAnalysisClient() - - # Setup request - resource = client.note_path("[PROJECT]", "[NOTE]") - permissions = [] - - with pytest.raises(CustomException): - client.test_iam_permissions(resource, permissions) diff --git a/datacatalog/.coveragerc b/datacatalog/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/datacatalog/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/datacatalog/.flake8 b/datacatalog/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/datacatalog/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/datacatalog/.repo-metadata.json b/datacatalog/.repo-metadata.json deleted file mode 100644 index 14de20c66627..000000000000 --- a/datacatalog/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "datacatalog ", - "name_pretty": "Google Cloud Data Catalog", - "product_documentation": "https://cloud.google.com/data-catalog", - "client_documentation": "https://googleapis.dev/python/datacatalog/latest", - "issue_tracker": "", - "release_level": "beta", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-datacatalog", - "api_id": "datacatalog.googleapis.com", - "requires_billing": true -} \ No newline at end of file diff --git a/datacatalog/CHANGELOG.md b/datacatalog/CHANGELOG.md deleted file mode 100644 index ab4a4bf41eab..000000000000 --- a/datacatalog/CHANGELOG.md +++ /dev/null @@ -1,101 +0,0 @@ -# Changelog - -[PyPI History][1] - -[1]: https://pypi.org/project/google-cloud-datacatalog/#history - -## 0.5.0 - -11-14-2019 12:54 PST - -### New Features - -- add policy tag manager clients ([#9804](https://github.com/googleapis/google-cloud-python/pull/9804)) - -### Documentation - -- add python 2 sunset banner to documentation ([#9036](https://github.com/googleapis/google-cloud-python/pull/9036)) -- add sample to create a fileset entry ([#9590](https://github.com/googleapis/google-cloud-python/pull/9590)) -- add sample to create an entry group ([#9584](https://github.com/googleapis/google-cloud-python/pull/9584)) - -### Internal / Testing Changes - -- change spacing in docs templates (via synth) ([#9743](https://github.com/googleapis/google-cloud-python/pull/9743)) - -## 0.4.0 - -10-23-2019 08:54 PDT - -### Implementation Changes - -- remove send/recv msg size limit (via synth) ([#8949](https://github.com/googleapis/google-cloud-python/pull/8949)) - -### New Features - -- add entry group operations ([#9520](https://github.com/googleapis/google-cloud-python/pull/9520)) - -### Documentation - -- fix intersphinx reference to requests ([#9294](https://github.com/googleapis/google-cloud-python/pull/9294)) -- remove CI for gh-pages, use googleapis.dev for api_core refs. ([#9085](https://github.com/googleapis/google-cloud-python/pull/9085)) -- remove unused import from samples (via synth). ([#9110](https://github.com/googleapis/google-cloud-python/pull/9110)) -- remove compatability badges from READMEs. ([#9035](https://github.com/googleapis/google-cloud-python/pull/9035)) -- update intersphinx mapping for requests. ([#8805](https://github.com/googleapis/google-cloud-python/pull/8805)) -- add 'search' sample (via synth). ([#8793](https://github.com/googleapis/google-cloud-python/pull/8793)) - -## 0.3.0 - -07-24-2019 15:58 PDT - - -### Implementation Changes -- Allow kwargs to be passed to create_channel (via synth). ([#8425](https://github.com/googleapis/google-cloud-python/pull/8425)) - -### New Features -- Add 'options_' argument to clients' 'get_iam_policy'; pin black version (via synth). ([#8654](https://github.com/googleapis/google-cloud-python/pull/8654)) -- Add 'client_options' support, update list method docstrings (via synth). ([#8503](https://github.com/googleapis/google-cloud-python/pull/8503)) - -### Dependencies -- Bump minimum version for google-api-core to 1.14.0. ([#8709](https://github.com/googleapis/google-cloud-python/pull/8709)) -- Update pin for 'grpc-google-iam-v1' to 0.12.3+. ([#8647](https://github.com/googleapis/google-cloud-python/pull/8647)) - -### Documentation -- Add get_entry sample (via synth). ([#8725](https://github.com/googleapis/google-cloud-python/pull/8725)) -- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705)) -- Add generated samples (via synth). ([#8710](https://github.com/googleapis/google-cloud-python/pull/8710)) -- Add compatibility check badges to READMEs. ([#8288](https://github.com/googleapis/google-cloud-python/pull/8288)) -- Update docstrings (via synth). ([#8299](https://github.com/googleapis/google-cloud-python/pull/8299)) - -### Internal / Testing Changes -- Enable Sample Generator Tool for Data Catalog ([#8708](https://github.com/googleapis/google-cloud-python/pull/8708)) -- Add docs job to publish to googleapis.dev. ([#8464](https://github.com/googleapis/google-cloud-python/pull/8464)) - -## 0.2.0 - -06-12-2019 12:46 PDT - -### New Features - -- Add search capability, tags that match a query, and IAM policies ([#8266](https://github.com/googleapis/google-cloud-python/pull/8266)) -- Add protos as an artifact to library (via synth). ([#8018](https://github.com/googleapis/google-cloud-python/pull/8018)) - -### Documentation - -- Add nox session `docs`, reorder methods (via synth). ([#7766](https://github.com/googleapis/google-cloud-python/pull/7766)) -- Fix broken link to client library docs in README ([#7713](https://github.com/googleapis/google-cloud-python/pull/7713)) - -### Internal / Testing Changes - -- Suppress checking 'cov-fail-under' in nox default session (via synth). ([#8235](https://github.com/googleapis/google-cloud-python/pull/8235)) -- Fix coverage in 'types.py' (via synth). ([#8150](https://github.com/googleapis/google-cloud-python/pull/8150)) -- Blacken noxfile.py, setup.py (via synth). ([#8117](https://github.com/googleapis/google-cloud-python/pull/8117)) -- Add empty lines (via synth). ([#8052](https://github.com/googleapis/google-cloud-python/pull/8052)) - -## 0.1.0 - -04-15-2019 15:46 PDT - -### New Features - -- Initial release of Cloud Data Catalog client. ([#7708](https://github.com/googleapis/google-cloud-python/pull/7708)) - diff --git a/datacatalog/LICENSE b/datacatalog/LICENSE deleted file mode 100644 index a8ee855de2aa..000000000000 --- a/datacatalog/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/datacatalog/MANIFEST.in b/datacatalog/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/datacatalog/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/datacatalog/README.rst b/datacatalog/README.rst deleted file mode 100644 index 83cb7a1b8452..000000000000 --- a/datacatalog/README.rst +++ /dev/null @@ -1,79 +0,0 @@ -Python Client for Google Cloud Data Catalog API (`Beta`_) -========================================================== - - - -`Google Cloud Data Catalog API`_: Google Cloud Data Catalog API provides features to attach metadata to -Google Cloud Platform resources like BigQuery Tables. Key critical resources -include: Entries (Data Catalog representation of a cloud resource). - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. _Beta: https://github.com/googleapis/google-cloud-python/blob/master/README.rst -.. _Google Cloud Data Catalog API: https://cloud.google.com/data-catalog -.. _Client Library Documentation: https://googleapis.dev/python/datacatalog/latest -.. _Product Documentation: https://cloud.google.com/data-catalog - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the Google Cloud Data Catalog API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Google Cloud Data Catalog API.: https://cloud.google.com/data-catalog -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-datacatalog - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-datacatalog - -Next Steps -~~~~~~~~~~ - -- Read the `Client Library Documentation`_ for Google Cloud Data Catalog API - API to see other available methods on the client. -- Read the `Google Cloud Data Catalog API Product documentation`_ to learn - more about the product and see How-to Guides. -- View this `repository’s main README`_ to see the full list of Cloud - APIs that we cover. - -.. _Google Cloud Data Catalog API Product documentation: https://cloud.google.com/data-catalog -.. _repository’s main README: https://github.com/googleapis/google-cloud-python/blob/master/README.rst diff --git a/datacatalog/docs/README.rst b/datacatalog/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/datacatalog/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/datacatalog/docs/_static/custom.css b/datacatalog/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/datacatalog/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/datacatalog/docs/_templates/layout.html b/datacatalog/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/datacatalog/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/datacatalog/docs/changelog.md b/datacatalog/docs/changelog.md deleted file mode 120000 index 04c99a55caae..000000000000 --- a/datacatalog/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../CHANGELOG.md \ No newline at end of file diff --git a/datacatalog/docs/conf.py b/datacatalog/docs/conf.py deleted file mode 100644 index a8aab8d98360..000000000000 --- a/datacatalog/docs/conf.py +++ /dev/null @@ -1,356 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-datacatalog documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-datacatalog" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-datacatalog-doc" - -# -- Options for warnings ------------------------------------------------------ - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-datacatalog.tex", - u"google-cloud-datacatalog Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - master_doc, - "google-cloud-datacatalog", - u"google-cloud-datacatalog Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-datacatalog", - u"google-cloud-datacatalog Documentation", - author, - "google-cloud-datacatalog", - "GAPIC library for the {metadata.shortName} v1beta1 service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/stable/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/datacatalog/docs/gapic/v1beta1/api.rst b/datacatalog/docs/gapic/v1beta1/api.rst deleted file mode 100644 index 4c56460c09d7..000000000000 --- a/datacatalog/docs/gapic/v1beta1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Google Cloud Data Catalog API -======================================== - -.. automodule:: google.cloud.datacatalog_v1beta1 - :members: - :inherited-members: \ No newline at end of file diff --git a/datacatalog/docs/gapic/v1beta1/types.rst b/datacatalog/docs/gapic/v1beta1/types.rst deleted file mode 100644 index bcc6cefbd1f7..000000000000 --- a/datacatalog/docs/gapic/v1beta1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Google Cloud Data Catalog API Client -============================================== - -.. automodule:: google.cloud.datacatalog_v1beta1.types - :members: \ No newline at end of file diff --git a/datacatalog/docs/index.rst b/datacatalog/docs/index.rst deleted file mode 100644 index 3964113dcdcd..000000000000 --- a/datacatalog/docs/index.rst +++ /dev/null @@ -1,22 +0,0 @@ -.. include:: README.rst - - -API Reference -------------- - -.. toctree:: - :maxdepth: 2 - - gapic/v1beta1/api - gapic/v1beta1/types - - -Changelog ---------- - -For a list of all ``google-cloud-datacatalog`` releases: - -.. toctree:: - :maxdepth: 2 - - changelog diff --git a/datacatalog/google/__init__.py b/datacatalog/google/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/datacatalog/google/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/datacatalog/google/cloud/__init__.py b/datacatalog/google/cloud/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/datacatalog/google/cloud/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/datacatalog/google/cloud/datacatalog.py b/datacatalog/google/cloud/datacatalog.py deleted file mode 100644 index 4c14f13ae475..000000000000 --- a/datacatalog/google/cloud/datacatalog.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import - -from google.cloud.datacatalog_v1beta1 import DataCatalogClient -from google.cloud.datacatalog_v1beta1 import PolicyTagManagerClient -from google.cloud.datacatalog_v1beta1 import PolicyTagManagerSerializationClient -from google.cloud.datacatalog_v1beta1 import enums -from google.cloud.datacatalog_v1beta1 import types - - -__all__ = ( - "enums", - "types", - "DataCatalogClient", - "PolicyTagManagerClient", - "PolicyTagManagerSerializationClient", -) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/__init__.py b/datacatalog/google/cloud/datacatalog_v1beta1/__init__.py deleted file mode 100644 index fe3a50682ae9..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/__init__.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from __future__ import absolute_import - -from google.cloud.datacatalog_v1beta1 import types -from google.cloud.datacatalog_v1beta1.gapic import data_catalog_client -from google.cloud.datacatalog_v1beta1.gapic import enums -from google.cloud.datacatalog_v1beta1.gapic import policy_tag_manager_client -from google.cloud.datacatalog_v1beta1.gapic import ( - policy_tag_manager_serialization_client, -) - - -class DataCatalogClient(data_catalog_client.DataCatalogClient): - __doc__ = data_catalog_client.DataCatalogClient.__doc__ - enums = enums - - -class PolicyTagManagerClient(policy_tag_manager_client.PolicyTagManagerClient): - __doc__ = policy_tag_manager_client.PolicyTagManagerClient.__doc__ - enums = enums - - -class PolicyTagManagerSerializationClient( - policy_tag_manager_serialization_client.PolicyTagManagerSerializationClient -): - __doc__ = ( - policy_tag_manager_serialization_client.PolicyTagManagerSerializationClient.__doc__ - ) - enums = enums - - -__all__ = ( - "enums", - "types", - "DataCatalogClient", - "PolicyTagManagerClient", - "PolicyTagManagerSerializationClient", -) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/__init__.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/data_catalog_client.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/data_catalog_client.py deleted file mode 100644 index 389e8e8dbb3b..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/data_catalog_client.py +++ /dev/null @@ -1,2385 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.cloud.datacatalog.v1beta1 DataCatalog API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.page_iterator -import google.api_core.path_template -import google.api_core.protobuf_helpers -import grpc - -from google.cloud.datacatalog_v1beta1.gapic import data_catalog_client_config -from google.cloud.datacatalog_v1beta1.gapic import enums -from google.cloud.datacatalog_v1beta1.gapic.transports import ( - data_catalog_grpc_transport, -) -from google.cloud.datacatalog_v1beta1.proto import datacatalog_pb2 -from google.cloud.datacatalog_v1beta1.proto import datacatalog_pb2_grpc -from google.cloud.datacatalog_v1beta1.proto import tags_pb2 -from google.iam.v1 import iam_policy_pb2 -from google.iam.v1 import options_pb2 -from google.iam.v1 import policy_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-datacatalog" -).version - - -class DataCatalogClient(object): - """ - Data Catalog API service allows clients to discover, understand, and manage - their data. - """ - - SERVICE_ADDRESS = "datacatalog.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.datacatalog.v1beta1.DataCatalog" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - DataCatalogClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def entry_path(cls, project, location, entry_group, entry): - """Return a fully-qualified entry string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}", - project=project, - location=location, - entry_group=entry_group, - entry=entry, - ) - - @classmethod - def entry_group_path(cls, project, location, entry_group): - """Return a fully-qualified entry_group string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/entryGroups/{entry_group}", - project=project, - location=location, - entry_group=entry_group, - ) - - @classmethod - def field_path(cls, project, location, tag_template, field): - """Return a fully-qualified field string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}", - project=project, - location=location, - tag_template=tag_template, - field=field, - ) - - @classmethod - def location_path(cls, project, location): - """Return a fully-qualified location string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}", - project=project, - location=location, - ) - - @classmethod - def tag_path(cls, project, location, entry_group, entry, tag): - """Return a fully-qualified tag string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}/tags/{tag}", - project=project, - location=location, - entry_group=entry_group, - entry=entry, - tag=tag, - ) - - @classmethod - def tag_template_path(cls, project, location, tag_template): - """Return a fully-qualified tag_template string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/tagTemplates/{tag_template}", - project=project, - location=location, - tag_template=tag_template, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.DataCatalogGrpcTransport, - Callable[[~.Credentials, type], ~.DataCatalogGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = data_catalog_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=data_catalog_grpc_transport.DataCatalogGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = data_catalog_grpc_transport.DataCatalogGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def search_catalog( - self, - scope, - query, - page_size=None, - order_by=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Searches Data Catalog for multiple resources like entries, tags that - match a query. - - This is a custom method - (https://cloud.google.com/apis/design/custom\_methods) and does not - return the complete resource, only the resource identifier and high - level fields. Clients can subsequentally call ``Get`` methods. - - Note that searches do not have full recall. There may be results that - match your query but are not returned, even in subsequent pages of - results. These missing results may vary across repeated calls to search. - Do not rely on this method if you need to guarantee full recall. - - See `Data Catalog Search - Syntax `__ - for more information. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> # TODO: Initialize `scope`: - >>> scope = {} - >>> - >>> # TODO: Initialize `query`: - >>> query = '' - >>> - >>> # Iterate over all results - >>> for element in client.search_catalog(scope, query): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.search_catalog(scope, query).pages: - ... for element in page: - ... # process element - ... pass - - Args: - scope (Union[dict, ~google.cloud.datacatalog_v1beta1.types.Scope]): Required. The scope of this search request. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.Scope` - query (str): Required. The query string in search query syntax. The query must be - non-empty. - - Query strings can be simple as "x" or more qualified as: - - - name:x - - column:x - - description:y - - Note: Query tokens need to have a minimum of 3 characters for substring - matching to work correctly. See `Data Catalog Search - Syntax `__ - for more information. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - order_by (str): Specifies the ordering of results, currently supported case-sensitive - choices are: - - - ``relevance``, only supports desecending - - ``last_access_timestamp [asc|desc]``, defaults to descending if not - specified - - ``last_modified_timestamp [asc|desc]``, defaults to descending if not - specified - - If not specified, defaults to ``relevance`` descending. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.datacatalog_v1beta1.types.SearchCatalogResult` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "search_catalog" not in self._inner_api_calls: - self._inner_api_calls[ - "search_catalog" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.search_catalog, - default_retry=self._method_configs["SearchCatalog"].retry, - default_timeout=self._method_configs["SearchCatalog"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.SearchCatalogRequest( - scope=scope, query=query, page_size=page_size, order_by=order_by - ) - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["search_catalog"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="results", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def create_entry_group( - self, - parent, - entry_group_id, - entry_group, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Alpha feature. Creates an EntryGroup. The user should enable the Data - Catalog API in the project identified by the ``parent`` parameter (see - [Data Catalog Resource Project] - (/data-catalog/docs/concepts/resource-project) for more information). - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `entry_group_id`: - >>> entry_group_id = '' - >>> - >>> # TODO: Initialize `entry_group`: - >>> entry_group = {} - >>> - >>> response = client.create_entry_group(parent, entry_group_id, entry_group) - - Args: - parent (str): Required. The name of the project this entry group is in. Example: - - - projects/{project\_id}/locations/{location} - - Note that this EntryGroup and its child resources may not actually be - stored in the location in this name. - entry_group_id (str): Required. The id of the entry group to create. - The id must begin with a letter or underscore, contain only English - letters, numbers and underscores, and be at most 64 characters. - entry_group (Union[dict, ~google.cloud.datacatalog_v1beta1.types.EntryGroup]): The entry group to create. Defaults to an empty entry group. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.EntryGroup` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.EntryGroup` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_entry_group" not in self._inner_api_calls: - self._inner_api_calls[ - "create_entry_group" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_entry_group, - default_retry=self._method_configs["CreateEntryGroup"].retry, - default_timeout=self._method_configs["CreateEntryGroup"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.CreateEntryGroupRequest( - parent=parent, entry_group_id=entry_group_id, entry_group=entry_group - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_entry_group"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_entry_group( - self, - name, - read_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Alpha feature. - Gets an EntryGroup. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> name = client.entry_group_path('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]') - >>> - >>> response = client.get_entry_group(name) - - Args: - name (str): Required. The name of the entry group. For example, - ``projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}``. - read_mask (Union[dict, ~google.cloud.datacatalog_v1beta1.types.FieldMask]): The fields to return. If not set or empty, all fields are returned. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.EntryGroup` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_entry_group" not in self._inner_api_calls: - self._inner_api_calls[ - "get_entry_group" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_entry_group, - default_retry=self._method_configs["GetEntryGroup"].retry, - default_timeout=self._method_configs["GetEntryGroup"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.GetEntryGroupRequest(name=name, read_mask=read_mask) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_entry_group"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_entry_group( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Alpha feature. Deletes an EntryGroup. Only entry groups that do not - contain entries can be deleted. The user should enable the Data Catalog - API in the project identified by the ``name`` parameter (see [Data - Catalog Resource Project] (/data-catalog/docs/concepts/resource-project) - for more information). - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> name = client.entry_group_path('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]') - >>> - >>> client.delete_entry_group(name) - - Args: - name (str): Required. The name of the entry group. For example, - ``projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_entry_group" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_entry_group" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_entry_group, - default_retry=self._method_configs["DeleteEntryGroup"].retry, - default_timeout=self._method_configs["DeleteEntryGroup"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.DeleteEntryGroupRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_entry_group"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_entry( - self, - parent, - entry_id, - entry, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Alpha feature. Creates an entry. Currently only entries of 'FILESET' - type can be created. The user should enable the Data Catalog API in the - project identified by the ``parent`` parameter (see [Data Catalog - Resource Project] (/data-catalog/docs/concepts/resource-project) for - more information). - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> parent = client.entry_group_path('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]') - >>> - >>> # TODO: Initialize `entry_id`: - >>> entry_id = '' - >>> - >>> # TODO: Initialize `entry`: - >>> entry = {} - >>> - >>> response = client.create_entry(parent, entry_id, entry) - - Args: - parent (str): Required. The name of the entry group this entry is in. Example: - - - projects/{project\_id}/locations/{location}/entryGroups/{entry\_group\_id} - - Note that this Entry and its child resources may not actually be stored - in the location in this name. - entry_id (str): Required. The id of the entry to create. - entry (Union[dict, ~google.cloud.datacatalog_v1beta1.types.Entry]): Required. The entry to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.Entry` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.Entry` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_entry" not in self._inner_api_calls: - self._inner_api_calls[ - "create_entry" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_entry, - default_retry=self._method_configs["CreateEntry"].retry, - default_timeout=self._method_configs["CreateEntry"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.CreateEntryRequest( - parent=parent, entry_id=entry_id, entry=entry - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_entry"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_entry( - self, - entry, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates an existing entry. The user should enable the Data Catalog API - in the project identified by the ``entry.name`` parameter (see [Data - Catalog Resource Project] (/data-catalog/docs/concepts/resource-project) - for more information). - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> # TODO: Initialize `entry`: - >>> entry = {} - >>> - >>> response = client.update_entry(entry) - - Args: - entry (Union[dict, ~google.cloud.datacatalog_v1beta1.types.Entry]): Required. The updated entry. The "name" field must be set. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.Entry` - update_mask (Union[dict, ~google.cloud.datacatalog_v1beta1.types.FieldMask]): The fields to update on the entry. If absent or empty, all modifiable - fields are updated. - - The following fields are modifiable: - - - For entries with type ``DATA_STREAM``: - - - ``schema`` - - - For entries with type ``FILESET`` - - - ``schema`` - - ``display_name`` - - ``description`` - - ``gcs_fileset_spec`` - - ``gcs_fileset_spec.file_patterns`` - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.Entry` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_entry" not in self._inner_api_calls: - self._inner_api_calls[ - "update_entry" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_entry, - default_retry=self._method_configs["UpdateEntry"].retry, - default_timeout=self._method_configs["UpdateEntry"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.UpdateEntryRequest( - entry=entry, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("entry.name", entry.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_entry"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_entry( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Alpha feature. Deletes an existing entry. Only entries created through - ``CreateEntry`` method can be deleted. The user should enable the Data - Catalog API in the project identified by the ``name`` parameter (see - [Data Catalog Resource Project] - (/data-catalog/docs/concepts/resource-project) for more information). - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> name = client.entry_path('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]') - >>> - >>> client.delete_entry(name) - - Args: - name (str): Required. The name of the entry. Example: - - - projects/{project\_id}/locations/{location}/entryGroups/{entry\_group\_id}/entries/{entry\_id} - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_entry" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_entry" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_entry, - default_retry=self._method_configs["DeleteEntry"].retry, - default_timeout=self._method_configs["DeleteEntry"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.DeleteEntryRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_entry"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_entry( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets an entry. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> name = client.entry_path('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]') - >>> - >>> response = client.get_entry(name) - - Args: - name (str): Required. The name of the entry. Example: - - - projects/{project\_id}/locations/{location}/entryGroups/{entry\_group\_id}/entries/{entry\_id} - - Entry groups are logical groupings of entries. Currently, users cannot - create/modify entry groups. They are created by Data Catalog; they - include ``@bigquery`` for all BigQuery entries, and ``@pubsub`` for all - Cloud Pub/Sub entries. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.Entry` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_entry" not in self._inner_api_calls: - self._inner_api_calls[ - "get_entry" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_entry, - default_retry=self._method_configs["GetEntry"].retry, - default_timeout=self._method_configs["GetEntry"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.GetEntryRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_entry"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def lookup_entry( - self, - linked_resource=None, - sql_resource=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Get an entry by target resource name. This method allows clients to use - the resource name from the source Google Cloud Platform service to get the - Data Catalog Entry. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> response = client.lookup_entry() - - Args: - linked_resource (str): The full name of the Google Cloud Platform resource the Data Catalog - entry represents. See: - https://cloud.google.com/apis/design/resource\_names#full\_resource\_name. - Full names are case-sensitive. - - Examples: - - - //bigquery.googleapis.com/projects/projectId/datasets/datasetId/tables/tableId - - //pubsub.googleapis.com/projects/projectId/topics/topicId - sql_resource (str): The SQL name of the entry. SQL names are case-sensitive. - - Examples: - - - ``cloud_pubsub.project_id.topic_id`` - - ``pubsub.project_id.`topic.id.with.dots``` - - ``bigquery.table.project_id.dataset_id.table_id`` - - ``bigquery.dataset.project_id.dataset_id`` - - ``datacatalog.project_id.location_id.entry_group_id.entry_id`` - - ``*_id``\ s shoud satisfy the standard SQL rules for identifiers. - https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.Entry` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "lookup_entry" not in self._inner_api_calls: - self._inner_api_calls[ - "lookup_entry" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.lookup_entry, - default_retry=self._method_configs["LookupEntry"].retry, - default_timeout=self._method_configs["LookupEntry"].timeout, - client_info=self._client_info, - ) - - # Sanity check: We have some fields which are mutually exclusive; - # raise ValueError if more than one is sent. - google.api_core.protobuf_helpers.check_oneof( - linked_resource=linked_resource, sql_resource=sql_resource - ) - - request = datacatalog_pb2.LookupEntryRequest( - linked_resource=linked_resource, sql_resource=sql_resource - ) - return self._inner_api_calls["lookup_entry"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_tag_template( - self, - parent, - tag_template_id, - tag_template, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a tag template. The user should enable the Data Catalog API in - the project identified by the ``parent`` parameter (see `Data Catalog - Resource - Project `__ - for more information). - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `tag_template_id`: - >>> tag_template_id = '' - >>> - >>> # TODO: Initialize `tag_template`: - >>> tag_template = {} - >>> - >>> response = client.create_tag_template(parent, tag_template_id, tag_template) - - Args: - parent (str): Required. The name of the project and the location this template is in. - Example: - - - projects/{project\_id}/locations/{location} - - TagTemplate and its child resources may not actually be stored in the - location in this name. - tag_template_id (str): Required. The id of the tag template to create. - tag_template (Union[dict, ~google.cloud.datacatalog_v1beta1.types.TagTemplate]): Required. The tag template to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.TagTemplate` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.TagTemplate` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_tag_template" not in self._inner_api_calls: - self._inner_api_calls[ - "create_tag_template" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_tag_template, - default_retry=self._method_configs["CreateTagTemplate"].retry, - default_timeout=self._method_configs["CreateTagTemplate"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.CreateTagTemplateRequest( - parent=parent, tag_template_id=tag_template_id, tag_template=tag_template - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_tag_template"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_tag_template( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a tag template. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> name = client.tag_template_path('[PROJECT]', '[LOCATION]', '[TAG_TEMPLATE]') - >>> - >>> response = client.get_tag_template(name) - - Args: - name (str): Required. The name of the tag template. Example: - - - projects/{project\_id}/locations/{location}/tagTemplates/{tag\_template\_id} - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.TagTemplate` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_tag_template" not in self._inner_api_calls: - self._inner_api_calls[ - "get_tag_template" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_tag_template, - default_retry=self._method_configs["GetTagTemplate"].retry, - default_timeout=self._method_configs["GetTagTemplate"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.GetTagTemplateRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_tag_template"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_tag_template( - self, - tag_template, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates a tag template. This method cannot be used to update the fields - of a template. The tag template fields are represented as separate - resources and should be updated using their own create/update/delete - methods. The user should enable the Data Catalog API in the project - identified by the ``tag_template.name`` parameter (see [Data Catalog - Resource Project] (/data-catalog/docs/concepts/resource-project) for - more information). - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> # TODO: Initialize `tag_template`: - >>> tag_template = {} - >>> - >>> response = client.update_tag_template(tag_template) - - Args: - tag_template (Union[dict, ~google.cloud.datacatalog_v1beta1.types.TagTemplate]): Required. The template to update. The "name" field must be set. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.TagTemplate` - update_mask (Union[dict, ~google.cloud.datacatalog_v1beta1.types.FieldMask]): The field mask specifies the parts of the template to overwrite. - - Allowed fields: - - - ``display_name`` - - If absent or empty, all of the allowed fields above will be updated. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.TagTemplate` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_tag_template" not in self._inner_api_calls: - self._inner_api_calls[ - "update_tag_template" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_tag_template, - default_retry=self._method_configs["UpdateTagTemplate"].retry, - default_timeout=self._method_configs["UpdateTagTemplate"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.UpdateTagTemplateRequest( - tag_template=tag_template, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("tag_template.name", tag_template.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_tag_template"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_tag_template( - self, - name, - force, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a tag template and all tags using the template. The user should - enable the Data Catalog API in the project identified by the ``name`` - parameter (see [Data Catalog Resource Project] - (/data-catalog/docs/concepts/resource-project) for more information). - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> name = client.tag_template_path('[PROJECT]', '[LOCATION]', '[TAG_TEMPLATE]') - >>> - >>> # TODO: Initialize `force`: - >>> force = False - >>> - >>> client.delete_tag_template(name, force) - - Args: - name (str): Required. The name of the tag template to delete. Example: - - - projects/{project\_id}/locations/{location}/tagTemplates/{tag\_template\_id} - force (bool): Required. Currently, this field must always be set to ``true``. This - confirms the deletion of any possible tags using this template. - ``force = false`` will be supported in the future. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_tag_template" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_tag_template" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_tag_template, - default_retry=self._method_configs["DeleteTagTemplate"].retry, - default_timeout=self._method_configs["DeleteTagTemplate"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.DeleteTagTemplateRequest(name=name, force=force) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_tag_template"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_tag_template_field( - self, - parent, - tag_template_field_id, - tag_template_field, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a field in a tag template. The user should enable the Data - Catalog API in the project identified by the ``parent`` parameter (see - `Data Catalog Resource - Project `__ - for more information). - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> parent = client.tag_template_path('[PROJECT]', '[LOCATION]', '[TAG_TEMPLATE]') - >>> - >>> # TODO: Initialize `tag_template_field_id`: - >>> tag_template_field_id = '' - >>> - >>> # TODO: Initialize `tag_template_field`: - >>> tag_template_field = {} - >>> - >>> response = client.create_tag_template_field(parent, tag_template_field_id, tag_template_field) - - Args: - parent (str): Required. The name of the project this template is in. Example: - - - projects/{project\_id}/locations/{location}/tagTemplates/{tag\_template\_id} - - Note that this TagTemplateField may not actually be stored in the - location in this name. - tag_template_field_id (str): Required. The ID of the tag template field to create. Field ids can - contain letters (both uppercase and lowercase), numbers (0-9), - underscores (\_) and dashes (-). Field IDs must be at least 1 character - long and at most 128 characters long. Field IDs must also be unique - within their template. - tag_template_field (Union[dict, ~google.cloud.datacatalog_v1beta1.types.TagTemplateField]): Required. The tag template field to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.TagTemplateField` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.TagTemplateField` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_tag_template_field" not in self._inner_api_calls: - self._inner_api_calls[ - "create_tag_template_field" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_tag_template_field, - default_retry=self._method_configs["CreateTagTemplateField"].retry, - default_timeout=self._method_configs["CreateTagTemplateField"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.CreateTagTemplateFieldRequest( - parent=parent, - tag_template_field_id=tag_template_field_id, - tag_template_field=tag_template_field, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_tag_template_field"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_tag_template_field( - self, - name, - tag_template_field, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates a field in a tag template. This method cannot be used to update - the field type. The user should enable the Data Catalog API in the - project identified by the ``name`` parameter (see [Data Catalog Resource - Project] (/data-catalog/docs/concepts/resource-project) for more - information). - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> name = client.field_path('[PROJECT]', '[LOCATION]', '[TAG_TEMPLATE]', '[FIELD]') - >>> - >>> # TODO: Initialize `tag_template_field`: - >>> tag_template_field = {} - >>> - >>> response = client.update_tag_template_field(name, tag_template_field) - - Args: - name (str): Required. The name of the tag template field. Example: - - - projects/{project\_id}/locations/{location}/tagTemplates/{tag\_template\_id}/fields/{tag\_template\_field\_id} - tag_template_field (Union[dict, ~google.cloud.datacatalog_v1beta1.types.TagTemplateField]): Required. The template to update. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.TagTemplateField` - update_mask (Union[dict, ~google.cloud.datacatalog_v1beta1.types.FieldMask]): Optional. The field mask specifies the parts of the template to be - updated. Allowed fields: - - - ``display_name`` - - ``type.enum_type`` - - ``is_required`` - - If ``update_mask`` is not set or empty, all of the allowed fields above - will be updated. - - When updating an enum type, the provided values will be merged with the - existing values. Therefore, enum values can only be added, existing enum - values cannot be deleted nor renamed. Updating a template field from - optional to required is NOT allowed. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.TagTemplateField` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_tag_template_field" not in self._inner_api_calls: - self._inner_api_calls[ - "update_tag_template_field" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_tag_template_field, - default_retry=self._method_configs["UpdateTagTemplateField"].retry, - default_timeout=self._method_configs["UpdateTagTemplateField"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.UpdateTagTemplateFieldRequest( - name=name, tag_template_field=tag_template_field, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_tag_template_field"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def rename_tag_template_field( - self, - name, - new_tag_template_field_id, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Renames a field in a tag template. The user should enable the Data - Catalog API in the project identified by the ``name`` parameter (see - `Data Catalog Resource - Project `__ - for more information). - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> name = client.field_path('[PROJECT]', '[LOCATION]', '[TAG_TEMPLATE]', '[FIELD]') - >>> - >>> # TODO: Initialize `new_tag_template_field_id`: - >>> new_tag_template_field_id = '' - >>> - >>> response = client.rename_tag_template_field(name, new_tag_template_field_id) - - Args: - name (str): Required. The name of the tag template. Example: - - - projects/{project\_id}/locations/{location}/tagTemplates/{tag\_template\_id}/fields/{tag\_template\_field\_id} - new_tag_template_field_id (str): Required. The new ID of this tag template field. For example, - ``my_new_field``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.TagTemplateField` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "rename_tag_template_field" not in self._inner_api_calls: - self._inner_api_calls[ - "rename_tag_template_field" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.rename_tag_template_field, - default_retry=self._method_configs["RenameTagTemplateField"].retry, - default_timeout=self._method_configs["RenameTagTemplateField"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.RenameTagTemplateFieldRequest( - name=name, new_tag_template_field_id=new_tag_template_field_id - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["rename_tag_template_field"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_tag_template_field( - self, - name, - force, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a field in a tag template and all uses of that field. The user - should enable the Data Catalog API in the project identified by the - ``name`` parameter (see [Data Catalog Resource Project] - (/data-catalog/docs/concepts/resource-project) for more information). - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> name = client.field_path('[PROJECT]', '[LOCATION]', '[TAG_TEMPLATE]', '[FIELD]') - >>> - >>> # TODO: Initialize `force`: - >>> force = False - >>> - >>> client.delete_tag_template_field(name, force) - - Args: - name (str): Required. The name of the tag template field to delete. Example: - - - projects/{project\_id}/locations/{location}/tagTemplates/{tag\_template\_id}/fields/{tag\_template\_field\_id} - force (bool): Required. Currently, this field must always be set to ``true``. This - confirms the deletion of this field from any tags using this field. - ``force = false`` will be supported in the future. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_tag_template_field" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_tag_template_field" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_tag_template_field, - default_retry=self._method_configs["DeleteTagTemplateField"].retry, - default_timeout=self._method_configs["DeleteTagTemplateField"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.DeleteTagTemplateFieldRequest(name=name, force=force) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_tag_template_field"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_tag( - self, - parent, - tag, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a tag on an ``Entry``. Note: The project identified by the - ``parent`` parameter for the - `tag `__ - and the `tag - template `__ - used to create the tag must be from the same organization. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> parent = client.entry_path('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]') - >>> - >>> # TODO: Initialize `tag`: - >>> tag = {} - >>> - >>> response = client.create_tag(parent, tag) - - Args: - parent (str): Required. The name of the resource to attach this tag to. Tags can be - attached to Entries. Example: - - - projects/{project\_id}/locations/{location}/entryGroups/{entry\_group\_id}/entries/{entry\_id} - - Note that this Tag and its child resources may not actually be stored in - the location in this name. - tag (Union[dict, ~google.cloud.datacatalog_v1beta1.types.Tag]): Required. The tag to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.Tag` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.Tag` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_tag" not in self._inner_api_calls: - self._inner_api_calls[ - "create_tag" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_tag, - default_retry=self._method_configs["CreateTag"].retry, - default_timeout=self._method_configs["CreateTag"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.CreateTagRequest(parent=parent, tag=tag) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_tag"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_tag( - self, - tag, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates an existing tag. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> # TODO: Initialize `tag`: - >>> tag = {} - >>> - >>> response = client.update_tag(tag) - - Args: - tag (Union[dict, ~google.cloud.datacatalog_v1beta1.types.Tag]): Required. The updated tag. The "name" field must be set. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.Tag` - update_mask (Union[dict, ~google.cloud.datacatalog_v1beta1.types.FieldMask]): The fields to update on the Tag. If absent or empty, all modifiable - fields are updated. Currently the only modifiable field is the field - ``fields``. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.Tag` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_tag" not in self._inner_api_calls: - self._inner_api_calls[ - "update_tag" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_tag, - default_retry=self._method_configs["UpdateTag"].retry, - default_timeout=self._method_configs["UpdateTag"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.UpdateTagRequest(tag=tag, update_mask=update_mask) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("tag.name", tag.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_tag"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_tag( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a tag. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> name = client.tag_path('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]', '[TAG]') - >>> - >>> client.delete_tag(name) - - Args: - name (str): Required. The name of the tag to delete. Example: - - - projects/{project\_id}/locations/{location}/entryGroups/{entry\_group\_id}/entries/{entry\_id}/tags/{tag\_id} - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_tag" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_tag" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_tag, - default_retry=self._method_configs["DeleteTag"].retry, - default_timeout=self._method_configs["DeleteTag"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.DeleteTagRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_tag"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_tags( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists the tags on an ``Entry``. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> parent = client.entry_path('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]') - >>> - >>> # Iterate over all results - >>> for element in client.list_tags(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_tags(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The name of the Data Catalog resource to list the tags of. The - resource could be an ``Entry``. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.datacatalog_v1beta1.types.Tag` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_tags" not in self._inner_api_calls: - self._inner_api_calls[ - "list_tags" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_tags, - default_retry=self._method_configs["ListTags"].retry, - default_timeout=self._method_configs["ListTags"].timeout, - client_info=self._client_info, - ) - - request = datacatalog_pb2.ListTagsRequest(parent=parent, page_size=page_size) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_tags"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="tags", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def set_iam_policy( - self, - resource, - policy, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the access control policy for a resource. Replaces any existing - policy. Supported resources are: - - - Tag templates. - - Entries. - - Entry groups. Note, this method cannot be used to manage policies for - BigQuery, Cloud Pub/Sub and any external Google Cloud Platform - resources synced to Cloud Data Catalog. - - Callers must have following Google IAM permission - - - ``datacatalog.tagTemplates.setIamPolicy`` to set policies on tag - templates. - - ``datacatalog.entries.setIamPolicy`` to set policies on entries. - - ``datacatalog.entryGroups.setIamPolicy`` to set policies on entry - groups. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> resource = client.tag_template_path('[PROJECT]', '[LOCATION]', '[TAG_TEMPLATE]') - >>> - >>> # TODO: Initialize `policy`: - >>> policy = {} - >>> - >>> response = client.set_iam_policy(resource, policy) - - Args: - resource (str): REQUIRED: The resource for which the policy is being specified. - See the operation documentation for the appropriate value for this field. - policy (Union[dict, ~google.cloud.datacatalog_v1beta1.types.Policy]): REQUIRED: The complete policy to be applied to the ``resource``. The - size of the policy is limited to a few 10s of KB. An empty policy is a - valid policy but certain Cloud Platform services (such as Projects) - might reject them. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.Policy` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.Policy` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_iam_policy" not in self._inner_api_calls: - self._inner_api_calls[ - "set_iam_policy" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_iam_policy, - default_retry=self._method_configs["SetIamPolicy"].retry, - default_timeout=self._method_configs["SetIamPolicy"].timeout, - client_info=self._client_info, - ) - - request = iam_policy_pb2.SetIamPolicyRequest(resource=resource, policy=policy) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("resource", resource)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_iam_policy"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_iam_policy( - self, - resource, - options_=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets the access control policy for a resource. A ``NOT_FOUND`` error is - returned if the resource does not exist. An empty policy is returned if - the resource exists but does not have a policy set on it. - - Supported resources are: - - - Tag templates. - - Entries. - - Entry groups. Note, this method cannot be used to manage policies for - BigQuery, Cloud Pub/Sub and any external Google Cloud Platform - resources synced to Cloud Data Catalog. - - Callers must have following Google IAM permission - - - ``datacatalog.tagTemplates.getIamPolicy`` to get policies on tag - templates. - - ``datacatalog.entries.getIamPolicy`` to get policies on entries. - - ``datacatalog.entryGroups.getIamPolicy`` to get policies on entry - groups. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> resource = client.tag_template_path('[PROJECT]', '[LOCATION]', '[TAG_TEMPLATE]') - >>> - >>> response = client.get_iam_policy(resource) - - Args: - resource (str): REQUIRED: The resource for which the policy is being requested. - See the operation documentation for the appropriate value for this field. - options_ (Union[dict, ~google.cloud.datacatalog_v1beta1.types.GetPolicyOptions]): OPTIONAL: A ``GetPolicyOptions`` object for specifying options to - ``GetIamPolicy``. This field is only used by Cloud IAM. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.GetPolicyOptions` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.Policy` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_iam_policy" not in self._inner_api_calls: - self._inner_api_calls[ - "get_iam_policy" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_iam_policy, - default_retry=self._method_configs["GetIamPolicy"].retry, - default_timeout=self._method_configs["GetIamPolicy"].timeout, - client_info=self._client_info, - ) - - request = iam_policy_pb2.GetIamPolicyRequest( - resource=resource, options=options_ - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("resource", resource)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_iam_policy"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def test_iam_permissions( - self, - resource, - permissions, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Returns the caller's permissions on a resource. If the resource does not - exist, an empty set of permissions is returned (We don't return a - ``NOT_FOUND`` error). - - Supported resources are: - - - Tag templates. - - Entries. - - Entry groups. Note, this method cannot be used to manage policies for - BigQuery, Cloud Pub/Sub and any external Google Cloud Platform - resources synced to Cloud Data Catalog. - - A caller is not required to have Google IAM permission to make this - request. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.DataCatalogClient() - >>> - >>> resource = client.tag_template_path('[PROJECT]', '[LOCATION]', '[TAG_TEMPLATE]') - >>> - >>> # TODO: Initialize `permissions`: - >>> permissions = [] - >>> - >>> response = client.test_iam_permissions(resource, permissions) - - Args: - resource (str): REQUIRED: The resource for which the policy detail is being requested. - See the operation documentation for the appropriate value for this field. - permissions (list[str]): The set of permissions to check for the ``resource``. Permissions with - wildcards (such as '*' or 'storage.*') are not allowed. For more - information see `IAM - Overview `__. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.TestIamPermissionsResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "test_iam_permissions" not in self._inner_api_calls: - self._inner_api_calls[ - "test_iam_permissions" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.test_iam_permissions, - default_retry=self._method_configs["TestIamPermissions"].retry, - default_timeout=self._method_configs["TestIamPermissions"].timeout, - client_info=self._client_info, - ) - - request = iam_policy_pb2.TestIamPermissionsRequest( - resource=resource, permissions=permissions - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("resource", resource)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["test_iam_permissions"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/data_catalog_client_config.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/data_catalog_client_config.py deleted file mode 100644 index 065f9970864c..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/data_catalog_client_config.py +++ /dev/null @@ -1,143 +0,0 @@ -config = { - "interfaces": { - "google.cloud.datacatalog.v1beta1.DataCatalog": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "SearchCatalog": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "CreateEntryGroup": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetEntryGroup": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteEntryGroup": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateEntry": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateEntry": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteEntry": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetEntry": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "LookupEntry": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateTagTemplate": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetTagTemplate": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateTagTemplate": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteTagTemplate": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateTagTemplateField": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateTagTemplateField": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "RenameTagTemplateField": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteTagTemplateField": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateTag": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateTag": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteTag": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListTags": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/enums.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/enums.py deleted file mode 100644 index 83ca9d81e2c2..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/enums.py +++ /dev/null @@ -1,106 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class EntryType(enum.IntEnum): - """ - Entry resources in Data Catalog can be of different types e.g. a - BigQuery Table entry is of type ``TABLE``. This enum describes all the - possible types Data Catalog contains. - - Attributes: - ENTRY_TYPE_UNSPECIFIED (int): Default unknown type - TABLE (int): Output only. The type of entry that has a GoogleSQL schema, including - logical views. - DATA_STREAM (int): Output only. An entry type which is used for streaming entries. Example: - Cloud Pub/Sub topic. - FILESET (int): Alpha feature. An entry type which is a set of files or objects. Example: - Cloud Storage fileset. - """ - - ENTRY_TYPE_UNSPECIFIED = 0 - TABLE = 2 - DATA_STREAM = 3 - FILESET = 4 - - -class SearchResultType(enum.IntEnum): - """ - The different types of resources that can be returned in search. - - Attributes: - SEARCH_RESULT_TYPE_UNSPECIFIED (int): Default unknown type. - ENTRY (int): An ``Entry``. - TAG_TEMPLATE (int): A ``TagTemplate``. - ENTRY_GROUP (int): An ``EntryGroup``. - """ - - SEARCH_RESULT_TYPE_UNSPECIFIED = 0 - ENTRY = 1 - TAG_TEMPLATE = 2 - ENTRY_GROUP = 3 - - -class TableSourceType(enum.IntEnum): - """ - Table source type. - - Attributes: - TABLE_SOURCE_TYPE_UNSPECIFIED (int): Default unknown type. - BIGQUERY_VIEW (int): Table view. - BIGQUERY_TABLE (int): BigQuery native table. - """ - - TABLE_SOURCE_TYPE_UNSPECIFIED = 0 - BIGQUERY_VIEW = 2 - BIGQUERY_TABLE = 5 - - -class FieldType(object): - class PrimitiveType(enum.IntEnum): - """ - Attributes: - PRIMITIVE_TYPE_UNSPECIFIED (int): This is the default invalid value for a type. - DOUBLE (int): A double precision number. - STRING (int): An UTF-8 string. - BOOL (int): A boolean value. - TIMESTAMP (int): A timestamp. - """ - - PRIMITIVE_TYPE_UNSPECIFIED = 0 - DOUBLE = 1 - STRING = 2 - BOOL = 3 - TIMESTAMP = 4 - - -class Taxonomy(object): - class PolicyType(enum.IntEnum): - """ - Defines policy types where policy tag can be used for. - - Attributes: - POLICY_TYPE_UNSPECIFIED (int): Unspecified policy type. - FINE_GRAINED_ACCESS_CONTROL (int): Fine grained access control policy, which enables access control on - tagged resources. - """ - - POLICY_TYPE_UNSPECIFIED = 0 - FINE_GRAINED_ACCESS_CONTROL = 1 diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_client.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_client.py deleted file mode 100644 index 619fdbac788d..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_client.py +++ /dev/null @@ -1,1154 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.cloud.datacatalog.v1beta1 PolicyTagManager API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import grpc - -from google.cloud.datacatalog_v1beta1.gapic import enums -from google.cloud.datacatalog_v1beta1.gapic import policy_tag_manager_client_config -from google.cloud.datacatalog_v1beta1.gapic.transports import ( - policy_tag_manager_grpc_transport, -) -from google.cloud.datacatalog_v1beta1.proto import datacatalog_pb2 -from google.cloud.datacatalog_v1beta1.proto import datacatalog_pb2_grpc -from google.cloud.datacatalog_v1beta1.proto import policytagmanager_pb2 -from google.cloud.datacatalog_v1beta1.proto import policytagmanager_pb2_grpc -from google.cloud.datacatalog_v1beta1.proto import tags_pb2 -from google.iam.v1 import iam_policy_pb2 -from google.iam.v1 import options_pb2 -from google.iam.v1 import policy_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-datacatalog" -).version - - -class PolicyTagManagerClient(object): - """ - The policy tag manager API service allows clients to manage their taxonomies - and policy tags. - """ - - SERVICE_ADDRESS = "datacatalog.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.datacatalog.v1beta1.PolicyTagManager" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - PolicyTagManagerClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.PolicyTagManagerGrpcTransport, - Callable[[~.Credentials, type], ~.PolicyTagManagerGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = policy_tag_manager_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=policy_tag_manager_grpc_transport.PolicyTagManagerGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = policy_tag_manager_grpc_transport.PolicyTagManagerGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def create_taxonomy( - self, - parent=None, - taxonomy=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a taxonomy in the specified project. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.PolicyTagManagerClient() - >>> - >>> response = client.create_taxonomy() - - Args: - parent (str): Required. Resource name of the project that the taxonomy will belong to. - taxonomy (Union[dict, ~google.cloud.datacatalog_v1beta1.types.Taxonomy]): The taxonomy to be created. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.Taxonomy` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.Taxonomy` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_taxonomy" not in self._inner_api_calls: - self._inner_api_calls[ - "create_taxonomy" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_taxonomy, - default_retry=self._method_configs["CreateTaxonomy"].retry, - default_timeout=self._method_configs["CreateTaxonomy"].timeout, - client_info=self._client_info, - ) - - request = policytagmanager_pb2.CreateTaxonomyRequest( - parent=parent, taxonomy=taxonomy - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_taxonomy"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_taxonomy( - self, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a taxonomy. This operation will also delete all - policy tags in this taxonomy along with their associated policies. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.PolicyTagManagerClient() - >>> - >>> client.delete_taxonomy() - - Args: - name (str): Required. Resource name of the taxonomy to be deleted. All policy tags in - this taxonomy will also be deleted. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_taxonomy" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_taxonomy" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_taxonomy, - default_retry=self._method_configs["DeleteTaxonomy"].retry, - default_timeout=self._method_configs["DeleteTaxonomy"].timeout, - client_info=self._client_info, - ) - - request = policytagmanager_pb2.DeleteTaxonomyRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_taxonomy"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_taxonomy( - self, - taxonomy=None, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates a taxonomy. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.PolicyTagManagerClient() - >>> - >>> response = client.update_taxonomy() - - Args: - taxonomy (Union[dict, ~google.cloud.datacatalog_v1beta1.types.Taxonomy]): The taxonomy to update. Only description, display\_name, and activated - policy types can be updated. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.Taxonomy` - update_mask (Union[dict, ~google.cloud.datacatalog_v1beta1.types.FieldMask]): The update mask applies to the resource. For the ``FieldMask`` - definition, see - https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - If not set, defaults to all of the fields that are allowed to update. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.Taxonomy` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_taxonomy" not in self._inner_api_calls: - self._inner_api_calls[ - "update_taxonomy" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_taxonomy, - default_retry=self._method_configs["UpdateTaxonomy"].retry, - default_timeout=self._method_configs["UpdateTaxonomy"].timeout, - client_info=self._client_info, - ) - - request = policytagmanager_pb2.UpdateTaxonomyRequest( - taxonomy=taxonomy, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("taxonomy.name", taxonomy.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_taxonomy"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_taxonomies( - self, - parent=None, - page_size=None, - page_token=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists all taxonomies in a project in a particular location that the caller - has permission to view. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.PolicyTagManagerClient() - >>> - >>> response = client.list_taxonomies() - - Args: - parent (str): Required. Resource name of the project to list the taxonomies of. - page_size (int): The maximum number of items to return. Must be a value between 1 and 1000. - If not set, defaults to 50. - page_token (str): The next\_page\_token value returned from a previous list request, if - any. If not set, defaults to an empty string. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.ListTaxonomiesResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_taxonomies" not in self._inner_api_calls: - self._inner_api_calls[ - "list_taxonomies" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_taxonomies, - default_retry=self._method_configs["ListTaxonomies"].retry, - default_timeout=self._method_configs["ListTaxonomies"].timeout, - client_info=self._client_info, - ) - - request = policytagmanager_pb2.ListTaxonomiesRequest( - parent=parent, page_size=page_size, page_token=page_token - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["list_taxonomies"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_taxonomy( - self, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a taxonomy. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.PolicyTagManagerClient() - >>> - >>> response = client.get_taxonomy() - - Args: - name (str): Required. Resource name of the requested taxonomy. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.Taxonomy` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_taxonomy" not in self._inner_api_calls: - self._inner_api_calls[ - "get_taxonomy" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_taxonomy, - default_retry=self._method_configs["GetTaxonomy"].retry, - default_timeout=self._method_configs["GetTaxonomy"].timeout, - client_info=self._client_info, - ) - - request = policytagmanager_pb2.GetTaxonomyRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_taxonomy"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_policy_tag( - self, - parent=None, - policy_tag=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a policy tag in the specified taxonomy. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.PolicyTagManagerClient() - >>> - >>> response = client.create_policy_tag() - - Args: - parent (str): Required. Resource name of the taxonomy that the policy tag will belong to. - policy_tag (Union[dict, ~google.cloud.datacatalog_v1beta1.types.PolicyTag]): The policy tag to be created. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.PolicyTag` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.PolicyTag` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_policy_tag" not in self._inner_api_calls: - self._inner_api_calls[ - "create_policy_tag" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_policy_tag, - default_retry=self._method_configs["CreatePolicyTag"].retry, - default_timeout=self._method_configs["CreatePolicyTag"].timeout, - client_info=self._client_info, - ) - - request = policytagmanager_pb2.CreatePolicyTagRequest( - parent=parent, policy_tag=policy_tag - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_policy_tag"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_policy_tag( - self, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a policy tag. Also deletes all of its descendant policy tags. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.PolicyTagManagerClient() - >>> - >>> client.delete_policy_tag() - - Args: - name (str): Required. Resource name of the policy tag to be deleted. All of its descendant - policy tags will also be deleted. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_policy_tag" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_policy_tag" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_policy_tag, - default_retry=self._method_configs["DeletePolicyTag"].retry, - default_timeout=self._method_configs["DeletePolicyTag"].timeout, - client_info=self._client_info, - ) - - request = policytagmanager_pb2.DeletePolicyTagRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_policy_tag"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_policy_tag( - self, - policy_tag=None, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates a policy tag. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.PolicyTagManagerClient() - >>> - >>> response = client.update_policy_tag() - - Args: - policy_tag (Union[dict, ~google.cloud.datacatalog_v1beta1.types.PolicyTag]): The policy tag to update. Only the description, display\_name, and - parent\_policy\_tag fields can be updated. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.PolicyTag` - update_mask (Union[dict, ~google.cloud.datacatalog_v1beta1.types.FieldMask]): The update mask applies to the resource. Only display\_name, description - and parent\_policy\_tag can be updated and thus can be listed in the - mask. If update\_mask is not provided, all allowed fields (i.e. - display\_name, description and parent) will be updated. For more - information including the ``FieldMask`` definition, see - https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - If not set, defaults to all of the fields that are allowed to update. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.PolicyTag` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_policy_tag" not in self._inner_api_calls: - self._inner_api_calls[ - "update_policy_tag" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_policy_tag, - default_retry=self._method_configs["UpdatePolicyTag"].retry, - default_timeout=self._method_configs["UpdatePolicyTag"].timeout, - client_info=self._client_info, - ) - - request = policytagmanager_pb2.UpdatePolicyTagRequest( - policy_tag=policy_tag, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("policy_tag.name", policy_tag.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_policy_tag"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_policy_tags( - self, - parent=None, - page_size=None, - page_token=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists all policy tags in a taxonomy. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.PolicyTagManagerClient() - >>> - >>> response = client.list_policy_tags() - - Args: - parent (str): Required. Resource name of the taxonomy to list the policy tags of. - page_size (int): The maximum number of items to return. Must be a value between 1 and 1000. - If not set, defaults to 50. - page_token (str): The next\_page\_token value returned from a previous List request, if - any. If not set, defaults to an empty string. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.ListPolicyTagsResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_policy_tags" not in self._inner_api_calls: - self._inner_api_calls[ - "list_policy_tags" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_policy_tags, - default_retry=self._method_configs["ListPolicyTags"].retry, - default_timeout=self._method_configs["ListPolicyTags"].timeout, - client_info=self._client_info, - ) - - request = policytagmanager_pb2.ListPolicyTagsRequest( - parent=parent, page_size=page_size, page_token=page_token - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["list_policy_tags"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_policy_tag( - self, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a policy tag. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.PolicyTagManagerClient() - >>> - >>> response = client.get_policy_tag() - - Args: - name (str): Required. Resource name of the requested policy tag. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.PolicyTag` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_policy_tag" not in self._inner_api_calls: - self._inner_api_calls[ - "get_policy_tag" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_policy_tag, - default_retry=self._method_configs["GetPolicyTag"].retry, - default_timeout=self._method_configs["GetPolicyTag"].timeout, - client_info=self._client_info, - ) - - request = policytagmanager_pb2.GetPolicyTagRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_policy_tag"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_iam_policy( - self, - resource=None, - options_=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets the IAM policy for a taxonomy or a policy tag. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.PolicyTagManagerClient() - >>> - >>> response = client.get_iam_policy() - - Args: - resource (str): REQUIRED: The resource for which the policy is being requested. - See the operation documentation for the appropriate value for this field. - options_ (Union[dict, ~google.cloud.datacatalog_v1beta1.types.GetPolicyOptions]): OPTIONAL: A ``GetPolicyOptions`` object for specifying options to - ``GetIamPolicy``. This field is only used by Cloud IAM. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.GetPolicyOptions` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.Policy` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_iam_policy" not in self._inner_api_calls: - self._inner_api_calls[ - "get_iam_policy" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_iam_policy, - default_retry=self._method_configs["GetIamPolicy"].retry, - default_timeout=self._method_configs["GetIamPolicy"].timeout, - client_info=self._client_info, - ) - - request = iam_policy_pb2.GetIamPolicyRequest( - resource=resource, options=options_ - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("resource", resource)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_iam_policy"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_iam_policy( - self, - resource=None, - policy=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the IAM policy for a taxonomy or a policy tag. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.PolicyTagManagerClient() - >>> - >>> response = client.set_iam_policy() - - Args: - resource (str): REQUIRED: The resource for which the policy is being specified. - See the operation documentation for the appropriate value for this field. - policy (Union[dict, ~google.cloud.datacatalog_v1beta1.types.Policy]): REQUIRED: The complete policy to be applied to the ``resource``. The - size of the policy is limited to a few 10s of KB. An empty policy is a - valid policy but certain Cloud Platform services (such as Projects) - might reject them. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.Policy` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.Policy` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_iam_policy" not in self._inner_api_calls: - self._inner_api_calls[ - "set_iam_policy" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_iam_policy, - default_retry=self._method_configs["SetIamPolicy"].retry, - default_timeout=self._method_configs["SetIamPolicy"].timeout, - client_info=self._client_info, - ) - - request = iam_policy_pb2.SetIamPolicyRequest(resource=resource, policy=policy) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("resource", resource)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_iam_policy"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def test_iam_permissions( - self, - resource=None, - permissions=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Returns the permissions that a caller has on the specified taxonomy or - policy tag. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.PolicyTagManagerClient() - >>> - >>> response = client.test_iam_permissions() - - Args: - resource (str): REQUIRED: The resource for which the policy detail is being requested. - See the operation documentation for the appropriate value for this field. - permissions (list[str]): The set of permissions to check for the ``resource``. Permissions with - wildcards (such as '*' or 'storage.*') are not allowed. For more - information see `IAM - Overview `__. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.TestIamPermissionsResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "test_iam_permissions" not in self._inner_api_calls: - self._inner_api_calls[ - "test_iam_permissions" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.test_iam_permissions, - default_retry=self._method_configs["TestIamPermissions"].retry, - default_timeout=self._method_configs["TestIamPermissions"].timeout, - client_info=self._client_info, - ) - - request = iam_policy_pb2.TestIamPermissionsRequest( - resource=resource, permissions=permissions - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("resource", resource)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["test_iam_permissions"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_client_config.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_client_config.py deleted file mode 100644 index 568750580247..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_client_config.py +++ /dev/null @@ -1,88 +0,0 @@ -config = { - "interfaces": { - "google.cloud.datacatalog.v1beta1.PolicyTagManager": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "CreateTaxonomy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteTaxonomy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateTaxonomy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListTaxonomies": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetTaxonomy": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreatePolicyTag": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeletePolicyTag": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdatePolicyTag": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListPolicyTags": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetPolicyTag": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_serialization_client.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_serialization_client.py deleted file mode 100644 index 2ff3a4c383a0..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_serialization_client.py +++ /dev/null @@ -1,372 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.cloud.datacatalog.v1beta1 PolicyTagManagerSerialization API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.protobuf_helpers -import grpc - -from google.cloud.datacatalog_v1beta1.gapic import enums -from google.cloud.datacatalog_v1beta1.gapic import ( - policy_tag_manager_serialization_client_config, -) -from google.cloud.datacatalog_v1beta1.gapic.transports import ( - policy_tag_manager_serialization_grpc_transport, -) -from google.cloud.datacatalog_v1beta1.proto import datacatalog_pb2 -from google.cloud.datacatalog_v1beta1.proto import datacatalog_pb2_grpc -from google.cloud.datacatalog_v1beta1.proto import policytagmanager_pb2 -from google.cloud.datacatalog_v1beta1.proto import policytagmanager_pb2_grpc -from google.cloud.datacatalog_v1beta1.proto import policytagmanagerserialization_pb2 -from google.cloud.datacatalog_v1beta1.proto import ( - policytagmanagerserialization_pb2_grpc, -) -from google.cloud.datacatalog_v1beta1.proto import tags_pb2 -from google.iam.v1 import iam_policy_pb2 -from google.iam.v1 import options_pb2 -from google.iam.v1 import policy_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-datacatalog" -).version - - -class PolicyTagManagerSerializationClient(object): - """ - Policy tag manager serialization API service allows clients to manipulate - their taxonomies and policy tags data with serialized format. - """ - - SERVICE_ADDRESS = "datacatalog.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - PolicyTagManagerSerializationClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.PolicyTagManagerSerializationGrpcTransport, - Callable[[~.Credentials, type], ~.PolicyTagManagerSerializationGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = policy_tag_manager_serialization_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=policy_tag_manager_serialization_grpc_transport.PolicyTagManagerSerializationGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = policy_tag_manager_serialization_grpc_transport.PolicyTagManagerSerializationGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def import_taxonomies( - self, - parent=None, - inline_source=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Imports all taxonomies and their policy tags to a project as new - taxonomies. - - This method provides a bulk taxonomy / policy tag creation using nested - proto structure. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.PolicyTagManagerSerializationClient() - >>> - >>> response = client.import_taxonomies() - - Args: - parent (str): Required. Resource name of project that the newly created taxonomies will - belong to. - inline_source (Union[dict, ~google.cloud.datacatalog_v1beta1.types.InlineSource]): Inline source used for taxonomies import - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datacatalog_v1beta1.types.InlineSource` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.ImportTaxonomiesResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "import_taxonomies" not in self._inner_api_calls: - self._inner_api_calls[ - "import_taxonomies" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.import_taxonomies, - default_retry=self._method_configs["ImportTaxonomies"].retry, - default_timeout=self._method_configs["ImportTaxonomies"].timeout, - client_info=self._client_info, - ) - - # Sanity check: We have some fields which are mutually exclusive; - # raise ValueError if more than one is sent. - google.api_core.protobuf_helpers.check_oneof(inline_source=inline_source) - - request = policytagmanagerserialization_pb2.ImportTaxonomiesRequest( - parent=parent, inline_source=inline_source - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["import_taxonomies"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def export_taxonomies( - self, - parent=None, - taxonomies=None, - serialized_taxonomies=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Exports all taxonomies and their policy tags in a project. - - This method generates SerializedTaxonomy protos with nested policy tags - that can be used as an input for future ImportTaxonomies calls. - - Example: - >>> from google.cloud import datacatalog_v1beta1 - >>> - >>> client = datacatalog_v1beta1.PolicyTagManagerSerializationClient() - >>> - >>> response = client.export_taxonomies() - - Args: - parent (str): Required. Resource name of the project that taxonomies to be exported - will share. - taxonomies (list[str]): Required. Resource names of the taxonomies to be exported. - serialized_taxonomies (bool): Export taxonomies as serialized taxonomies. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datacatalog_v1beta1.types.ExportTaxonomiesResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "export_taxonomies" not in self._inner_api_calls: - self._inner_api_calls[ - "export_taxonomies" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.export_taxonomies, - default_retry=self._method_configs["ExportTaxonomies"].retry, - default_timeout=self._method_configs["ExportTaxonomies"].timeout, - client_info=self._client_info, - ) - - # Sanity check: We have some fields which are mutually exclusive; - # raise ValueError if more than one is sent. - google.api_core.protobuf_helpers.check_oneof( - serialized_taxonomies=serialized_taxonomies - ) - - request = policytagmanagerserialization_pb2.ExportTaxonomiesRequest( - parent=parent, - taxonomies=taxonomies, - serialized_taxonomies=serialized_taxonomies, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["export_taxonomies"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_serialization_client_config.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_serialization_client_config.py deleted file mode 100644 index 98ba9b0bca34..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_serialization_client_config.py +++ /dev/null @@ -1,33 +0,0 @@ -config = { - "interfaces": { - "google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "ImportTaxonomies": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ExportTaxonomies": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/__init__.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/data_catalog_grpc_transport.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/data_catalog_grpc_transport.py deleted file mode 100644 index ad5c46fa8661..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/data_catalog_grpc_transport.py +++ /dev/null @@ -1,535 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers - -from google.cloud.datacatalog_v1beta1.proto import datacatalog_pb2_grpc - - -class DataCatalogGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.datacatalog.v1beta1 DataCatalog API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="datacatalog.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "data_catalog_stub": datacatalog_pb2_grpc.DataCatalogStub(channel) - } - - @classmethod - def create_channel( - cls, address="datacatalog.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def search_catalog(self): - """Return the gRPC stub for :meth:`DataCatalogClient.search_catalog`. - - Searches Data Catalog for multiple resources like entries, tags that - match a query. - - This is a custom method - (https://cloud.google.com/apis/design/custom\_methods) and does not - return the complete resource, only the resource identifier and high - level fields. Clients can subsequentally call ``Get`` methods. - - Note that searches do not have full recall. There may be results that - match your query but are not returned, even in subsequent pages of - results. These missing results may vary across repeated calls to search. - Do not rely on this method if you need to guarantee full recall. - - See `Data Catalog Search - Syntax `__ - for more information. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].SearchCatalog - - @property - def create_entry_group(self): - """Return the gRPC stub for :meth:`DataCatalogClient.create_entry_group`. - - Alpha feature. Creates an EntryGroup. The user should enable the Data - Catalog API in the project identified by the ``parent`` parameter (see - [Data Catalog Resource Project] - (/data-catalog/docs/concepts/resource-project) for more information). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].CreateEntryGroup - - @property - def get_entry_group(self): - """Return the gRPC stub for :meth:`DataCatalogClient.get_entry_group`. - - Alpha feature. - Gets an EntryGroup. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].GetEntryGroup - - @property - def delete_entry_group(self): - """Return the gRPC stub for :meth:`DataCatalogClient.delete_entry_group`. - - Alpha feature. Deletes an EntryGroup. Only entry groups that do not - contain entries can be deleted. The user should enable the Data Catalog - API in the project identified by the ``name`` parameter (see [Data - Catalog Resource Project] (/data-catalog/docs/concepts/resource-project) - for more information). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].DeleteEntryGroup - - @property - def create_entry(self): - """Return the gRPC stub for :meth:`DataCatalogClient.create_entry`. - - Alpha feature. Creates an entry. Currently only entries of 'FILESET' - type can be created. The user should enable the Data Catalog API in the - project identified by the ``parent`` parameter (see [Data Catalog - Resource Project] (/data-catalog/docs/concepts/resource-project) for - more information). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].CreateEntry - - @property - def update_entry(self): - """Return the gRPC stub for :meth:`DataCatalogClient.update_entry`. - - Updates an existing entry. The user should enable the Data Catalog API - in the project identified by the ``entry.name`` parameter (see [Data - Catalog Resource Project] (/data-catalog/docs/concepts/resource-project) - for more information). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].UpdateEntry - - @property - def delete_entry(self): - """Return the gRPC stub for :meth:`DataCatalogClient.delete_entry`. - - Alpha feature. Deletes an existing entry. Only entries created through - ``CreateEntry`` method can be deleted. The user should enable the Data - Catalog API in the project identified by the ``name`` parameter (see - [Data Catalog Resource Project] - (/data-catalog/docs/concepts/resource-project) for more information). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].DeleteEntry - - @property - def get_entry(self): - """Return the gRPC stub for :meth:`DataCatalogClient.get_entry`. - - Gets an entry. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].GetEntry - - @property - def lookup_entry(self): - """Return the gRPC stub for :meth:`DataCatalogClient.lookup_entry`. - - Get an entry by target resource name. This method allows clients to use - the resource name from the source Google Cloud Platform service to get the - Data Catalog Entry. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].LookupEntry - - @property - def create_tag_template(self): - """Return the gRPC stub for :meth:`DataCatalogClient.create_tag_template`. - - Creates a tag template. The user should enable the Data Catalog API in - the project identified by the ``parent`` parameter (see `Data Catalog - Resource - Project `__ - for more information). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].CreateTagTemplate - - @property - def get_tag_template(self): - """Return the gRPC stub for :meth:`DataCatalogClient.get_tag_template`. - - Gets a tag template. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].GetTagTemplate - - @property - def update_tag_template(self): - """Return the gRPC stub for :meth:`DataCatalogClient.update_tag_template`. - - Updates a tag template. This method cannot be used to update the fields - of a template. The tag template fields are represented as separate - resources and should be updated using their own create/update/delete - methods. The user should enable the Data Catalog API in the project - identified by the ``tag_template.name`` parameter (see [Data Catalog - Resource Project] (/data-catalog/docs/concepts/resource-project) for - more information). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].UpdateTagTemplate - - @property - def delete_tag_template(self): - """Return the gRPC stub for :meth:`DataCatalogClient.delete_tag_template`. - - Deletes a tag template and all tags using the template. The user should - enable the Data Catalog API in the project identified by the ``name`` - parameter (see [Data Catalog Resource Project] - (/data-catalog/docs/concepts/resource-project) for more information). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].DeleteTagTemplate - - @property - def create_tag_template_field(self): - """Return the gRPC stub for :meth:`DataCatalogClient.create_tag_template_field`. - - Creates a field in a tag template. The user should enable the Data - Catalog API in the project identified by the ``parent`` parameter (see - `Data Catalog Resource - Project `__ - for more information). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].CreateTagTemplateField - - @property - def update_tag_template_field(self): - """Return the gRPC stub for :meth:`DataCatalogClient.update_tag_template_field`. - - Updates a field in a tag template. This method cannot be used to update - the field type. The user should enable the Data Catalog API in the - project identified by the ``name`` parameter (see [Data Catalog Resource - Project] (/data-catalog/docs/concepts/resource-project) for more - information). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].UpdateTagTemplateField - - @property - def rename_tag_template_field(self): - """Return the gRPC stub for :meth:`DataCatalogClient.rename_tag_template_field`. - - Renames a field in a tag template. The user should enable the Data - Catalog API in the project identified by the ``name`` parameter (see - `Data Catalog Resource - Project `__ - for more information). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].RenameTagTemplateField - - @property - def delete_tag_template_field(self): - """Return the gRPC stub for :meth:`DataCatalogClient.delete_tag_template_field`. - - Deletes a field in a tag template and all uses of that field. The user - should enable the Data Catalog API in the project identified by the - ``name`` parameter (see [Data Catalog Resource Project] - (/data-catalog/docs/concepts/resource-project) for more information). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].DeleteTagTemplateField - - @property - def create_tag(self): - """Return the gRPC stub for :meth:`DataCatalogClient.create_tag`. - - Creates a tag on an ``Entry``. Note: The project identified by the - ``parent`` parameter for the - `tag `__ - and the `tag - template `__ - used to create the tag must be from the same organization. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].CreateTag - - @property - def update_tag(self): - """Return the gRPC stub for :meth:`DataCatalogClient.update_tag`. - - Updates an existing tag. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].UpdateTag - - @property - def delete_tag(self): - """Return the gRPC stub for :meth:`DataCatalogClient.delete_tag`. - - Deletes a tag. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].DeleteTag - - @property - def list_tags(self): - """Return the gRPC stub for :meth:`DataCatalogClient.list_tags`. - - Lists the tags on an ``Entry``. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].ListTags - - @property - def set_iam_policy(self): - """Return the gRPC stub for :meth:`DataCatalogClient.set_iam_policy`. - - Sets the access control policy for a resource. Replaces any existing - policy. Supported resources are: - - - Tag templates. - - Entries. - - Entry groups. Note, this method cannot be used to manage policies for - BigQuery, Cloud Pub/Sub and any external Google Cloud Platform - resources synced to Cloud Data Catalog. - - Callers must have following Google IAM permission - - - ``datacatalog.tagTemplates.setIamPolicy`` to set policies on tag - templates. - - ``datacatalog.entries.setIamPolicy`` to set policies on entries. - - ``datacatalog.entryGroups.setIamPolicy`` to set policies on entry - groups. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].SetIamPolicy - - @property - def get_iam_policy(self): - """Return the gRPC stub for :meth:`DataCatalogClient.get_iam_policy`. - - Gets the access control policy for a resource. A ``NOT_FOUND`` error is - returned if the resource does not exist. An empty policy is returned if - the resource exists but does not have a policy set on it. - - Supported resources are: - - - Tag templates. - - Entries. - - Entry groups. Note, this method cannot be used to manage policies for - BigQuery, Cloud Pub/Sub and any external Google Cloud Platform - resources synced to Cloud Data Catalog. - - Callers must have following Google IAM permission - - - ``datacatalog.tagTemplates.getIamPolicy`` to get policies on tag - templates. - - ``datacatalog.entries.getIamPolicy`` to get policies on entries. - - ``datacatalog.entryGroups.getIamPolicy`` to get policies on entry - groups. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].GetIamPolicy - - @property - def test_iam_permissions(self): - """Return the gRPC stub for :meth:`DataCatalogClient.test_iam_permissions`. - - Returns the caller's permissions on a resource. If the resource does not - exist, an empty set of permissions is returned (We don't return a - ``NOT_FOUND`` error). - - Supported resources are: - - - Tag templates. - - Entries. - - Entry groups. Note, this method cannot be used to manage policies for - BigQuery, Cloud Pub/Sub and any external Google Cloud Platform - resources synced to Cloud Data Catalog. - - A caller is not required to have Google IAM permission to make this - request. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_catalog_stub"].TestIamPermissions diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/policy_tag_manager_grpc_transport.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/policy_tag_manager_grpc_transport.py deleted file mode 100644 index 71a1ca50fe9f..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/policy_tag_manager_grpc_transport.py +++ /dev/null @@ -1,282 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers - -from google.cloud.datacatalog_v1beta1.proto import policytagmanager_pb2_grpc - - -class PolicyTagManagerGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.datacatalog.v1beta1 PolicyTagManager API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="datacatalog.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "policy_tag_manager_stub": policytagmanager_pb2_grpc.PolicyTagManagerStub( - channel - ) - } - - @classmethod - def create_channel( - cls, address="datacatalog.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def create_taxonomy(self): - """Return the gRPC stub for :meth:`PolicyTagManagerClient.create_taxonomy`. - - Creates a taxonomy in the specified project. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["policy_tag_manager_stub"].CreateTaxonomy - - @property - def delete_taxonomy(self): - """Return the gRPC stub for :meth:`PolicyTagManagerClient.delete_taxonomy`. - - Deletes a taxonomy. This operation will also delete all - policy tags in this taxonomy along with their associated policies. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["policy_tag_manager_stub"].DeleteTaxonomy - - @property - def update_taxonomy(self): - """Return the gRPC stub for :meth:`PolicyTagManagerClient.update_taxonomy`. - - Updates a taxonomy. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["policy_tag_manager_stub"].UpdateTaxonomy - - @property - def list_taxonomies(self): - """Return the gRPC stub for :meth:`PolicyTagManagerClient.list_taxonomies`. - - Lists all taxonomies in a project in a particular location that the caller - has permission to view. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["policy_tag_manager_stub"].ListTaxonomies - - @property - def get_taxonomy(self): - """Return the gRPC stub for :meth:`PolicyTagManagerClient.get_taxonomy`. - - Gets a taxonomy. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["policy_tag_manager_stub"].GetTaxonomy - - @property - def create_policy_tag(self): - """Return the gRPC stub for :meth:`PolicyTagManagerClient.create_policy_tag`. - - Creates a policy tag in the specified taxonomy. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["policy_tag_manager_stub"].CreatePolicyTag - - @property - def delete_policy_tag(self): - """Return the gRPC stub for :meth:`PolicyTagManagerClient.delete_policy_tag`. - - Deletes a policy tag. Also deletes all of its descendant policy tags. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["policy_tag_manager_stub"].DeletePolicyTag - - @property - def update_policy_tag(self): - """Return the gRPC stub for :meth:`PolicyTagManagerClient.update_policy_tag`. - - Updates a policy tag. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["policy_tag_manager_stub"].UpdatePolicyTag - - @property - def list_policy_tags(self): - """Return the gRPC stub for :meth:`PolicyTagManagerClient.list_policy_tags`. - - Lists all policy tags in a taxonomy. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["policy_tag_manager_stub"].ListPolicyTags - - @property - def get_policy_tag(self): - """Return the gRPC stub for :meth:`PolicyTagManagerClient.get_policy_tag`. - - Gets a policy tag. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["policy_tag_manager_stub"].GetPolicyTag - - @property - def get_iam_policy(self): - """Return the gRPC stub for :meth:`PolicyTagManagerClient.get_iam_policy`. - - Gets the IAM policy for a taxonomy or a policy tag. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["policy_tag_manager_stub"].GetIamPolicy - - @property - def set_iam_policy(self): - """Return the gRPC stub for :meth:`PolicyTagManagerClient.set_iam_policy`. - - Sets the IAM policy for a taxonomy or a policy tag. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["policy_tag_manager_stub"].SetIamPolicy - - @property - def test_iam_permissions(self): - """Return the gRPC stub for :meth:`PolicyTagManagerClient.test_iam_permissions`. - - Returns the permissions that a caller has on the specified taxonomy or - policy tag. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["policy_tag_manager_stub"].TestIamPermissions diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/policy_tag_manager_serialization_grpc_transport.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/policy_tag_manager_serialization_grpc_transport.py deleted file mode 100644 index a3cfd42acfa1..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/policy_tag_manager_serialization_grpc_transport.py +++ /dev/null @@ -1,145 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers - -from google.cloud.datacatalog_v1beta1.proto import ( - policytagmanagerserialization_pb2_grpc, -) - - -class PolicyTagManagerSerializationGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.datacatalog.v1beta1 PolicyTagManagerSerialization API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="datacatalog.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "policy_tag_manager_serialization_stub": policytagmanagerserialization_pb2_grpc.PolicyTagManagerSerializationStub( - channel - ) - } - - @classmethod - def create_channel( - cls, address="datacatalog.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def import_taxonomies(self): - """Return the gRPC stub for :meth:`PolicyTagManagerSerializationClient.import_taxonomies`. - - Imports all taxonomies and their policy tags to a project as new - taxonomies. - - This method provides a bulk taxonomy / policy tag creation using nested - proto structure. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["policy_tag_manager_serialization_stub"].ImportTaxonomies - - @property - def export_taxonomies(self): - """Return the gRPC stub for :meth:`PolicyTagManagerSerializationClient.export_taxonomies`. - - Exports all taxonomies and their policy tags in a project. - - This method generates SerializedTaxonomy protos with nested policy tags - that can be used as an input for future ImportTaxonomies calls. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["policy_tag_manager_serialization_stub"].ExportTaxonomies diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/__init__.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/datacatalog.proto b/datacatalog/google/cloud/datacatalog_v1beta1/proto/datacatalog.proto deleted file mode 100644 index 8b67be1a0d29..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/datacatalog.proto +++ /dev/null @@ -1,1012 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datacatalog.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/datacatalog/v1beta1/gcs_fileset_spec.proto"; -import "google/cloud/datacatalog/v1beta1/schema.proto"; -import "google/cloud/datacatalog/v1beta1/search.proto"; -import "google/cloud/datacatalog/v1beta1/table_spec.proto"; -import "google/cloud/datacatalog/v1beta1/tags.proto"; -import "google/cloud/datacatalog/v1beta1/timestamps.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datacatalog"; - -// Data Catalog API service allows clients to discover, understand, and manage -// their data. -service DataCatalog { - option (google.api.default_host) = "datacatalog.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Searches Data Catalog for multiple resources like entries, tags that - // match a query. - // - // This is a custom method - // (https://cloud.google.com/apis/design/custom_methods) and does not return - // the complete resource, only the resource identifier and high level - // fields. Clients can subsequentally call `Get` methods. - // - // Note that searches do not have full recall. There may be results that match - // your query but are not returned, even in subsequent pages of results. These - // missing results may vary across repeated calls to search. Do not rely on - // this method if you need to guarantee full recall. - // - // See [Data Catalog Search - // Syntax](/data-catalog/docs/how-to/search-reference) for more information. - rpc SearchCatalog(SearchCatalogRequest) returns (SearchCatalogResponse) { - option (google.api.http) = { - post: "/v1beta1/catalog:search" - body: "*" - }; - option (google.api.method_signature) = "scope,query"; - } - - // Alpha feature. - // Creates an EntryGroup. - // The user should enable the Data Catalog API in the project identified by - // the `parent` parameter (see [Data Catalog Resource Project] - // (/data-catalog/docs/concepts/resource-project) for more information). - rpc CreateEntryGroup(CreateEntryGroupRequest) returns (EntryGroup) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/entryGroups" - body: "entry_group" - }; - option (google.api.method_signature) = "parent,entry_group_id,entry_group"; - } - - // Alpha feature. - // Gets an EntryGroup. - rpc GetEntryGroup(GetEntryGroupRequest) returns (EntryGroup) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/entryGroups/*}" - }; - option (google.api.method_signature) = "name"; - option (google.api.method_signature) = "name,read_mask"; - } - - // Alpha feature. - // Deletes an EntryGroup. Only entry groups that do not contain entries can be - // deleted. The user should enable the Data Catalog API in the project - // identified by the `name` parameter (see [Data Catalog Resource Project] - // (/data-catalog/docs/concepts/resource-project) for more information). - rpc DeleteEntryGroup(DeleteEntryGroupRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/entryGroups/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Alpha feature. - // Creates an entry. Currently only entries of 'FILESET' type can be created. - // The user should enable the Data Catalog API in the project identified by - // the `parent` parameter (see [Data Catalog Resource Project] - // (/data-catalog/docs/concepts/resource-project) for more information). - rpc CreateEntry(CreateEntryRequest) returns (Entry) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/entryGroups/*}/entries" - body: "entry" - }; - option (google.api.method_signature) = "parent,entry_id,entry"; - } - - // Updates an existing entry. - // The user should enable the Data Catalog API in the project identified by - // the `entry.name` parameter (see [Data Catalog Resource Project] - // (/data-catalog/docs/concepts/resource-project) for more information). - rpc UpdateEntry(UpdateEntryRequest) returns (Entry) { - option (google.api.http) = { - patch: "/v1beta1/{entry.name=projects/*/locations/*/entryGroups/*/entries/*}" - body: "entry" - }; - option (google.api.method_signature) = "entry"; - option (google.api.method_signature) = "entry,update_mask"; - } - - // Alpha feature. - // Deletes an existing entry. Only entries created through - // [CreateEntry][google.cloud.datacatalog.v1beta1.DataCatalog.CreateEntry] - // method can be deleted. - // The user should enable the Data Catalog API in the project identified by - // the `name` parameter (see [Data Catalog Resource Project] - // (/data-catalog/docs/concepts/resource-project) for more information). - rpc DeleteEntry(DeleteEntryRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Gets an entry. - rpc GetEntry(GetEntryRequest) returns (Entry) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Get an entry by target resource name. This method allows clients to use - // the resource name from the source Google Cloud Platform service to get the - // Data Catalog Entry. - rpc LookupEntry(LookupEntryRequest) returns (Entry) { - option (google.api.http) = { - get: "/v1beta1/entries:lookup" - }; - } - - // Creates a tag template. The user should enable the Data Catalog API in - // the project identified by the `parent` parameter (see [Data Catalog - // Resource Project](/data-catalog/docs/concepts/resource-project) for more - // information). - rpc CreateTagTemplate(CreateTagTemplateRequest) returns (TagTemplate) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/tagTemplates" - body: "tag_template" - }; - option (google.api.method_signature) = - "parent,tag_template_id,tag_template"; - } - - // Gets a tag template. - rpc GetTagTemplate(GetTagTemplateRequest) returns (TagTemplate) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/tagTemplates/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a tag template. This method cannot be used to update the fields of - // a template. The tag template fields are represented as separate resources - // and should be updated using their own create/update/delete methods. - // The user should enable the Data Catalog API in the project identified by - // the `tag_template.name` parameter (see [Data Catalog Resource Project] - // (/data-catalog/docs/concepts/resource-project) for more information). - rpc UpdateTagTemplate(UpdateTagTemplateRequest) returns (TagTemplate) { - option (google.api.http) = { - patch: "/v1beta1/{tag_template.name=projects/*/locations/*/tagTemplates/*}" - body: "tag_template" - }; - option (google.api.method_signature) = "tag_template"; - option (google.api.method_signature) = "tag_template,update_mask"; - } - - // Deletes a tag template and all tags using the template. - // The user should enable the Data Catalog API in the project identified by - // the `name` parameter (see [Data Catalog Resource Project] - // (/data-catalog/docs/concepts/resource-project) for more information). - rpc DeleteTagTemplate(DeleteTagTemplateRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/tagTemplates/*}" - }; - option (google.api.method_signature) = "name,force"; - } - - // Creates a field in a tag template. The user should enable the Data Catalog - // API in the project identified by the `parent` parameter (see - // [Data Catalog Resource - // Project](/data-catalog/docs/concepts/resource-project) for more - // information). - rpc CreateTagTemplateField(CreateTagTemplateFieldRequest) - returns (TagTemplateField) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/tagTemplates/*}/fields" - body: "tag_template_field" - }; - option (google.api.method_signature) = - "parent,tag_template_field_id,tag_template_field"; - } - - // Updates a field in a tag template. This method cannot be used to update the - // field type. The user should enable the Data Catalog API in the project - // identified by the `name` parameter (see [Data Catalog Resource Project] - // (/data-catalog/docs/concepts/resource-project) for more information). - rpc UpdateTagTemplateField(UpdateTagTemplateFieldRequest) - returns (TagTemplateField) { - option (google.api.http) = { - patch: "/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}" - body: "tag_template_field" - }; - option (google.api.method_signature) = "name,tag_template_field"; - option (google.api.method_signature) = - "name,tag_template_field,update_mask"; - } - - // Renames a field in a tag template. The user should enable the Data Catalog - // API in the project identified by the `name` parameter (see [Data Catalog - // Resource Project](/data-catalog/docs/concepts/resource-project) for more - // information). - rpc RenameTagTemplateField(RenameTagTemplateFieldRequest) - returns (TagTemplateField) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}:rename" - body: "*" - }; - option (google.api.method_signature) = "name,new_tag_template_field_id"; - } - - // Deletes a field in a tag template and all uses of that field. - // The user should enable the Data Catalog API in the project identified by - // the `name` parameter (see [Data Catalog Resource Project] - // (/data-catalog/docs/concepts/resource-project) for more information). - rpc DeleteTagTemplateField(DeleteTagTemplateFieldRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}" - }; - option (google.api.method_signature) = "name,force"; - } - - // Creates a tag on an [Entry][google.cloud.datacatalog.v1beta1.Entry]. - // Note: The project identified by the `parent` parameter for the - // [tag](/data-catalog/docs/reference/rest/v1beta1/projects.locations.entryGroups.entries.tags/create#path-parameters) - // and the - // [tag - // template](/data-catalog/docs/reference/rest/v1beta1/projects.locations.tagTemplates/create#path-parameters) - // used to create the tag must be from the same organization. - rpc CreateTag(CreateTagRequest) returns (Tag) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/entryGroups/*/entries/*}/tags" - body: "tag" - }; - option (google.api.method_signature) = "parent,tag"; - } - - // Updates an existing tag. - rpc UpdateTag(UpdateTagRequest) returns (Tag) { - option (google.api.http) = { - patch: "/v1beta1/{tag.name=projects/*/locations/*/entryGroups/*/entries/*/tags/*}" - body: "tag" - }; - option (google.api.method_signature) = "tag"; - option (google.api.method_signature) = "tag,update_mask"; - } - - // Deletes a tag. - rpc DeleteTag(DeleteTagRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*/tags/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists the tags on an [Entry][google.cloud.datacatalog.v1beta1.Entry]. - rpc ListTags(ListTagsRequest) returns (ListTagsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/entryGroups/*/entries/*}/tags" - }; - option (google.api.method_signature) = "parent"; - } - - // Sets the access control policy for a resource. Replaces any existing - // policy. - // Supported resources are: - // - Tag templates. - // - Entries. - // - Entry groups. - // Note, this method cannot be used to manage policies for BigQuery, Cloud - // Pub/Sub and any external Google Cloud Platform resources synced to Cloud - // Data Catalog. - // - // Callers must have following Google IAM permission - // - `datacatalog.tagTemplates.setIamPolicy` to set policies on tag - // templates. - // - `datacatalog.entries.setIamPolicy` to set policies on entries. - // - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:setIamPolicy" - body: "*" - additional_bindings { - post: "/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:setIamPolicy" - body: "*" - } - additional_bindings { - post: "/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:setIamPolicy" - body: "*" - } - }; - } - - // Gets the access control policy for a resource. A `NOT_FOUND` error - // is returned if the resource does not exist. An empty policy is returned - // if the resource exists but does not have a policy set on it. - // - // Supported resources are: - // - Tag templates. - // - Entries. - // - Entry groups. - // Note, this method cannot be used to manage policies for BigQuery, Cloud - // Pub/Sub and any external Google Cloud Platform resources synced to Cloud - // Data Catalog. - // - // Callers must have following Google IAM permission - // - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag - // templates. - // - `datacatalog.entries.getIamPolicy` to get policies on entries. - // - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:getIamPolicy" - body: "*" - additional_bindings { - post: "/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:getIamPolicy" - body: "*" - } - additional_bindings { - post: "/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:getIamPolicy" - body: "*" - } - }; - } - - // Returns the caller's permissions on a resource. - // If the resource does not exist, an empty set of permissions is returned - // (We don't return a `NOT_FOUND` error). - // - // Supported resources are: - // - Tag templates. - // - Entries. - // - Entry groups. - // Note, this method cannot be used to manage policies for BigQuery, Cloud - // Pub/Sub and any external Google Cloud Platform resources synced to Cloud - // Data Catalog. - // - // A caller is not required to have Google IAM permission to make this - // request. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { - post: "/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:testIamPermissions" - body: "*" - additional_bindings { - post: "/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:testIamPermissions" - body: "*" - } - additional_bindings { - post: "/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:testIamPermissions" - body: "*" - } - }; - } -} - -// Request message for -// [SearchCatalog][google.cloud.datacatalog.v1beta1.DataCatalog.SearchCatalog]. -message SearchCatalogRequest { - message Scope { - // Data Catalog tries to automatically choose the right corpus of data to - // search through. You can ensure an organization is included by adding it - // to `include_org_ids`. You can ensure a project's org is included with - // `include_project_ids`. You must specify at least one organization - // using `include_org_ids` or `include_project_ids` in all search requests. - // - // List of organization IDs to search within. To find your organization ID, - // follow instructions in - // https://cloud.google.com/resource-manager/docs/creating-managing-organization. - repeated string include_org_ids = 2; - - // List of project IDs to search within. To learn more about the - // distinction between project names/IDs/numbers, go to - // https://cloud.google.com/docs/overview/#projects. - repeated string include_project_ids = 3; - - // If `true`, include Google Cloud Platform (GCP) public datasets in the - // search results. Info on GCP public datasets is available at - // https://cloud.google.com/public-datasets/. By default, GCP public - // datasets are excluded. - bool include_gcp_public_datasets = 7; - } - - // Required. The scope of this search request. - Scope scope = 6 [(google.api.field_behavior) = REQUIRED]; - - // Required. The query string in search query syntax. The query must be - // non-empty. - // - // Query strings can be simple as "x" or more qualified as: - // - // * name:x - // * column:x - // * description:y - // - // Note: Query tokens need to have a minimum of 3 characters for substring - // matching to work correctly. See [Data Catalog Search - // Syntax](/data-catalog/docs/how-to/search-reference) for more information. - string query = 1 [(google.api.field_behavior) = REQUIRED]; - - // Number of results in the search page. If <=0 then defaults to 10. Max limit - // for page_size is 1000. Throws an invalid argument for page_size > 1000. - int32 page_size = 2; - - // Optional. Pagination token returned in an earlier - // [SearchCatalogResponse.next_page_token][google.cloud.datacatalog.v1beta1.SearchCatalogResponse.next_page_token], - // which indicates that this is a continuation of a prior - // [SearchCatalogRequest][google.cloud.datacatalog.v1beta1.DataCatalog.SearchCatalog] - // call, and that the system should return the next page of data. If empty, - // the first page is returned. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Specifies the ordering of results, currently supported case-sensitive - // choices are: - // - // * `relevance`, only supports desecending - // * `last_access_timestamp [asc|desc]`, defaults to descending if not - // specified - // * `last_modified_timestamp [asc|desc]`, defaults to descending if not - // specified - // - // If not specified, defaults to `relevance` descending. - string order_by = 5; -} - -// Response message for -// [SearchCatalog][google.cloud.datacatalog.v1beta1.DataCatalog.SearchCatalog]. -message SearchCatalogResponse { - // Search results. - repeated SearchCatalogResult results = 1; - - // The token that can be used to retrieve the next page of results. - string next_page_token = 3; -} - -// Request message for -// [CreateEntryGroup][google.cloud.datacatalog.v1beta1.DataCatalog.CreateEntryGroup]. -message CreateEntryGroupRequest { - // Required. The name of the project this entry group is in. Example: - // - // * projects/{project_id}/locations/{location} - // - // Note that this EntryGroup and its child resources may not actually be - // stored in the location in this name. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "datacatalog.googleapis.com/EntryGroup" - } - ]; - - // Required. The id of the entry group to create. - string entry_group_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // The entry group to create. Defaults to an empty entry group. - EntryGroup entry_group = 2; -} - -// Request message for -// [GetEntryGroup][google.cloud.datacatalog.v1beta1.DataCatalog.GetEntryGroup]. -message GetEntryGroupRequest { - // Required. The name of the entry group. For example, - // `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datacatalog.googleapis.com/EntryGroup" - } - ]; - - // The fields to return. If not set or empty, all fields are returned. - google.protobuf.FieldMask read_mask = 2; -} - -// Request message for -// [DeleteEntryGroup][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteEntryGroup]. -message DeleteEntryGroupRequest { - // Required. The name of the entry group. For example, - // `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datacatalog.googleapis.com/EntryGroup" - } - ]; -} - -// Request message for -// [CreateEntry][google.cloud.datacatalog.v1beta1.DataCatalog.CreateEntry]. -message CreateEntryRequest { - // Required. The name of the entry group this entry is in. Example: - // - // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id} - // - // Note that this Entry and its child resources may not actually be stored in - // the location in this name. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datacatalog.googleapis.com/EntryGroup" - } - ]; - - // Required. The id of the entry to create. - string entry_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The entry to create. - Entry entry = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [UpdateEntry][google.cloud.datacatalog.v1beta1.DataCatalog.UpdateEntry]. -message UpdateEntryRequest { - // Required. The updated entry. The "name" field must be set. - Entry entry = 1 [(google.api.field_behavior) = REQUIRED]; - - // The fields to update on the entry. If absent or empty, all modifiable - // fields are updated. - // - // The following fields are modifiable: - // * For entries with type `DATA_STREAM`: - // * `schema` - // * For entries with type `FILESET` - // * `schema` - // * `display_name` - // * `description` - // * `gcs_fileset_spec` - // * `gcs_fileset_spec.file_patterns` - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for -// [DeleteEntry][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteEntry]. -message DeleteEntryRequest { - // Required. The name of the entry. Example: - // - // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datacatalog.googleapis.com/Entry" - } - ]; -} - -// Request message for -// [GetEntry][google.cloud.datacatalog.v1beta1.DataCatalog.GetEntry]. -message GetEntryRequest { - // Required. The name of the entry. Example: - // - // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} - // - // Entry groups are logical groupings of entries. Currently, users cannot - // create/modify entry groups. They are created by Data Catalog; they include - // `@bigquery` for all BigQuery entries, and `@pubsub` for all Cloud Pub/Sub - // entries. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datacatalog.googleapis.com/Entry" - } - ]; -} - -// Request message for -// [LookupEntry][google.cloud.datacatalog.v1beta1.DataCatalog.LookupEntry]. -message LookupEntryRequest { - // Required. Represents either the Google Cloud Platform resource or SQL name - // for a Google Cloud Platform resource. - oneof target_name { - // The full name of the Google Cloud Platform resource the Data Catalog - // entry represents. See: - // https://cloud.google.com/apis/design/resource_names#full_resource_name. - // Full names are case-sensitive. - // - // Examples: - // - // * //bigquery.googleapis.com/projects/projectId/datasets/datasetId/tables/tableId - // * //pubsub.googleapis.com/projects/projectId/topics/topicId - string linked_resource = 1; - - // The SQL name of the entry. SQL names are case-sensitive. - // - // Examples: - // - // * `cloud_pubsub.project_id.topic_id` - // * ``pubsub.project_id.`topic.id.with.dots` `` - // * `bigquery.project_id.dataset_id.table_id` - // * `datacatalog.project_id.location_id.entry_group_id.entry_id` - // - // `*_id`s shoud satisfy the standard SQL rules for identifiers. - // https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical. - string sql_resource = 3; - } -} - -// Entry Metadata. -// A Data Catalog Entry resource represents another resource in Google -// Cloud Platform, such as a BigQuery dataset or a Cloud Pub/Sub topic. -// Clients can use the `linked_resource` field in the Entry resource to refer to -// the original resource ID of the source system. -// -// An Entry resource contains resource details, such as its schema. An Entry can -// also be used to attach flexible metadata, such as a -// [Tag][google.cloud.datacatalog.v1beta1.Tag]. -message Entry { - option (google.api.resource) = { - type: "datacatalog.googleapis.com/Entry" - pattern: "projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}" - }; - - // The Data Catalog resource name of the entry in URL format. Example: - // - // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} - // - // Note that this Entry and its child resources may not actually be stored in - // the location in this name. - string name = 1 [(google.api.resource_reference) = { - type: "datacatalog.googleapis.com/EntryGroup" - }]; - - // Output only. The resource this metadata entry refers to. - // - // For Google Cloud Platform resources, `linked_resource` is the [full name of - // the - // resource](https://cloud.google.com/apis/design/resource_names#full_resource_name). - // For example, the `linked_resource` for a table resource from BigQuery is: - // - // * //bigquery.googleapis.com/projects/projectId/datasets/datasetId/tables/tableId - string linked_resource = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Entry type. - oneof entry_type { - // The type of the entry. - EntryType type = 2; - } - - // Type specification information. - oneof type_spec { - // Specification that applies to a Cloud Storage fileset. This is only valid - // on entries of type FILESET. - GcsFilesetSpec gcs_fileset_spec = 6; - - // Specification that applies to a BigQuery table. This is only valid on - // entries of type `TABLE`. - BigQueryTableSpec bigquery_table_spec = 12; - - // Specification for a group of BigQuery tables with name pattern - // `[prefix]YYYYMMDD`. Context: - // https://cloud.google.com/bigquery/docs/partitioned-tables#partitioning_versus_sharding. - BigQueryDateShardedSpec bigquery_date_sharded_spec = 15; - } - - // Display information such as title and description. A short name to identify - // the entry, for example, "Analytics Data - Jan 2011". Default value is an - // empty string. - string display_name = 3; - - // Entry description, which can consist of several sentences or paragraphs - // that describe entry contents. Default value is an empty string. - string description = 4; - - // Schema of the entry. An entry might not have any schema attached to it. - Schema schema = 5; - - // Output only. Timestamps about the underlying Google Cloud Platform - // resource, not about this Data Catalog Entry. - SystemTimestamps source_system_timestamps = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// EntryGroup Metadata. -// An EntryGroup resource represents a logical grouping of zero or more -// Data Catalog [Entry][google.cloud.datacatalog.v1beta1.Entry] resources. -message EntryGroup { - option (google.api.resource) = { - type: "datacatalog.googleapis.com/EntryGroup" - pattern: "projects/{project}/locations/{location}/entryGroups/{entry_group}" - }; - - // The resource name of the entry group in URL format. Example: - // - // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id} - // - // Note that this EntryGroup and its child resources may not actually be - // stored in the location in this name. - string name = 1; - - // A short name to identify the entry group, for example, - // "analytics data - jan 2011". Default value is an empty string. - string display_name = 2; - - // Entry group description, which can consist of several sentences or - // paragraphs that describe entry group contents. Default value is an empty - // string. - string description = 3; - - // Output only. Timestamps about this EntryGroup. Default value is empty - // timestamps. - SystemTimestamps data_catalog_timestamps = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request message for -// [CreateTagTemplate][google.cloud.datacatalog.v1beta1.DataCatalog.CreateTagTemplate]. -message CreateTagTemplateRequest { - // Required. The name of the project and the location this template is in. - // Example: - // - // * projects/{project_id}/locations/{location} - // - // TagTemplate and its child resources may not actually be stored in the - // location in this name. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "datacatalog.googleapis.com/TagTemplate" - } - ]; - - // Required. The id of the tag template to create. - string tag_template_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The tag template to create. - TagTemplate tag_template = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [GetTagTemplate][google.cloud.datacatalog.v1beta1.DataCatalog.GetTagTemplate]. -message GetTagTemplateRequest { - // Required. The name of the tag template. Example: - // - // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datacatalog.googleapis.com/TagTemplate" - } - ]; -} - -// Entry resources in Data Catalog can be of different types e.g. a BigQuery -// Table entry is of type `TABLE`. This enum describes all the possible types -// Data Catalog contains. -enum EntryType { - // Default unknown type - ENTRY_TYPE_UNSPECIFIED = 0; - - // Output only. The type of entry that has a GoogleSQL schema, including - // logical views. - TABLE = 2; - - // Output only. An entry type which is used for streaming entries. Example: - // Cloud Pub/Sub topic. - DATA_STREAM = 3; - - // Alpha feature. An entry type which is a set of files or objects. Example: - // Cloud Storage fileset. - FILESET = 4; -} - -// Request message for -// [UpdateTagTemplate][google.cloud.datacatalog.v1beta1.DataCatalog.UpdateTagTemplate]. -message UpdateTagTemplateRequest { - // Required. The template to update. The "name" field must be set. - TagTemplate tag_template = 1 [(google.api.field_behavior) = REQUIRED]; - - // The field mask specifies the parts of the template to overwrite. - // - // Allowed fields: - // - // * `display_name` - // - // If absent or empty, all of the allowed fields above will be updated. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for -// [DeleteTagTemplate][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteTagTemplate]. -message DeleteTagTemplateRequest { - // Required. The name of the tag template to delete. Example: - // - // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datacatalog.googleapis.com/TagTemplate" - } - ]; - - // Required. Currently, this field must always be set to `true`. - // This confirms the deletion of any possible tags using this template. - // `force = false` will be supported in the future. - bool force = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [CreateTag][google.cloud.datacatalog.v1beta1.DataCatalog.CreateTag]. -message CreateTagRequest { - // Required. The name of the resource to attach this tag to. Tags can be - // attached to Entries. Example: - // - // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} - // - // Note that this Tag and its child resources may not actually be stored in - // the location in this name. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "datacatalog.googleapis.com/Tag" } - ]; - - // Required. The tag to create. - Tag tag = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [UpdateTag][google.cloud.datacatalog.v1beta1.DataCatalog.UpdateTag]. -message UpdateTagRequest { - // Required. The updated tag. The "name" field must be set. - Tag tag = 1 [(google.api.field_behavior) = REQUIRED]; - - // The fields to update on the Tag. If absent or empty, all modifiable fields - // are updated. Currently the only modifiable field is the field `fields`. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for -// [DeleteTag][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteTag]. -message DeleteTagRequest { - // Required. The name of the tag to delete. Example: - // - // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "datacatalog.googleapis.com/Tag" - } - ]; -} - -// Request message for -// [CreateTagTemplateField][google.cloud.datacatalog.v1beta1.DataCatalog.CreateTagTemplateField]. -message CreateTagTemplateFieldRequest { - // Required. The name of the project this template is in. Example: - // - // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id} - // - // Note that this TagTemplateField may not actually be stored in the location - // in this name. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datacatalog.googleapis.com/TagTemplate" - } - ]; - - // Required. The ID of the tag template field to create. - // Field ids can contain letters (both uppercase and lowercase), numbers - // (0-9), underscores (_) and dashes (-). Field IDs must be at least 1 - // character long and at most 128 characters long. Field IDs must also be - // unique within their template. - string tag_template_field_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The tag template field to create. - TagTemplateField tag_template_field = 3 - [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [UpdateTagTemplateField][google.cloud.datacatalog.v1beta1.DataCatalog.UpdateTagTemplateField]. -message UpdateTagTemplateFieldRequest { - // Required. The name of the tag template field. Example: - // - // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datacatalog.googleapis.com/TagTemplateField" - } - ]; - - // Required. The template to update. - TagTemplateField tag_template_field = 2 - [(google.api.field_behavior) = REQUIRED]; - - // The field mask specifies the parts of the template to be updated. - // Allowed fields: - // - // * `display_name` - // * `type.enum_type` - // - // If `update_mask` is not set or empty, all of the allowed fields above will - // be updated. - // - // When updating an enum type, the provided values will be merged with the - // existing values. Therefore, enum values can only be added, existing enum - // values cannot be deleted nor renamed. - google.protobuf.FieldMask update_mask = 3; -} - -// Request message for -// [RenameTagTemplateField][google.cloud.datacatalog.v1beta1.DataCatalog.RenameTagTemplateField]. -message RenameTagTemplateFieldRequest { - // Required. The name of the tag template. Example: - // - // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datacatalog.googleapis.com/TagTemplateField" - } - ]; - - // Required. The new ID of this tag template field. For example, - // `my_new_field`. - string new_tag_template_field_id = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [DeleteTagTemplateField][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteTagTemplateField]. -message DeleteTagTemplateFieldRequest { - // Required. The name of the tag template field to delete. Example: - // - // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datacatalog.googleapis.com/TagTemplateField" - } - ]; - - // Required. Currently, this field must always be set to `true`. - // This confirms the deletion of this field from any tags using this field. - // `force = false` will be supported in the future. - bool force = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [ListTags][google.cloud.datacatalog.v1beta1.DataCatalog.ListTags]. -message ListTagsRequest { - // Required. The name of the Data Catalog resource to list the tags of. The - // resource could be an [Entry][google.cloud.datacatalog.v1beta1.Entry]. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "datacatalog.googleapis.com/Tag" - } - ]; - - // The maximum number of tags to return. Default is 10. Max limit is 1000. - int32 page_size = 2; - - // Token that specifies which page is requested. If empty, the first page is - // returned. - string page_token = 3; -} - -// Response message for -// [ListTags][google.cloud.datacatalog.v1beta1.DataCatalog.ListTags]. -message ListTagsResponse { - // [Tag][google.cloud.datacatalog.v1beta1.Tag] details. - repeated Tag tags = 1; - - // Token to retrieve the next page of results. It is set to empty if no items - // remain in results. - string next_page_token = 2; -} diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/datacatalog_pb2.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/datacatalog_pb2.py deleted file mode 100644 index 5a5612a55736..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/datacatalog_pb2.py +++ /dev/null @@ -1,3141 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/datacatalog_v1beta1/proto/datacatalog.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.datacatalog_v1beta1.proto import ( - gcs_fileset_spec_pb2 as google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_gcs__fileset__spec__pb2, -) -from google.cloud.datacatalog_v1beta1.proto import ( - schema_pb2 as google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_schema__pb2, -) -from google.cloud.datacatalog_v1beta1.proto import ( - search_pb2 as google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_search__pb2, -) -from google.cloud.datacatalog_v1beta1.proto import ( - table_spec_pb2 as google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_table__spec__pb2, -) -from google.cloud.datacatalog_v1beta1.proto import ( - tags_pb2 as google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2, -) -from google.cloud.datacatalog_v1beta1.proto import ( - timestamps_pb2 as google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_timestamps__pb2, -) -from google.iam.v1 import iam_policy_pb2 as google_dot_iam_dot_v1_dot_iam__policy__pb2 -from google.iam.v1 import policy_pb2 as google_dot_iam_dot_v1_dot_policy__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/datacatalog_v1beta1/proto/datacatalog.proto", - package="google.cloud.datacatalog.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n$com.google.cloud.datacatalog.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" - ), - serialized_pb=_b( - '\n8google/cloud/datacatalog_v1beta1/proto/datacatalog.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a=google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec.proto\x1a\x33google/cloud/datacatalog_v1beta1/proto/schema.proto\x1a\x33google/cloud/datacatalog_v1beta1/proto/search.proto\x1a\x37google/cloud/datacatalog_v1beta1/proto/table_spec.proto\x1a\x31google/cloud/datacatalog_v1beta1/proto/tags.proto\x1a\x37google/cloud/datacatalog_v1beta1/proto/timestamps.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto"\x9e\x02\n\x14SearchCatalogRequest\x12P\n\x05scope\x18\x06 \x01(\x0b\x32<.google.cloud.datacatalog.v1beta1.SearchCatalogRequest.ScopeB\x03\xe0\x41\x02\x12\x12\n\x05query\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x08order_by\x18\x05 \x01(\t\x1a\x62\n\x05Scope\x12\x17\n\x0finclude_org_ids\x18\x02 \x03(\t\x12\x1b\n\x13include_project_ids\x18\x03 \x03(\t\x12#\n\x1binclude_gcp_public_datasets\x18\x07 \x01(\x08"x\n\x15SearchCatalogResponse\x12\x46\n\x07results\x18\x01 \x03(\x0b\x32\x35.google.cloud.datacatalog.v1beta1.SearchCatalogResult\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t"\xb8\x01\n\x17\x43reateEntryGroupRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%datacatalog.googleapis.com/EntryGroup\x12\x1b\n\x0e\x65ntry_group_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x0b\x65ntry_group\x18\x02 \x01(\x0b\x32,.google.cloud.datacatalog.v1beta1.EntryGroup"\x82\x01\n\x14GetEntryGroupRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%datacatalog.googleapis.com/EntryGroup\x12-\n\tread_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"V\n\x17\x44\x65leteEntryGroupRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%datacatalog.googleapis.com/EntryGroup"\xa7\x01\n\x12\x43reateEntryRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%datacatalog.googleapis.com/EntryGroup\x12\x15\n\x08\x65ntry_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12;\n\x05\x65ntry\x18\x02 \x01(\x0b\x32\'.google.cloud.datacatalog.v1beta1.EntryB\x03\xe0\x41\x02"\x82\x01\n\x12UpdateEntryRequest\x12;\n\x05\x65ntry\x18\x01 \x01(\x0b\x32\'.google.cloud.datacatalog.v1beta1.EntryB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"L\n\x12\x44\x65leteEntryRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n datacatalog.googleapis.com/Entry"I\n\x0fGetEntryRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n datacatalog.googleapis.com/Entry"V\n\x12LookupEntryRequest\x12\x19\n\x0flinked_resource\x18\x01 \x01(\tH\x00\x12\x16\n\x0csql_resource\x18\x03 \x01(\tH\x00\x42\r\n\x0btarget_name"\xf4\x05\n\x05\x45ntry\x12\x38\n\x04name\x18\x01 \x01(\tB*\xfa\x41\'\n%datacatalog.googleapis.com/EntryGroup\x12\x1c\n\x0flinked_resource\x18\t \x01(\tB\x03\xe0\x41\x03\x12;\n\x04type\x18\x02 \x01(\x0e\x32+.google.cloud.datacatalog.v1beta1.EntryTypeH\x00\x12L\n\x10gcs_fileset_spec\x18\x06 \x01(\x0b\x32\x30.google.cloud.datacatalog.v1beta1.GcsFilesetSpecH\x01\x12R\n\x13\x62igquery_table_spec\x18\x0c \x01(\x0b\x32\x33.google.cloud.datacatalog.v1beta1.BigQueryTableSpecH\x01\x12_\n\x1a\x62igquery_date_sharded_spec\x18\x0f \x01(\x0b\x32\x39.google.cloud.datacatalog.v1beta1.BigQueryDateShardedSpecH\x01\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x38\n\x06schema\x18\x05 \x01(\x0b\x32(.google.cloud.datacatalog.v1beta1.Schema\x12Y\n\x18source_system_timestamps\x18\x07 \x01(\x0b\x32\x32.google.cloud.datacatalog.v1beta1.SystemTimestampsB\x03\xe0\x41\x03:x\xea\x41u\n datacatalog.googleapis.com/Entry\x12Qprojects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}B\x0c\n\nentry_typeB\x0b\n\ttype_spec"\x8e\x02\n\nEntryGroup\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12X\n\x17\x64\x61ta_catalog_timestamps\x18\x04 \x01(\x0b\x32\x32.google.cloud.datacatalog.v1beta1.SystemTimestampsB\x03\xe0\x41\x03:m\xea\x41j\n%datacatalog.googleapis.com/EntryGroup\x12\x41projects/{project}/locations/{location}/entryGroups/{entry_group}"\xc2\x01\n\x18\x43reateTagTemplateRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&datacatalog.googleapis.com/TagTemplate\x12\x1c\n\x0ftag_template_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12H\n\x0ctag_template\x18\x02 \x01(\x0b\x32-.google.cloud.datacatalog.v1beta1.TagTemplateB\x03\xe0\x41\x02"U\n\x15GetTagTemplateRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&datacatalog.googleapis.com/TagTemplate"\x95\x01\n\x18UpdateTagTemplateRequest\x12H\n\x0ctag_template\x18\x01 \x01(\x0b\x32-.google.cloud.datacatalog.v1beta1.TagTemplateB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"l\n\x18\x44\x65leteTagTemplateRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&datacatalog.googleapis.com/TagTemplate\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08\x42\x03\xe0\x41\x02"\x83\x01\n\x10\x43reateTagRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64\x61tacatalog.googleapis.com/Tag\x12\x37\n\x03tag\x18\x02 \x01(\x0b\x32%.google.cloud.datacatalog.v1beta1.TagB\x03\xe0\x41\x02"|\n\x10UpdateTagRequest\x12\x37\n\x03tag\x18\x01 \x01(\x0b\x32%.google.cloud.datacatalog.v1beta1.TagB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"H\n\x10\x44\x65leteTagRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64\x61tacatalog.googleapis.com/Tag"\xd8\x01\n\x1d\x43reateTagTemplateFieldRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&datacatalog.googleapis.com/TagTemplate\x12"\n\x15tag_template_field_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12S\n\x12tag_template_field\x18\x03 \x01(\x0b\x32\x32.google.cloud.datacatalog.v1beta1.TagTemplateFieldB\x03\xe0\x41\x02"\xed\x01\n\x1dUpdateTagTemplateFieldRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+datacatalog.googleapis.com/TagTemplateField\x12S\n\x12tag_template_field\x18\x02 \x01(\x0b\x32\x32.google.cloud.datacatalog.v1beta1.TagTemplateFieldB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01"\x8a\x01\n\x1dRenameTagTemplateFieldRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+datacatalog.googleapis.com/TagTemplateField\x12&\n\x19new_tag_template_field_id\x18\x02 \x01(\tB\x03\xe0\x41\x02"v\n\x1d\x44\x65leteTagTemplateFieldRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+datacatalog.googleapis.com/TagTemplateField\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08\x42\x03\xe0\x41\x02"p\n\x0fListTagsRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64\x61tacatalog.googleapis.com/Tag\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"`\n\x10ListTagsResponse\x12\x33\n\x04tags\x18\x01 \x03(\x0b\x32%.google.cloud.datacatalog.v1beta1.Tag\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t*P\n\tEntryType\x12\x1a\n\x16\x45NTRY_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05TABLE\x10\x02\x12\x0f\n\x0b\x44\x41TA_STREAM\x10\x03\x12\x0b\n\x07\x46ILESET\x10\x04\x32\xc8+\n\x0b\x44\x61taCatalog\x12\xb2\x01\n\rSearchCatalog\x12\x36.google.cloud.datacatalog.v1beta1.SearchCatalogRequest\x1a\x37.google.cloud.datacatalog.v1beta1.SearchCatalogResponse"0\x82\xd3\xe4\x93\x02\x1c"\x17/v1beta1/catalog:search:\x01*\xda\x41\x0bscope,query\x12\xea\x01\n\x10\x43reateEntryGroup\x12\x39.google.cloud.datacatalog.v1beta1.CreateEntryGroupRequest\x1a,.google.cloud.datacatalog.v1beta1.EntryGroup"m\x82\xd3\xe4\x93\x02\x43"4/v1beta1/{parent=projects/*/locations/*}/entryGroups:\x0b\x65ntry_group\xda\x41!parent,entry_group_id,entry_group\x12\xcb\x01\n\rGetEntryGroup\x12\x36.google.cloud.datacatalog.v1beta1.GetEntryGroupRequest\x1a,.google.cloud.datacatalog.v1beta1.EntryGroup"T\x82\xd3\xe4\x93\x02\x36\x12\x34/v1beta1/{name=projects/*/locations/*/entryGroups/*}\xda\x41\x04name\xda\x41\x0ename,read_mask\x12\xaa\x01\n\x10\x44\x65leteEntryGroup\x12\x39.google.cloud.datacatalog.v1beta1.DeleteEntryGroupRequest\x1a\x16.google.protobuf.Empty"C\x82\xd3\xe4\x93\x02\x36*4/v1beta1/{name=projects/*/locations/*/entryGroups/*}\xda\x41\x04name\x12\xd3\x01\n\x0b\x43reateEntry\x12\x34.google.cloud.datacatalog.v1beta1.CreateEntryRequest\x1a\'.google.cloud.datacatalog.v1beta1.Entry"e\x82\xd3\xe4\x93\x02G">/v1beta1/{parent=projects/*/locations/*/entryGroups/*}/entries:\x05\x65ntry\xda\x41\x15parent,entry_id,entry\x12\xdd\x01\n\x0bUpdateEntry\x12\x34.google.cloud.datacatalog.v1beta1.UpdateEntryRequest\x1a\'.google.cloud.datacatalog.v1beta1.Entry"o\x82\xd3\xe4\x93\x02M2D/v1beta1/{entry.name=projects/*/locations/*/entryGroups/*/entries/*}:\x05\x65ntry\xda\x41\x05\x65ntry\xda\x41\x11\x65ntry,update_mask\x12\xaa\x01\n\x0b\x44\x65leteEntry\x12\x34.google.cloud.datacatalog.v1beta1.DeleteEntryRequest\x1a\x16.google.protobuf.Empty"M\x82\xd3\xe4\x93\x02@*>/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*}\xda\x41\x04name\x12\xb5\x01\n\x08GetEntry\x12\x31.google.cloud.datacatalog.v1beta1.GetEntryRequest\x1a\'.google.cloud.datacatalog.v1beta1.Entry"M\x82\xd3\xe4\x93\x02@\x12>/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*}\xda\x41\x04name\x12\x8d\x01\n\x0bLookupEntry\x12\x34.google.cloud.datacatalog.v1beta1.LookupEntryRequest\x1a\'.google.cloud.datacatalog.v1beta1.Entry"\x1f\x82\xd3\xe4\x93\x02\x19\x12\x17/v1beta1/entries:lookup\x12\xf1\x01\n\x11\x43reateTagTemplate\x12:.google.cloud.datacatalog.v1beta1.CreateTagTemplateRequest\x1a-.google.cloud.datacatalog.v1beta1.TagTemplate"q\x82\xd3\xe4\x93\x02\x45"5/v1beta1/{parent=projects/*/locations/*}/tagTemplates:\x0ctag_template\xda\x41#parent,tag_template_id,tag_template\x12\xbe\x01\n\x0eGetTagTemplate\x12\x37.google.cloud.datacatalog.v1beta1.GetTagTemplateRequest\x1a-.google.cloud.datacatalog.v1beta1.TagTemplate"D\x82\xd3\xe4\x93\x02\x37\x12\x35/v1beta1/{name=projects/*/locations/*/tagTemplates/*}\xda\x41\x04name\x12\x83\x02\n\x11UpdateTagTemplate\x12:.google.cloud.datacatalog.v1beta1.UpdateTagTemplateRequest\x1a-.google.cloud.datacatalog.v1beta1.TagTemplate"\x82\x01\x82\xd3\xe4\x93\x02R2B/v1beta1/{tag_template.name=projects/*/locations/*/tagTemplates/*}:\x0ctag_template\xda\x41\x0ctag_template\xda\x41\x18tag_template,update_mask\x12\xb3\x01\n\x11\x44\x65leteTagTemplate\x12:.google.cloud.datacatalog.v1beta1.DeleteTagTemplateRequest\x1a\x16.google.protobuf.Empty"J\x82\xd3\xe4\x93\x02\x37*5/v1beta1/{name=projects/*/locations/*/tagTemplates/*}\xda\x41\nname,force\x12\x9c\x02\n\x16\x43reateTagTemplateField\x12?.google.cloud.datacatalog.v1beta1.CreateTagTemplateFieldRequest\x1a\x32.google.cloud.datacatalog.v1beta1.TagTemplateField"\x8c\x01\x82\xd3\xe4\x93\x02T">/v1beta1/{parent=projects/*/locations/*/tagTemplates/*}/fields:\x12tag_template_field\xda\x41/parent,tag_template_field_id,tag_template_field\x12\xaa\x02\n\x16UpdateTagTemplateField\x12?.google.cloud.datacatalog.v1beta1.UpdateTagTemplateFieldRequest\x1a\x32.google.cloud.datacatalog.v1beta1.TagTemplateField"\x9a\x01\x82\xd3\xe4\x93\x02T2>/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}:\x12tag_template_field\xda\x41\x17name,tag_template_field\xda\x41#name,tag_template_field,update_mask\x12\x80\x02\n\x16RenameTagTemplateField\x12?.google.cloud.datacatalog.v1beta1.RenameTagTemplateFieldRequest\x1a\x32.google.cloud.datacatalog.v1beta1.TagTemplateField"q\x82\xd3\xe4\x93\x02J"E/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}:rename:\x01*\xda\x41\x1ename,new_tag_template_field_id\x12\xc6\x01\n\x16\x44\x65leteTagTemplateField\x12?.google.cloud.datacatalog.v1beta1.DeleteTagTemplateFieldRequest\x1a\x16.google.protobuf.Empty"S\x82\xd3\xe4\x93\x02@*>/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}\xda\x41\nname,force\x12\xc7\x01\n\tCreateTag\x12\x32.google.cloud.datacatalog.v1beta1.CreateTagRequest\x1a%.google.cloud.datacatalog.v1beta1.Tag"_\x82\xd3\xe4\x93\x02L"E/v1beta1/{parent=projects/*/locations/*/entryGroups/*/entries/*}/tags:\x03tag\xda\x41\nparent,tag\x12\xd6\x01\n\tUpdateTag\x12\x32.google.cloud.datacatalog.v1beta1.UpdateTagRequest\x1a%.google.cloud.datacatalog.v1beta1.Tag"n\x82\xd3\xe4\x93\x02P2I/v1beta1/{tag.name=projects/*/locations/*/entryGroups/*/entries/*/tags/*}:\x03tag\xda\x41\x03tag\xda\x41\x0ftag,update_mask\x12\xad\x01\n\tDeleteTag\x12\x32.google.cloud.datacatalog.v1beta1.DeleteTagRequest\x1a\x16.google.protobuf.Empty"T\x82\xd3\xe4\x93\x02G*E/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*/tags/*}\xda\x41\x04name\x12\xc9\x01\n\x08ListTags\x12\x31.google.cloud.datacatalog.v1beta1.ListTagsRequest\x1a\x32.google.cloud.datacatalog.v1beta1.ListTagsResponse"V\x82\xd3\xe4\x93\x02G\x12\x45/v1beta1/{parent=projects/*/locations/*/entryGroups/*/entries/*}/tags\xda\x41\x06parent\x12\xc0\x02\n\x0cSetIamPolicy\x12".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"\xf4\x01\x82\xd3\xe4\x93\x02\xed\x01"F/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:setIamPolicy:\x01*ZJ"E/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:setIamPolicy:\x01*ZT"O/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:setIamPolicy:\x01*\x12\xc0\x02\n\x0cGetIamPolicy\x12".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"\xf4\x01\x82\xd3\xe4\x93\x02\xed\x01"F/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:getIamPolicy:\x01*ZJ"E/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:getIamPolicy:\x01*ZT"O/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:getIamPolicy:\x01*\x12\xf2\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse"\x86\x02\x82\xd3\xe4\x93\x02\xff\x01"L/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:testIamPermissions:\x01*ZP"K/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:testIamPermissions:\x01*ZZ"U/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:testIamPermissions:\x01*\x1aN\xca\x41\x1a\x64\x61tacatalog.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBx\n$com.google.cloud.datacatalog.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_gcs__fileset__spec__pb2.DESCRIPTOR, - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_schema__pb2.DESCRIPTOR, - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_search__pb2.DESCRIPTOR, - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_table__spec__pb2.DESCRIPTOR, - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2.DESCRIPTOR, - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_timestamps__pb2.DESCRIPTOR, - google_dot_iam_dot_v1_dot_iam__policy__pb2.DESCRIPTOR, - google_dot_iam_dot_v1_dot_policy__pb2.DESCRIPTOR, - google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - ], -) - -_ENTRYTYPE = _descriptor.EnumDescriptor( - name="EntryType", - full_name="google.cloud.datacatalog.v1beta1.EntryType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="ENTRY_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TABLE", index=1, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DATA_STREAM", index=2, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FILESET", index=3, number=4, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4873, - serialized_end=4953, -) -_sym_db.RegisterEnumDescriptor(_ENTRYTYPE) - -EntryType = enum_type_wrapper.EnumTypeWrapper(_ENTRYTYPE) -ENTRY_TYPE_UNSPECIFIED = 0 -TABLE = 2 -DATA_STREAM = 3 -FILESET = 4 - - -_SEARCHCATALOGREQUEST_SCOPE = _descriptor.Descriptor( - name="Scope", - full_name="google.cloud.datacatalog.v1beta1.SearchCatalogRequest.Scope", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="include_org_ids", - full_name="google.cloud.datacatalog.v1beta1.SearchCatalogRequest.Scope.include_org_ids", - index=0, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="include_project_ids", - full_name="google.cloud.datacatalog.v1beta1.SearchCatalogRequest.Scope.include_project_ids", - index=1, - number=3, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="include_gcp_public_datasets", - full_name="google.cloud.datacatalog.v1beta1.SearchCatalogRequest.Scope.include_gcp_public_datasets", - index=2, - number=7, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=855, - serialized_end=953, -) - -_SEARCHCATALOGREQUEST = _descriptor.Descriptor( - name="SearchCatalogRequest", - full_name="google.cloud.datacatalog.v1beta1.SearchCatalogRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="scope", - full_name="google.cloud.datacatalog.v1beta1.SearchCatalogRequest.scope", - index=0, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="query", - full_name="google.cloud.datacatalog.v1beta1.SearchCatalogRequest.query", - index=1, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.datacatalog.v1beta1.SearchCatalogRequest.page_size", - index=2, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.datacatalog.v1beta1.SearchCatalogRequest.page_token", - index=3, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="order_by", - full_name="google.cloud.datacatalog.v1beta1.SearchCatalogRequest.order_by", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_SEARCHCATALOGREQUEST_SCOPE], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=667, - serialized_end=953, -) - - -_SEARCHCATALOGRESPONSE = _descriptor.Descriptor( - name="SearchCatalogResponse", - full_name="google.cloud.datacatalog.v1beta1.SearchCatalogResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="results", - full_name="google.cloud.datacatalog.v1beta1.SearchCatalogResponse.results", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.datacatalog.v1beta1.SearchCatalogResponse.next_page_token", - index=1, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=955, - serialized_end=1075, -) - - -_CREATEENTRYGROUPREQUEST = _descriptor.Descriptor( - name="CreateEntryGroupRequest", - full_name="google.cloud.datacatalog.v1beta1.CreateEntryGroupRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datacatalog.v1beta1.CreateEntryGroupRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A'\022%datacatalog.googleapis.com/EntryGroup" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="entry_group_id", - full_name="google.cloud.datacatalog.v1beta1.CreateEntryGroupRequest.entry_group_id", - index=1, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="entry_group", - full_name="google.cloud.datacatalog.v1beta1.CreateEntryGroupRequest.entry_group", - index=2, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1078, - serialized_end=1262, -) - - -_GETENTRYGROUPREQUEST = _descriptor.Descriptor( - name="GetEntryGroupRequest", - full_name="google.cloud.datacatalog.v1beta1.GetEntryGroupRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datacatalog.v1beta1.GetEntryGroupRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A'\n%datacatalog.googleapis.com/EntryGroup" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="read_mask", - full_name="google.cloud.datacatalog.v1beta1.GetEntryGroupRequest.read_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1265, - serialized_end=1395, -) - - -_DELETEENTRYGROUPREQUEST = _descriptor.Descriptor( - name="DeleteEntryGroupRequest", - full_name="google.cloud.datacatalog.v1beta1.DeleteEntryGroupRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datacatalog.v1beta1.DeleteEntryGroupRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A'\n%datacatalog.googleapis.com/EntryGroup" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1397, - serialized_end=1483, -) - - -_CREATEENTRYREQUEST = _descriptor.Descriptor( - name="CreateEntryRequest", - full_name="google.cloud.datacatalog.v1beta1.CreateEntryRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datacatalog.v1beta1.CreateEntryRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A'\n%datacatalog.googleapis.com/EntryGroup" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="entry_id", - full_name="google.cloud.datacatalog.v1beta1.CreateEntryRequest.entry_id", - index=1, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="entry", - full_name="google.cloud.datacatalog.v1beta1.CreateEntryRequest.entry", - index=2, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1486, - serialized_end=1653, -) - - -_UPDATEENTRYREQUEST = _descriptor.Descriptor( - name="UpdateEntryRequest", - full_name="google.cloud.datacatalog.v1beta1.UpdateEntryRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entry", - full_name="google.cloud.datacatalog.v1beta1.UpdateEntryRequest.entry", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.datacatalog.v1beta1.UpdateEntryRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1656, - serialized_end=1786, -) - - -_DELETEENTRYREQUEST = _descriptor.Descriptor( - name="DeleteEntryRequest", - full_name="google.cloud.datacatalog.v1beta1.DeleteEntryRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datacatalog.v1beta1.DeleteEntryRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b('\340A\002\372A"\n datacatalog.googleapis.com/Entry'), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1788, - serialized_end=1864, -) - - -_GETENTRYREQUEST = _descriptor.Descriptor( - name="GetEntryRequest", - full_name="google.cloud.datacatalog.v1beta1.GetEntryRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datacatalog.v1beta1.GetEntryRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b('\340A\002\372A"\n datacatalog.googleapis.com/Entry'), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1866, - serialized_end=1939, -) - - -_LOOKUPENTRYREQUEST = _descriptor.Descriptor( - name="LookupEntryRequest", - full_name="google.cloud.datacatalog.v1beta1.LookupEntryRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="linked_resource", - full_name="google.cloud.datacatalog.v1beta1.LookupEntryRequest.linked_resource", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="sql_resource", - full_name="google.cloud.datacatalog.v1beta1.LookupEntryRequest.sql_resource", - index=1, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="target_name", - full_name="google.cloud.datacatalog.v1beta1.LookupEntryRequest.target_name", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1941, - serialized_end=2027, -) - - -_ENTRY = _descriptor.Descriptor( - name="Entry", - full_name="google.cloud.datacatalog.v1beta1.Entry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datacatalog.v1beta1.Entry.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\372A'\n%datacatalog.googleapis.com/EntryGroup"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="linked_resource", - full_name="google.cloud.datacatalog.v1beta1.Entry.linked_resource", - index=1, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.datacatalog.v1beta1.Entry.type", - index=2, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="gcs_fileset_spec", - full_name="google.cloud.datacatalog.v1beta1.Entry.gcs_fileset_spec", - index=3, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bigquery_table_spec", - full_name="google.cloud.datacatalog.v1beta1.Entry.bigquery_table_spec", - index=4, - number=12, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bigquery_date_sharded_spec", - full_name="google.cloud.datacatalog.v1beta1.Entry.bigquery_date_sharded_spec", - index=5, - number=15, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.datacatalog.v1beta1.Entry.display_name", - index=6, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.datacatalog.v1beta1.Entry.description", - index=7, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="schema", - full_name="google.cloud.datacatalog.v1beta1.Entry.schema", - index=8, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="source_system_timestamps", - full_name="google.cloud.datacatalog.v1beta1.Entry.source_system_timestamps", - index=9, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b( - "\352Au\n datacatalog.googleapis.com/Entry\022Qprojects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="entry_type", - full_name="google.cloud.datacatalog.v1beta1.Entry.entry_type", - index=0, - containing_type=None, - fields=[], - ), - _descriptor.OneofDescriptor( - name="type_spec", - full_name="google.cloud.datacatalog.v1beta1.Entry.type_spec", - index=1, - containing_type=None, - fields=[], - ), - ], - serialized_start=2030, - serialized_end=2786, -) - - -_ENTRYGROUP = _descriptor.Descriptor( - name="EntryGroup", - full_name="google.cloud.datacatalog.v1beta1.EntryGroup", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datacatalog.v1beta1.EntryGroup.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.datacatalog.v1beta1.EntryGroup.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.datacatalog.v1beta1.EntryGroup.description", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="data_catalog_timestamps", - full_name="google.cloud.datacatalog.v1beta1.EntryGroup.data_catalog_timestamps", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b( - "\352Aj\n%datacatalog.googleapis.com/EntryGroup\022Aprojects/{project}/locations/{location}/entryGroups/{entry_group}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2789, - serialized_end=3059, -) - - -_CREATETAGTEMPLATEREQUEST = _descriptor.Descriptor( - name="CreateTagTemplateRequest", - full_name="google.cloud.datacatalog.v1beta1.CreateTagTemplateRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datacatalog.v1beta1.CreateTagTemplateRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A(\022&datacatalog.googleapis.com/TagTemplate" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tag_template_id", - full_name="google.cloud.datacatalog.v1beta1.CreateTagTemplateRequest.tag_template_id", - index=1, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tag_template", - full_name="google.cloud.datacatalog.v1beta1.CreateTagTemplateRequest.tag_template", - index=2, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3062, - serialized_end=3256, -) - - -_GETTAGTEMPLATEREQUEST = _descriptor.Descriptor( - name="GetTagTemplateRequest", - full_name="google.cloud.datacatalog.v1beta1.GetTagTemplateRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datacatalog.v1beta1.GetTagTemplateRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A(\n&datacatalog.googleapis.com/TagTemplate" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3258, - serialized_end=3343, -) - - -_UPDATETAGTEMPLATEREQUEST = _descriptor.Descriptor( - name="UpdateTagTemplateRequest", - full_name="google.cloud.datacatalog.v1beta1.UpdateTagTemplateRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="tag_template", - full_name="google.cloud.datacatalog.v1beta1.UpdateTagTemplateRequest.tag_template", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.datacatalog.v1beta1.UpdateTagTemplateRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3346, - serialized_end=3495, -) - - -_DELETETAGTEMPLATEREQUEST = _descriptor.Descriptor( - name="DeleteTagTemplateRequest", - full_name="google.cloud.datacatalog.v1beta1.DeleteTagTemplateRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datacatalog.v1beta1.DeleteTagTemplateRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A(\n&datacatalog.googleapis.com/TagTemplate" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="force", - full_name="google.cloud.datacatalog.v1beta1.DeleteTagTemplateRequest.force", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3497, - serialized_end=3605, -) - - -_CREATETAGREQUEST = _descriptor.Descriptor( - name="CreateTagRequest", - full_name="google.cloud.datacatalog.v1beta1.CreateTagRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datacatalog.v1beta1.CreateTagRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A \n\036datacatalog.googleapis.com/Tag" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tag", - full_name="google.cloud.datacatalog.v1beta1.CreateTagRequest.tag", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3608, - serialized_end=3739, -) - - -_UPDATETAGREQUEST = _descriptor.Descriptor( - name="UpdateTagRequest", - full_name="google.cloud.datacatalog.v1beta1.UpdateTagRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="tag", - full_name="google.cloud.datacatalog.v1beta1.UpdateTagRequest.tag", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.datacatalog.v1beta1.UpdateTagRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3741, - serialized_end=3865, -) - - -_DELETETAGREQUEST = _descriptor.Descriptor( - name="DeleteTagRequest", - full_name="google.cloud.datacatalog.v1beta1.DeleteTagRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datacatalog.v1beta1.DeleteTagRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A \022\036datacatalog.googleapis.com/Tag" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3867, - serialized_end=3939, -) - - -_CREATETAGTEMPLATEFIELDREQUEST = _descriptor.Descriptor( - name="CreateTagTemplateFieldRequest", - full_name="google.cloud.datacatalog.v1beta1.CreateTagTemplateFieldRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datacatalog.v1beta1.CreateTagTemplateFieldRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A(\n&datacatalog.googleapis.com/TagTemplate" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tag_template_field_id", - full_name="google.cloud.datacatalog.v1beta1.CreateTagTemplateFieldRequest.tag_template_field_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tag_template_field", - full_name="google.cloud.datacatalog.v1beta1.CreateTagTemplateFieldRequest.tag_template_field", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3942, - serialized_end=4158, -) - - -_UPDATETAGTEMPLATEFIELDREQUEST = _descriptor.Descriptor( - name="UpdateTagTemplateFieldRequest", - full_name="google.cloud.datacatalog.v1beta1.UpdateTagTemplateFieldRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datacatalog.v1beta1.UpdateTagTemplateFieldRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A-\n+datacatalog.googleapis.com/TagTemplateField" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tag_template_field", - full_name="google.cloud.datacatalog.v1beta1.UpdateTagTemplateFieldRequest.tag_template_field", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.datacatalog.v1beta1.UpdateTagTemplateFieldRequest.update_mask", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4161, - serialized_end=4398, -) - - -_RENAMETAGTEMPLATEFIELDREQUEST = _descriptor.Descriptor( - name="RenameTagTemplateFieldRequest", - full_name="google.cloud.datacatalog.v1beta1.RenameTagTemplateFieldRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datacatalog.v1beta1.RenameTagTemplateFieldRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A-\n+datacatalog.googleapis.com/TagTemplateField" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="new_tag_template_field_id", - full_name="google.cloud.datacatalog.v1beta1.RenameTagTemplateFieldRequest.new_tag_template_field_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4401, - serialized_end=4539, -) - - -_DELETETAGTEMPLATEFIELDREQUEST = _descriptor.Descriptor( - name="DeleteTagTemplateFieldRequest", - full_name="google.cloud.datacatalog.v1beta1.DeleteTagTemplateFieldRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datacatalog.v1beta1.DeleteTagTemplateFieldRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A-\n+datacatalog.googleapis.com/TagTemplateField" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="force", - full_name="google.cloud.datacatalog.v1beta1.DeleteTagTemplateFieldRequest.force", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4541, - serialized_end=4659, -) - - -_LISTTAGSREQUEST = _descriptor.Descriptor( - name="ListTagsRequest", - full_name="google.cloud.datacatalog.v1beta1.ListTagsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datacatalog.v1beta1.ListTagsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A \022\036datacatalog.googleapis.com/Tag" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.datacatalog.v1beta1.ListTagsRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.datacatalog.v1beta1.ListTagsRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4661, - serialized_end=4773, -) - - -_LISTTAGSRESPONSE = _descriptor.Descriptor( - name="ListTagsResponse", - full_name="google.cloud.datacatalog.v1beta1.ListTagsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="tags", - full_name="google.cloud.datacatalog.v1beta1.ListTagsResponse.tags", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.datacatalog.v1beta1.ListTagsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4775, - serialized_end=4871, -) - -_SEARCHCATALOGREQUEST_SCOPE.containing_type = _SEARCHCATALOGREQUEST -_SEARCHCATALOGREQUEST.fields_by_name["scope"].message_type = _SEARCHCATALOGREQUEST_SCOPE -_SEARCHCATALOGRESPONSE.fields_by_name[ - "results" -].message_type = ( - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_search__pb2._SEARCHCATALOGRESULT -) -_CREATEENTRYGROUPREQUEST.fields_by_name["entry_group"].message_type = _ENTRYGROUP -_GETENTRYGROUPREQUEST.fields_by_name[ - "read_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_CREATEENTRYREQUEST.fields_by_name["entry"].message_type = _ENTRY -_UPDATEENTRYREQUEST.fields_by_name["entry"].message_type = _ENTRY -_UPDATEENTRYREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_LOOKUPENTRYREQUEST.oneofs_by_name["target_name"].fields.append( - _LOOKUPENTRYREQUEST.fields_by_name["linked_resource"] -) -_LOOKUPENTRYREQUEST.fields_by_name[ - "linked_resource" -].containing_oneof = _LOOKUPENTRYREQUEST.oneofs_by_name["target_name"] -_LOOKUPENTRYREQUEST.oneofs_by_name["target_name"].fields.append( - _LOOKUPENTRYREQUEST.fields_by_name["sql_resource"] -) -_LOOKUPENTRYREQUEST.fields_by_name[ - "sql_resource" -].containing_oneof = _LOOKUPENTRYREQUEST.oneofs_by_name["target_name"] -_ENTRY.fields_by_name["type"].enum_type = _ENTRYTYPE -_ENTRY.fields_by_name[ - "gcs_fileset_spec" -].message_type = ( - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_gcs__fileset__spec__pb2._GCSFILESETSPEC -) -_ENTRY.fields_by_name[ - "bigquery_table_spec" -].message_type = ( - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_table__spec__pb2._BIGQUERYTABLESPEC -) -_ENTRY.fields_by_name[ - "bigquery_date_sharded_spec" -].message_type = ( - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_table__spec__pb2._BIGQUERYDATESHARDEDSPEC -) -_ENTRY.fields_by_name[ - "schema" -].message_type = ( - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_schema__pb2._SCHEMA -) -_ENTRY.fields_by_name[ - "source_system_timestamps" -].message_type = ( - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_timestamps__pb2._SYSTEMTIMESTAMPS -) -_ENTRY.oneofs_by_name["entry_type"].fields.append(_ENTRY.fields_by_name["type"]) -_ENTRY.fields_by_name["type"].containing_oneof = _ENTRY.oneofs_by_name["entry_type"] -_ENTRY.oneofs_by_name["type_spec"].fields.append( - _ENTRY.fields_by_name["gcs_fileset_spec"] -) -_ENTRY.fields_by_name["gcs_fileset_spec"].containing_oneof = _ENTRY.oneofs_by_name[ - "type_spec" -] -_ENTRY.oneofs_by_name["type_spec"].fields.append( - _ENTRY.fields_by_name["bigquery_table_spec"] -) -_ENTRY.fields_by_name["bigquery_table_spec"].containing_oneof = _ENTRY.oneofs_by_name[ - "type_spec" -] -_ENTRY.oneofs_by_name["type_spec"].fields.append( - _ENTRY.fields_by_name["bigquery_date_sharded_spec"] -) -_ENTRY.fields_by_name[ - "bigquery_date_sharded_spec" -].containing_oneof = _ENTRY.oneofs_by_name["type_spec"] -_ENTRYGROUP.fields_by_name[ - "data_catalog_timestamps" -].message_type = ( - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_timestamps__pb2._SYSTEMTIMESTAMPS -) -_CREATETAGTEMPLATEREQUEST.fields_by_name[ - "tag_template" -].message_type = ( - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2._TAGTEMPLATE -) -_UPDATETAGTEMPLATEREQUEST.fields_by_name[ - "tag_template" -].message_type = ( - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2._TAGTEMPLATE -) -_UPDATETAGTEMPLATEREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_CREATETAGREQUEST.fields_by_name[ - "tag" -].message_type = google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2._TAG -_UPDATETAGREQUEST.fields_by_name[ - "tag" -].message_type = google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2._TAG -_UPDATETAGREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_CREATETAGTEMPLATEFIELDREQUEST.fields_by_name[ - "tag_template_field" -].message_type = ( - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2._TAGTEMPLATEFIELD -) -_UPDATETAGTEMPLATEFIELDREQUEST.fields_by_name[ - "tag_template_field" -].message_type = ( - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2._TAGTEMPLATEFIELD -) -_UPDATETAGTEMPLATEFIELDREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_LISTTAGSRESPONSE.fields_by_name[ - "tags" -].message_type = google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2._TAG -DESCRIPTOR.message_types_by_name["SearchCatalogRequest"] = _SEARCHCATALOGREQUEST -DESCRIPTOR.message_types_by_name["SearchCatalogResponse"] = _SEARCHCATALOGRESPONSE -DESCRIPTOR.message_types_by_name["CreateEntryGroupRequest"] = _CREATEENTRYGROUPREQUEST -DESCRIPTOR.message_types_by_name["GetEntryGroupRequest"] = _GETENTRYGROUPREQUEST -DESCRIPTOR.message_types_by_name["DeleteEntryGroupRequest"] = _DELETEENTRYGROUPREQUEST -DESCRIPTOR.message_types_by_name["CreateEntryRequest"] = _CREATEENTRYREQUEST -DESCRIPTOR.message_types_by_name["UpdateEntryRequest"] = _UPDATEENTRYREQUEST -DESCRIPTOR.message_types_by_name["DeleteEntryRequest"] = _DELETEENTRYREQUEST -DESCRIPTOR.message_types_by_name["GetEntryRequest"] = _GETENTRYREQUEST -DESCRIPTOR.message_types_by_name["LookupEntryRequest"] = _LOOKUPENTRYREQUEST -DESCRIPTOR.message_types_by_name["Entry"] = _ENTRY -DESCRIPTOR.message_types_by_name["EntryGroup"] = _ENTRYGROUP -DESCRIPTOR.message_types_by_name["CreateTagTemplateRequest"] = _CREATETAGTEMPLATEREQUEST -DESCRIPTOR.message_types_by_name["GetTagTemplateRequest"] = _GETTAGTEMPLATEREQUEST -DESCRIPTOR.message_types_by_name["UpdateTagTemplateRequest"] = _UPDATETAGTEMPLATEREQUEST -DESCRIPTOR.message_types_by_name["DeleteTagTemplateRequest"] = _DELETETAGTEMPLATEREQUEST -DESCRIPTOR.message_types_by_name["CreateTagRequest"] = _CREATETAGREQUEST -DESCRIPTOR.message_types_by_name["UpdateTagRequest"] = _UPDATETAGREQUEST -DESCRIPTOR.message_types_by_name["DeleteTagRequest"] = _DELETETAGREQUEST -DESCRIPTOR.message_types_by_name[ - "CreateTagTemplateFieldRequest" -] = _CREATETAGTEMPLATEFIELDREQUEST -DESCRIPTOR.message_types_by_name[ - "UpdateTagTemplateFieldRequest" -] = _UPDATETAGTEMPLATEFIELDREQUEST -DESCRIPTOR.message_types_by_name[ - "RenameTagTemplateFieldRequest" -] = _RENAMETAGTEMPLATEFIELDREQUEST -DESCRIPTOR.message_types_by_name[ - "DeleteTagTemplateFieldRequest" -] = _DELETETAGTEMPLATEFIELDREQUEST -DESCRIPTOR.message_types_by_name["ListTagsRequest"] = _LISTTAGSREQUEST -DESCRIPTOR.message_types_by_name["ListTagsResponse"] = _LISTTAGSRESPONSE -DESCRIPTOR.enum_types_by_name["EntryType"] = _ENTRYTYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -SearchCatalogRequest = _reflection.GeneratedProtocolMessageType( - "SearchCatalogRequest", - (_message.Message,), - dict( - Scope=_reflection.GeneratedProtocolMessageType( - "Scope", - (_message.Message,), - dict( - DESCRIPTOR=_SEARCHCATALOGREQUEST_SCOPE, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__=""" - Attributes: - include_org_ids: - Data Catalog tries to automatically choose the right corpus of - data to search through. You can ensure an organization is - included by adding it to ``include_org_ids``. You can ensure a - project's org is included with ``include_project_ids``. You - must specify at least one organization using - ``include_org_ids`` or ``include_project_ids`` in all search - requests. List of organization IDs to search within. To find - your organization ID, follow instructions in - https://cloud.google.com/resource-manager/docs/creating- - managing-organization. - include_project_ids: - List of project IDs to search within. To learn more about the - distinction between project names/IDs/numbers, go to - https://cloud.google.com/docs/overview/#projects. - include_gcp_public_datasets: - If ``true``, include Google Cloud Platform (GCP) public - datasets in the search results. Info on GCP public datasets is - available at https://cloud.google.com/public-datasets/. By - default, GCP public datasets are excluded. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.SearchCatalogRequest.Scope) - ), - ), - DESCRIPTOR=_SEARCHCATALOGREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [SearchCatalog][google.cloud.datacatalog.v1beta1.DataCatalog.SearchCatalog]. - - - Attributes: - scope: - Required. The scope of this search request. - query: - Required. The query string in search query syntax. The query - must be non-empty. Query strings can be simple as "x" or more - qualified as: - name:x - column:x - description:y Note: - Query tokens need to have a minimum of 3 characters for - substring matching to work correctly. See `Data Catalog Search - Syntax `__ for - more information. - page_size: - Number of results in the search page. If <=0 then defaults to - 10. Max limit for page\_size is 1000. Throws an invalid - argument for page\_size > 1000. - page_token: - Optional. Pagination token returned in an earlier [SearchCatal - ogResponse.next\_page\_token][google.cloud.datacatalog.v1beta1 - .SearchCatalogResponse.next\_page\_token], which indicates - that this is a continuation of a prior [SearchCatalogRequest][ - google.cloud.datacatalog.v1beta1.DataCatalog.SearchCatalog] - call, and that the system should return the next page of data. - If empty, the first page is returned. - order_by: - Specifies the ordering of results, currently supported case- - sensitive choices are: - ``relevance``, only supports - desecending - ``last_access_timestamp [asc|desc]``, defaults - to descending if not specified - ``last_modified_timestamp - [asc|desc]``, defaults to descending if not specified If - not specified, defaults to ``relevance`` descending. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.SearchCatalogRequest) - ), -) -_sym_db.RegisterMessage(SearchCatalogRequest) -_sym_db.RegisterMessage(SearchCatalogRequest.Scope) - -SearchCatalogResponse = _reflection.GeneratedProtocolMessageType( - "SearchCatalogResponse", - (_message.Message,), - dict( - DESCRIPTOR=_SEARCHCATALOGRESPONSE, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Response message for - [SearchCatalog][google.cloud.datacatalog.v1beta1.DataCatalog.SearchCatalog]. - - - Attributes: - results: - Search results. - next_page_token: - The token that can be used to retrieve the next page of - results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.SearchCatalogResponse) - ), -) -_sym_db.RegisterMessage(SearchCatalogResponse) - -CreateEntryGroupRequest = _reflection.GeneratedProtocolMessageType( - "CreateEntryGroupRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEENTRYGROUPREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [CreateEntryGroup][google.cloud.datacatalog.v1beta1.DataCatalog.CreateEntryGroup]. - - - Attributes: - parent: - Required. The name of the project this entry group is in. - Example: - projects/{project\_id}/locations/{location} Note - that this EntryGroup and its child resources may not actually - be stored in the location in this name. - entry_group_id: - Required. The id of the entry group to create. The id must - begin with a letter or underscore, contain only English - letters, numbers and underscores, and be at most 64 - characters. - entry_group: - The entry group to create. Defaults to an empty entry group. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.CreateEntryGroupRequest) - ), -) -_sym_db.RegisterMessage(CreateEntryGroupRequest) - -GetEntryGroupRequest = _reflection.GeneratedProtocolMessageType( - "GetEntryGroupRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETENTRYGROUPREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [GetEntryGroup][google.cloud.datacatalog.v1beta1.DataCatalog.GetEntryGroup]. - - - Attributes: - name: - Required. The name of the entry group. For example, ``projects - /{project_id}/locations/{location}/entryGroups/{entry_group_id - }``. - read_mask: - The fields to return. If not set or empty, all fields are - returned. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.GetEntryGroupRequest) - ), -) -_sym_db.RegisterMessage(GetEntryGroupRequest) - -DeleteEntryGroupRequest = _reflection.GeneratedProtocolMessageType( - "DeleteEntryGroupRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEENTRYGROUPREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [DeleteEntryGroup][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteEntryGroup]. - - - Attributes: - name: - Required. The name of the entry group. For example, ``projects - /{project_id}/locations/{location}/entryGroups/{entry_group_id - }``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.DeleteEntryGroupRequest) - ), -) -_sym_db.RegisterMessage(DeleteEntryGroupRequest) - -CreateEntryRequest = _reflection.GeneratedProtocolMessageType( - "CreateEntryRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEENTRYREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [CreateEntry][google.cloud.datacatalog.v1beta1.DataCatalog.CreateEntry]. - - - Attributes: - parent: - Required. The name of the entry group this entry is in. - Example: - projects/{project\_id}/locations/{location}/entry - Groups/{entry\_group\_id} Note that this Entry and its child - resources may not actually be stored in the location in this - name. - entry_id: - Required. The id of the entry to create. - entry: - Required. The entry to create. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.CreateEntryRequest) - ), -) -_sym_db.RegisterMessage(CreateEntryRequest) - -UpdateEntryRequest = _reflection.GeneratedProtocolMessageType( - "UpdateEntryRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEENTRYREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [UpdateEntry][google.cloud.datacatalog.v1beta1.DataCatalog.UpdateEntry]. - - - Attributes: - entry: - Required. The updated entry. The "name" field must be set. - update_mask: - The fields to update on the entry. If absent or empty, all - modifiable fields are updated. The following fields are - modifiable: \* For entries with type ``DATA_STREAM``: \* - ``schema`` \* For entries with type ``FILESET`` \* ``schema`` - \* ``display_name`` \* ``description`` \* ``gcs_fileset_spec`` - \* ``gcs_fileset_spec.file_patterns`` - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.UpdateEntryRequest) - ), -) -_sym_db.RegisterMessage(UpdateEntryRequest) - -DeleteEntryRequest = _reflection.GeneratedProtocolMessageType( - "DeleteEntryRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEENTRYREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [DeleteEntry][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteEntry]. - - - Attributes: - name: - Required. The name of the entry. Example: - projects/{projec - t\_id}/locations/{location}/entryGroups/{entry\_group\_id}/ent - ries/{entry\_id} - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.DeleteEntryRequest) - ), -) -_sym_db.RegisterMessage(DeleteEntryRequest) - -GetEntryRequest = _reflection.GeneratedProtocolMessageType( - "GetEntryRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETENTRYREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [GetEntry][google.cloud.datacatalog.v1beta1.DataCatalog.GetEntry]. - - - Attributes: - name: - Required. The name of the entry. Example: - projects/{projec - t\_id}/locations/{location}/entryGroups/{entry\_group\_id}/ent - ries/{entry\_id} Entry groups are logical groupings of - entries. Currently, users cannot create/modify entry groups. - They are created by Data Catalog; they include ``@bigquery`` - for all BigQuery entries, and ``@pubsub`` for all Cloud - Pub/Sub entries. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.GetEntryRequest) - ), -) -_sym_db.RegisterMessage(GetEntryRequest) - -LookupEntryRequest = _reflection.GeneratedProtocolMessageType( - "LookupEntryRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LOOKUPENTRYREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [LookupEntry][google.cloud.datacatalog.v1beta1.DataCatalog.LookupEntry]. - - - Attributes: - target_name: - Required. Represents either the Google Cloud Platform resource - or SQL name for a Google Cloud Platform resource. - linked_resource: - The full name of the Google Cloud Platform resource the Data - Catalog entry represents. See: https://cloud.google.com/apis/d - esign/resource\_names#full\_resource\_name. Full names are - case-sensitive. Examples: - //bigquery.googleapis.com/proje - cts/projectId/datasets/datasetId/tables/tableId - - //pubsub.googleapis.com/projects/projectId/topics/topicId - sql_resource: - The SQL name of the entry. SQL names are case-sensitive. - Examples: - ``cloud_pubsub.project_id.topic_id`` - - ``pubsub.project_id.`topic.id.with.dots``` - - ``bigquery.table.project_id.dataset_id.table_id`` - - ``bigquery.dataset.project_id.dataset_id`` - - ``datacatalog.project_id.location_id.entry_group_id.entry_id`` - ``*_id``\ s shoud satisfy the standard SQL rules for - identifiers. - https://cloud.google.com/bigquery/docs/reference/standard- - sql/lexical. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.LookupEntryRequest) - ), -) -_sym_db.RegisterMessage(LookupEntryRequest) - -Entry = _reflection.GeneratedProtocolMessageType( - "Entry", - (_message.Message,), - dict( - DESCRIPTOR=_ENTRY, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Entry Metadata. A Data Catalog Entry resource represents - another resource in Google Cloud Platform, such as a BigQuery dataset or - a Cloud Pub/Sub topic. Clients can use the ``linked_resource`` field in - the Entry resource to refer to the original resource ID of the source - system. - - An Entry resource contains resource details, such as its schema. An - Entry can also be used to attach flexible metadata, such as a - [Tag][google.cloud.datacatalog.v1beta1.Tag]. - - - Attributes: - name: - The Data Catalog resource name of the entry in URL format. - Example: - projects/{project\_id}/locations/{location}/entry - Groups/{entry\_group\_id}/entries/{entry\_id} Note that this - Entry and its child resources may not actually be stored in - the location in this name. - linked_resource: - Output only. The resource this metadata entry refers to. For - Google Cloud Platform resources, ``linked_resource`` is the - `full name of the resource `__. For example, the - ``linked_resource`` for a table resource from BigQuery is: - - //bigquery.googleapis.com/projects/projectId/datasets/datasetI - d/tables/tableId - entry_type: - Required. Entry type. - type: - The type of the entry. - type_spec: - Type specification information. - gcs_fileset_spec: - Specification that applies to a Cloud Storage fileset. This is - only valid on entries of type FILESET. - bigquery_table_spec: - Specification that applies to a BigQuery table. This is only - valid on entries of type ``TABLE``. - bigquery_date_sharded_spec: - Specification for a group of BigQuery tables with name pattern - ``[prefix]YYYYMMDD``. Context: - https://cloud.google.com/bigquery/docs/partitioned- - tables#partitioning\_versus\_sharding. - display_name: - Display information such as title and description. A short - name to identify the entry, for example, "Analytics Data - Jan - 2011". Default value is an empty string. - description: - Entry description, which can consist of several sentences or - paragraphs that describe entry contents. Default value is an - empty string. - schema: - Schema of the entry. An entry might not have any schema - attached to it. - source_system_timestamps: - Output only. Timestamps about the underlying Google Cloud - Platform resource, not about this Data Catalog Entry. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.Entry) - ), -) -_sym_db.RegisterMessage(Entry) - -EntryGroup = _reflection.GeneratedProtocolMessageType( - "EntryGroup", - (_message.Message,), - dict( - DESCRIPTOR=_ENTRYGROUP, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""EntryGroup Metadata. An EntryGroup resource represents a - logical grouping of zero or more Data Catalog - [Entry][google.cloud.datacatalog.v1beta1.Entry] resources. - - - Attributes: - name: - The resource name of the entry group in URL format. Example: - - projects/{project\_id}/locations/{location}/entryGroups/{en - try\_group\_id} Note that this EntryGroup and its child - resources may not actually be stored in the location in this - name. - display_name: - A short name to identify the entry group, for example, - "analytics data - jan 2011". Default value is an empty string. - description: - Entry group description, which can consist of several - sentences or paragraphs that describe entry group contents. - Default value is an empty string. - data_catalog_timestamps: - Output only. Timestamps about this EntryGroup. Default value - is empty timestamps. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.EntryGroup) - ), -) -_sym_db.RegisterMessage(EntryGroup) - -CreateTagTemplateRequest = _reflection.GeneratedProtocolMessageType( - "CreateTagTemplateRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATETAGTEMPLATEREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [CreateTagTemplate][google.cloud.datacatalog.v1beta1.DataCatalog.CreateTagTemplate]. - - - Attributes: - parent: - Required. The name of the project and the location this - template is in. Example: - - projects/{project\_id}/locations/{location} TagTemplate and - its child resources may not actually be stored in the location - in this name. - tag_template_id: - Required. The id of the tag template to create. - tag_template: - Required. The tag template to create. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.CreateTagTemplateRequest) - ), -) -_sym_db.RegisterMessage(CreateTagTemplateRequest) - -GetTagTemplateRequest = _reflection.GeneratedProtocolMessageType( - "GetTagTemplateRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETTAGTEMPLATEREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [GetTagTemplate][google.cloud.datacatalog.v1beta1.DataCatalog.GetTagTemplate]. - - - Attributes: - name: - Required. The name of the tag template. Example: - projects/ - {project\_id}/locations/{location}/tagTemplates/{tag\_template - \_id} - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.GetTagTemplateRequest) - ), -) -_sym_db.RegisterMessage(GetTagTemplateRequest) - -UpdateTagTemplateRequest = _reflection.GeneratedProtocolMessageType( - "UpdateTagTemplateRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATETAGTEMPLATEREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [UpdateTagTemplate][google.cloud.datacatalog.v1beta1.DataCatalog.UpdateTagTemplate]. - - - Attributes: - tag_template: - Required. The template to update. The "name" field must be - set. - update_mask: - The field mask specifies the parts of the template to - overwrite. Allowed fields: - ``display_name`` If absent or - empty, all of the allowed fields above will be updated. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.UpdateTagTemplateRequest) - ), -) -_sym_db.RegisterMessage(UpdateTagTemplateRequest) - -DeleteTagTemplateRequest = _reflection.GeneratedProtocolMessageType( - "DeleteTagTemplateRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETETAGTEMPLATEREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [DeleteTagTemplate][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteTagTemplate]. - - - Attributes: - name: - Required. The name of the tag template to delete. Example: - - projects/{project\_id}/locations/{location}/tagTemplates/{tag\ - _template\_id} - force: - Required. Currently, this field must always be set to - ``true``. This confirms the deletion of any possible tags - using this template. ``force = false`` will be supported in - the future. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.DeleteTagTemplateRequest) - ), -) -_sym_db.RegisterMessage(DeleteTagTemplateRequest) - -CreateTagRequest = _reflection.GeneratedProtocolMessageType( - "CreateTagRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATETAGREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [CreateTag][google.cloud.datacatalog.v1beta1.DataCatalog.CreateTag]. - - - Attributes: - parent: - Required. The name of the resource to attach this tag to. Tags - can be attached to Entries. Example: - projects/{project\_id - }/locations/{location}/entryGroups/{entry\_group\_id}/entries/ - {entry\_id} Note that this Tag and its child resources may - not actually be stored in the location in this name. - tag: - Required. The tag to create. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.CreateTagRequest) - ), -) -_sym_db.RegisterMessage(CreateTagRequest) - -UpdateTagRequest = _reflection.GeneratedProtocolMessageType( - "UpdateTagRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATETAGREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [UpdateTag][google.cloud.datacatalog.v1beta1.DataCatalog.UpdateTag]. - - - Attributes: - tag: - Required. The updated tag. The "name" field must be set. - update_mask: - The fields to update on the Tag. If absent or empty, all - modifiable fields are updated. Currently the only modifiable - field is the field ``fields``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.UpdateTagRequest) - ), -) -_sym_db.RegisterMessage(UpdateTagRequest) - -DeleteTagRequest = _reflection.GeneratedProtocolMessageType( - "DeleteTagRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETETAGREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [DeleteTag][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteTag]. - - - Attributes: - name: - Required. The name of the tag to delete. Example: - projects - /{project\_id}/locations/{location}/entryGroups/{entry\_group\ - _id}/entries/{entry\_id}/tags/{tag\_id} - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.DeleteTagRequest) - ), -) -_sym_db.RegisterMessage(DeleteTagRequest) - -CreateTagTemplateFieldRequest = _reflection.GeneratedProtocolMessageType( - "CreateTagTemplateFieldRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATETAGTEMPLATEFIELDREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [CreateTagTemplateField][google.cloud.datacatalog.v1beta1.DataCatalog.CreateTagTemplateField]. - - - Attributes: - parent: - Required. The name of the project this template is in. - Example: - projects/{project\_id}/locations/{location}/tagTe - mplates/{tag\_template\_id} Note that this TagTemplateField - may not actually be stored in the location in this name. - tag_template_field_id: - Required. The ID of the tag template field to create. Field - ids can contain letters (both uppercase and lowercase), - numbers (0-9), underscores (\_) and dashes (-). Field IDs must - be at least 1 character long and at most 128 characters long. - Field IDs must also be unique within their template. - tag_template_field: - Required. The tag template field to create. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.CreateTagTemplateFieldRequest) - ), -) -_sym_db.RegisterMessage(CreateTagTemplateFieldRequest) - -UpdateTagTemplateFieldRequest = _reflection.GeneratedProtocolMessageType( - "UpdateTagTemplateFieldRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATETAGTEMPLATEFIELDREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [UpdateTagTemplateField][google.cloud.datacatalog.v1beta1.DataCatalog.UpdateTagTemplateField]. - - - Attributes: - name: - Required. The name of the tag template field. Example: - pro - jects/{project\_id}/locations/{location}/tagTemplates/{tag\_te - mplate\_id}/fields/{tag\_template\_field\_id} - tag_template_field: - Required. The template to update. - update_mask: - Optional. The field mask specifies the parts of the template - to be updated. Allowed fields: - ``display_name`` - - ``type.enum_type`` - ``is_required`` If ``update_mask`` is - not set or empty, all of the allowed fields above will be - updated. When updating an enum type, the provided values will - be merged with the existing values. Therefore, enum values can - only be added, existing enum values cannot be deleted nor - renamed. Updating a template field from optional to required - is NOT allowed. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.UpdateTagTemplateFieldRequest) - ), -) -_sym_db.RegisterMessage(UpdateTagTemplateFieldRequest) - -RenameTagTemplateFieldRequest = _reflection.GeneratedProtocolMessageType( - "RenameTagTemplateFieldRequest", - (_message.Message,), - dict( - DESCRIPTOR=_RENAMETAGTEMPLATEFIELDREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [RenameTagTemplateField][google.cloud.datacatalog.v1beta1.DataCatalog.RenameTagTemplateField]. - - - Attributes: - name: - Required. The name of the tag template. Example: - projects/ - {project\_id}/locations/{location}/tagTemplates/{tag\_template - \_id}/fields/{tag\_template\_field\_id} - new_tag_template_field_id: - Required. The new ID of this tag template field. For example, - ``my_new_field``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.RenameTagTemplateFieldRequest) - ), -) -_sym_db.RegisterMessage(RenameTagTemplateFieldRequest) - -DeleteTagTemplateFieldRequest = _reflection.GeneratedProtocolMessageType( - "DeleteTagTemplateFieldRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETETAGTEMPLATEFIELDREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [DeleteTagTemplateField][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteTagTemplateField]. - - - Attributes: - name: - Required. The name of the tag template field to delete. - Example: - projects/{project\_id}/locations/{location}/tagTe - mplates/{tag\_template\_id}/fields/{tag\_template\_field\_id} - force: - Required. Currently, this field must always be set to - ``true``. This confirms the deletion of this field from any - tags using this field. ``force = false`` will be supported in - the future. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.DeleteTagTemplateFieldRequest) - ), -) -_sym_db.RegisterMessage(DeleteTagTemplateFieldRequest) - -ListTagsRequest = _reflection.GeneratedProtocolMessageType( - "ListTagsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTTAGSREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Request message for - [ListTags][google.cloud.datacatalog.v1beta1.DataCatalog.ListTags]. - - - Attributes: - parent: - Required. The name of the Data Catalog resource to list the - tags of. The resource could be an - [Entry][google.cloud.datacatalog.v1beta1.Entry]. - page_size: - The maximum number of tags to return. Default is 10. Max limit - is 1000. - page_token: - Token that specifies which page is requested. If empty, the - first page is returned. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.ListTagsRequest) - ), -) -_sym_db.RegisterMessage(ListTagsRequest) - -ListTagsResponse = _reflection.GeneratedProtocolMessageType( - "ListTagsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTTAGSRESPONSE, - __module__="google.cloud.datacatalog_v1beta1.proto.datacatalog_pb2", - __doc__="""Response message for - [ListTags][google.cloud.datacatalog.v1beta1.DataCatalog.ListTags]. - - - Attributes: - tags: - [Tag][google.cloud.datacatalog.v1beta1.Tag] details. - next_page_token: - Token to retrieve the next page of results. It is set to empty - if no items remain in results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.ListTagsResponse) - ), -) -_sym_db.RegisterMessage(ListTagsResponse) - - -DESCRIPTOR._options = None -_SEARCHCATALOGREQUEST.fields_by_name["scope"]._options = None -_SEARCHCATALOGREQUEST.fields_by_name["query"]._options = None -_SEARCHCATALOGREQUEST.fields_by_name["page_token"]._options = None -_CREATEENTRYGROUPREQUEST.fields_by_name["parent"]._options = None -_CREATEENTRYGROUPREQUEST.fields_by_name["entry_group_id"]._options = None -_GETENTRYGROUPREQUEST.fields_by_name["name"]._options = None -_DELETEENTRYGROUPREQUEST.fields_by_name["name"]._options = None -_CREATEENTRYREQUEST.fields_by_name["parent"]._options = None -_CREATEENTRYREQUEST.fields_by_name["entry_id"]._options = None -_CREATEENTRYREQUEST.fields_by_name["entry"]._options = None -_UPDATEENTRYREQUEST.fields_by_name["entry"]._options = None -_DELETEENTRYREQUEST.fields_by_name["name"]._options = None -_GETENTRYREQUEST.fields_by_name["name"]._options = None -_ENTRY.fields_by_name["name"]._options = None -_ENTRY.fields_by_name["linked_resource"]._options = None -_ENTRY.fields_by_name["source_system_timestamps"]._options = None -_ENTRY._options = None -_ENTRYGROUP.fields_by_name["data_catalog_timestamps"]._options = None -_ENTRYGROUP._options = None -_CREATETAGTEMPLATEREQUEST.fields_by_name["parent"]._options = None -_CREATETAGTEMPLATEREQUEST.fields_by_name["tag_template_id"]._options = None -_CREATETAGTEMPLATEREQUEST.fields_by_name["tag_template"]._options = None -_GETTAGTEMPLATEREQUEST.fields_by_name["name"]._options = None -_UPDATETAGTEMPLATEREQUEST.fields_by_name["tag_template"]._options = None -_DELETETAGTEMPLATEREQUEST.fields_by_name["name"]._options = None -_DELETETAGTEMPLATEREQUEST.fields_by_name["force"]._options = None -_CREATETAGREQUEST.fields_by_name["parent"]._options = None -_CREATETAGREQUEST.fields_by_name["tag"]._options = None -_UPDATETAGREQUEST.fields_by_name["tag"]._options = None -_DELETETAGREQUEST.fields_by_name["name"]._options = None -_CREATETAGTEMPLATEFIELDREQUEST.fields_by_name["parent"]._options = None -_CREATETAGTEMPLATEFIELDREQUEST.fields_by_name["tag_template_field_id"]._options = None -_CREATETAGTEMPLATEFIELDREQUEST.fields_by_name["tag_template_field"]._options = None -_UPDATETAGTEMPLATEFIELDREQUEST.fields_by_name["name"]._options = None -_UPDATETAGTEMPLATEFIELDREQUEST.fields_by_name["tag_template_field"]._options = None -_UPDATETAGTEMPLATEFIELDREQUEST.fields_by_name["update_mask"]._options = None -_RENAMETAGTEMPLATEFIELDREQUEST.fields_by_name["name"]._options = None -_RENAMETAGTEMPLATEFIELDREQUEST.fields_by_name[ - "new_tag_template_field_id" -]._options = None -_DELETETAGTEMPLATEFIELDREQUEST.fields_by_name["name"]._options = None -_DELETETAGTEMPLATEFIELDREQUEST.fields_by_name["force"]._options = None -_LISTTAGSREQUEST.fields_by_name["parent"]._options = None - -_DATACATALOG = _descriptor.ServiceDescriptor( - name="DataCatalog", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\032datacatalog.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=4956, - serialized_end=10532, - methods=[ - _descriptor.MethodDescriptor( - name="SearchCatalog", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.SearchCatalog", - index=0, - containing_service=None, - input_type=_SEARCHCATALOGREQUEST, - output_type=_SEARCHCATALOGRESPONSE, - serialized_options=_b( - '\202\323\344\223\002\034"\027/v1beta1/catalog:search:\001*\332A\013scope,query' - ), - ), - _descriptor.MethodDescriptor( - name="CreateEntryGroup", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.CreateEntryGroup", - index=1, - containing_service=None, - input_type=_CREATEENTRYGROUPREQUEST, - output_type=_ENTRYGROUP, - serialized_options=_b( - '\202\323\344\223\002C"4/v1beta1/{parent=projects/*/locations/*}/entryGroups:\013entry_group\332A!parent,entry_group_id,entry_group' - ), - ), - _descriptor.MethodDescriptor( - name="GetEntryGroup", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.GetEntryGroup", - index=2, - containing_service=None, - input_type=_GETENTRYGROUPREQUEST, - output_type=_ENTRYGROUP, - serialized_options=_b( - "\202\323\344\223\0026\0224/v1beta1/{name=projects/*/locations/*/entryGroups/*}\332A\004name\332A\016name,read_mask" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteEntryGroup", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.DeleteEntryGroup", - index=3, - containing_service=None, - input_type=_DELETEENTRYGROUPREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\0026*4/v1beta1/{name=projects/*/locations/*/entryGroups/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="CreateEntry", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.CreateEntry", - index=4, - containing_service=None, - input_type=_CREATEENTRYREQUEST, - output_type=_ENTRY, - serialized_options=_b( - '\202\323\344\223\002G">/v1beta1/{parent=projects/*/locations/*/entryGroups/*}/entries:\005entry\332A\025parent,entry_id,entry' - ), - ), - _descriptor.MethodDescriptor( - name="UpdateEntry", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.UpdateEntry", - index=5, - containing_service=None, - input_type=_UPDATEENTRYREQUEST, - output_type=_ENTRY, - serialized_options=_b( - "\202\323\344\223\002M2D/v1beta1/{entry.name=projects/*/locations/*/entryGroups/*/entries/*}:\005entry\332A\005entry\332A\021entry,update_mask" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteEntry", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.DeleteEntry", - index=6, - containing_service=None, - input_type=_DELETEENTRYREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002@*>/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="GetEntry", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.GetEntry", - index=7, - containing_service=None, - input_type=_GETENTRYREQUEST, - output_type=_ENTRY, - serialized_options=_b( - "\202\323\344\223\002@\022>/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="LookupEntry", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.LookupEntry", - index=8, - containing_service=None, - input_type=_LOOKUPENTRYREQUEST, - output_type=_ENTRY, - serialized_options=_b( - "\202\323\344\223\002\031\022\027/v1beta1/entries:lookup" - ), - ), - _descriptor.MethodDescriptor( - name="CreateTagTemplate", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.CreateTagTemplate", - index=9, - containing_service=None, - input_type=_CREATETAGTEMPLATEREQUEST, - output_type=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2._TAGTEMPLATE, - serialized_options=_b( - '\202\323\344\223\002E"5/v1beta1/{parent=projects/*/locations/*}/tagTemplates:\014tag_template\332A#parent,tag_template_id,tag_template' - ), - ), - _descriptor.MethodDescriptor( - name="GetTagTemplate", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.GetTagTemplate", - index=10, - containing_service=None, - input_type=_GETTAGTEMPLATEREQUEST, - output_type=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2._TAGTEMPLATE, - serialized_options=_b( - "\202\323\344\223\0027\0225/v1beta1/{name=projects/*/locations/*/tagTemplates/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateTagTemplate", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.UpdateTagTemplate", - index=11, - containing_service=None, - input_type=_UPDATETAGTEMPLATEREQUEST, - output_type=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2._TAGTEMPLATE, - serialized_options=_b( - "\202\323\344\223\002R2B/v1beta1/{tag_template.name=projects/*/locations/*/tagTemplates/*}:\014tag_template\332A\014tag_template\332A\030tag_template,update_mask" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteTagTemplate", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.DeleteTagTemplate", - index=12, - containing_service=None, - input_type=_DELETETAGTEMPLATEREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\0027*5/v1beta1/{name=projects/*/locations/*/tagTemplates/*}\332A\nname,force" - ), - ), - _descriptor.MethodDescriptor( - name="CreateTagTemplateField", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.CreateTagTemplateField", - index=13, - containing_service=None, - input_type=_CREATETAGTEMPLATEFIELDREQUEST, - output_type=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2._TAGTEMPLATEFIELD, - serialized_options=_b( - '\202\323\344\223\002T">/v1beta1/{parent=projects/*/locations/*/tagTemplates/*}/fields:\022tag_template_field\332A/parent,tag_template_field_id,tag_template_field' - ), - ), - _descriptor.MethodDescriptor( - name="UpdateTagTemplateField", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.UpdateTagTemplateField", - index=14, - containing_service=None, - input_type=_UPDATETAGTEMPLATEFIELDREQUEST, - output_type=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2._TAGTEMPLATEFIELD, - serialized_options=_b( - "\202\323\344\223\002T2>/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}:\022tag_template_field\332A\027name,tag_template_field\332A#name,tag_template_field,update_mask" - ), - ), - _descriptor.MethodDescriptor( - name="RenameTagTemplateField", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.RenameTagTemplateField", - index=15, - containing_service=None, - input_type=_RENAMETAGTEMPLATEFIELDREQUEST, - output_type=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2._TAGTEMPLATEFIELD, - serialized_options=_b( - '\202\323\344\223\002J"E/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}:rename:\001*\332A\036name,new_tag_template_field_id' - ), - ), - _descriptor.MethodDescriptor( - name="DeleteTagTemplateField", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.DeleteTagTemplateField", - index=16, - containing_service=None, - input_type=_DELETETAGTEMPLATEFIELDREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002@*>/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}\332A\nname,force" - ), - ), - _descriptor.MethodDescriptor( - name="CreateTag", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.CreateTag", - index=17, - containing_service=None, - input_type=_CREATETAGREQUEST, - output_type=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2._TAG, - serialized_options=_b( - '\202\323\344\223\002L"E/v1beta1/{parent=projects/*/locations/*/entryGroups/*/entries/*}/tags:\003tag\332A\nparent,tag' - ), - ), - _descriptor.MethodDescriptor( - name="UpdateTag", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.UpdateTag", - index=18, - containing_service=None, - input_type=_UPDATETAGREQUEST, - output_type=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2._TAG, - serialized_options=_b( - "\202\323\344\223\002P2I/v1beta1/{tag.name=projects/*/locations/*/entryGroups/*/entries/*/tags/*}:\003tag\332A\003tag\332A\017tag,update_mask" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteTag", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.DeleteTag", - index=19, - containing_service=None, - input_type=_DELETETAGREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002G*E/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*/tags/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ListTags", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.ListTags", - index=20, - containing_service=None, - input_type=_LISTTAGSREQUEST, - output_type=_LISTTAGSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002G\022E/v1beta1/{parent=projects/*/locations/*/entryGroups/*/entries/*}/tags\332A\006parent" - ), - ), - _descriptor.MethodDescriptor( - name="SetIamPolicy", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.SetIamPolicy", - index=21, - containing_service=None, - input_type=google_dot_iam_dot_v1_dot_iam__policy__pb2._SETIAMPOLICYREQUEST, - output_type=google_dot_iam_dot_v1_dot_policy__pb2._POLICY, - serialized_options=_b( - '\202\323\344\223\002\355\001"F/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:setIamPolicy:\001*ZJ"E/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:setIamPolicy:\001*ZT"O/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:setIamPolicy:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="GetIamPolicy", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.GetIamPolicy", - index=22, - containing_service=None, - input_type=google_dot_iam_dot_v1_dot_iam__policy__pb2._GETIAMPOLICYREQUEST, - output_type=google_dot_iam_dot_v1_dot_policy__pb2._POLICY, - serialized_options=_b( - '\202\323\344\223\002\355\001"F/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:getIamPolicy:\001*ZJ"E/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:getIamPolicy:\001*ZT"O/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:getIamPolicy:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="TestIamPermissions", - full_name="google.cloud.datacatalog.v1beta1.DataCatalog.TestIamPermissions", - index=23, - containing_service=None, - input_type=google_dot_iam_dot_v1_dot_iam__policy__pb2._TESTIAMPERMISSIONSREQUEST, - output_type=google_dot_iam_dot_v1_dot_iam__policy__pb2._TESTIAMPERMISSIONSRESPONSE, - serialized_options=_b( - '\202\323\344\223\002\377\001"L/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:testIamPermissions:\001*ZP"K/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:testIamPermissions:\001*ZZ"U/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:testIamPermissions:\001*' - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_DATACATALOG) - -DESCRIPTOR.services_by_name["DataCatalog"] = _DATACATALOG - -# @@protoc_insertion_point(module_scope) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/datacatalog_pb2_grpc.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/datacatalog_pb2_grpc.py deleted file mode 100644 index 3364f7f20fb4..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/datacatalog_pb2_grpc.py +++ /dev/null @@ -1,559 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.datacatalog_v1beta1.proto import ( - datacatalog_pb2 as google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2, -) -from google.cloud.datacatalog_v1beta1.proto import ( - tags_pb2 as google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2, -) -from google.iam.v1 import iam_policy_pb2 as google_dot_iam_dot_v1_dot_iam__policy__pb2 -from google.iam.v1 import policy_pb2 as google_dot_iam_dot_v1_dot_policy__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class DataCatalogStub(object): - """Data Catalog API service allows clients to discover, understand, and manage - their data. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.SearchCatalog = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/SearchCatalog", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.SearchCatalogRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.SearchCatalogResponse.FromString, - ) - self.CreateEntryGroup = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/CreateEntryGroup", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.CreateEntryGroupRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.EntryGroup.FromString, - ) - self.GetEntryGroup = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/GetEntryGroup", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.GetEntryGroupRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.EntryGroup.FromString, - ) - self.DeleteEntryGroup = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/DeleteEntryGroup", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.DeleteEntryGroupRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.CreateEntry = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/CreateEntry", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.CreateEntryRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.Entry.FromString, - ) - self.UpdateEntry = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/UpdateEntry", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.UpdateEntryRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.Entry.FromString, - ) - self.DeleteEntry = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/DeleteEntry", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.DeleteEntryRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.GetEntry = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/GetEntry", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.GetEntryRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.Entry.FromString, - ) - self.LookupEntry = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/LookupEntry", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.LookupEntryRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.Entry.FromString, - ) - self.CreateTagTemplate = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/CreateTagTemplate", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.CreateTagTemplateRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2.TagTemplate.FromString, - ) - self.GetTagTemplate = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/GetTagTemplate", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.GetTagTemplateRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2.TagTemplate.FromString, - ) - self.UpdateTagTemplate = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/UpdateTagTemplate", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.UpdateTagTemplateRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2.TagTemplate.FromString, - ) - self.DeleteTagTemplate = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/DeleteTagTemplate", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.DeleteTagTemplateRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.CreateTagTemplateField = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/CreateTagTemplateField", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.CreateTagTemplateFieldRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2.TagTemplateField.FromString, - ) - self.UpdateTagTemplateField = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/UpdateTagTemplateField", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.UpdateTagTemplateFieldRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2.TagTemplateField.FromString, - ) - self.RenameTagTemplateField = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/RenameTagTemplateField", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.RenameTagTemplateFieldRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2.TagTemplateField.FromString, - ) - self.DeleteTagTemplateField = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/DeleteTagTemplateField", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.DeleteTagTemplateFieldRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.CreateTag = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/CreateTag", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.CreateTagRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2.Tag.FromString, - ) - self.UpdateTag = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/UpdateTag", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.UpdateTagRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2.Tag.FromString, - ) - self.DeleteTag = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/DeleteTag", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.DeleteTagRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.ListTags = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/ListTags", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.ListTagsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.ListTagsResponse.FromString, - ) - self.SetIamPolicy = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/SetIamPolicy", - request_serializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.SetIamPolicyRequest.SerializeToString, - response_deserializer=google_dot_iam_dot_v1_dot_policy__pb2.Policy.FromString, - ) - self.GetIamPolicy = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/GetIamPolicy", - request_serializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.GetIamPolicyRequest.SerializeToString, - response_deserializer=google_dot_iam_dot_v1_dot_policy__pb2.Policy.FromString, - ) - self.TestIamPermissions = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.DataCatalog/TestIamPermissions", - request_serializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.TestIamPermissionsRequest.SerializeToString, - response_deserializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.TestIamPermissionsResponse.FromString, - ) - - -class DataCatalogServicer(object): - """Data Catalog API service allows clients to discover, understand, and manage - their data. - """ - - def SearchCatalog(self, request, context): - """Searches Data Catalog for multiple resources like entries, tags that - match a query. - - This is a custom method - (https://cloud.google.com/apis/design/custom_methods) and does not return - the complete resource, only the resource identifier and high level - fields. Clients can subsequentally call `Get` methods. - - Note that searches do not have full recall. There may be results that match - your query but are not returned, even in subsequent pages of results. These - missing results may vary across repeated calls to search. Do not rely on - this method if you need to guarantee full recall. - - See [Data Catalog Search - Syntax](/data-catalog/docs/how-to/search-reference) for more information. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateEntryGroup(self, request, context): - """Alpha feature. - Creates an EntryGroup. - The user should enable the Data Catalog API in the project identified by - the `parent` parameter (see [Data Catalog Resource Project] - (/data-catalog/docs/concepts/resource-project) for more information). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetEntryGroup(self, request, context): - """Alpha feature. - Gets an EntryGroup. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteEntryGroup(self, request, context): - """Alpha feature. - Deletes an EntryGroup. Only entry groups that do not contain entries can be - deleted. The user should enable the Data Catalog API in the project - identified by the `name` parameter (see [Data Catalog Resource Project] - (/data-catalog/docs/concepts/resource-project) for more information). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateEntry(self, request, context): - """Alpha feature. - Creates an entry. Currently only entries of 'FILESET' type can be created. - The user should enable the Data Catalog API in the project identified by - the `parent` parameter (see [Data Catalog Resource Project] - (/data-catalog/docs/concepts/resource-project) for more information). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateEntry(self, request, context): - """Updates an existing entry. - The user should enable the Data Catalog API in the project identified by - the `entry.name` parameter (see [Data Catalog Resource Project] - (/data-catalog/docs/concepts/resource-project) for more information). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteEntry(self, request, context): - """Alpha feature. - Deletes an existing entry. Only entries created through - [CreateEntry][google.cloud.datacatalog.v1beta1.DataCatalog.CreateEntry] - method can be deleted. - The user should enable the Data Catalog API in the project identified by - the `name` parameter (see [Data Catalog Resource Project] - (/data-catalog/docs/concepts/resource-project) for more information). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetEntry(self, request, context): - """Gets an entry. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def LookupEntry(self, request, context): - """Get an entry by target resource name. This method allows clients to use - the resource name from the source Google Cloud Platform service to get the - Data Catalog Entry. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateTagTemplate(self, request, context): - """Creates a tag template. The user should enable the Data Catalog API in - the project identified by the `parent` parameter (see [Data Catalog - Resource Project](/data-catalog/docs/concepts/resource-project) for more - information). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetTagTemplate(self, request, context): - """Gets a tag template. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateTagTemplate(self, request, context): - """Updates a tag template. This method cannot be used to update the fields of - a template. The tag template fields are represented as separate resources - and should be updated using their own create/update/delete methods. - The user should enable the Data Catalog API in the project identified by - the `tag_template.name` parameter (see [Data Catalog Resource Project] - (/data-catalog/docs/concepts/resource-project) for more information). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteTagTemplate(self, request, context): - """Deletes a tag template and all tags using the template. - The user should enable the Data Catalog API in the project identified by - the `name` parameter (see [Data Catalog Resource Project] - (/data-catalog/docs/concepts/resource-project) for more information). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateTagTemplateField(self, request, context): - """Creates a field in a tag template. The user should enable the Data Catalog - API in the project identified by the `parent` parameter (see - [Data Catalog Resource - Project](/data-catalog/docs/concepts/resource-project) for more - information). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateTagTemplateField(self, request, context): - """Updates a field in a tag template. This method cannot be used to update the - field type. The user should enable the Data Catalog API in the project - identified by the `name` parameter (see [Data Catalog Resource Project] - (/data-catalog/docs/concepts/resource-project) for more information). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def RenameTagTemplateField(self, request, context): - """Renames a field in a tag template. The user should enable the Data Catalog - API in the project identified by the `name` parameter (see [Data Catalog - Resource Project](/data-catalog/docs/concepts/resource-project) for more - information). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteTagTemplateField(self, request, context): - """Deletes a field in a tag template and all uses of that field. - The user should enable the Data Catalog API in the project identified by - the `name` parameter (see [Data Catalog Resource Project] - (/data-catalog/docs/concepts/resource-project) for more information). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateTag(self, request, context): - """Creates a tag on an [Entry][google.cloud.datacatalog.v1beta1.Entry]. - Note: The project identified by the `parent` parameter for the - [tag](/data-catalog/docs/reference/rest/v1beta1/projects.locations.entryGroups.entries.tags/create#path-parameters) - and the - [tag - template](/data-catalog/docs/reference/rest/v1beta1/projects.locations.tagTemplates/create#path-parameters) - used to create the tag must be from the same organization. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateTag(self, request, context): - """Updates an existing tag. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteTag(self, request, context): - """Deletes a tag. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListTags(self, request, context): - """Lists the tags on an [Entry][google.cloud.datacatalog.v1beta1.Entry]. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SetIamPolicy(self, request, context): - """Sets the access control policy for a resource. Replaces any existing - policy. - Supported resources are: - - Tag templates. - - Entries. - - Entry groups. - Note, this method cannot be used to manage policies for BigQuery, Cloud - Pub/Sub and any external Google Cloud Platform resources synced to Cloud - Data Catalog. - - Callers must have following Google IAM permission - - `datacatalog.tagTemplates.setIamPolicy` to set policies on tag - templates. - - `datacatalog.entries.setIamPolicy` to set policies on entries. - - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetIamPolicy(self, request, context): - """Gets the access control policy for a resource. A `NOT_FOUND` error - is returned if the resource does not exist. An empty policy is returned - if the resource exists but does not have a policy set on it. - - Supported resources are: - - Tag templates. - - Entries. - - Entry groups. - Note, this method cannot be used to manage policies for BigQuery, Cloud - Pub/Sub and any external Google Cloud Platform resources synced to Cloud - Data Catalog. - - Callers must have following Google IAM permission - - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag - templates. - - `datacatalog.entries.getIamPolicy` to get policies on entries. - - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def TestIamPermissions(self, request, context): - """Returns the caller's permissions on a resource. - If the resource does not exist, an empty set of permissions is returned - (We don't return a `NOT_FOUND` error). - - Supported resources are: - - Tag templates. - - Entries. - - Entry groups. - Note, this method cannot be used to manage policies for BigQuery, Cloud - Pub/Sub and any external Google Cloud Platform resources synced to Cloud - Data Catalog. - - A caller is not required to have Google IAM permission to make this - request. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_DataCatalogServicer_to_server(servicer, server): - rpc_method_handlers = { - "SearchCatalog": grpc.unary_unary_rpc_method_handler( - servicer.SearchCatalog, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.SearchCatalogRequest.FromString, - response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.SearchCatalogResponse.SerializeToString, - ), - "CreateEntryGroup": grpc.unary_unary_rpc_method_handler( - servicer.CreateEntryGroup, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.CreateEntryGroupRequest.FromString, - response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.EntryGroup.SerializeToString, - ), - "GetEntryGroup": grpc.unary_unary_rpc_method_handler( - servicer.GetEntryGroup, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.GetEntryGroupRequest.FromString, - response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.EntryGroup.SerializeToString, - ), - "DeleteEntryGroup": grpc.unary_unary_rpc_method_handler( - servicer.DeleteEntryGroup, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.DeleteEntryGroupRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "CreateEntry": grpc.unary_unary_rpc_method_handler( - servicer.CreateEntry, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.CreateEntryRequest.FromString, - response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.Entry.SerializeToString, - ), - "UpdateEntry": grpc.unary_unary_rpc_method_handler( - servicer.UpdateEntry, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.UpdateEntryRequest.FromString, - response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.Entry.SerializeToString, - ), - "DeleteEntry": grpc.unary_unary_rpc_method_handler( - servicer.DeleteEntry, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.DeleteEntryRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "GetEntry": grpc.unary_unary_rpc_method_handler( - servicer.GetEntry, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.GetEntryRequest.FromString, - response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.Entry.SerializeToString, - ), - "LookupEntry": grpc.unary_unary_rpc_method_handler( - servicer.LookupEntry, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.LookupEntryRequest.FromString, - response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.Entry.SerializeToString, - ), - "CreateTagTemplate": grpc.unary_unary_rpc_method_handler( - servicer.CreateTagTemplate, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.CreateTagTemplateRequest.FromString, - response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2.TagTemplate.SerializeToString, - ), - "GetTagTemplate": grpc.unary_unary_rpc_method_handler( - servicer.GetTagTemplate, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.GetTagTemplateRequest.FromString, - response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2.TagTemplate.SerializeToString, - ), - "UpdateTagTemplate": grpc.unary_unary_rpc_method_handler( - servicer.UpdateTagTemplate, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.UpdateTagTemplateRequest.FromString, - response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2.TagTemplate.SerializeToString, - ), - "DeleteTagTemplate": grpc.unary_unary_rpc_method_handler( - servicer.DeleteTagTemplate, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.DeleteTagTemplateRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "CreateTagTemplateField": grpc.unary_unary_rpc_method_handler( - servicer.CreateTagTemplateField, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.CreateTagTemplateFieldRequest.FromString, - response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2.TagTemplateField.SerializeToString, - ), - "UpdateTagTemplateField": grpc.unary_unary_rpc_method_handler( - servicer.UpdateTagTemplateField, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.UpdateTagTemplateFieldRequest.FromString, - response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2.TagTemplateField.SerializeToString, - ), - "RenameTagTemplateField": grpc.unary_unary_rpc_method_handler( - servicer.RenameTagTemplateField, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.RenameTagTemplateFieldRequest.FromString, - response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2.TagTemplateField.SerializeToString, - ), - "DeleteTagTemplateField": grpc.unary_unary_rpc_method_handler( - servicer.DeleteTagTemplateField, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.DeleteTagTemplateFieldRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "CreateTag": grpc.unary_unary_rpc_method_handler( - servicer.CreateTag, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.CreateTagRequest.FromString, - response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2.Tag.SerializeToString, - ), - "UpdateTag": grpc.unary_unary_rpc_method_handler( - servicer.UpdateTag, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.UpdateTagRequest.FromString, - response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_tags__pb2.Tag.SerializeToString, - ), - "DeleteTag": grpc.unary_unary_rpc_method_handler( - servicer.DeleteTag, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.DeleteTagRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "ListTags": grpc.unary_unary_rpc_method_handler( - servicer.ListTags, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.ListTagsRequest.FromString, - response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_datacatalog__pb2.ListTagsResponse.SerializeToString, - ), - "SetIamPolicy": grpc.unary_unary_rpc_method_handler( - servicer.SetIamPolicy, - request_deserializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.SetIamPolicyRequest.FromString, - response_serializer=google_dot_iam_dot_v1_dot_policy__pb2.Policy.SerializeToString, - ), - "GetIamPolicy": grpc.unary_unary_rpc_method_handler( - servicer.GetIamPolicy, - request_deserializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.GetIamPolicyRequest.FromString, - response_serializer=google_dot_iam_dot_v1_dot_policy__pb2.Policy.SerializeToString, - ), - "TestIamPermissions": grpc.unary_unary_rpc_method_handler( - servicer.TestIamPermissions, - request_deserializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.TestIamPermissionsRequest.FromString, - response_serializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.TestIamPermissionsResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.datacatalog.v1beta1.DataCatalog", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec.proto b/datacatalog/google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec.proto deleted file mode 100644 index e7397d054365..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec.proto +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datacatalog.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/cloud/datacatalog/v1beta1/timestamps.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datacatalog"; - -// Describes a Cloud Storage fileset entry. -message GcsFilesetSpec { - // Required. Patterns to identify a set of files in Google Cloud Storage. - // - // Examples of valid file_patterns: - // - // * `gs://bucket_name/*`: matches all files in `bucket_name` - // * `gs://bucket_name/file*`: matches files prefixed by `file` in - // `bucket_name` - // * `gs://bucket_name/a/*/b`: matches all files in `bucket_name` that match - // `a/*/b` pattern, such as `a/c/b`, `a/d/b` - // * `gs://another_bucket/a.txt`: matches `gs://another_bucket/a.txt` - repeated string file_patterns = 1 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Sample files contained in this fileset, not all files - // contained in this fileset are represented here. - repeated GcsFileSpec sample_gcs_file_specs = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Specifications of a single file in GCS. -message GcsFileSpec { - // Required. The full file path. Example: `gs://bucket_name/a/b.txt`. - string file_path = 1 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Timestamps about the GCS file. - SystemTimestamps gcs_timestamps = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The size of the file, in bytes. - int64 size_bytes = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec_pb2.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec_pb2.py deleted file mode 100644 index 695ebcdd59df..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec_pb2.py +++ /dev/null @@ -1,246 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.cloud.datacatalog_v1beta1.proto import ( - timestamps_pb2 as google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_timestamps__pb2, -) - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec.proto", - package="google.cloud.datacatalog.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n$com.google.cloud.datacatalog.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" - ), - serialized_pb=_b( - '\n=google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x37google/cloud/datacatalog_v1beta1/proto/timestamps.proto"\x7f\n\x0eGcsFilesetSpec\x12\x1a\n\rfile_patterns\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12Q\n\x15sample_gcs_file_specs\x18\x02 \x03(\x0b\x32-.google.cloud.datacatalog.v1beta1.GcsFileSpecB\x03\xe0\x41\x03"\x8f\x01\n\x0bGcsFileSpec\x12\x16\n\tfile_path\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12O\n\x0egcs_timestamps\x18\x02 \x01(\x0b\x32\x32.google.cloud.datacatalog.v1beta1.SystemTimestampsB\x03\xe0\x41\x03\x12\x17\n\nsize_bytes\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03\x42x\n$com.google.cloud.datacatalog.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[ - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_timestamps__pb2.DESCRIPTOR, - ], -) - - -_GCSFILESETSPEC = _descriptor.Descriptor( - name="GcsFilesetSpec", - full_name="google.cloud.datacatalog.v1beta1.GcsFilesetSpec", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="file_patterns", - full_name="google.cloud.datacatalog.v1beta1.GcsFilesetSpec.file_patterns", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="sample_gcs_file_specs", - full_name="google.cloud.datacatalog.v1beta1.GcsFilesetSpec.sample_gcs_file_specs", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=189, - serialized_end=316, -) - - -_GCSFILESPEC = _descriptor.Descriptor( - name="GcsFileSpec", - full_name="google.cloud.datacatalog.v1beta1.GcsFileSpec", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="file_path", - full_name="google.cloud.datacatalog.v1beta1.GcsFileSpec.file_path", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="gcs_timestamps", - full_name="google.cloud.datacatalog.v1beta1.GcsFileSpec.gcs_timestamps", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="size_bytes", - full_name="google.cloud.datacatalog.v1beta1.GcsFileSpec.size_bytes", - index=2, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=319, - serialized_end=462, -) - -_GCSFILESETSPEC.fields_by_name["sample_gcs_file_specs"].message_type = _GCSFILESPEC -_GCSFILESPEC.fields_by_name[ - "gcs_timestamps" -].message_type = ( - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_timestamps__pb2._SYSTEMTIMESTAMPS -) -DESCRIPTOR.message_types_by_name["GcsFilesetSpec"] = _GCSFILESETSPEC -DESCRIPTOR.message_types_by_name["GcsFileSpec"] = _GCSFILESPEC -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -GcsFilesetSpec = _reflection.GeneratedProtocolMessageType( - "GcsFilesetSpec", - (_message.Message,), - dict( - DESCRIPTOR=_GCSFILESETSPEC, - __module__="google.cloud.datacatalog_v1beta1.proto.gcs_fileset_spec_pb2", - __doc__="""Describes a Cloud Storage fileset entry. - - - Attributes: - file_patterns: - Required. Patterns to identify a set of files in Google Cloud - Storage. See `Cloud Storage documentation - `__ for more - information. Note that bucket wildcards are currently not - supported. Examples of valid file\_patterns: - - ``gs://bucket_name/dir/*``: matches all files within - ``bucket_name/dir`` directory. - ``gs://bucket_name/dir/**``: - matches all files in ``bucket_name/dir`` spanning all - subdirectories. - ``gs://bucket_name/file*``: matches files - prefixed by ``file`` in ``bucket_name`` - - ``gs://bucket_name/a/*/b``: matches all files in - ``bucket_name`` that match ``a/*/b`` pattern, such as - ``a/c/b``, ``a/d/b`` - ``gs://another_bucket/a.txt``: matches - ``gs://another_bucket/a.txt`` - sample_gcs_file_specs: - Output only. Sample files contained in this fileset, not all - files contained in this fileset are represented here. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.GcsFilesetSpec) - ), -) -_sym_db.RegisterMessage(GcsFilesetSpec) - -GcsFileSpec = _reflection.GeneratedProtocolMessageType( - "GcsFileSpec", - (_message.Message,), - dict( - DESCRIPTOR=_GCSFILESPEC, - __module__="google.cloud.datacatalog_v1beta1.proto.gcs_fileset_spec_pb2", - __doc__="""Specifications of a single file in Cloud Storage. - - - Attributes: - file_path: - Required. The full file path. Example: - ``gs://bucket_name/a/b.txt``. - gcs_timestamps: - Output only. Timestamps about the Cloud Storage file. - size_bytes: - Output only. The size of the file, in bytes. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.GcsFileSpec) - ), -) -_sym_db.RegisterMessage(GcsFileSpec) - - -DESCRIPTOR._options = None -_GCSFILESETSPEC.fields_by_name["file_patterns"]._options = None -_GCSFILESETSPEC.fields_by_name["sample_gcs_file_specs"]._options = None -_GCSFILESPEC.fields_by_name["file_path"]._options = None -_GCSFILESPEC.fields_by_name["gcs_timestamps"]._options = None -_GCSFILESPEC.fields_by_name["size_bytes"]._options = None -# @@protoc_insertion_point(module_scope) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec_pb2_grpc.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/policytagmanager_pb2.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/policytagmanager_pb2.py deleted file mode 100644 index 9aefa451e147..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/policytagmanager_pb2.py +++ /dev/null @@ -1,1521 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/datacatalog_v1beta1/proto/policytagmanager.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.datacatalog_v1beta1.proto import ( - timestamps_pb2 as google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_timestamps__pb2, -) -from google.iam.v1 import iam_policy_pb2 as google_dot_iam_dot_v1_dot_iam__policy__pb2 -from google.iam.v1 import policy_pb2 as google_dot_iam_dot_v1_dot_policy__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/datacatalog_v1beta1/proto/policytagmanager.proto", - package="google.cloud.datacatalog.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n$com.google.cloud.datacatalog.v1beta1B\025PolicyTagManagerProtoP\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" - ), - serialized_pb=_b( - '\n=google/cloud/datacatalog_v1beta1/proto/policytagmanager.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x37google/cloud/datacatalog_v1beta1/proto/timestamps.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto"\xe3\x02\n\x08Taxonomy\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12Z\n\x16\x61\x63tivated_policy_types\x18\x06 \x03(\x0e\x32\x35.google.cloud.datacatalog.v1beta1.Taxonomy.PolicyTypeB\x03\xe0\x41\x01"J\n\nPolicyType\x12\x1b\n\x17POLICY_TYPE_UNSPECIFIED\x10\x00\x12\x1f\n\x1b\x46INE_GRAINED_ACCESS_CONTROL\x10\x01:g\xea\x41\x64\n#datacatalog.googleapis.com/Taxonomy\x12=projects/{project}/locations/{location}/taxonomies/{taxonomy}"\x8c\x02\n\tPolicyTag\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x19\n\x11parent_policy_tag\x18\x04 \x01(\t\x12\x1e\n\x11\x63hild_policy_tags\x18\x05 \x03(\tB\x03\xe0\x41\x03:\x80\x01\xea\x41}\n$datacatalog.googleapis.com/PolicyTag\x12Uprojects/{project}/locations/{location}/taxonomies/{taxonomy}/policyTags/{policy_tag}"\x92\x01\n\x15\x43reateTaxonomyRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#datacatalog.googleapis.com/Taxonomy\x12<\n\x08taxonomy\x18\x02 \x01(\x0b\x32*.google.cloud.datacatalog.v1beta1.Taxonomy"R\n\x15\x44\x65leteTaxonomyRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#datacatalog.googleapis.com/Taxonomy"\x86\x01\n\x15UpdateTaxonomyRequest\x12<\n\x08taxonomy\x18\x01 \x01(\x0b\x32*.google.cloud.datacatalog.v1beta1.Taxonomy\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"{\n\x15ListTaxonomiesRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#datacatalog.googleapis.com/Taxonomy\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"q\n\x16ListTaxonomiesResponse\x12>\n\ntaxonomies\x18\x01 \x03(\x0b\x32*.google.cloud.datacatalog.v1beta1.Taxonomy\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"O\n\x12GetTaxonomyRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#datacatalog.googleapis.com/Taxonomy"\x97\x01\n\x16\x43reatePolicyTagRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$datacatalog.googleapis.com/PolicyTag\x12?\n\npolicy_tag\x18\x02 \x01(\x0b\x32+.google.cloud.datacatalog.v1beta1.PolicyTag"T\n\x16\x44\x65letePolicyTagRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$datacatalog.googleapis.com/PolicyTag"\x8a\x01\n\x16UpdatePolicyTagRequest\x12?\n\npolicy_tag\x18\x01 \x01(\x0b\x32+.google.cloud.datacatalog.v1beta1.PolicyTag\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"|\n\x15ListPolicyTagsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$datacatalog.googleapis.com/PolicyTag\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"s\n\x16ListPolicyTagsResponse\x12@\n\x0bpolicy_tags\x18\x01 \x03(\x0b\x32+.google.cloud.datacatalog.v1beta1.PolicyTag\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"Q\n\x13GetPolicyTagRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$datacatalog.googleapis.com/PolicyTag2\xe5\x16\n\x10PolicyTagManager\x12\xce\x01\n\x0e\x43reateTaxonomy\x12\x37.google.cloud.datacatalog.v1beta1.CreateTaxonomyRequest\x1a*.google.cloud.datacatalog.v1beta1.Taxonomy"W\x82\xd3\xe4\x93\x02?"3/v1beta1/{parent=projects/*/locations/*}/taxonomies:\x08taxonomy\xda\x41\x0fparent,taxonomy\x12\xa5\x01\n\x0e\x44\x65leteTaxonomy\x12\x37.google.cloud.datacatalog.v1beta1.DeleteTaxonomyRequest\x1a\x16.google.protobuf.Empty"B\x82\xd3\xe4\x93\x02\x35*3/v1beta1/{name=projects/*/locations/*/taxonomies/*}\xda\x41\x04name\x12\xd0\x01\n\x0eUpdateTaxonomy\x12\x37.google.cloud.datacatalog.v1beta1.UpdateTaxonomyRequest\x1a*.google.cloud.datacatalog.v1beta1.Taxonomy"Y\x82\xd3\xe4\x93\x02H2\n\ntaxonomies\x18\x01 \x03(\x0b\x32*.google.cloud.datacatalog.v1beta1.Taxonomy"\xc7\x01\n\x17\x45xportTaxonomiesRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#datacatalog.googleapis.com/Taxonomy\x12?\n\ntaxonomies\x18\x02 \x03(\tB+\xe0\x41\x02\xfa\x41%\n#datacatalog.googleapis.com/Taxonomy\x12\x1f\n\x15serialized_taxonomies\x18\x03 \x01(\x08H\x00\x42\r\n\x0b\x64\x65stination"d\n\x18\x45xportTaxonomiesResponse\x12H\n\ntaxonomies\x18\x01 \x03(\x0b\x32\x34.google.cloud.datacatalog.v1beta1.SerializedTaxonomy2\x92\x04\n\x1dPolicyTagManagerSerialization\x12\xd0\x01\n\x10ImportTaxonomies\x12\x39.google.cloud.datacatalog.v1beta1.ImportTaxonomiesRequest\x1a:.google.cloud.datacatalog.v1beta1.ImportTaxonomiesResponse"E\x82\xd3\xe4\x93\x02?":/v1beta1/{parent=projects/*/locations/*}/taxonomies:import:\x01*\x12\xcd\x01\n\x10\x45xportTaxonomies\x12\x39.google.cloud.datacatalog.v1beta1.ExportTaxonomiesRequest\x1a:.google.cloud.datacatalog.v1beta1.ExportTaxonomiesResponse"B\x82\xd3\xe4\x93\x02<\x12:/v1beta1/{parent=projects/*/locations/*}/taxonomies:export\x1aN\xca\x41\x1a\x64\x61tacatalog.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x9c\x01\n$com.google.cloud.datacatalog.v1beta1B"PolicyTagManagerSerializationProtoP\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanager__pb2.DESCRIPTOR, - google_dot_iam_dot_v1_dot_policy__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - ], -) - - -_SERIALIZEDTAXONOMY = _descriptor.Descriptor( - name="SerializedTaxonomy", - full_name="google.cloud.datacatalog.v1beta1.SerializedTaxonomy", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.datacatalog.v1beta1.SerializedTaxonomy.display_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.datacatalog.v1beta1.SerializedTaxonomy.description", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="policy_tags", - full_name="google.cloud.datacatalog.v1beta1.SerializedTaxonomy.policy_tags", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=319, - serialized_end=463, -) - - -_SERIALIZEDPOLICYTAG = _descriptor.Descriptor( - name="SerializedPolicyTag", - full_name="google.cloud.datacatalog.v1beta1.SerializedPolicyTag", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.datacatalog.v1beta1.SerializedPolicyTag.display_name", - index=0, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.datacatalog.v1beta1.SerializedPolicyTag.description", - index=1, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="child_policy_tags", - full_name="google.cloud.datacatalog.v1beta1.SerializedPolicyTag.child_policy_tags", - index=2, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=466, - serialized_end=617, -) - - -_IMPORTTAXONOMIESREQUEST = _descriptor.Descriptor( - name="ImportTaxonomiesRequest", - full_name="google.cloud.datacatalog.v1beta1.ImportTaxonomiesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datacatalog.v1beta1.ImportTaxonomiesRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A%\022#datacatalog.googleapis.com/Taxonomy" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="inline_source", - full_name="google.cloud.datacatalog.v1beta1.ImportTaxonomiesRequest.inline_source", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="source", - full_name="google.cloud.datacatalog.v1beta1.ImportTaxonomiesRequest.source", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=620, - serialized_end=789, -) - - -_INLINESOURCE = _descriptor.Descriptor( - name="InlineSource", - full_name="google.cloud.datacatalog.v1beta1.InlineSource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="taxonomies", - full_name="google.cloud.datacatalog.v1beta1.InlineSource.taxonomies", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=791, - serialized_end=884, -) - - -_IMPORTTAXONOMIESRESPONSE = _descriptor.Descriptor( - name="ImportTaxonomiesResponse", - full_name="google.cloud.datacatalog.v1beta1.ImportTaxonomiesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="taxonomies", - full_name="google.cloud.datacatalog.v1beta1.ImportTaxonomiesResponse.taxonomies", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=886, - serialized_end=976, -) - - -_EXPORTTAXONOMIESREQUEST = _descriptor.Descriptor( - name="ExportTaxonomiesRequest", - full_name="google.cloud.datacatalog.v1beta1.ExportTaxonomiesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datacatalog.v1beta1.ExportTaxonomiesRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A%\022#datacatalog.googleapis.com/Taxonomy" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="taxonomies", - full_name="google.cloud.datacatalog.v1beta1.ExportTaxonomiesRequest.taxonomies", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A%\n#datacatalog.googleapis.com/Taxonomy" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="serialized_taxonomies", - full_name="google.cloud.datacatalog.v1beta1.ExportTaxonomiesRequest.serialized_taxonomies", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="destination", - full_name="google.cloud.datacatalog.v1beta1.ExportTaxonomiesRequest.destination", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=979, - serialized_end=1178, -) - - -_EXPORTTAXONOMIESRESPONSE = _descriptor.Descriptor( - name="ExportTaxonomiesResponse", - full_name="google.cloud.datacatalog.v1beta1.ExportTaxonomiesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="taxonomies", - full_name="google.cloud.datacatalog.v1beta1.ExportTaxonomiesResponse.taxonomies", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1180, - serialized_end=1280, -) - -_SERIALIZEDTAXONOMY.fields_by_name["policy_tags"].message_type = _SERIALIZEDPOLICYTAG -_SERIALIZEDPOLICYTAG.fields_by_name[ - "child_policy_tags" -].message_type = _SERIALIZEDPOLICYTAG -_IMPORTTAXONOMIESREQUEST.fields_by_name["inline_source"].message_type = _INLINESOURCE -_IMPORTTAXONOMIESREQUEST.oneofs_by_name["source"].fields.append( - _IMPORTTAXONOMIESREQUEST.fields_by_name["inline_source"] -) -_IMPORTTAXONOMIESREQUEST.fields_by_name[ - "inline_source" -].containing_oneof = _IMPORTTAXONOMIESREQUEST.oneofs_by_name["source"] -_INLINESOURCE.fields_by_name["taxonomies"].message_type = _SERIALIZEDTAXONOMY -_IMPORTTAXONOMIESRESPONSE.fields_by_name[ - "taxonomies" -].message_type = ( - google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanager__pb2._TAXONOMY -) -_EXPORTTAXONOMIESREQUEST.oneofs_by_name["destination"].fields.append( - _EXPORTTAXONOMIESREQUEST.fields_by_name["serialized_taxonomies"] -) -_EXPORTTAXONOMIESREQUEST.fields_by_name[ - "serialized_taxonomies" -].containing_oneof = _EXPORTTAXONOMIESREQUEST.oneofs_by_name["destination"] -_EXPORTTAXONOMIESRESPONSE.fields_by_name[ - "taxonomies" -].message_type = _SERIALIZEDTAXONOMY -DESCRIPTOR.message_types_by_name["SerializedTaxonomy"] = _SERIALIZEDTAXONOMY -DESCRIPTOR.message_types_by_name["SerializedPolicyTag"] = _SERIALIZEDPOLICYTAG -DESCRIPTOR.message_types_by_name["ImportTaxonomiesRequest"] = _IMPORTTAXONOMIESREQUEST -DESCRIPTOR.message_types_by_name["InlineSource"] = _INLINESOURCE -DESCRIPTOR.message_types_by_name["ImportTaxonomiesResponse"] = _IMPORTTAXONOMIESRESPONSE -DESCRIPTOR.message_types_by_name["ExportTaxonomiesRequest"] = _EXPORTTAXONOMIESREQUEST -DESCRIPTOR.message_types_by_name["ExportTaxonomiesResponse"] = _EXPORTTAXONOMIESRESPONSE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -SerializedTaxonomy = _reflection.GeneratedProtocolMessageType( - "SerializedTaxonomy", - (_message.Message,), - dict( - DESCRIPTOR=_SERIALIZEDTAXONOMY, - __module__="google.cloud.datacatalog_v1beta1.proto.policytagmanagerserialization_pb2", - __doc__="""Message capturing a taxonomy and its policy tag hierarchy - as a nested proto. Used for taxonomy import/export and mutation. - - - Attributes: - display_name: - Required. Display name of the taxonomy. Max 200 bytes when - encoded in UTF-8. - description: - Description of the serialized taxonomy. The length of the - description is limited to 2000 bytes when encoded in UTF-8. If - not set, defaults to an empty description. - policy_tags: - Top level policy tags associated with the taxonomy if any. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.SerializedTaxonomy) - ), -) -_sym_db.RegisterMessage(SerializedTaxonomy) - -SerializedPolicyTag = _reflection.GeneratedProtocolMessageType( - "SerializedPolicyTag", - (_message.Message,), - dict( - DESCRIPTOR=_SERIALIZEDPOLICYTAG, - __module__="google.cloud.datacatalog_v1beta1.proto.policytagmanagerserialization_pb2", - __doc__="""Message representing one policy tag when exported as a - nested proto. - - - Attributes: - display_name: - Required. Display name of the policy tag. Max 200 bytes when - encoded in UTF-8. - description: - Description of the serialized policy tag. The length of the - description is limited to 2000 bytes when encoded in UTF-8. If - not set, defaults to an empty description. - child_policy_tags: - Children of the policy tag if any. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.SerializedPolicyTag) - ), -) -_sym_db.RegisterMessage(SerializedPolicyTag) - -ImportTaxonomiesRequest = _reflection.GeneratedProtocolMessageType( - "ImportTaxonomiesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTTAXONOMIESREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.policytagmanagerserialization_pb2", - __doc__="""Request message for - [ImportTaxonomies][google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization.ImportTaxonomies]. - - - Attributes: - parent: - Required. Resource name of project that the newly created - taxonomies will belong to. - source: - Required. Source taxonomies to be imported in a tree - structure. - inline_source: - Inline source used for taxonomies import - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.ImportTaxonomiesRequest) - ), -) -_sym_db.RegisterMessage(ImportTaxonomiesRequest) - -InlineSource = _reflection.GeneratedProtocolMessageType( - "InlineSource", - (_message.Message,), - dict( - DESCRIPTOR=_INLINESOURCE, - __module__="google.cloud.datacatalog_v1beta1.proto.policytagmanagerserialization_pb2", - __doc__="""Inline source used for taxonomies import. - - - Attributes: - taxonomies: - Required. Taxonomies to be imported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.InlineSource) - ), -) -_sym_db.RegisterMessage(InlineSource) - -ImportTaxonomiesResponse = _reflection.GeneratedProtocolMessageType( - "ImportTaxonomiesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTTAXONOMIESRESPONSE, - __module__="google.cloud.datacatalog_v1beta1.proto.policytagmanagerserialization_pb2", - __doc__="""Response message for - [ImportTaxonomies][google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization.ImportTaxonomies]. - - - Attributes: - taxonomies: - Taxonomies that were imported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.ImportTaxonomiesResponse) - ), -) -_sym_db.RegisterMessage(ImportTaxonomiesResponse) - -ExportTaxonomiesRequest = _reflection.GeneratedProtocolMessageType( - "ExportTaxonomiesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_EXPORTTAXONOMIESREQUEST, - __module__="google.cloud.datacatalog_v1beta1.proto.policytagmanagerserialization_pb2", - __doc__="""Request message for - [ExportTaxonomies][google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization.ExportTaxonomies]. - - - Attributes: - parent: - Required. Resource name of the project that taxonomies to be - exported will share. - taxonomies: - Required. Resource names of the taxonomies to be exported. - destination: - Required. Taxonomies export destination. - serialized_taxonomies: - Export taxonomies as serialized taxonomies. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.ExportTaxonomiesRequest) - ), -) -_sym_db.RegisterMessage(ExportTaxonomiesRequest) - -ExportTaxonomiesResponse = _reflection.GeneratedProtocolMessageType( - "ExportTaxonomiesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_EXPORTTAXONOMIESRESPONSE, - __module__="google.cloud.datacatalog_v1beta1.proto.policytagmanagerserialization_pb2", - __doc__="""Response message for - [ExportTaxonomies][google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization.ExportTaxonomies]. - - - Attributes: - taxonomies: - List of taxonomies and policy tags in a tree structure. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.ExportTaxonomiesResponse) - ), -) -_sym_db.RegisterMessage(ExportTaxonomiesResponse) - - -DESCRIPTOR._options = None -_SERIALIZEDTAXONOMY.fields_by_name["display_name"]._options = None -_SERIALIZEDPOLICYTAG.fields_by_name["display_name"]._options = None -_IMPORTTAXONOMIESREQUEST.fields_by_name["parent"]._options = None -_INLINESOURCE.fields_by_name["taxonomies"]._options = None -_EXPORTTAXONOMIESREQUEST.fields_by_name["parent"]._options = None -_EXPORTTAXONOMIESREQUEST.fields_by_name["taxonomies"]._options = None - -_POLICYTAGMANAGERSERIALIZATION = _descriptor.ServiceDescriptor( - name="PolicyTagManagerSerialization", - full_name="google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\032datacatalog.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=1283, - serialized_end=1813, - methods=[ - _descriptor.MethodDescriptor( - name="ImportTaxonomies", - full_name="google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization.ImportTaxonomies", - index=0, - containing_service=None, - input_type=_IMPORTTAXONOMIESREQUEST, - output_type=_IMPORTTAXONOMIESRESPONSE, - serialized_options=_b( - '\202\323\344\223\002?":/v1beta1/{parent=projects/*/locations/*}/taxonomies:import:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="ExportTaxonomies", - full_name="google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization.ExportTaxonomies", - index=1, - containing_service=None, - input_type=_EXPORTTAXONOMIESREQUEST, - output_type=_EXPORTTAXONOMIESRESPONSE, - serialized_options=_b( - "\202\323\344\223\002<\022:/v1beta1/{parent=projects/*/locations/*}/taxonomies:export" - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_POLICYTAGMANAGERSERIALIZATION) - -DESCRIPTOR.services_by_name[ - "PolicyTagManagerSerialization" -] = _POLICYTAGMANAGERSERIALIZATION - -# @@protoc_insertion_point(module_scope) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/policytagmanagerserialization_pb2_grpc.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/policytagmanagerserialization_pb2_grpc.py deleted file mode 100644 index 74a7fdcfa5f7..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/policytagmanagerserialization_pb2_grpc.py +++ /dev/null @@ -1,76 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.datacatalog_v1beta1.proto import ( - policytagmanagerserialization_pb2 as google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanagerserialization__pb2, -) - - -class PolicyTagManagerSerializationStub(object): - """Policy tag manager serialization API service allows clients to manipulate - their taxonomies and policy tags data with serialized format. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ImportTaxonomies = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization/ImportTaxonomies", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanagerserialization__pb2.ImportTaxonomiesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanagerserialization__pb2.ImportTaxonomiesResponse.FromString, - ) - self.ExportTaxonomies = channel.unary_unary( - "/google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization/ExportTaxonomies", - request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanagerserialization__pb2.ExportTaxonomiesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanagerserialization__pb2.ExportTaxonomiesResponse.FromString, - ) - - -class PolicyTagManagerSerializationServicer(object): - """Policy tag manager serialization API service allows clients to manipulate - their taxonomies and policy tags data with serialized format. - """ - - def ImportTaxonomies(self, request, context): - """Imports all taxonomies and their policy tags to a project as new - taxonomies. - - This method provides a bulk taxonomy / policy tag creation using nested - proto structure. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ExportTaxonomies(self, request, context): - """Exports all taxonomies and their policy tags in a project. - - This method generates SerializedTaxonomy protos with nested policy tags - that can be used as an input for future ImportTaxonomies calls. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_PolicyTagManagerSerializationServicer_to_server(servicer, server): - rpc_method_handlers = { - "ImportTaxonomies": grpc.unary_unary_rpc_method_handler( - servicer.ImportTaxonomies, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanagerserialization__pb2.ImportTaxonomiesRequest.FromString, - response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanagerserialization__pb2.ImportTaxonomiesResponse.SerializeToString, - ), - "ExportTaxonomies": grpc.unary_unary_rpc_method_handler( - servicer.ExportTaxonomies, - request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanagerserialization__pb2.ExportTaxonomiesRequest.FromString, - response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanagerserialization__pb2.ExportTaxonomiesResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization", - rpc_method_handlers, - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/schema.proto b/datacatalog/google/cloud/datacatalog_v1beta1/proto/schema.proto deleted file mode 100644 index aca588b4503b..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/schema.proto +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datacatalog.v1beta1; - -import "google/api/field_behavior.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datacatalog"; - -// Represents a schema (e.g. BigQuery, GoogleSQL, Avro schema). -message Schema { - // Required. Schema of columns. A maximum of 10,000 columns and sub-columns - // can be specified. - repeated ColumnSchema columns = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Representation of a column within a schema. Columns could be nested inside -// other columns. -message ColumnSchema { - // Required. Name of the column. - string column = 6 [(google.api.field_behavior) = REQUIRED]; - - // Required. Type of the column. - string type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Description of the column. Default value is an empty string. - string description = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A column's mode indicates whether the values in this column are - // required, nullable, etc. Only `NULLABLE`, `REQUIRED` and `REPEATED` are - // supported. Default mode is `NULLABLE`. - string mode = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Schema of sub-columns. A column can have zero or more - // sub-columns. - repeated ColumnSchema subcolumns = 7 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/schema_pb2.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/schema_pb2.py deleted file mode 100644 index 1c679bf027ce..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/schema_pb2.py +++ /dev/null @@ -1,250 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/datacatalog_v1beta1/proto/schema.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/datacatalog_v1beta1/proto/schema.proto", - package="google.cloud.datacatalog.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n$com.google.cloud.datacatalog.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" - ), - serialized_pb=_b( - '\n3google/cloud/datacatalog_v1beta1/proto/schema.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1fgoogle/api/field_behavior.proto"N\n\x06Schema\x12\x44\n\x07\x63olumns\x18\x02 \x03(\x0b\x32..google.cloud.datacatalog.v1beta1.ColumnSchemaB\x03\xe0\x41\x02"\xac\x01\n\x0c\x43olumnSchema\x12\x13\n\x06\x63olumn\x18\x06 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04mode\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12G\n\nsubcolumns\x18\x07 \x03(\x0b\x32..google.cloud.datacatalog.v1beta1.ColumnSchemaB\x03\xe0\x41\x01\x42x\n$com.google.cloud.datacatalog.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[google_dot_api_dot_field__behavior__pb2.DESCRIPTOR], -) - - -_SCHEMA = _descriptor.Descriptor( - name="Schema", - full_name="google.cloud.datacatalog.v1beta1.Schema", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="columns", - full_name="google.cloud.datacatalog.v1beta1.Schema.columns", - index=0, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=122, - serialized_end=200, -) - - -_COLUMNSCHEMA = _descriptor.Descriptor( - name="ColumnSchema", - full_name="google.cloud.datacatalog.v1beta1.ColumnSchema", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="column", - full_name="google.cloud.datacatalog.v1beta1.ColumnSchema.column", - index=0, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.datacatalog.v1beta1.ColumnSchema.type", - index=1, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.datacatalog.v1beta1.ColumnSchema.description", - index=2, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mode", - full_name="google.cloud.datacatalog.v1beta1.ColumnSchema.mode", - index=3, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="subcolumns", - full_name="google.cloud.datacatalog.v1beta1.ColumnSchema.subcolumns", - index=4, - number=7, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=203, - serialized_end=375, -) - -_SCHEMA.fields_by_name["columns"].message_type = _COLUMNSCHEMA -_COLUMNSCHEMA.fields_by_name["subcolumns"].message_type = _COLUMNSCHEMA -DESCRIPTOR.message_types_by_name["Schema"] = _SCHEMA -DESCRIPTOR.message_types_by_name["ColumnSchema"] = _COLUMNSCHEMA -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Schema = _reflection.GeneratedProtocolMessageType( - "Schema", - (_message.Message,), - dict( - DESCRIPTOR=_SCHEMA, - __module__="google.cloud.datacatalog_v1beta1.proto.schema_pb2", - __doc__="""Represents a schema (e.g. BigQuery, GoogleSQL, Avro - schema). - - - Attributes: - columns: - Required. Schema of columns. A maximum of 10,000 columns and - sub-columns can be specified. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.Schema) - ), -) -_sym_db.RegisterMessage(Schema) - -ColumnSchema = _reflection.GeneratedProtocolMessageType( - "ColumnSchema", - (_message.Message,), - dict( - DESCRIPTOR=_COLUMNSCHEMA, - __module__="google.cloud.datacatalog_v1beta1.proto.schema_pb2", - __doc__="""Representation of a column within a schema. Columns could - be nested inside other columns. - - - Attributes: - column: - Required. Name of the column. - type: - Required. Type of the column. - description: - Optional. Description of the column. Default value is an empty - string. - mode: - Optional. A column's mode indicates whether the values in this - column are required, nullable, etc. Only ``NULLABLE``, - ``REQUIRED`` and ``REPEATED`` are supported. Default mode is - ``NULLABLE``. - subcolumns: - Optional. Schema of sub-columns. A column can have zero or - more sub-columns. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.ColumnSchema) - ), -) -_sym_db.RegisterMessage(ColumnSchema) - - -DESCRIPTOR._options = None -_SCHEMA.fields_by_name["columns"]._options = None -_COLUMNSCHEMA.fields_by_name["column"]._options = None -_COLUMNSCHEMA.fields_by_name["type"]._options = None -_COLUMNSCHEMA.fields_by_name["description"]._options = None -_COLUMNSCHEMA.fields_by_name["mode"]._options = None -_COLUMNSCHEMA.fields_by_name["subcolumns"]._options = None -# @@protoc_insertion_point(module_scope) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/schema_pb2_grpc.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/schema_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/schema_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/search.proto b/datacatalog/google/cloud/datacatalog_v1beta1/proto/search.proto deleted file mode 100644 index 372c1573c3db..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/search.proto +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datacatalog.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/timestamp.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datacatalog"; - -// A result that appears in the response of a search request. Each result -// captures details of one entry that matches the search. -message SearchCatalogResult { - // Type of the search result. This field can be used to determine which Get - // method to call to fetch the full resource. - SearchResultType search_result_type = 1; - - // Sub-type of the search result. This is a dot-delimited description of the - // resource's full type, and is the same as the value callers would provide in - // the "type" search facet. Examples: `entry.table`, `entry.dataStream`, - // `tagTemplate`. - string search_result_subtype = 2; - - // The relative resource name of the resource in URL format. - // Examples: - // - // * `projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}` - // * `projects/{project_id}/tagTemplates/{tag_template_id}` - string relative_resource_name = 3; - - // The full name of the cloud resource the entry belongs to. See: - // https://cloud.google.com/apis/design/resource_names#full_resource_name. - // Example: - // - // * `//bigquery.googleapis.com/projects/projectId/datasets/datasetId/tables/tableId` - string linked_resource = 4; -} - -// The different types of resources that can be returned in search. -enum SearchResultType { - // Default unknown type. - SEARCH_RESULT_TYPE_UNSPECIFIED = 0; - - // An [Entry][google.cloud.datacatalog.v1beta1.Entry]. - ENTRY = 1; - - // A [TagTemplate][google.cloud.datacatalog.v1beta1.TagTemplate]. - TAG_TEMPLATE = 2; - - // An [EntryGroup][google.cloud.datacatalog.v1beta1.EntryGroup]. - ENTRY_GROUP = 3; -} diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/search_pb2.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/search_pb2.py deleted file mode 100644 index 77a5f5e29a6c..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/search_pb2.py +++ /dev/null @@ -1,211 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/datacatalog_v1beta1/proto/search.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/datacatalog_v1beta1/proto/search.proto", - package="google.cloud.datacatalog.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n$com.google.cloud.datacatalog.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" - ), - serialized_pb=_b( - '\n3google/cloud/datacatalog_v1beta1/proto/search.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xbd\x01\n\x13SearchCatalogResult\x12N\n\x12search_result_type\x18\x01 \x01(\x0e\x32\x32.google.cloud.datacatalog.v1beta1.SearchResultType\x12\x1d\n\x15search_result_subtype\x18\x02 \x01(\t\x12\x1e\n\x16relative_resource_name\x18\x03 \x01(\t\x12\x17\n\x0flinked_resource\x18\x04 \x01(\t*d\n\x10SearchResultType\x12"\n\x1eSEARCH_RESULT_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x45NTRY\x10\x01\x12\x10\n\x0cTAG_TEMPLATE\x10\x02\x12\x0f\n\x0b\x45NTRY_GROUP\x10\x03\x42x\n$com.google.cloud.datacatalog.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[ - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - -_SEARCHRESULTTYPE = _descriptor.EnumDescriptor( - name="SearchResultType", - full_name="google.cloud.datacatalog.v1beta1.SearchResultType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="SEARCH_RESULT_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="ENTRY", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TAG_TEMPLATE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="ENTRY_GROUP", index=3, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=347, - serialized_end=447, -) -_sym_db.RegisterEnumDescriptor(_SEARCHRESULTTYPE) - -SearchResultType = enum_type_wrapper.EnumTypeWrapper(_SEARCHRESULTTYPE) -SEARCH_RESULT_TYPE_UNSPECIFIED = 0 -ENTRY = 1 -TAG_TEMPLATE = 2 -ENTRY_GROUP = 3 - - -_SEARCHCATALOGRESULT = _descriptor.Descriptor( - name="SearchCatalogResult", - full_name="google.cloud.datacatalog.v1beta1.SearchCatalogResult", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="search_result_type", - full_name="google.cloud.datacatalog.v1beta1.SearchCatalogResult.search_result_type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="search_result_subtype", - full_name="google.cloud.datacatalog.v1beta1.SearchCatalogResult.search_result_subtype", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="relative_resource_name", - full_name="google.cloud.datacatalog.v1beta1.SearchCatalogResult.relative_resource_name", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="linked_resource", - full_name="google.cloud.datacatalog.v1beta1.SearchCatalogResult.linked_resource", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=156, - serialized_end=345, -) - -_SEARCHCATALOGRESULT.fields_by_name["search_result_type"].enum_type = _SEARCHRESULTTYPE -DESCRIPTOR.message_types_by_name["SearchCatalogResult"] = _SEARCHCATALOGRESULT -DESCRIPTOR.enum_types_by_name["SearchResultType"] = _SEARCHRESULTTYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -SearchCatalogResult = _reflection.GeneratedProtocolMessageType( - "SearchCatalogResult", - (_message.Message,), - dict( - DESCRIPTOR=_SEARCHCATALOGRESULT, - __module__="google.cloud.datacatalog_v1beta1.proto.search_pb2", - __doc__="""A result that appears in the response of a search request. - Each result captures details of one entry that matches the search. - - - Attributes: - search_result_type: - Type of the search result. This field can be used to determine - which Get method to call to fetch the full resource. - search_result_subtype: - Sub-type of the search result. This is a dot-delimited - description of the resource's full type, and is the same as - the value callers would provide in the "type" search facet. - Examples: ``entry.table``, ``entry.dataStream``, - ``tagTemplate``. - relative_resource_name: - The relative resource name of the resource in URL format. - Examples: - ``projects/{project_id}/locations/{location_id}/ - entryGroups/{entry_group_id}/entries/{entry_id}`` - - ``projects/{project_id}/tagTemplates/{tag_template_id}`` - linked_resource: - The full name of the cloud resource the entry belongs to. See: - https://cloud.google.com/apis/design/resource\_names#full\_res - ource\_name. Example: - ``//bigquery.googleapis.com/projects - /projectId/datasets/datasetId/tables/tableId`` - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.SearchCatalogResult) - ), -) -_sym_db.RegisterMessage(SearchCatalogResult) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/search_pb2_grpc.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/search_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/search_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/table_spec.proto b/datacatalog/google/cloud/datacatalog_v1beta1/proto/table_spec.proto deleted file mode 100644 index 4f9fddaaf97b..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/table_spec.proto +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datacatalog.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datacatalog"; - -// Describes a BigQuery table. -message BigQueryTableSpec { - // Output only. The table source type. - TableSourceType table_source_type = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. - oneof type_spec { - // Table view specification. This field should only be populated if - // `table_source_type` is `BIGQUERY_VIEW`. - ViewSpec view_spec = 2; - - // Spec of a BigQuery table. This field should only be populated if - // `table_source_type` is `BIGQUERY_TABLE`. - TableSpec table_spec = 3; - } -} - -// Table source type. -enum TableSourceType { - // Default unknown type. - TABLE_SOURCE_TYPE_UNSPECIFIED = 0; - - // Table view. - BIGQUERY_VIEW = 2; - - // BigQuery native table. - BIGQUERY_TABLE = 5; -} - -// Table view specification. -message ViewSpec { - // Output only. The query that defines the table view. - string view_query = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Normal BigQuery table spec. -message TableSpec { - // Output only. If the table is a dated shard, i.e., with name pattern - // `[prefix]YYYYMMDD`, `grouped_entry` is the Data Catalog resource name of - // the date sharded grouped entry, for example, - // `projects/{project_id}/locations/{location}/entrygroups/{entry_group_id}/entries/{entry_id}`. - // Otherwise, `grouped_entry` is empty. - string grouped_entry = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "datacatalog.googleapis.com/Entry" - } - ]; -} - -// Spec for a group of BigQuery tables with name pattern `[prefix]YYYYMMDD`. -// Context: -// https://cloud.google.com/bigquery/docs/partitioned-tables#partitioning_versus_sharding -message BigQueryDateShardedSpec { - // Output only. The Data Catalog resource name of the dataset entry the - // current table belongs to, for example, - // `projects/{project_id}/locations/{location}/entrygroups/{entry_group_id}/entries/{entry_id}`. - string dataset = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "datacatalog.googleapis.com/Entry" - } - ]; - - // Output only. The table name prefix of the shards. The name of any given - // shard is - // `[table_prefix]YYYYMMDD`, for example, for shard `MyTable20180101`, the - // `table_prefix` is `MyTable`. - string table_prefix = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Total number of shards. - int64 shard_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/table_spec_pb2.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/table_spec_pb2.py deleted file mode 100644 index 3d1467ce9380..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/table_spec_pb2.py +++ /dev/null @@ -1,434 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/datacatalog_v1beta1/proto/table_spec.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/datacatalog_v1beta1/proto/table_spec.proto", - package="google.cloud.datacatalog.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n$com.google.cloud.datacatalog.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" - ), - serialized_pb=_b( - '\n7google/cloud/datacatalog_v1beta1/proto/table_spec.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto"\xf7\x01\n\x11\x42igQueryTableSpec\x12Q\n\x11table_source_type\x18\x01 \x01(\x0e\x32\x31.google.cloud.datacatalog.v1beta1.TableSourceTypeB\x03\xe0\x41\x03\x12?\n\tview_spec\x18\x02 \x01(\x0b\x32*.google.cloud.datacatalog.v1beta1.ViewSpecH\x00\x12\x41\n\ntable_spec\x18\x03 \x01(\x0b\x32+.google.cloud.datacatalog.v1beta1.TableSpecH\x00\x42\x0b\n\ttype_spec"#\n\x08ViewSpec\x12\x17\n\nview_query\x18\x01 \x01(\tB\x03\xe0\x41\x03"L\n\tTableSpec\x12?\n\rgrouped_entry\x18\x01 \x01(\tB(\xe0\x41\x03\xfa\x41"\n datacatalog.googleapis.com/Entry"\x89\x01\n\x17\x42igQueryDateShardedSpec\x12\x39\n\x07\x64\x61taset\x18\x01 \x01(\tB(\xe0\x41\x03\xfa\x41"\n datacatalog.googleapis.com/Entry\x12\x19\n\x0ctable_prefix\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bshard_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03*[\n\x0fTableSourceType\x12!\n\x1dTABLE_SOURCE_TYPE_UNSPECIFIED\x10\x00\x12\x11\n\rBIGQUERY_VIEW\x10\x02\x12\x12\n\x0e\x42IGQUERY_TABLE\x10\x05\x42x\n$com.google.cloud.datacatalog.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[ - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - ], -) - -_TABLESOURCETYPE = _descriptor.EnumDescriptor( - name="TableSourceType", - full_name="google.cloud.datacatalog.v1beta1.TableSourceType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="TABLE_SOURCE_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="BIGQUERY_VIEW", index=1, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="BIGQUERY_TABLE", index=2, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=658, - serialized_end=749, -) -_sym_db.RegisterEnumDescriptor(_TABLESOURCETYPE) - -TableSourceType = enum_type_wrapper.EnumTypeWrapper(_TABLESOURCETYPE) -TABLE_SOURCE_TYPE_UNSPECIFIED = 0 -BIGQUERY_VIEW = 2 -BIGQUERY_TABLE = 5 - - -_BIGQUERYTABLESPEC = _descriptor.Descriptor( - name="BigQueryTableSpec", - full_name="google.cloud.datacatalog.v1beta1.BigQueryTableSpec", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="table_source_type", - full_name="google.cloud.datacatalog.v1beta1.BigQueryTableSpec.table_source_type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="view_spec", - full_name="google.cloud.datacatalog.v1beta1.BigQueryTableSpec.view_spec", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="table_spec", - full_name="google.cloud.datacatalog.v1beta1.BigQueryTableSpec.table_spec", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="type_spec", - full_name="google.cloud.datacatalog.v1beta1.BigQueryTableSpec.type_spec", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=154, - serialized_end=401, -) - - -_VIEWSPEC = _descriptor.Descriptor( - name="ViewSpec", - full_name="google.cloud.datacatalog.v1beta1.ViewSpec", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="view_query", - full_name="google.cloud.datacatalog.v1beta1.ViewSpec.view_query", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=403, - serialized_end=438, -) - - -_TABLESPEC = _descriptor.Descriptor( - name="TableSpec", - full_name="google.cloud.datacatalog.v1beta1.TableSpec", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="grouped_entry", - full_name="google.cloud.datacatalog.v1beta1.TableSpec.grouped_entry", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b('\340A\003\372A"\n datacatalog.googleapis.com/Entry'), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=440, - serialized_end=516, -) - - -_BIGQUERYDATESHARDEDSPEC = _descriptor.Descriptor( - name="BigQueryDateShardedSpec", - full_name="google.cloud.datacatalog.v1beta1.BigQueryDateShardedSpec", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="dataset", - full_name="google.cloud.datacatalog.v1beta1.BigQueryDateShardedSpec.dataset", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b('\340A\003\372A"\n datacatalog.googleapis.com/Entry'), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="table_prefix", - full_name="google.cloud.datacatalog.v1beta1.BigQueryDateShardedSpec.table_prefix", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shard_count", - full_name="google.cloud.datacatalog.v1beta1.BigQueryDateShardedSpec.shard_count", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=519, - serialized_end=656, -) - -_BIGQUERYTABLESPEC.fields_by_name["table_source_type"].enum_type = _TABLESOURCETYPE -_BIGQUERYTABLESPEC.fields_by_name["view_spec"].message_type = _VIEWSPEC -_BIGQUERYTABLESPEC.fields_by_name["table_spec"].message_type = _TABLESPEC -_BIGQUERYTABLESPEC.oneofs_by_name["type_spec"].fields.append( - _BIGQUERYTABLESPEC.fields_by_name["view_spec"] -) -_BIGQUERYTABLESPEC.fields_by_name[ - "view_spec" -].containing_oneof = _BIGQUERYTABLESPEC.oneofs_by_name["type_spec"] -_BIGQUERYTABLESPEC.oneofs_by_name["type_spec"].fields.append( - _BIGQUERYTABLESPEC.fields_by_name["table_spec"] -) -_BIGQUERYTABLESPEC.fields_by_name[ - "table_spec" -].containing_oneof = _BIGQUERYTABLESPEC.oneofs_by_name["type_spec"] -DESCRIPTOR.message_types_by_name["BigQueryTableSpec"] = _BIGQUERYTABLESPEC -DESCRIPTOR.message_types_by_name["ViewSpec"] = _VIEWSPEC -DESCRIPTOR.message_types_by_name["TableSpec"] = _TABLESPEC -DESCRIPTOR.message_types_by_name["BigQueryDateShardedSpec"] = _BIGQUERYDATESHARDEDSPEC -DESCRIPTOR.enum_types_by_name["TableSourceType"] = _TABLESOURCETYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -BigQueryTableSpec = _reflection.GeneratedProtocolMessageType( - "BigQueryTableSpec", - (_message.Message,), - dict( - DESCRIPTOR=_BIGQUERYTABLESPEC, - __module__="google.cloud.datacatalog_v1beta1.proto.table_spec_pb2", - __doc__="""Describes a BigQuery table. - - - Attributes: - table_source_type: - Output only. The table source type. - type_spec: - Output only. - view_spec: - Table view specification. This field should only be populated - if ``table_source_type`` is ``BIGQUERY_VIEW``. - table_spec: - Spec of a BigQuery table. This field should only be populated - if ``table_source_type`` is ``BIGQUERY_TABLE``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.BigQueryTableSpec) - ), -) -_sym_db.RegisterMessage(BigQueryTableSpec) - -ViewSpec = _reflection.GeneratedProtocolMessageType( - "ViewSpec", - (_message.Message,), - dict( - DESCRIPTOR=_VIEWSPEC, - __module__="google.cloud.datacatalog_v1beta1.proto.table_spec_pb2", - __doc__="""Table view specification. - - - Attributes: - view_query: - Output only. The query that defines the table view. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.ViewSpec) - ), -) -_sym_db.RegisterMessage(ViewSpec) - -TableSpec = _reflection.GeneratedProtocolMessageType( - "TableSpec", - (_message.Message,), - dict( - DESCRIPTOR=_TABLESPEC, - __module__="google.cloud.datacatalog_v1beta1.proto.table_spec_pb2", - __doc__="""Normal BigQuery table spec. - - - Attributes: - grouped_entry: - Output only. If the table is a dated shard, i.e., with name - pattern ``[prefix]YYYYMMDD``, ``grouped_entry`` is the Data - Catalog resource name of the date sharded grouped entry, for - example, ``projects/{project_id}/locations/{location}/entrygro - ups/{entry_group_id}/entries/{entry_id}``. Otherwise, - ``grouped_entry`` is empty. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.TableSpec) - ), -) -_sym_db.RegisterMessage(TableSpec) - -BigQueryDateShardedSpec = _reflection.GeneratedProtocolMessageType( - "BigQueryDateShardedSpec", - (_message.Message,), - dict( - DESCRIPTOR=_BIGQUERYDATESHARDEDSPEC, - __module__="google.cloud.datacatalog_v1beta1.proto.table_spec_pb2", - __doc__="""Spec for a group of BigQuery tables with name pattern - ``[prefix]YYYYMMDD``. Context: - https://cloud.google.com/bigquery/docs/partitioned-tables#partitioning\_versus\_sharding - - - Attributes: - dataset: - Output only. The Data Catalog resource name of the dataset - entry the current table belongs to, for example, ``projects/{p - roject_id}/locations/{location}/entrygroups/{entry_group_id}/e - ntries/{entry_id}``. - table_prefix: - Output only. The table name prefix of the shards. The name of - any given shard is ``[table_prefix]YYYYMMDD``, for example, - for shard ``MyTable20180101``, the ``table_prefix`` is - ``MyTable``. - shard_count: - Output only. Total number of shards. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.BigQueryDateShardedSpec) - ), -) -_sym_db.RegisterMessage(BigQueryDateShardedSpec) - - -DESCRIPTOR._options = None -_BIGQUERYTABLESPEC.fields_by_name["table_source_type"]._options = None -_VIEWSPEC.fields_by_name["view_query"]._options = None -_TABLESPEC.fields_by_name["grouped_entry"]._options = None -_BIGQUERYDATESHARDEDSPEC.fields_by_name["dataset"]._options = None -_BIGQUERYDATESHARDEDSPEC.fields_by_name["table_prefix"]._options = None -_BIGQUERYDATESHARDEDSPEC.fields_by_name["shard_count"]._options = None -# @@protoc_insertion_point(module_scope) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/table_spec_pb2_grpc.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/table_spec_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/table_spec_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/tags.proto b/datacatalog/google/cloud/datacatalog_v1beta1/proto/tags.proto deleted file mode 100644 index c2fc2da43467..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/tags.proto +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datacatalog.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datacatalog"; - -// Tags are used to attach custom metadata to Data Catalog resources. Tags -// conform to the specifications within their tag template. -message Tag { - option (google.api.resource) = { - type: "datacatalog.googleapis.com/Tag" - pattern: "projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}/tags/{tag}" - }; - - // The resource name of the tag in URL format. Example: - // - // * projects/{project_id}/locations/{location}/entrygroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id} - // - // where `tag_id` is a system-generated identifier. - // Note that this Tag may not actually be stored in the location in this name. - string name = 1; - - // Required. The resource name of the tag template that this tag uses. - // Example: - // - // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id} - // - // This field cannot be modified after creation. - string template = 2 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The display name of the tag template. - string template_display_name = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The scope within the parent resource that this tag is attached to. If not - // provided, the tag is attached to the parent resource itself. - // Deleting the scope from the parent resource will delete all tags attached - // to that scope. These fields cannot be updated after creation. - oneof scope { - // Resources like Entry can have schemas associated with them. This scope - // allows users to attach tags to an individual column based on that schema. - // - // For attaching a tag to a nested column, use `.` to separate the column - // names. Example: - // - // * `outer_column.inner_column` - string column = 4; - } - - // Required. This maps the ID of a tag field to the value of and additional - // information about that field. Valid field IDs are defined by the tag's - // template. A tag must have at least 1 field and at most 500 fields. - map fields = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Contains the value and supporting information for a field within -// a [Tag][google.cloud.datacatalog.v1beta1.Tag]. -message TagField { - // Holds an enum value. - message EnumValue { - // The display name of the enum value. - string display_name = 1; - } - - // Output only. The display name of this field. - string display_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The value of this field. - oneof kind { - // Holds the value for a tag field with double type. - double double_value = 2; - - // Holds the value for a tag field with string type. - string string_value = 3; - - // Holds the value for a tag field with boolean type. - bool bool_value = 4; - - // Holds the value for a tag field with timestamp type. - google.protobuf.Timestamp timestamp_value = 5; - - // Holds the value for a tag field with enum type. This value must be - // one of the allowed values in the definition of this enum. - EnumValue enum_value = 6; - } -} - -// A tag template defines the schema of the tags used to attach to Data Catalog -// resources. It defines the mapping of accepted field names and types that can -// be used within the tag. The tag template also controls the access to the tag. -message TagTemplate { - option (google.api.resource) = { - type: "datacatalog.googleapis.com/TagTemplate" - pattern: "projects/{project}/locations/{location}/tagTemplates/{tag_template}" - }; - - // The resource name of the tag template in URL format. Example: - // - // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id} - // - // Note that this TagTemplate and its child resources may not actually be - // stored in the location in this name. - string name = 1; - - // The display name for this template. Defaults to an empty string. - string display_name = 2; - - // Required. Map of tag template field IDs to the settings for the field. - // This map is an exhaustive list of the allowed fields. This map must contain - // at least one field and at most 500 fields. - // - // The keys to this map are tag template field IDs. Field IDs can contain - // letters (both uppercase and lowercase), numbers (0-9) and underscores (_). - // Field IDs must be at least 1 character long and at most - // 64 characters long. Field IDs must start with a letter or underscore. - map fields = 3 - [(google.api.field_behavior) = REQUIRED]; -} - -// The template for an individual field within a tag template. -message TagTemplateField { - option (google.api.resource) = { - type: "datacatalog.googleapis.com/TagTemplateField" - pattern: "projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}" - }; - - // Output only. The resource name of the tag template field in URL format. - // Example: - // - // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template}/fields/{field} - // - // Note that this TagTemplateField may not actually be stored in the location - // in this name. - string name = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The display name for this field. Defaults to an empty string. - string display_name = 1; - - // Required. The type of value this tag field can contain. - FieldType type = 2 [(google.api.field_behavior) = REQUIRED]; -} - -message FieldType { - message EnumType { - message EnumValue { - // Required. The display name of the enum value. Must not be an empty - // string. - string display_name = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Required on create; optional on update. The set of allowed values for - // this enum. This set must not be empty, the display names of the values in - // this set must not be empty and the display names of the values must be - // case-insensitively unique within this set. Currently, enum values can - // only be added to the list of allowed values. Deletion and renaming of - // enum values are not supported. Can have up to 500 allowed values. - repeated EnumValue allowed_values = 1; - } - - enum PrimitiveType { - // This is the default invalid value for a type. - PRIMITIVE_TYPE_UNSPECIFIED = 0; - - // A double precision number. - DOUBLE = 1; - - // An UTF-8 string. - STRING = 2; - - // A boolean value. - BOOL = 3; - - // A timestamp. - TIMESTAMP = 4; - } - - // Required. - oneof type_decl { - // Represents primitive types - string, bool etc. - PrimitiveType primitive_type = 1; - - // Represents an enum type. - EnumType enum_type = 2; - } -} diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/tags_pb2.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/tags_pb2.py deleted file mode 100644 index 40d947d73dcb..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/tags_pb2.py +++ /dev/null @@ -1,1116 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/datacatalog_v1beta1/proto/tags.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/datacatalog_v1beta1/proto/tags.proto", - package="google.cloud.datacatalog.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n$com.google.cloud.datacatalog.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" - ), - serialized_pb=_b( - '\n1google/cloud/datacatalog_v1beta1/proto/tags.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\x90\x03\n\x03Tag\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x15\n\x08template\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12"\n\x15template_display_name\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x06\x63olumn\x18\x04 \x01(\tH\x00\x12\x46\n\x06\x66ields\x18\x03 \x03(\x0b\x32\x31.google.cloud.datacatalog.v1beta1.Tag.FieldsEntryB\x03\xe0\x41\x02\x1aY\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x39\n\x05value\x18\x02 \x01(\x0b\x32*.google.cloud.datacatalog.v1beta1.TagField:\x02\x38\x01:\x81\x01\xea\x41~\n\x1e\x64\x61tacatalog.googleapis.com/Tag\x12\\projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}/tags/{tag}B\x07\n\x05scope"\x99\x02\n\x08TagField\x12\x19\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x16\n\x0c\x64ouble_value\x18\x02 \x01(\x01H\x00\x12\x16\n\x0cstring_value\x18\x03 \x01(\tH\x00\x12\x14\n\nbool_value\x18\x04 \x01(\x08H\x00\x12\x35\n\x0ftimestamp_value\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12J\n\nenum_value\x18\x06 \x01(\x0b\x32\x34.google.cloud.datacatalog.v1beta1.TagField.EnumValueH\x00\x1a!\n\tEnumValue\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x06\n\x04kind"\xd6\x02\n\x0bTagTemplate\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12N\n\x06\x66ields\x18\x03 \x03(\x0b\x32\x39.google.cloud.datacatalog.v1beta1.TagTemplate.FieldsEntryB\x03\xe0\x41\x02\x1a\x61\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x41\n\x05value\x18\x02 \x01(\x0b\x32\x32.google.cloud.datacatalog.v1beta1.TagTemplateField:\x02\x38\x01:p\xea\x41m\n&datacatalog.googleapis.com/TagTemplate\x12\x43projects/{project}/locations/{location}/tagTemplates/{tag_template}"\x98\x02\n\x10TagTemplateField\x12\x11\n\x04name\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12>\n\x04type\x18\x02 \x01(\x0b\x32+.google.cloud.datacatalog.v1beta1.FieldTypeB\x03\xe0\x41\x02\x12\x13\n\x0bis_required\x18\x03 \x01(\x08:\x85\x01\xea\x41\x81\x01\n+datacatalog.googleapis.com/TagTemplateField\x12Rprojects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}"\xa7\x03\n\tFieldType\x12S\n\x0eprimitive_type\x18\x01 \x01(\x0e\x32\x39.google.cloud.datacatalog.v1beta1.FieldType.PrimitiveTypeH\x00\x12I\n\tenum_type\x18\x02 \x01(\x0b\x32\x34.google.cloud.datacatalog.v1beta1.FieldType.EnumTypeH\x00\x1a\x8a\x01\n\x08\x45numType\x12V\n\x0e\x61llowed_values\x18\x01 \x03(\x0b\x32>.google.cloud.datacatalog.v1beta1.FieldType.EnumType.EnumValue\x1a&\n\tEnumValue\x12\x19\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x03\xe0\x41\x02"`\n\rPrimitiveType\x12\x1e\n\x1aPRIMITIVE_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06\x44OUBLE\x10\x01\x12\n\n\x06STRING\x10\x02\x12\x08\n\x04\x42OOL\x10\x03\x12\r\n\tTIMESTAMP\x10\x04\x42\x0b\n\ttype_declBx\n$com.google.cloud.datacatalog.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[ - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_FIELDTYPE_PRIMITIVETYPE = _descriptor.EnumDescriptor( - name="PrimitiveType", - full_name="google.cloud.datacatalog.v1beta1.FieldType.PrimitiveType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="PRIMITIVE_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="DOUBLE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="STRING", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="BOOL", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TIMESTAMP", index=4, number=4, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1810, - serialized_end=1906, -) -_sym_db.RegisterEnumDescriptor(_FIELDTYPE_PRIMITIVETYPE) - - -_TAG_FIELDSENTRY = _descriptor.Descriptor( - name="FieldsEntry", - full_name="google.cloud.datacatalog.v1beta1.Tag.FieldsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.datacatalog.v1beta1.Tag.FieldsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.datacatalog.v1beta1.Tag.FieldsEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=351, - serialized_end=440, -) - -_TAG = _descriptor.Descriptor( - name="Tag", - full_name="google.cloud.datacatalog.v1beta1.Tag", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datacatalog.v1beta1.Tag.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="template", - full_name="google.cloud.datacatalog.v1beta1.Tag.template", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="template_display_name", - full_name="google.cloud.datacatalog.v1beta1.Tag.template_display_name", - index=2, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="column", - full_name="google.cloud.datacatalog.v1beta1.Tag.column", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="fields", - full_name="google.cloud.datacatalog.v1beta1.Tag.fields", - index=4, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_TAG_FIELDSENTRY], - enum_types=[], - serialized_options=_b( - "\352A~\n\036datacatalog.googleapis.com/Tag\022\\projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}/tags/{tag}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="scope", - full_name="google.cloud.datacatalog.v1beta1.Tag.scope", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=181, - serialized_end=581, -) - - -_TAGFIELD_ENUMVALUE = _descriptor.Descriptor( - name="EnumValue", - full_name="google.cloud.datacatalog.v1beta1.TagField.EnumValue", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.datacatalog.v1beta1.TagField.EnumValue.display_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=824, - serialized_end=857, -) - -_TAGFIELD = _descriptor.Descriptor( - name="TagField", - full_name="google.cloud.datacatalog.v1beta1.TagField", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.datacatalog.v1beta1.TagField.display_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="double_value", - full_name="google.cloud.datacatalog.v1beta1.TagField.double_value", - index=1, - number=2, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="string_value", - full_name="google.cloud.datacatalog.v1beta1.TagField.string_value", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bool_value", - full_name="google.cloud.datacatalog.v1beta1.TagField.bool_value", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="timestamp_value", - full_name="google.cloud.datacatalog.v1beta1.TagField.timestamp_value", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enum_value", - full_name="google.cloud.datacatalog.v1beta1.TagField.enum_value", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_TAGFIELD_ENUMVALUE], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="kind", - full_name="google.cloud.datacatalog.v1beta1.TagField.kind", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=584, - serialized_end=865, -) - - -_TAGTEMPLATE_FIELDSENTRY = _descriptor.Descriptor( - name="FieldsEntry", - full_name="google.cloud.datacatalog.v1beta1.TagTemplate.FieldsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.datacatalog.v1beta1.TagTemplate.FieldsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.datacatalog.v1beta1.TagTemplate.FieldsEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=999, - serialized_end=1096, -) - -_TAGTEMPLATE = _descriptor.Descriptor( - name="TagTemplate", - full_name="google.cloud.datacatalog.v1beta1.TagTemplate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datacatalog.v1beta1.TagTemplate.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.datacatalog.v1beta1.TagTemplate.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="fields", - full_name="google.cloud.datacatalog.v1beta1.TagTemplate.fields", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_TAGTEMPLATE_FIELDSENTRY], - enum_types=[], - serialized_options=_b( - "\352Am\n&datacatalog.googleapis.com/TagTemplate\022Cprojects/{project}/locations/{location}/tagTemplates/{tag_template}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=868, - serialized_end=1210, -) - - -_TAGTEMPLATEFIELD = _descriptor.Descriptor( - name="TagTemplateField", - full_name="google.cloud.datacatalog.v1beta1.TagTemplateField", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datacatalog.v1beta1.TagTemplateField.name", - index=0, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.datacatalog.v1beta1.TagTemplateField.display_name", - index=1, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.datacatalog.v1beta1.TagTemplateField.type", - index=2, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="is_required", - full_name="google.cloud.datacatalog.v1beta1.TagTemplateField.is_required", - index=3, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b( - "\352A\201\001\n+datacatalog.googleapis.com/TagTemplateField\022Rprojects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1213, - serialized_end=1493, -) - - -_FIELDTYPE_ENUMTYPE_ENUMVALUE = _descriptor.Descriptor( - name="EnumValue", - full_name="google.cloud.datacatalog.v1beta1.FieldType.EnumType.EnumValue", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.datacatalog.v1beta1.FieldType.EnumType.EnumValue.display_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1770, - serialized_end=1808, -) - -_FIELDTYPE_ENUMTYPE = _descriptor.Descriptor( - name="EnumType", - full_name="google.cloud.datacatalog.v1beta1.FieldType.EnumType", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="allowed_values", - full_name="google.cloud.datacatalog.v1beta1.FieldType.EnumType.allowed_values", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[_FIELDTYPE_ENUMTYPE_ENUMVALUE], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1670, - serialized_end=1808, -) - -_FIELDTYPE = _descriptor.Descriptor( - name="FieldType", - full_name="google.cloud.datacatalog.v1beta1.FieldType", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="primitive_type", - full_name="google.cloud.datacatalog.v1beta1.FieldType.primitive_type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enum_type", - full_name="google.cloud.datacatalog.v1beta1.FieldType.enum_type", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_FIELDTYPE_ENUMTYPE], - enum_types=[_FIELDTYPE_PRIMITIVETYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="type_decl", - full_name="google.cloud.datacatalog.v1beta1.FieldType.type_decl", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1496, - serialized_end=1919, -) - -_TAG_FIELDSENTRY.fields_by_name["value"].message_type = _TAGFIELD -_TAG_FIELDSENTRY.containing_type = _TAG -_TAG.fields_by_name["fields"].message_type = _TAG_FIELDSENTRY -_TAG.oneofs_by_name["scope"].fields.append(_TAG.fields_by_name["column"]) -_TAG.fields_by_name["column"].containing_oneof = _TAG.oneofs_by_name["scope"] -_TAGFIELD_ENUMVALUE.containing_type = _TAGFIELD -_TAGFIELD.fields_by_name[ - "timestamp_value" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_TAGFIELD.fields_by_name["enum_value"].message_type = _TAGFIELD_ENUMVALUE -_TAGFIELD.oneofs_by_name["kind"].fields.append(_TAGFIELD.fields_by_name["double_value"]) -_TAGFIELD.fields_by_name["double_value"].containing_oneof = _TAGFIELD.oneofs_by_name[ - "kind" -] -_TAGFIELD.oneofs_by_name["kind"].fields.append(_TAGFIELD.fields_by_name["string_value"]) -_TAGFIELD.fields_by_name["string_value"].containing_oneof = _TAGFIELD.oneofs_by_name[ - "kind" -] -_TAGFIELD.oneofs_by_name["kind"].fields.append(_TAGFIELD.fields_by_name["bool_value"]) -_TAGFIELD.fields_by_name["bool_value"].containing_oneof = _TAGFIELD.oneofs_by_name[ - "kind" -] -_TAGFIELD.oneofs_by_name["kind"].fields.append( - _TAGFIELD.fields_by_name["timestamp_value"] -) -_TAGFIELD.fields_by_name["timestamp_value"].containing_oneof = _TAGFIELD.oneofs_by_name[ - "kind" -] -_TAGFIELD.oneofs_by_name["kind"].fields.append(_TAGFIELD.fields_by_name["enum_value"]) -_TAGFIELD.fields_by_name["enum_value"].containing_oneof = _TAGFIELD.oneofs_by_name[ - "kind" -] -_TAGTEMPLATE_FIELDSENTRY.fields_by_name["value"].message_type = _TAGTEMPLATEFIELD -_TAGTEMPLATE_FIELDSENTRY.containing_type = _TAGTEMPLATE -_TAGTEMPLATE.fields_by_name["fields"].message_type = _TAGTEMPLATE_FIELDSENTRY -_TAGTEMPLATEFIELD.fields_by_name["type"].message_type = _FIELDTYPE -_FIELDTYPE_ENUMTYPE_ENUMVALUE.containing_type = _FIELDTYPE_ENUMTYPE -_FIELDTYPE_ENUMTYPE.fields_by_name[ - "allowed_values" -].message_type = _FIELDTYPE_ENUMTYPE_ENUMVALUE -_FIELDTYPE_ENUMTYPE.containing_type = _FIELDTYPE -_FIELDTYPE.fields_by_name["primitive_type"].enum_type = _FIELDTYPE_PRIMITIVETYPE -_FIELDTYPE.fields_by_name["enum_type"].message_type = _FIELDTYPE_ENUMTYPE -_FIELDTYPE_PRIMITIVETYPE.containing_type = _FIELDTYPE -_FIELDTYPE.oneofs_by_name["type_decl"].fields.append( - _FIELDTYPE.fields_by_name["primitive_type"] -) -_FIELDTYPE.fields_by_name[ - "primitive_type" -].containing_oneof = _FIELDTYPE.oneofs_by_name["type_decl"] -_FIELDTYPE.oneofs_by_name["type_decl"].fields.append( - _FIELDTYPE.fields_by_name["enum_type"] -) -_FIELDTYPE.fields_by_name["enum_type"].containing_oneof = _FIELDTYPE.oneofs_by_name[ - "type_decl" -] -DESCRIPTOR.message_types_by_name["Tag"] = _TAG -DESCRIPTOR.message_types_by_name["TagField"] = _TAGFIELD -DESCRIPTOR.message_types_by_name["TagTemplate"] = _TAGTEMPLATE -DESCRIPTOR.message_types_by_name["TagTemplateField"] = _TAGTEMPLATEFIELD -DESCRIPTOR.message_types_by_name["FieldType"] = _FIELDTYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Tag = _reflection.GeneratedProtocolMessageType( - "Tag", - (_message.Message,), - dict( - FieldsEntry=_reflection.GeneratedProtocolMessageType( - "FieldsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_TAG_FIELDSENTRY, - __module__="google.cloud.datacatalog_v1beta1.proto.tags_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.Tag.FieldsEntry) - ), - ), - DESCRIPTOR=_TAG, - __module__="google.cloud.datacatalog_v1beta1.proto.tags_pb2", - __doc__="""Tags are used to attach custom metadata to Data Catalog - resources. Tags conform to the specifications within their tag template. - - See `Data Catalog IAM `__ for - information on the permissions needed to create or view tags. - - - Attributes: - name: - The resource name of the tag in URL format. Example: - proje - cts/{project\_id}/locations/{location}/entrygroups/{entry\_gro - up\_id}/entries/{entry\_id}/tags/{tag\_id} where ``tag_id`` - is a system-generated identifier. Note that this Tag may not - actually be stored in the location in this name. - template: - Required. The resource name of the tag template that this tag - uses. Example: - projects/{project\_id}/locations/{location} - /tagTemplates/{tag\_template\_id} This field cannot be - modified after creation. - template_display_name: - Output only. The display name of the tag template. - scope: - The scope within the parent resource that this tag is attached - to. If not provided, the tag is attached to the parent - resource itself. Deleting the scope from the parent resource - will delete all tags attached to that scope. These fields - cannot be updated after creation. - column: - Resources like Entry can have schemas associated with them. - This scope allows users to attach tags to an individual column - based on that schema. For attaching a tag to a nested column, - use ``.`` to separate the column names. Example: - - ``outer_column.inner_column`` - fields: - Required. This maps the ID of a tag field to the value of and - additional information about that field. Valid field IDs are - defined by the tag's template. A tag must have at least 1 - field and at most 500 fields. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.Tag) - ), -) -_sym_db.RegisterMessage(Tag) -_sym_db.RegisterMessage(Tag.FieldsEntry) - -TagField = _reflection.GeneratedProtocolMessageType( - "TagField", - (_message.Message,), - dict( - EnumValue=_reflection.GeneratedProtocolMessageType( - "EnumValue", - (_message.Message,), - dict( - DESCRIPTOR=_TAGFIELD_ENUMVALUE, - __module__="google.cloud.datacatalog_v1beta1.proto.tags_pb2", - __doc__="""Holds an enum value. - - - Attributes: - display_name: - The display name of the enum value. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.TagField.EnumValue) - ), - ), - DESCRIPTOR=_TAGFIELD, - __module__="google.cloud.datacatalog_v1beta1.proto.tags_pb2", - __doc__="""Contains the value and supporting information for a field - within a [Tag][google.cloud.datacatalog.v1beta1.Tag]. - - - Attributes: - display_name: - Output only. The display name of this field. - kind: - Required. The value of this field. - double_value: - Holds the value for a tag field with double type. - string_value: - Holds the value for a tag field with string type. - bool_value: - Holds the value for a tag field with boolean type. - timestamp_value: - Holds the value for a tag field with timestamp type. - enum_value: - Holds the value for a tag field with enum type. This value - must be one of the allowed values in the definition of this - enum. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.TagField) - ), -) -_sym_db.RegisterMessage(TagField) -_sym_db.RegisterMessage(TagField.EnumValue) - -TagTemplate = _reflection.GeneratedProtocolMessageType( - "TagTemplate", - (_message.Message,), - dict( - FieldsEntry=_reflection.GeneratedProtocolMessageType( - "FieldsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_TAGTEMPLATE_FIELDSENTRY, - __module__="google.cloud.datacatalog_v1beta1.proto.tags_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.TagTemplate.FieldsEntry) - ), - ), - DESCRIPTOR=_TAGTEMPLATE, - __module__="google.cloud.datacatalog_v1beta1.proto.tags_pb2", - __doc__="""A tag template defines the schema of the tags used to - attach to Data Catalog resources. It defines the mapping of accepted - field names and types that can be used within the tag. The tag template - also controls the access to the tag. - - - Attributes: - name: - The resource name of the tag template in URL format. Example: - - projects/{project\_id}/locations/{location}/tagTemplates/{t - ag\_template\_id} Note that this TagTemplate and its child - resources may not actually be stored in the location in this - name. - display_name: - The display name for this template. Defaults to an empty - string. - fields: - Required. Map of tag template field IDs to the settings for - the field. This map is an exhaustive list of the allowed - fields. This map must contain at least one field and at most - 500 fields. The keys to this map are tag template field IDs. - Field IDs can contain letters (both uppercase and lowercase), - numbers (0-9) and underscores (\_). Field IDs must be at least - 1 character long and at most 64 characters long. Field IDs - must start with a letter or underscore. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.TagTemplate) - ), -) -_sym_db.RegisterMessage(TagTemplate) -_sym_db.RegisterMessage(TagTemplate.FieldsEntry) - -TagTemplateField = _reflection.GeneratedProtocolMessageType( - "TagTemplateField", - (_message.Message,), - dict( - DESCRIPTOR=_TAGTEMPLATEFIELD, - __module__="google.cloud.datacatalog_v1beta1.proto.tags_pb2", - __doc__="""The template for an individual field within a tag - template. - - - Attributes: - name: - Output only. The resource name of the tag template field in - URL format. Example: - projects/{project\_id}/locations/{loc - ation}/tagTemplates/{tag\_template}/fields/{field} Note that - this TagTemplateField may not actually be stored in the - location in this name. - display_name: - The display name for this field. Defaults to an empty string. - type: - Required. The type of value this tag field can contain. - is_required: - Whether this is a required field. Defaults to false. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.TagTemplateField) - ), -) -_sym_db.RegisterMessage(TagTemplateField) - -FieldType = _reflection.GeneratedProtocolMessageType( - "FieldType", - (_message.Message,), - dict( - EnumType=_reflection.GeneratedProtocolMessageType( - "EnumType", - (_message.Message,), - dict( - EnumValue=_reflection.GeneratedProtocolMessageType( - "EnumValue", - (_message.Message,), - dict( - DESCRIPTOR=_FIELDTYPE_ENUMTYPE_ENUMVALUE, - __module__="google.cloud.datacatalog_v1beta1.proto.tags_pb2", - __doc__=""" - Attributes: - display_name: - Required. The display name of the enum value. Must not be an - empty string. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.FieldType.EnumType.EnumValue) - ), - ), - DESCRIPTOR=_FIELDTYPE_ENUMTYPE, - __module__="google.cloud.datacatalog_v1beta1.proto.tags_pb2", - __doc__=""" - Attributes: - allowed_values: - Required on create; optional on update. The set of allowed - values for this enum. This set must not be empty, the display - names of the values in this set must not be empty and the - display names of the values must be case-insensitively unique - within this set. Currently, enum values can only be added to - the list of allowed values. Deletion and renaming of enum - values are not supported. Can have up to 500 allowed values. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.FieldType.EnumType) - ), - ), - DESCRIPTOR=_FIELDTYPE, - __module__="google.cloud.datacatalog_v1beta1.proto.tags_pb2", - __doc__=""" - Attributes: - type_decl: - Required. - primitive_type: - Represents primitive types - string, bool etc. - enum_type: - Represents an enum type. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.FieldType) - ), -) -_sym_db.RegisterMessage(FieldType) -_sym_db.RegisterMessage(FieldType.EnumType) -_sym_db.RegisterMessage(FieldType.EnumType.EnumValue) - - -DESCRIPTOR._options = None -_TAG_FIELDSENTRY._options = None -_TAG.fields_by_name["template"]._options = None -_TAG.fields_by_name["template_display_name"]._options = None -_TAG.fields_by_name["fields"]._options = None -_TAG._options = None -_TAGFIELD.fields_by_name["display_name"]._options = None -_TAGTEMPLATE_FIELDSENTRY._options = None -_TAGTEMPLATE.fields_by_name["fields"]._options = None -_TAGTEMPLATE._options = None -_TAGTEMPLATEFIELD.fields_by_name["name"]._options = None -_TAGTEMPLATEFIELD.fields_by_name["type"]._options = None -_TAGTEMPLATEFIELD._options = None -_FIELDTYPE_ENUMTYPE_ENUMVALUE.fields_by_name["display_name"]._options = None -# @@protoc_insertion_point(module_scope) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/tags_pb2_grpc.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/tags_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/tags_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/timestamps.proto b/datacatalog/google/cloud/datacatalog_v1beta1/proto/timestamps.proto deleted file mode 100644 index 9a3d640e411c..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/timestamps.proto +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datacatalog.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/timestamp.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datacatalog"; - -// Timestamps about this resource according to a particular system. -message SystemTimestamps { - // The creation time of the resource within the given system. - google.protobuf.Timestamp create_time = 1; - - // The last-modified time of the resource within the given system. - google.protobuf.Timestamp update_time = 2; - - // Output only. The expiration time of the resource within the given system. - // Currently only apllicable to BigQuery resources. - google.protobuf.Timestamp expire_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/timestamps_pb2.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/timestamps_pb2.py deleted file mode 100644 index 873b2035e365..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/timestamps_pb2.py +++ /dev/null @@ -1,153 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/datacatalog_v1beta1/proto/timestamps.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/datacatalog_v1beta1/proto/timestamps.proto", - package="google.cloud.datacatalog.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n$com.google.cloud.datacatalog.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" - ), - serialized_pb=_b( - '\n7google/cloud/datacatalog_v1beta1/proto/timestamps.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xaa\x01\n\x10SystemTimestamps\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42x\n$com.google.cloud.datacatalog.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[ - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_SYSTEMTIMESTAMPS = _descriptor.Descriptor( - name="SystemTimestamps", - full_name="google.cloud.datacatalog.v1beta1.SystemTimestamps", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.datacatalog.v1beta1.SystemTimestamps.create_time", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_time", - full_name="google.cloud.datacatalog.v1beta1.SystemTimestamps.update_time", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="expire_time", - full_name="google.cloud.datacatalog.v1beta1.SystemTimestamps.expire_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=160, - serialized_end=330, -) - -_SYSTEMTIMESTAMPS.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_SYSTEMTIMESTAMPS.fields_by_name[ - "update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_SYSTEMTIMESTAMPS.fields_by_name[ - "expire_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -DESCRIPTOR.message_types_by_name["SystemTimestamps"] = _SYSTEMTIMESTAMPS -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -SystemTimestamps = _reflection.GeneratedProtocolMessageType( - "SystemTimestamps", - (_message.Message,), - dict( - DESCRIPTOR=_SYSTEMTIMESTAMPS, - __module__="google.cloud.datacatalog_v1beta1.proto.timestamps_pb2", - __doc__="""Timestamps about this resource according to a particular - system. - - - Attributes: - create_time: - The creation time of the resource within the given system. - update_time: - The last-modified time of the resource within the given - system. - expire_time: - Output only. The expiration time of the resource within the - given system. Currently only apllicable to BigQuery resources. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.SystemTimestamps) - ), -) -_sym_db.RegisterMessage(SystemTimestamps) - - -DESCRIPTOR._options = None -_SYSTEMTIMESTAMPS.fields_by_name["expire_time"]._options = None -# @@protoc_insertion_point(module_scope) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/timestamps_pb2_grpc.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/timestamps_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/timestamps_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/types.py b/datacatalog/google/cloud/datacatalog_v1beta1/types.py deleted file mode 100644 index b074c7924ce0..000000000000 --- a/datacatalog/google/cloud/datacatalog_v1beta1/types.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.datacatalog_v1beta1.proto import datacatalog_pb2 -from google.cloud.datacatalog_v1beta1.proto import gcs_fileset_spec_pb2 -from google.cloud.datacatalog_v1beta1.proto import policytagmanager_pb2 -from google.cloud.datacatalog_v1beta1.proto import policytagmanagerserialization_pb2 -from google.cloud.datacatalog_v1beta1.proto import schema_pb2 -from google.cloud.datacatalog_v1beta1.proto import search_pb2 -from google.cloud.datacatalog_v1beta1.proto import table_spec_pb2 -from google.cloud.datacatalog_v1beta1.proto import tags_pb2 -from google.cloud.datacatalog_v1beta1.proto import timestamps_pb2 -from google.iam.v1 import iam_policy_pb2 -from google.iam.v1 import options_pb2 -from google.iam.v1 import policy_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 -from google.protobuf import timestamp_pb2 -from google.type import expr_pb2 - - -_shared_modules = [ - iam_policy_pb2, - options_pb2, - policy_pb2, - empty_pb2, - field_mask_pb2, - timestamp_pb2, - expr_pb2, -] - -_local_modules = [ - datacatalog_pb2, - gcs_fileset_spec_pb2, - policytagmanager_pb2, - policytagmanagerserialization_pb2, - schema_pb2, - search_pb2, - table_spec_pb2, - tags_pb2, - timestamps_pb2, -] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.datacatalog_v1beta1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/datacatalog/noxfile.py b/datacatalog/noxfile.py deleted file mode 100644 index 364ec4bdb25e..000000000000 --- a/datacatalog/noxfile.py +++ /dev/null @@ -1,179 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python=["2.7", "3.7"]) -def samples(session): - requirements_path = os.path.join("samples", "requirements.txt") - requirements_exists = os.path.exists(requirements_path) - - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - if requirements_exists: - session.install("-r", requirements_path) - session.install("-e", ".") - - session.run("py.test", "--quiet", "samples", *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=80") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/datacatalog/samples/__init__.py b/datacatalog/samples/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/datacatalog/samples/quickstart/__init__.py b/datacatalog/samples/quickstart/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/datacatalog/samples/quickstart/create_fileset_entry_quickstart.py b/datacatalog/samples/quickstart/create_fileset_entry_quickstart.py deleted file mode 100644 index 55b0af59e689..000000000000 --- a/datacatalog/samples/quickstart/create_fileset_entry_quickstart.py +++ /dev/null @@ -1,115 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -def create_fileset_entry_quickstart(client, project_id, entry_group_id, entry_id): - - # [START datacatalog_create_fileset_quickstart_tag] - # Import required modules. - from google.cloud import datacatalog_v1beta1 - - # TODO(developer): Construct a Data Catalog client object. - # client = datacatalog_v1beta1.DataCatalogClient() - - # TODO(developer): Set project_id to your - # Google Cloud Platform project ID the entry will belong. - # project_id = "your-project-id" - - # TODO(developer): Specify the geographic location where the - # entry should reside. - # Currently, Data Catalog stores metadata in the us-central1 region. - location_id = "us-central1" - - # TODO(developer): Set entry_group_id to the ID of the entry group - # the entry will belong. - # entry_group_id = "your_entry_group_id" - - # TODO(developer): Set entry_id to the ID of the entry to create. - # entry_id = "your_entry_id" - - # Create an Entry Group. - # Construct a full Entry Group object to send to the API. - entry_group_obj = datacatalog_v1beta1.types.EntryGroup() - entry_group_obj.display_name = "My Fileset Entry Group" - entry_group_obj.description = "This Entry Group consists of ...." - - # Send the Entry Group to the API for creation. - # Raises google.api_core.exceptions.AlreadyExists if the Entry Group - # already exists within the project. - entry_group = client.create_entry_group( - parent=datacatalog_v1beta1.DataCatalogClient.location_path( - project_id, location_id - ), - entry_group_id=entry_group_id, - entry_group=entry_group_obj, - ) - print("Created entry group {}".format(entry_group.name)) - - # Create a Fileset Entry. - # Construct a full Entry object to send to the API. - entry = datacatalog_v1beta1.types.Entry() - entry.display_name = "My Fileset" - entry.description = "This Fileset consists of ..." - entry.gcs_fileset_spec.file_patterns.append("gs://cloud-samples-data/*") - entry.type = datacatalog_v1beta1.enums.EntryType.FILESET - - # Create the Schema, for example when you have a csv file. - columns = [] - columns.append( - datacatalog_v1beta1.types.ColumnSchema( - column="first_name", - description="First name", - mode="REQUIRED", - type="STRING", - ) - ) - - columns.append( - datacatalog_v1beta1.types.ColumnSchema( - column="last_name", description="Last name", mode="REQUIRED", type="STRING" - ) - ) - - # Create sub columns for the addresses parent column - subcolumns = [] - subcolumns.append( - datacatalog_v1beta1.types.ColumnSchema( - column="city", description="City", mode="NULLABLE", type="STRING" - ) - ) - - subcolumns.append( - datacatalog_v1beta1.types.ColumnSchema( - column="state", description="State", mode="NULLABLE", type="STRING" - ) - ) - - columns.append( - datacatalog_v1beta1.types.ColumnSchema( - column="addresses", - description="Addresses", - mode="REPEATED", - subcolumns=subcolumns, - type="RECORD", - ) - ) - - entry.schema.columns.extend(columns) - - # Send the entry to the API for creation. - # Raises google.api_core.exceptions.AlreadyExists if the Entry already - # exists within the project. - entry = client.create_entry(entry_group.name, entry_id, entry) - print("Created entry {}".format(entry.name)) - # [END datacatalog_create_fileset_quickstart_tag] diff --git a/datacatalog/samples/tests/__init__.py b/datacatalog/samples/tests/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/datacatalog/samples/tests/conftest.py b/datacatalog/samples/tests/conftest.py deleted file mode 100644 index 75e6753ff446..000000000000 --- a/datacatalog/samples/tests/conftest.py +++ /dev/null @@ -1,94 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import datetime -import uuid - -import pytest - -import google.auth -from google.cloud import datacatalog_v1beta1 - - -@pytest.fixture(scope="session") -def client(credentials): - return datacatalog_v1beta1.DataCatalogClient(credentials=credentials) - - -@pytest.fixture(scope="session") -def default_credentials(): - return google.auth.default() - - -@pytest.fixture(scope="session") -def credentials(default_credentials): - return default_credentials[0] - - -@pytest.fixture(scope="session") -def project_id(default_credentials): - return default_credentials[1] - - -@pytest.fixture -def random_entry_id(client, project_id, random_entry_group_id): - now = datetime.datetime.now() - random_entry_id = "example_entry_{}_{}".format( - now.strftime("%Y%m%d%H%M%S"), uuid.uuid4().hex[:8] - ) - yield random_entry_id - entry_name = datacatalog_v1beta1.DataCatalogClient.entry_path( - project_id, "us-central1", random_entry_group_id, random_entry_id - ) - client.delete_entry(entry_name) - - -@pytest.fixture -def random_entry_group_id(client, project_id): - now = datetime.datetime.now() - random_entry_group_id = "example_entry_group_{}_{}".format( - now.strftime("%Y%m%d%H%M%S"), uuid.uuid4().hex[:8] - ) - yield random_entry_group_id - entry_group_name = datacatalog_v1beta1.DataCatalogClient.entry_group_path( - project_id, "us-central1", random_entry_group_id - ) - client.delete_entry_group(entry_group_name) - - -@pytest.fixture -def random_entry_name(client, entry_group_name): - now = datetime.datetime.now() - random_entry_id = "example_entry_{}_{}".format( - now.strftime("%Y%m%d%H%M%S"), uuid.uuid4().hex[:8] - ) - random_entry_name = "{}/entries/{}".format(entry_group_name, random_entry_id) - yield random_entry_name - client.delete_entry(random_entry_name) - - -@pytest.fixture -def entry_group_name(client, project_id): - now = datetime.datetime.now() - entry_group_id = "python_entry_group_sample_{}_{}".format( - now.strftime("%Y%m%d%H%M%S"), uuid.uuid4().hex[:8] - ) - entry_group = client.create_entry_group( - datacatalog_v1beta1.DataCatalogClient.location_path(project_id, "us-central1"), - entry_group_id, - {}, - ) - yield entry_group.name - client.delete_entry_group(entry_group.name) diff --git a/datacatalog/samples/tests/quickstart/__init__.py b/datacatalog/samples/tests/quickstart/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/datacatalog/samples/tests/quickstart/test_create_fileset_entry_quickstart.py b/datacatalog/samples/tests/quickstart/test_create_fileset_entry_quickstart.py deleted file mode 100644 index 769d034fac4a..000000000000 --- a/datacatalog/samples/tests/quickstart/test_create_fileset_entry_quickstart.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from google.cloud import datacatalog_v1beta1 - -from ...quickstart import create_fileset_entry_quickstart - - -def test_create_fileset_entry_quickstart( - capsys, client, project_id, random_entry_group_id, random_entry_id -): - - create_fileset_entry_quickstart.create_fileset_entry_quickstart( - client, project_id, random_entry_group_id, random_entry_id - ) - out, err = capsys.readouterr() - assert ( - "Created entry group" - " projects/{}/locations/{}/entryGroups/{}".format( - project_id, "us-central1", random_entry_group_id - ) - in out - ) - - expected_entry_name = datacatalog_v1beta1.DataCatalogClient.entry_path( - project_id, "us-central1", random_entry_group_id, random_entry_id - ) - - assert "Created entry {}".format(expected_entry_name) in out diff --git a/datacatalog/samples/tests/test_create_entry_group.py b/datacatalog/samples/tests/test_create_entry_group.py deleted file mode 100644 index 9c8c33b8cd64..000000000000 --- a/datacatalog/samples/tests/test_create_entry_group.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from ..v1beta1 import create_entry_group - - -def test_create_entry_group(capsys, client, project_id, random_entry_group_id): - - create_entry_group.create_entry_group(client, project_id, random_entry_group_id) - out, err = capsys.readouterr() - assert ( - "Created entry group" - " projects/{}/locations/{}/entryGroups/{}".format( - project_id, "us-central1", random_entry_group_id - ) - in out - ) diff --git a/datacatalog/samples/tests/test_create_fileset_entry.py b/datacatalog/samples/tests/test_create_fileset_entry.py deleted file mode 100644 index 8d0bc28fd07f..000000000000 --- a/datacatalog/samples/tests/test_create_fileset_entry.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import re - -from ..v1beta1 import create_fileset_entry - - -def test_create_fileset_entry(capsys, client, random_entry_name): - - entry_name_pattern = "(?P.+?)/entries/(?P.+?$)" - entry_name_matches = re.match(entry_name_pattern, random_entry_name) - entry_group_name = entry_name_matches.group("entry_group_name") - entry_id = entry_name_matches.group("entry_id") - - create_fileset_entry.create_fileset_entry(client, entry_group_name, entry_id) - out, err = capsys.readouterr() - assert "Created entry {}".format(random_entry_name) in out diff --git a/datacatalog/samples/v1beta1/__init__.py b/datacatalog/samples/v1beta1/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/datacatalog/samples/v1beta1/create_entry_group.py b/datacatalog/samples/v1beta1/create_entry_group.py deleted file mode 100644 index 24a856d8739c..000000000000 --- a/datacatalog/samples/v1beta1/create_entry_group.py +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -def create_entry_group(client, project_id, entry_group_id): - - # [START datacatalog_create_entry_group_tag] - from google.cloud import datacatalog_v1beta1 - - # TODO(developer): Construct a Data Catalog client object. - # client = datacatalog_v1beta1.DataCatalogClient() - - # TODO(developer): Set entry_group_id to the ID of the - # entry group to create. - # project_id = "your-project-id" - - # TODO(developer): Specify the geographic location where the - # entry group should reside. - # Currently, Data Catalog stores metadata in the us-central1 region. - location_id = "us-central1" - - # TODO(developer): Set entry_group_id to the ID of the - # entry group to create. - # entry_group_id = "your_entry_group_id" - - # Construct a full location path to be the parent of the entry group. - parent = datacatalog_v1beta1.DataCatalogClient.location_path( - project_id, location_id - ) - - # Construct a full EntryGroup object to send to the API. - entry_group = datacatalog_v1beta1.types.EntryGroup() - entry_group.display_name = "My Entry Group" - entry_group.description = "This Entry Group consists of ..." - - # Send the entry group to the API for creation. - # Raises google.api_core.exceptions.AlreadyExists if the Entry Group - # already exists within the project. - entry_group = client.create_entry_group( - parent, entry_group_id, entry_group - ) # Make an API request. - print("Created entry group {}".format(entry_group.name)) - # [END datacatalog_create_entry_group_tag] diff --git a/datacatalog/samples/v1beta1/create_fileset_entry.py b/datacatalog/samples/v1beta1/create_fileset_entry.py deleted file mode 100644 index 6cc275655988..000000000000 --- a/datacatalog/samples/v1beta1/create_fileset_entry.py +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -def create_fileset_entry(client, entry_group_name, entry_id): - - # [START datacatalog_create_fileset_tag] - from google.cloud import datacatalog_v1beta1 - - # TODO(developer): Construct a Data Catalog client object. - # client = datacatalog_v1beta1.DataCatalogClient() - - # TODO(developer): Set entry_group_name to the Name of the entry group - # the entry will belong. - # entry_group_name = "your_entry_group_name" - - # TODO(developer): Set entry_id to the ID of the entry to create. - # entry_id = "your_entry_id" - - # Construct a full Entry object to send to the API. - entry = datacatalog_v1beta1.types.Entry() - entry.display_name = "My Fileset" - entry.description = "This Fileset consists of ..." - entry.gcs_fileset_spec.file_patterns.append("gs://my_bucket/*") - entry.type = datacatalog_v1beta1.enums.EntryType.FILESET - - # Create the Schema, for example when you have a csv file. - columns = [] - columns.append( - datacatalog_v1beta1.types.ColumnSchema( - column="first_name", - description="First name", - mode="REQUIRED", - type="STRING", - ) - ) - - columns.append( - datacatalog_v1beta1.types.ColumnSchema( - column="last_name", description="Last name", mode="REQUIRED", type="STRING" - ) - ) - - # Create sub columns for the addresses parent column - subcolumns = [] - subcolumns.append( - datacatalog_v1beta1.types.ColumnSchema( - column="city", description="City", mode="NULLABLE", type="STRING" - ) - ) - - subcolumns.append( - datacatalog_v1beta1.types.ColumnSchema( - column="state", description="State", mode="NULLABLE", type="STRING" - ) - ) - - columns.append( - datacatalog_v1beta1.types.ColumnSchema( - column="addresses", - description="Addresses", - mode="REPEATED", - subcolumns=subcolumns, - type="RECORD", - ) - ) - - entry.schema.columns.extend(columns) - - # Send the entry to the API for creation. - # Raises google.api_core.exceptions.AlreadyExists if the Entry already - # exists within the project. - entry = client.create_entry(entry_group_name, entry_id, entry) - print("Created entry {}".format(entry.name)) - # [END datacatalog_create_fileset_tag] diff --git a/datacatalog/samples/v1beta1/datacatalog_get_entry.py b/datacatalog/samples/v1beta1/datacatalog_get_entry.py deleted file mode 100644 index fcd8b2096c7e..000000000000 --- a/datacatalog/samples/v1beta1/datacatalog_get_entry.py +++ /dev/null @@ -1,77 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT! This is a generated sample ("Request", "datacatalog_get_entry") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-datacatalog - -# sample-metadata -# title: -# description: Get Entry -# usage: python3 samples/v1beta1/datacatalog_get_entry.py [--project_id "[Google Cloud Project ID]"] [--location_id "[Google Cloud Location ID]"] [--entry_group_id "[Entry Group ID]"] [--entry_id "[Entry ID]"] - -# [START datacatalog_get_entry] -from google.cloud import datacatalog_v1beta1 -from google.cloud.datacatalog_v1beta1 import enums - - -def sample_get_entry(project_id, location_id, entry_group_id, entry_id): - """ - Get Entry - - Args: - project_id Your Google Cloud project ID - location_id Google Cloud region, e.g. us-central1 - entry_group_id ID of the Entry Group, e.g. @bigquery, @pubsub, my_entry_group - entry_id ID of the Entry - """ - - client = datacatalog_v1beta1.DataCatalogClient() - - # project_id = '[Google Cloud Project ID]' - # location_id = '[Google Cloud Location ID]' - # entry_group_id = '[Entry Group ID]' - # entry_id = '[Entry ID]' - name = client.entry_path(project_id, location_id, entry_group_id, entry_id) - - response = client.get_entry(name) - entry = response - print(u"Entry name: {}".format(entry.name)) - print(u"Entry type: {}".format(enums.EntryType(entry.type).name)) - print(u"Linked resource: {}".format(entry.linked_resource)) - - -# [END datacatalog_get_entry] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument("--project_id", type=str, default="[Google Cloud Project ID]") - parser.add_argument("--location_id", type=str, default="[Google Cloud Location ID]") - parser.add_argument("--entry_group_id", type=str, default="[Entry Group ID]") - parser.add_argument("--entry_id", type=str, default="[Entry ID]") - args = parser.parse_args() - - sample_get_entry( - args.project_id, args.location_id, args.entry_group_id, args.entry_id - ) - - -if __name__ == "__main__": - main() diff --git a/datacatalog/samples/v1beta1/datacatalog_lookup_entry.py b/datacatalog/samples/v1beta1/datacatalog_lookup_entry.py deleted file mode 100644 index 7920df16bf2f..000000000000 --- a/datacatalog/samples/v1beta1/datacatalog_lookup_entry.py +++ /dev/null @@ -1,69 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT! This is a generated sample ("Request", "datacatalog_lookup_entry") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-datacatalog - -# sample-metadata -# title: -# description: Lookup Entry -# usage: python3 samples/v1beta1/datacatalog_lookup_entry.py [--resource_name "[Full Resource Name]"] - -# [START datacatalog_lookup_entry] -from google.cloud import datacatalog_v1beta1 -from google.cloud.datacatalog_v1beta1 import enums - - -def sample_lookup_entry(resource_name): - """ - Lookup Entry - - Args: - resource_name The full name of the Google Cloud Platform resource the Data - Catalog entry represents. - See: https://cloud.google.com/apis/design/resource_names#full_resource_name - Examples: - //bigquery.googleapis.com/projects/bigquery-public-data/datasets/new_york_taxi_trips/tables/taxi_zone_geom - //pubsub.googleapis.com/projects/pubsub-public-data/topics/taxirides-realtime - """ - - client = datacatalog_v1beta1.DataCatalogClient() - - # resource_name = '[Full Resource Name]' - response = client.lookup_entry(linked_resource=resource_name) - entry = response - print(u"Entry name: {}".format(entry.name)) - print(u"Entry type: {}".format(enums.EntryType(entry.type).name)) - print(u"Linked resource: {}".format(entry.linked_resource)) - - -# [END datacatalog_lookup_entry] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument("--resource_name", type=str, default="[Full Resource Name]") - args = parser.parse_args() - - sample_lookup_entry(args.resource_name) - - -if __name__ == "__main__": - main() diff --git a/datacatalog/samples/v1beta1/datacatalog_lookup_entry_sql_resource.py b/datacatalog/samples/v1beta1/datacatalog_lookup_entry_sql_resource.py deleted file mode 100644 index 9656759ef4bd..000000000000 --- a/datacatalog/samples/v1beta1/datacatalog_lookup_entry_sql_resource.py +++ /dev/null @@ -1,68 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT! This is a generated sample ("Request", "datacatalog_lookup_entry_sql_resource") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-datacatalog - -# sample-metadata -# title: -# description: Lookup Entry using SQL resource -# usage: python3 samples/v1beta1/datacatalog_lookup_entry_sql_resource.py [--sql_name "[SQL Resource Name]"] - -# [START datacatalog_lookup_entry_sql_resource] -from google.cloud import datacatalog_v1beta1 -from google.cloud.datacatalog_v1beta1 import enums - - -def sample_lookup_entry(sql_name): - """ - Lookup Entry using SQL resource - - Args: - sql_name The SQL name of the Google Cloud Platform resource the Data Catalog - entry represents. - Examples: - bigquery.table.`bigquery-public-data`.new_york_taxi_trips.taxi_zone_geom - pubsub.topic.`pubsub-public-data`.`taxirides-realtime` - """ - - client = datacatalog_v1beta1.DataCatalogClient() - - # sql_name = '[SQL Resource Name]' - response = client.lookup_entry(sql_resource=sql_name) - entry = response - print(u"Entry name: {}".format(entry.name)) - print(u"Entry type: {}".format(enums.EntryType(entry.type).name)) - print(u"Linked resource: {}".format(entry.linked_resource)) - - -# [END datacatalog_lookup_entry_sql_resource] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument("--sql_name", type=str, default="[SQL Resource Name]") - args = parser.parse_args() - - sample_lookup_entry(args.sql_name) - - -if __name__ == "__main__": - main() diff --git a/datacatalog/samples/v1beta1/datacatalog_search.py b/datacatalog/samples/v1beta1/datacatalog_search.py deleted file mode 100644 index c4c1798c1cc9..000000000000 --- a/datacatalog/samples/v1beta1/datacatalog_search.py +++ /dev/null @@ -1,90 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT! This is a generated sample ("RequestPagedAll", "datacatalog_search") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-datacatalog - -# sample-metadata -# title: -# description: Search Catalog -# usage: python3 samples/v1beta1/datacatalog_search.py [--include_project_id "[Google Cloud Project ID]"] [--include_gcp_public_datasets false] [--query "[String in search query syntax]"] - -# [START datacatalog_search] -from google.cloud import datacatalog_v1beta1 -from google.cloud.datacatalog_v1beta1 import enums - - -def sample_search_catalog(include_project_id, include_gcp_public_datasets, query): - """ - Search Catalog - - Args: - include_project_id Your Google Cloud project ID. - include_gcp_public_datasets If true, include Google Cloud Platform (GCP) public - datasets in the search results. - query Your query string. - See: https://cloud.google.com/data-catalog/docs/how-to/search-reference - Example: system=bigquery type=dataset - """ - - client = datacatalog_v1beta1.DataCatalogClient() - - # include_project_id = '[Google Cloud Project ID]' - # include_gcp_public_datasets = False - # query = '[String in search query syntax]' - include_project_ids = [include_project_id] - scope = { - "include_project_ids": include_project_ids, - "include_gcp_public_datasets": include_gcp_public_datasets, - } - - # Iterate over all results - for response_item in client.search_catalog(scope, query): - print( - u"Result type: {}".format( - enums.SearchResultType(response_item.search_result_type).name - ) - ) - print(u"Result subtype: {}".format(response_item.search_result_subtype)) - print( - u"Relative resource name: {}".format(response_item.relative_resource_name) - ) - print(u"Linked resource: {}\n".format(response_item.linked_resource)) - - -# [END datacatalog_search] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument( - "--include_project_id", type=str, default="[Google Cloud Project ID]" - ) - parser.add_argument("--include_gcp_public_datasets", type=bool, default=False) - parser.add_argument("--query", type=str, default="[String in search query syntax]") - args = parser.parse_args() - - sample_search_catalog( - args.include_project_id, args.include_gcp_public_datasets, args.query - ) - - -if __name__ == "__main__": - main() diff --git a/datacatalog/setup.cfg b/datacatalog/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/datacatalog/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/datacatalog/setup.py b/datacatalog/setup.py deleted file mode 100644 index fdfebd66d781..000000000000 --- a/datacatalog/setup.py +++ /dev/null @@ -1,79 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import io -import os - -import setuptools - -name = "google-cloud-datacatalog" -description = "Google Cloud Data Catalog API API client library" -version = "0.5.0" -# Should be one of: -# 'Development Status :: 3 - Alpha' -# 'Development Status :: 4 - Beta' -# 'Development Status :: 5 - Production/Stable' -release_status = "Development Status :: 4 - Beta" -dependencies = [ - "google-api-core[grpc] >= 1.14.0, < 2.0.0dev", - "grpc-google-iam-v1 >= 0.12.3, < 0.13dev", - 'enum34; python_version < "3.4"', -] - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/googleapis/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - include_package_data=True, - zip_safe=False, -) diff --git a/datacatalog/synth.metadata b/datacatalog/synth.metadata deleted file mode 100644 index 9e8c7dee107d..000000000000 --- a/datacatalog/synth.metadata +++ /dev/null @@ -1,288 +0,0 @@ -{ - "updateTime": "2020-01-30T13:19:21.735414Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c1246a29e22b0f98e800a536b5b0da2d933a55f2", - "internalRef": "292310790", - "log": "c1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\n" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "datacatalog", - "apiVersion": "v1beta1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/datacatalog/v1beta1/artman_datacatalog_v1beta1.yaml" - } - } - ], - "newFiles": [ - { - "path": ".coveragerc" - }, - { - "path": ".flake8" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "LICENSE" - }, - { - "path": "MANIFEST.in" - }, - { - "path": "README.rst" - }, - { - "path": "docs/README.rst" - }, - { - "path": "docs/_static/custom.css" - }, - { - "path": "docs/_templates/layout.html" - }, - { - "path": "docs/changelog.md" - }, - { - "path": "docs/conf.py" - }, - { - "path": "docs/gapic/v1beta1/api.rst" - }, - { - "path": "docs/gapic/v1beta1/types.rst" - }, - { - "path": "docs/index.rst" - }, - { - "path": "google/__init__.py" - }, - { - "path": "google/cloud/__init__.py" - }, - { - "path": "google/cloud/datacatalog.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/__init__.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/gapic/__init__.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/gapic/data_catalog_client.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/gapic/data_catalog_client_config.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/gapic/enums.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_client.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_client_config.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_serialization_client.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_serialization_client_config.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/gapic/transports/data_catalog_grpc_transport.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/gapic/transports/policy_tag_manager_grpc_transport.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/gapic/transports/policy_tag_manager_serialization_grpc_transport.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/__init__.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/datacatalog.proto" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/datacatalog_pb2.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/datacatalog_pb2_grpc.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec.proto" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec_pb2.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec_pb2_grpc.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/policytagmanager_pb2.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/policytagmanager_pb2_grpc.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/policytagmanagerserialization_pb2.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/policytagmanagerserialization_pb2_grpc.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/schema.proto" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/schema_pb2.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/schema_pb2_grpc.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/search.proto" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/search_pb2.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/search_pb2_grpc.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/table_spec.proto" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/table_spec_pb2.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/table_spec_pb2_grpc.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/tags.proto" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/tags_pb2.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/tags_pb2_grpc.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/timestamps.proto" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/timestamps_pb2.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/proto/timestamps_pb2_grpc.py" - }, - { - "path": "google/cloud/datacatalog_v1beta1/types.py" - }, - { - "path": "noxfile.py" - }, - { - "path": "samples/__init__.py" - }, - { - "path": "samples/quickstart/__init__.py" - }, - { - "path": "samples/quickstart/create_fileset_entry_quickstart.py" - }, - { - "path": "samples/tests/__init__.py" - }, - { - "path": "samples/tests/conftest.py" - }, - { - "path": "samples/tests/quickstart/__init__.py" - }, - { - "path": "samples/tests/quickstart/test_create_fileset_entry_quickstart.py" - }, - { - "path": "samples/tests/test_create_entry_group.py" - }, - { - "path": "samples/tests/test_create_fileset_entry.py" - }, - { - "path": "samples/v1beta1/__init__.py" - }, - { - "path": "samples/v1beta1/create_entry_group.py" - }, - { - "path": "samples/v1beta1/create_fileset_entry.py" - }, - { - "path": "samples/v1beta1/datacatalog_get_entry.py" - }, - { - "path": "samples/v1beta1/datacatalog_lookup_entry.py" - }, - { - "path": "samples/v1beta1/datacatalog_lookup_entry_sql_resource.py" - }, - { - "path": "samples/v1beta1/datacatalog_search.py" - }, - { - "path": "setup.cfg" - }, - { - "path": "setup.py" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "tests/unit/gapic/v1beta1/test_data_catalog_client_v1beta1.py" - }, - { - "path": "tests/unit/gapic/v1beta1/test_policy_tag_manager_client_v1beta1.py" - }, - { - "path": "tests/unit/gapic/v1beta1/test_policy_tag_manager_serialization_client_v1beta1.py" - } - ] -} \ No newline at end of file diff --git a/datacatalog/synth.py b/datacatalog/synth.py deleted file mode 100644 index 76bc9c150a39..000000000000 --- a/datacatalog/synth.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -from synthtool import gcp - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() -version = 'v1beta1' - -# ---------------------------------------------------------------------------- -# Generate datacatalog GAPIC layer -# ---------------------------------------------------------------------------- -library = gapic.py_library( - 'datacatalog', - version, - config_path='/google/cloud/datacatalog/v1beta1/artman_datacatalog_v1beta1.yaml', - artman_output_name='datacatalog-v1beta1', - include_protos=True, - generator_args=["--dev_samples"], -) - -s.move( - library, - excludes=[ - 'docs/conf.py', - 'docs/index.rst', - 'google/cloud/datacatalog_v1beta1/__init__.py', - 'README.rst', - 'nox*.py', - 'setup.py', - 'setup.cfg', - ], -) - -# Fix docstring issue for classes with no summary line -s.replace( - "google/cloud/**/proto/*_pb2.py", - '''__doc__ = """Attributes:''', - '''__doc__ = """ - Attributes:''', -) - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = common.py_library( - unit_cov_level=80, - cov_level=80, - samples_test=True, -) -s.move(templated_files) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/datacatalog/tests/unit/gapic/v1beta1/test_data_catalog_client_v1beta1.py b/datacatalog/tests/unit/gapic/v1beta1/test_data_catalog_client_v1beta1.py deleted file mode 100644 index 0c2d7ed4d7d7..000000000000 --- a/datacatalog/tests/unit/gapic/v1beta1/test_data_catalog_client_v1beta1.py +++ /dev/null @@ -1,1105 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import datacatalog_v1beta1 -from google.cloud.datacatalog_v1beta1.proto import datacatalog_pb2 -from google.cloud.datacatalog_v1beta1.proto import search_pb2 -from google.cloud.datacatalog_v1beta1.proto import tags_pb2 -from google.iam.v1 import iam_policy_pb2 -from google.iam.v1 import policy_pb2 -from google.protobuf import empty_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestDataCatalogClient(object): - def test_search_catalog(self): - # Setup Expected Response - next_page_token = "" - results_element = {} - results = [results_element] - expected_response = {"next_page_token": next_page_token, "results": results} - expected_response = datacatalog_pb2.SearchCatalogResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - scope = {} - query = "query107944136" - - paged_list_response = client.search_catalog(scope, query) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.results[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.SearchCatalogRequest( - scope=scope, query=query - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_search_catalog_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - scope = {} - query = "query107944136" - - paged_list_response = client.search_catalog(scope, query) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_create_entry_group(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - } - expected_response = datacatalog_pb2.EntryGroup(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - entry_group_id = "entryGroupId-43122680" - entry_group = {} - - response = client.create_entry_group(parent, entry_group_id, entry_group) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.CreateEntryGroupRequest( - parent=parent, entry_group_id=entry_group_id, entry_group=entry_group - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_entry_group_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - entry_group_id = "entryGroupId-43122680" - entry_group = {} - - with pytest.raises(CustomException): - client.create_entry_group(parent, entry_group_id, entry_group) - - def test_get_entry_group(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name_2, - "display_name": display_name, - "description": description, - } - expected_response = datacatalog_pb2.EntryGroup(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - name = client.entry_group_path("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]") - - response = client.get_entry_group(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.GetEntryGroupRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_entry_group_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - name = client.entry_group_path("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]") - - with pytest.raises(CustomException): - client.get_entry_group(name) - - def test_delete_entry_group(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - name = client.entry_group_path("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]") - - client.delete_entry_group(name) - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.DeleteEntryGroupRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_entry_group_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - name = client.entry_group_path("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]") - - with pytest.raises(CustomException): - client.delete_entry_group(name) - - def test_create_entry(self): - # Setup Expected Response - name = "name3373707" - linked_resource = "linkedResource1544625012" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name, - "linked_resource": linked_resource, - "display_name": display_name, - "description": description, - } - expected_response = datacatalog_pb2.Entry(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - parent = client.entry_group_path("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]") - entry_id = "entryId-2093663224" - entry = {} - - response = client.create_entry(parent, entry_id, entry) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.CreateEntryRequest( - parent=parent, entry_id=entry_id, entry=entry - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_entry_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - parent = client.entry_group_path("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]") - entry_id = "entryId-2093663224" - entry = {} - - with pytest.raises(CustomException): - client.create_entry(parent, entry_id, entry) - - def test_update_entry(self): - # Setup Expected Response - name = "name3373707" - linked_resource = "linkedResource1544625012" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name, - "linked_resource": linked_resource, - "display_name": display_name, - "description": description, - } - expected_response = datacatalog_pb2.Entry(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - entry = {} - - response = client.update_entry(entry) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.UpdateEntryRequest(entry=entry) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_entry_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - entry = {} - - with pytest.raises(CustomException): - client.update_entry(entry) - - def test_delete_entry(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - name = client.entry_path("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]") - - client.delete_entry(name) - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.DeleteEntryRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_entry_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - name = client.entry_path("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]") - - with pytest.raises(CustomException): - client.delete_entry(name) - - def test_get_entry(self): - # Setup Expected Response - name_2 = "name2-1052831874" - linked_resource = "linkedResource1544625012" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name_2, - "linked_resource": linked_resource, - "display_name": display_name, - "description": description, - } - expected_response = datacatalog_pb2.Entry(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - name = client.entry_path("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]") - - response = client.get_entry(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.GetEntryRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_entry_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - name = client.entry_path("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]") - - with pytest.raises(CustomException): - client.get_entry(name) - - def test_lookup_entry(self): - # Setup Expected Response - name = "name3373707" - linked_resource = "linkedResource1544625012" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name, - "linked_resource": linked_resource, - "display_name": display_name, - "description": description, - } - expected_response = datacatalog_pb2.Entry(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - response = client.lookup_entry() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.LookupEntryRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_lookup_entry_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - with pytest.raises(CustomException): - client.lookup_entry() - - def test_create_tag_template(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - expected_response = {"name": name, "display_name": display_name} - expected_response = tags_pb2.TagTemplate(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - tag_template_id = "tagTemplateId-2020335141" - tag_template = {} - - response = client.create_tag_template(parent, tag_template_id, tag_template) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.CreateTagTemplateRequest( - parent=parent, tag_template_id=tag_template_id, tag_template=tag_template - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_tag_template_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - tag_template_id = "tagTemplateId-2020335141" - tag_template = {} - - with pytest.raises(CustomException): - client.create_tag_template(parent, tag_template_id, tag_template) - - def test_get_tag_template(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - expected_response = {"name": name_2, "display_name": display_name} - expected_response = tags_pb2.TagTemplate(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - name = client.tag_template_path("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]") - - response = client.get_tag_template(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.GetTagTemplateRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_tag_template_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - name = client.tag_template_path("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]") - - with pytest.raises(CustomException): - client.get_tag_template(name) - - def test_update_tag_template(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - expected_response = {"name": name, "display_name": display_name} - expected_response = tags_pb2.TagTemplate(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - tag_template = {} - - response = client.update_tag_template(tag_template) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.UpdateTagTemplateRequest( - tag_template=tag_template - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_tag_template_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - tag_template = {} - - with pytest.raises(CustomException): - client.update_tag_template(tag_template) - - def test_delete_tag_template(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - name = client.tag_template_path("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]") - force = False - - client.delete_tag_template(name, force) - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.DeleteTagTemplateRequest( - name=name, force=force - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_tag_template_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - name = client.tag_template_path("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]") - force = False - - with pytest.raises(CustomException): - client.delete_tag_template(name, force) - - def test_create_tag_template_field(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - is_required = True - expected_response = { - "name": name, - "display_name": display_name, - "is_required": is_required, - } - expected_response = tags_pb2.TagTemplateField(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - parent = client.tag_template_path("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]") - tag_template_field_id = "tagTemplateFieldId-92144832" - tag_template_field = {} - - response = client.create_tag_template_field( - parent, tag_template_field_id, tag_template_field - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.CreateTagTemplateFieldRequest( - parent=parent, - tag_template_field_id=tag_template_field_id, - tag_template_field=tag_template_field, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_tag_template_field_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - parent = client.tag_template_path("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]") - tag_template_field_id = "tagTemplateFieldId-92144832" - tag_template_field = {} - - with pytest.raises(CustomException): - client.create_tag_template_field( - parent, tag_template_field_id, tag_template_field - ) - - def test_update_tag_template_field(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - is_required = True - expected_response = { - "name": name_2, - "display_name": display_name, - "is_required": is_required, - } - expected_response = tags_pb2.TagTemplateField(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - name = client.field_path("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") - tag_template_field = {} - - response = client.update_tag_template_field(name, tag_template_field) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.UpdateTagTemplateFieldRequest( - name=name, tag_template_field=tag_template_field - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_tag_template_field_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - name = client.field_path("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") - tag_template_field = {} - - with pytest.raises(CustomException): - client.update_tag_template_field(name, tag_template_field) - - def test_rename_tag_template_field(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - is_required = True - expected_response = { - "name": name_2, - "display_name": display_name, - "is_required": is_required, - } - expected_response = tags_pb2.TagTemplateField(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - name = client.field_path("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") - new_tag_template_field_id = "newTagTemplateFieldId-1668354591" - - response = client.rename_tag_template_field(name, new_tag_template_field_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.RenameTagTemplateFieldRequest( - name=name, new_tag_template_field_id=new_tag_template_field_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_rename_tag_template_field_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - name = client.field_path("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") - new_tag_template_field_id = "newTagTemplateFieldId-1668354591" - - with pytest.raises(CustomException): - client.rename_tag_template_field(name, new_tag_template_field_id) - - def test_delete_tag_template_field(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - name = client.field_path("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") - force = False - - client.delete_tag_template_field(name, force) - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.DeleteTagTemplateFieldRequest( - name=name, force=force - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_tag_template_field_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - name = client.field_path("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]", "[FIELD]") - force = False - - with pytest.raises(CustomException): - client.delete_tag_template_field(name, force) - - def test_create_tag(self): - # Setup Expected Response - name = "name3373707" - template = "template-1321546630" - template_display_name = "templateDisplayName-532252787" - column = "column-1354837162" - expected_response = { - "name": name, - "template": template, - "template_display_name": template_display_name, - "column": column, - } - expected_response = tags_pb2.Tag(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - parent = client.entry_path( - "[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]" - ) - tag = {} - - response = client.create_tag(parent, tag) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.CreateTagRequest(parent=parent, tag=tag) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_tag_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - parent = client.entry_path( - "[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]" - ) - tag = {} - - with pytest.raises(CustomException): - client.create_tag(parent, tag) - - def test_update_tag(self): - # Setup Expected Response - name = "name3373707" - template = "template-1321546630" - template_display_name = "templateDisplayName-532252787" - column = "column-1354837162" - expected_response = { - "name": name, - "template": template, - "template_display_name": template_display_name, - "column": column, - } - expected_response = tags_pb2.Tag(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - tag = {} - - response = client.update_tag(tag) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.UpdateTagRequest(tag=tag) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_tag_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - tag = {} - - with pytest.raises(CustomException): - client.update_tag(tag) - - def test_delete_tag(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - name = client.tag_path( - "[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]" - ) - - client.delete_tag(name) - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.DeleteTagRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_tag_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - name = client.tag_path( - "[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]", "[TAG]" - ) - - with pytest.raises(CustomException): - client.delete_tag(name) - - def test_list_tags(self): - # Setup Expected Response - next_page_token = "" - tags_element = {} - tags = [tags_element] - expected_response = {"next_page_token": next_page_token, "tags": tags} - expected_response = datacatalog_pb2.ListTagsResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - parent = client.entry_path( - "[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]" - ) - - paged_list_response = client.list_tags(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.tags[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = datacatalog_pb2.ListTagsRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_tags_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - parent = client.entry_path( - "[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]" - ) - - paged_list_response = client.list_tags(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_set_iam_policy(self): - # Setup Expected Response - version = 351608024 - etag = b"21" - expected_response = {"version": version, "etag": etag} - expected_response = policy_pb2.Policy(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - resource = client.tag_template_path("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]") - policy = {} - - response = client.set_iam_policy(resource, policy) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = iam_policy_pb2.SetIamPolicyRequest( - resource=resource, policy=policy - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_iam_policy_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - resource = client.tag_template_path("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]") - policy = {} - - with pytest.raises(CustomException): - client.set_iam_policy(resource, policy) - - def test_get_iam_policy(self): - # Setup Expected Response - version = 351608024 - etag = b"21" - expected_response = {"version": version, "etag": etag} - expected_response = policy_pb2.Policy(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - resource = client.tag_template_path("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]") - - response = client.get_iam_policy(resource) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = iam_policy_pb2.GetIamPolicyRequest(resource=resource) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_iam_policy_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - resource = client.tag_template_path("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]") - - with pytest.raises(CustomException): - client.get_iam_policy(resource) - - def test_test_iam_permissions(self): - # Setup Expected Response - expected_response = {} - expected_response = iam_policy_pb2.TestIamPermissionsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup Request - resource = client.tag_template_path("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]") - permissions = [] - - response = client.test_iam_permissions(resource, permissions) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = iam_policy_pb2.TestIamPermissionsRequest( - resource=resource, permissions=permissions - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_test_iam_permissions_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.DataCatalogClient() - - # Setup request - resource = client.tag_template_path("[PROJECT]", "[LOCATION]", "[TAG_TEMPLATE]") - permissions = [] - - with pytest.raises(CustomException): - client.test_iam_permissions(resource, permissions) diff --git a/datacatalog/tests/unit/gapic/v1beta1/test_policy_tag_manager_client_v1beta1.py b/datacatalog/tests/unit/gapic/v1beta1/test_policy_tag_manager_client_v1beta1.py deleted file mode 100644 index 21295004eded..000000000000 --- a/datacatalog/tests/unit/gapic/v1beta1/test_policy_tag_manager_client_v1beta1.py +++ /dev/null @@ -1,515 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import datacatalog_v1beta1 -from google.cloud.datacatalog_v1beta1.proto import policytagmanager_pb2 -from google.iam.v1 import iam_policy_pb2 -from google.iam.v1 import policy_pb2 -from google.protobuf import empty_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestPolicyTagManagerClient(object): - def test_create_taxonomy(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - } - expected_response = policytagmanager_pb2.Taxonomy(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - response = client.create_taxonomy() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = policytagmanager_pb2.CreateTaxonomyRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_taxonomy_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - with pytest.raises(CustomException): - client.create_taxonomy() - - def test_delete_taxonomy(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - client.delete_taxonomy() - - assert len(channel.requests) == 1 - expected_request = policytagmanager_pb2.DeleteTaxonomyRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_taxonomy_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - with pytest.raises(CustomException): - client.delete_taxonomy() - - def test_update_taxonomy(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - } - expected_response = policytagmanager_pb2.Taxonomy(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - response = client.update_taxonomy() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = policytagmanager_pb2.UpdateTaxonomyRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_taxonomy_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - with pytest.raises(CustomException): - client.update_taxonomy() - - def test_list_taxonomies(self): - # Setup Expected Response - next_page_token = "nextPageToken-1530815211" - expected_response = {"next_page_token": next_page_token} - expected_response = policytagmanager_pb2.ListTaxonomiesResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - response = client.list_taxonomies() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = policytagmanager_pb2.ListTaxonomiesRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_taxonomies_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - with pytest.raises(CustomException): - client.list_taxonomies() - - def test_get_taxonomy(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - } - expected_response = policytagmanager_pb2.Taxonomy(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - response = client.get_taxonomy() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = policytagmanager_pb2.GetTaxonomyRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_taxonomy_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - with pytest.raises(CustomException): - client.get_taxonomy() - - def test_create_policy_tag(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - parent_policy_tag = "parentPolicyTag2071382466" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - "parent_policy_tag": parent_policy_tag, - } - expected_response = policytagmanager_pb2.PolicyTag(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - response = client.create_policy_tag() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = policytagmanager_pb2.CreatePolicyTagRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_policy_tag_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - with pytest.raises(CustomException): - client.create_policy_tag() - - def test_delete_policy_tag(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - client.delete_policy_tag() - - assert len(channel.requests) == 1 - expected_request = policytagmanager_pb2.DeletePolicyTagRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_policy_tag_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - with pytest.raises(CustomException): - client.delete_policy_tag() - - def test_update_policy_tag(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - parent_policy_tag = "parentPolicyTag2071382466" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - "parent_policy_tag": parent_policy_tag, - } - expected_response = policytagmanager_pb2.PolicyTag(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - response = client.update_policy_tag() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = policytagmanager_pb2.UpdatePolicyTagRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_policy_tag_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - with pytest.raises(CustomException): - client.update_policy_tag() - - def test_list_policy_tags(self): - # Setup Expected Response - next_page_token = "nextPageToken-1530815211" - expected_response = {"next_page_token": next_page_token} - expected_response = policytagmanager_pb2.ListPolicyTagsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - response = client.list_policy_tags() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = policytagmanager_pb2.ListPolicyTagsRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_policy_tags_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - with pytest.raises(CustomException): - client.list_policy_tags() - - def test_get_policy_tag(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - parent_policy_tag = "parentPolicyTag2071382466" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - "parent_policy_tag": parent_policy_tag, - } - expected_response = policytagmanager_pb2.PolicyTag(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - response = client.get_policy_tag() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = policytagmanager_pb2.GetPolicyTagRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_policy_tag_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - with pytest.raises(CustomException): - client.get_policy_tag() - - def test_get_iam_policy(self): - # Setup Expected Response - version = 351608024 - etag = b"21" - expected_response = {"version": version, "etag": etag} - expected_response = policy_pb2.Policy(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - response = client.get_iam_policy() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = iam_policy_pb2.GetIamPolicyRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_iam_policy_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - with pytest.raises(CustomException): - client.get_iam_policy() - - def test_set_iam_policy(self): - # Setup Expected Response - version = 351608024 - etag = b"21" - expected_response = {"version": version, "etag": etag} - expected_response = policy_pb2.Policy(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - response = client.set_iam_policy() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = iam_policy_pb2.SetIamPolicyRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_iam_policy_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - with pytest.raises(CustomException): - client.set_iam_policy() - - def test_test_iam_permissions(self): - # Setup Expected Response - expected_response = {} - expected_response = iam_policy_pb2.TestIamPermissionsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - response = client.test_iam_permissions() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = iam_policy_pb2.TestIamPermissionsRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_test_iam_permissions_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerClient() - - with pytest.raises(CustomException): - client.test_iam_permissions() diff --git a/datacatalog/tests/unit/gapic/v1beta1/test_policy_tag_manager_serialization_client_v1beta1.py b/datacatalog/tests/unit/gapic/v1beta1/test_policy_tag_manager_serialization_client_v1beta1.py deleted file mode 100644 index bf15fb6c2082..000000000000 --- a/datacatalog/tests/unit/gapic/v1beta1/test_policy_tag_manager_serialization_client_v1beta1.py +++ /dev/null @@ -1,127 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import datacatalog_v1beta1 -from google.cloud.datacatalog_v1beta1.proto import policytagmanagerserialization_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestPolicyTagManagerSerializationClient(object): - def test_import_taxonomies(self): - # Setup Expected Response - expected_response = {} - expected_response = policytagmanagerserialization_pb2.ImportTaxonomiesResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerSerializationClient() - - response = client.import_taxonomies() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = policytagmanagerserialization_pb2.ImportTaxonomiesRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_import_taxonomies_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerSerializationClient() - - with pytest.raises(CustomException): - client.import_taxonomies() - - def test_export_taxonomies(self): - # Setup Expected Response - expected_response = {} - expected_response = policytagmanagerserialization_pb2.ExportTaxonomiesResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerSerializationClient() - - response = client.export_taxonomies() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = policytagmanagerserialization_pb2.ExportTaxonomiesRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_export_taxonomies_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datacatalog_v1beta1.PolicyTagManagerSerializationClient() - - with pytest.raises(CustomException): - client.export_taxonomies() diff --git a/datalabeling/.coveragerc b/datalabeling/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/datalabeling/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/datalabeling/.flake8 b/datalabeling/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/datalabeling/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/datalabeling/.gitignore b/datalabeling/.gitignore deleted file mode 100644 index 9e3a5f25770c..000000000000 --- a/datalabeling/.gitignore +++ /dev/null @@ -1 +0,0 @@ -docs/_build \ No newline at end of file diff --git a/datalabeling/.repo-metadata.json b/datalabeling/.repo-metadata.json deleted file mode 100644 index aa6fd203cb49..000000000000 --- a/datalabeling/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "datalabeling", - "name_pretty": "Google Cloud Data Labeling", - "product_documentation": "https://cloud.google.com/data-labeling/docs/", - "client_documentation": "https://googleapis.dev/python/datalabeling/latest", - "issue_tracker": "", - "release_level": "beta", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-datalabeling", - "api_id": "datalabeling.googleapis.com", - "requires_billing": true -} \ No newline at end of file diff --git a/datalabeling/CHANGELOG.md b/datalabeling/CHANGELOG.md deleted file mode 100644 index 9616fc56ff76..000000000000 --- a/datalabeling/CHANGELOG.md +++ /dev/null @@ -1,77 +0,0 @@ -# Changelog - -[PyPI History][1] - -[1]: https://pypi.org/project/google-cloud-datalabeling/#history - -## 0.3.0 - -10-10-2019 11:08 PDT - - -### Implementation Changes -- Remove send / receive message size limit (via synth). ([#8950](https://github.com/googleapis/google-cloud-python/pull/8950)) - -### Dependencies -- Bump minimum version for google-api-core to 1.14.0. ([#8709](https://github.com/googleapis/google-cloud-python/pull/8709)) - -### Documentation -- Fix intersphinx reference to requests. ([#9294](https://github.com/googleapis/google-cloud-python/pull/9294)) -- Remove CI for gh-pages, use googleapis.dev for `api_core` refs. ([#9085](https://github.com/googleapis/google-cloud-python/pull/9085)) -- Remove compatability badges from READMEs. ([#9035](https://github.com/googleapis/google-cloud-python/pull/9035)) -- Update intersphinx mapping for requests. ([#8805](https://github.com/googleapis/google-cloud-python/pull/8805)) -- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705)) - -## 0.2.1 - -07-16-2019 10:17 PDT - - -### Implementation Changes -- Import operations.proto (via synth). ([#8678](https://github.com/googleapis/google-cloud-python/pull/8678)) - -### Documentation -- Add compatibility check badges to READMEs. ([#8288](https://github.com/googleapis/google-cloud-python/pull/8288)) -- Fix links in README.rst. ([#8626](https://github.com/googleapis/google-cloud-python/pull/8626)) - -## 0.2.0 - -07-09-2019 12:56 PDT - - -### Implementation Changes -- Allow kwargs to be passed to create_channel (via synth). ([#8386](https://github.com/googleapis/google-cloud-python/pull/8386)) - -### New Features -- Add 'client_options' support, update list method docstrings (via synth). ([#8504](https://github.com/googleapis/google-cloud-python/pull/8504)) -- [BREAKING] Remove audio type, add general_data type, blocking_resources (via synth). ([#8459](https://github.com/googleapis/google-cloud-python/pull/8459)) - -### Documentation -- Update index.rst ([#7764](https://github.com/googleapis/google-cloud-python/pull/7764)) - -### Internal / Testing Changes -- Pin black version (via synth). ([#8578](https://github.com/googleapis/google-cloud-python/pull/8578)) -- Add docs job to publish to googleapis.dev. ([#8464](https://github.com/googleapis/google-cloud-python/pull/8464)) -- Declare encoding as utf-8 in pb2 files (via synth). ([#8348](https://github.com/googleapis/google-cloud-python/pull/8348)) -- Add disclaimer to auto-generated template files (via synth). ([#8310](https://github.com/googleapis/google-cloud-python/pull/8310)) -- Supress checking 'cov-fail-under' in nox default session (via synth). ([#8236](https://github.com/googleapis/google-cloud-python/pull/8236)) -- Fix coverage in 'types.py' (via synth). ([#8151](https://github.com/googleapis/google-cloud-python/pull/8151)) -- Blacken noxfile.py, setup.py (via synth). ([#8118](https://github.com/googleapis/google-cloud-python/pull/8118)) -- Add empty lines (via synth). ([#8053](https://github.com/googleapis/google-cloud-python/pull/8053)) -- Add nox session `docs`, reorder methods (via synth). ([#7767](https://github.com/googleapis/google-cloud-python/pull/7767)) - -## 0.1.1 - -04-02-2019 11:29 PDT - -### Internal / Testing Changes - -- Fix release classifier. ([#7643](https://github.com/googleapis/google-cloud-python/pull/7643)) - -## 0.1.0 - -04-01-2019 17:32 PDT - -### New Features - -- Create Data Labeling Python client. (#7635) diff --git a/datalabeling/LICENSE b/datalabeling/LICENSE deleted file mode 100644 index a8ee855de2aa..000000000000 --- a/datalabeling/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/datalabeling/MANIFEST.in b/datalabeling/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/datalabeling/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/datalabeling/README.rst b/datalabeling/README.rst deleted file mode 100644 index 068e1573eb49..000000000000 --- a/datalabeling/README.rst +++ /dev/null @@ -1,89 +0,0 @@ -Python Client for Data Labeling API (`Beta`_) -============================================== - - - -`Data Labeling API`_: Public API for Google Cloud AI Data Labeling Service. - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. _Beta: https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/README.rst -.. _Data Labeling API: https://cloud.google.com/data-labeling -.. _Client Library Documentation: https://googleapis.dev/python/datalabeling/latest -.. _Product Documentation: https://cloud.google.com/data-labeling/docs/ - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the Data Labeling API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Data Labeling API.: https://cloud.google.com/data-labeling -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Supported Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^ - -Python >= 3.5 - - -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Python == 2.7. Python 2.7 support will be removed on January 1, 2020. - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-datalabeling - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-datalabeling - -Next Steps -~~~~~~~~~~ - -- Read the `Client Library Documentation`_ for Data Labeling API - API to see other available methods on the client. -- Read the `Data Labeling API Product documentation`_ to learn - more about the product and see How-to Guides. -- View this `repository’s main README`_ to see the full list of Cloud - APIs that we cover. - -.. _Data Labeling API Product documentation: https://cloud.google.com/data-labeling/docs -.. _repository’s main README: https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/README.rst diff --git a/datalabeling/docs/README.rst b/datalabeling/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/datalabeling/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/datalabeling/docs/_static/custom.css b/datalabeling/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/datalabeling/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/datalabeling/docs/_templates/layout.html b/datalabeling/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/datalabeling/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/datalabeling/docs/changelog.md b/datalabeling/docs/changelog.md deleted file mode 120000 index 04c99a55caae..000000000000 --- a/datalabeling/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../CHANGELOG.md \ No newline at end of file diff --git a/datalabeling/docs/conf.py b/datalabeling/docs/conf.py deleted file mode 100644 index c44df67e0175..000000000000 --- a/datalabeling/docs/conf.py +++ /dev/null @@ -1,356 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-datalabeling documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-datalabeling" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-datalabeling-doc" - -# -- Options for warnings ------------------------------------------------------ - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-datalabeling.tex", - u"google-cloud-datalabeling Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - master_doc, - "google-cloud-datalabeling", - u"google-cloud-datalabeling Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-datalabeling", - u"google-cloud-datalabeling Documentation", - author, - "google-cloud-datalabeling", - "GAPIC library for the {metadata.shortName} v1beta1 service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/stable/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/datalabeling/docs/gapic/v1beta1/api.rst b/datalabeling/docs/gapic/v1beta1/api.rst deleted file mode 100644 index 78258fac24c6..000000000000 --- a/datalabeling/docs/gapic/v1beta1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Data Labeling API -============================ - -.. automodule:: google.cloud.datalabeling_v1beta1 - :members: - :inherited-members: \ No newline at end of file diff --git a/datalabeling/docs/gapic/v1beta1/types.rst b/datalabeling/docs/gapic/v1beta1/types.rst deleted file mode 100644 index 07d64dc8da3b..000000000000 --- a/datalabeling/docs/gapic/v1beta1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Data Labeling API Client -================================== - -.. automodule:: google.cloud.datalabeling_v1beta1.types - :members: \ No newline at end of file diff --git a/datalabeling/docs/index.rst b/datalabeling/docs/index.rst deleted file mode 100644 index c7068aa8b15b..000000000000 --- a/datalabeling/docs/index.rst +++ /dev/null @@ -1,19 +0,0 @@ -.. include:: README.rst - -Api Reference -------------- -.. toctree:: - :maxdepth: 2 - - gapic/v1beta1/api - gapic/v1beta1/types - -Changelog ---------- - -For a list of all ``google-cloud-datalabeling`` releases: - -.. toctree:: - :maxdepth: 2 - - changelog diff --git a/datalabeling/google/__init__.py b/datalabeling/google/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/datalabeling/google/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/datalabeling/google/cloud/__init__.py b/datalabeling/google/cloud/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/datalabeling/google/cloud/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/datalabeling/google/cloud/datalabeling.py b/datalabeling/google/cloud/datalabeling.py deleted file mode 100644 index d4b9c191eecc..000000000000 --- a/datalabeling/google/cloud/datalabeling.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import - -from google.cloud.datalabeling_v1beta1 import DataLabelingServiceClient -from google.cloud.datalabeling_v1beta1 import enums -from google.cloud.datalabeling_v1beta1 import types - - -__all__ = ("enums", "types", "DataLabelingServiceClient") diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/__init__.py b/datalabeling/google/cloud/datalabeling_v1beta1/__init__.py deleted file mode 100644 index 908930d63de2..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/__init__.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from __future__ import absolute_import - -from google.cloud.datalabeling_v1beta1 import types -from google.cloud.datalabeling_v1beta1.gapic import data_labeling_service_client -from google.cloud.datalabeling_v1beta1.gapic import enums - - -class DataLabelingServiceClient(data_labeling_service_client.DataLabelingServiceClient): - __doc__ = data_labeling_service_client.DataLabelingServiceClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "DataLabelingServiceClient") diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/gapic/__init__.py b/datalabeling/google/cloud/datalabeling_v1beta1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py b/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py deleted file mode 100644 index 31f5785a783d..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py +++ /dev/null @@ -1,3376 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.cloud.datalabeling.v1beta1 DataLabelingService API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.operation -import google.api_core.operations_v1 -import google.api_core.page_iterator -import google.api_core.path_template -import google.api_core.protobuf_helpers -import grpc - -from google.cloud.datalabeling_v1beta1.gapic import data_labeling_service_client_config -from google.cloud.datalabeling_v1beta1.gapic import enums -from google.cloud.datalabeling_v1beta1.gapic.transports import ( - data_labeling_service_grpc_transport, -) -from google.cloud.datalabeling_v1beta1.proto import annotation_spec_set_pb2 -from google.cloud.datalabeling_v1beta1.proto import data_labeling_service_pb2 -from google.cloud.datalabeling_v1beta1.proto import data_labeling_service_pb2_grpc -from google.cloud.datalabeling_v1beta1.proto import dataset_pb2 -from google.cloud.datalabeling_v1beta1.proto import evaluation_job_pb2 -from google.cloud.datalabeling_v1beta1.proto import evaluation_pb2 -from google.cloud.datalabeling_v1beta1.proto import human_annotation_config_pb2 -from google.cloud.datalabeling_v1beta1.proto import instruction_pb2 -from google.cloud.datalabeling_v1beta1.proto import ( - operations_pb2 as proto_operations_pb2, -) -from google.longrunning import operations_pb2 as longrunning_operations_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-datalabeling" -).version - - -class DataLabelingServiceClient(object): - SERVICE_ADDRESS = "datalabeling.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.datalabeling.v1beta1.DataLabelingService" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - DataLabelingServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def annotated_dataset_path(cls, project, dataset, annotated_dataset): - """Return a fully-qualified annotated_dataset string.""" - return google.api_core.path_template.expand( - "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}", - project=project, - dataset=dataset, - annotated_dataset=annotated_dataset, - ) - - @classmethod - def annotation_spec_set_path(cls, project, annotation_spec_set): - """Return a fully-qualified annotation_spec_set string.""" - return google.api_core.path_template.expand( - "projects/{project}/annotationSpecSets/{annotation_spec_set}", - project=project, - annotation_spec_set=annotation_spec_set, - ) - - @classmethod - def data_item_path(cls, project, dataset, data_item): - """Return a fully-qualified data_item string.""" - return google.api_core.path_template.expand( - "projects/{project}/datasets/{dataset}/dataItems/{data_item}", - project=project, - dataset=dataset, - data_item=data_item, - ) - - @classmethod - def dataset_path(cls, project, dataset): - """Return a fully-qualified dataset string.""" - return google.api_core.path_template.expand( - "projects/{project}/datasets/{dataset}", project=project, dataset=dataset - ) - - @classmethod - def evaluation_path(cls, project, dataset, evaluation): - """Return a fully-qualified evaluation string.""" - return google.api_core.path_template.expand( - "projects/{project}/datasets/{dataset}/evaluations/{evaluation}", - project=project, - dataset=dataset, - evaluation=evaluation, - ) - - @classmethod - def evaluation_job_path(cls, project, evaluation_job): - """Return a fully-qualified evaluation_job string.""" - return google.api_core.path_template.expand( - "projects/{project}/evaluationJobs/{evaluation_job}", - project=project, - evaluation_job=evaluation_job, - ) - - @classmethod - def example_path(cls, project, dataset, annotated_dataset, example): - """Return a fully-qualified example string.""" - return google.api_core.path_template.expand( - "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}", - project=project, - dataset=dataset, - annotated_dataset=annotated_dataset, - example=example, - ) - - @classmethod - def instruction_path(cls, project, instruction): - """Return a fully-qualified instruction string.""" - return google.api_core.path_template.expand( - "projects/{project}/instructions/{instruction}", - project=project, - instruction=instruction, - ) - - @classmethod - def project_path(cls, project): - """Return a fully-qualified project string.""" - return google.api_core.path_template.expand( - "projects/{project}", project=project - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.DataLabelingServiceGrpcTransport, - Callable[[~.Credentials, type], ~.DataLabelingServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = data_labeling_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=data_labeling_service_grpc_transport.DataLabelingServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = data_labeling_service_grpc_transport.DataLabelingServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def create_dataset( - self, - parent, - dataset, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates dataset. If success return a Dataset resource. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> # TODO: Initialize `dataset`: - >>> dataset = {} - >>> - >>> response = client.create_dataset(parent, dataset) - - Args: - parent (str): Required. Dataset resource parent, format: projects/{project\_id} - dataset (Union[dict, ~google.cloud.datalabeling_v1beta1.types.Dataset]): Required. The dataset to be created. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.Dataset` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datalabeling_v1beta1.types.Dataset` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_dataset" not in self._inner_api_calls: - self._inner_api_calls[ - "create_dataset" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_dataset, - default_retry=self._method_configs["CreateDataset"].retry, - default_timeout=self._method_configs["CreateDataset"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.CreateDatasetRequest( - parent=parent, dataset=dataset - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_dataset"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_dataset( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets dataset by resource name. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> name = client.dataset_path('[PROJECT]', '[DATASET]') - >>> - >>> response = client.get_dataset(name) - - Args: - name (str): Required. Dataset resource name, format: - projects/{project\_id}/datasets/{dataset\_id} - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datalabeling_v1beta1.types.Dataset` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_dataset" not in self._inner_api_calls: - self._inner_api_calls[ - "get_dataset" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_dataset, - default_retry=self._method_configs["GetDataset"].retry, - default_timeout=self._method_configs["GetDataset"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.GetDatasetRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_dataset"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_datasets( - self, - parent, - filter_=None, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists datasets under a project. Pagination is supported. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> # Iterate over all results - >>> for element in client.list_datasets(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_datasets(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. Dataset resource parent, format: projects/{project\_id} - filter_ (str): Optional. Filter on dataset is not supported at this moment. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.datalabeling_v1beta1.types.Dataset` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_datasets" not in self._inner_api_calls: - self._inner_api_calls[ - "list_datasets" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_datasets, - default_retry=self._method_configs["ListDatasets"].retry, - default_timeout=self._method_configs["ListDatasets"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.ListDatasetsRequest( - parent=parent, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_datasets"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="datasets", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def delete_dataset( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a dataset by resource name. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> name = client.dataset_path('[PROJECT]', '[DATASET]') - >>> - >>> client.delete_dataset(name) - - Args: - name (str): Required. Dataset resource name, format: - projects/{project\_id}/datasets/{dataset\_id} - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_dataset" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_dataset" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_dataset, - default_retry=self._method_configs["DeleteDataset"].retry, - default_timeout=self._method_configs["DeleteDataset"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.DeleteDatasetRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_dataset"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def import_data( - self, - name, - input_config, - user_email_address=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Imports data into dataset based on source locations defined in request. - It can be called multiple times for the same dataset. Each dataset can - only have one long running operation running on it. For example, no - labeling task (also long running operation) can be started while - importing is still ongoing. Vice versa. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> name = client.dataset_path('[PROJECT]', '[DATASET]') - >>> - >>> # TODO: Initialize `input_config`: - >>> input_config = {} - >>> - >>> response = client.import_data(name, input_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. Dataset resource name, format: - projects/{project\_id}/datasets/{dataset\_id} - input_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.InputConfig]): Required. Specify the input source of the data. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.InputConfig` - user_email_address (str): Email of the user who started the import task and should be notified by - email. If empty no notification will be sent. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datalabeling_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "import_data" not in self._inner_api_calls: - self._inner_api_calls[ - "import_data" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.import_data, - default_retry=self._method_configs["ImportData"].retry, - default_timeout=self._method_configs["ImportData"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.ImportDataRequest( - name=name, input_config=input_config, user_email_address=user_email_address - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["import_data"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - proto_operations_pb2.ImportDataOperationResponse, - metadata_type=proto_operations_pb2.ImportDataOperationMetadata, - ) - - def export_data( - self, - name, - annotated_dataset, - output_config, - filter_=None, - user_email_address=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Exports data and annotations from dataset. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> name = client.dataset_path('[PROJECT]', '[DATASET]') - >>> annotated_dataset = client.annotated_dataset_path('[PROJECT]', '[DATASET]', '[ANNOTATED_DATASET]') - >>> - >>> # TODO: Initialize `output_config`: - >>> output_config = {} - >>> - >>> response = client.export_data(name, annotated_dataset, output_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. Dataset resource name, format: - projects/{project\_id}/datasets/{dataset\_id} - annotated_dataset (str): Required. Annotated dataset resource name. DataItem in Dataset and their - annotations in specified annotated dataset will be exported. It's in - format of - projects/{project\_id}/datasets/{dataset\_id}/annotatedDatasets/ - {annotated\_dataset\_id} - output_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.OutputConfig]): Required. Specify the output destination. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.OutputConfig` - filter_ (str): Optional. Filter is not supported at this moment. - user_email_address (str): Email of the user who started the export task and should be notified by - email. If empty no notification will be sent. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datalabeling_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "export_data" not in self._inner_api_calls: - self._inner_api_calls[ - "export_data" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.export_data, - default_retry=self._method_configs["ExportData"].retry, - default_timeout=self._method_configs["ExportData"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.ExportDataRequest( - name=name, - annotated_dataset=annotated_dataset, - output_config=output_config, - filter=filter_, - user_email_address=user_email_address, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["export_data"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - proto_operations_pb2.ExportDataOperationResponse, - metadata_type=proto_operations_pb2.ExportDataOperationMetadata, - ) - - def get_data_item( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a data item in a dataset by resource name. This API can be - called after data are imported into dataset. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> name = client.data_item_path('[PROJECT]', '[DATASET]', '[DATA_ITEM]') - >>> - >>> response = client.get_data_item(name) - - Args: - name (str): Required. The name of the data item to get, format: - projects/{project\_id}/datasets/{dataset\_id}/dataItems/{data\_item\_id} - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datalabeling_v1beta1.types.DataItem` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_data_item" not in self._inner_api_calls: - self._inner_api_calls[ - "get_data_item" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_data_item, - default_retry=self._method_configs["GetDataItem"].retry, - default_timeout=self._method_configs["GetDataItem"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.GetDataItemRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_data_item"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_data_items( - self, - parent, - filter_=None, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists data items in a dataset. This API can be called after data - are imported into dataset. Pagination is supported. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> parent = client.dataset_path('[PROJECT]', '[DATASET]') - >>> - >>> # Iterate over all results - >>> for element in client.list_data_items(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_data_items(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. Name of the dataset to list data items, format: - projects/{project\_id}/datasets/{dataset\_id} - filter_ (str): Optional. Filter is not supported at this moment. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.datalabeling_v1beta1.types.DataItem` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_data_items" not in self._inner_api_calls: - self._inner_api_calls[ - "list_data_items" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_data_items, - default_retry=self._method_configs["ListDataItems"].retry, - default_timeout=self._method_configs["ListDataItems"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.ListDataItemsRequest( - parent=parent, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_data_items"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="data_items", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_annotated_dataset( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets an annotated dataset by resource name. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> name = client.annotated_dataset_path('[PROJECT]', '[DATASET]', '[ANNOTATED_DATASET]') - >>> - >>> response = client.get_annotated_dataset(name) - - Args: - name (str): Required. Name of the annotated dataset to get, format: - projects/{project\_id}/datasets/{dataset\_id}/annotatedDatasets/ - {annotated\_dataset\_id} - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datalabeling_v1beta1.types.AnnotatedDataset` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_annotated_dataset" not in self._inner_api_calls: - self._inner_api_calls[ - "get_annotated_dataset" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_annotated_dataset, - default_retry=self._method_configs["GetAnnotatedDataset"].retry, - default_timeout=self._method_configs["GetAnnotatedDataset"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.GetAnnotatedDatasetRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_annotated_dataset"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_annotated_datasets( - self, - parent, - filter_=None, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists annotated datasets for a dataset. Pagination is supported. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> parent = client.dataset_path('[PROJECT]', '[DATASET]') - >>> - >>> # Iterate over all results - >>> for element in client.list_annotated_datasets(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_annotated_datasets(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. Name of the dataset to list annotated datasets, format: - projects/{project\_id}/datasets/{dataset\_id} - filter_ (str): Optional. Filter is not supported at this moment. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.datalabeling_v1beta1.types.AnnotatedDataset` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_annotated_datasets" not in self._inner_api_calls: - self._inner_api_calls[ - "list_annotated_datasets" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_annotated_datasets, - default_retry=self._method_configs["ListAnnotatedDatasets"].retry, - default_timeout=self._method_configs["ListAnnotatedDatasets"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.ListAnnotatedDatasetsRequest( - parent=parent, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_annotated_datasets"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="annotated_datasets", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def delete_annotated_dataset( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes an annotated dataset by resource name. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> name = client.annotated_dataset_path('[PROJECT]', '[DATASET]', '[ANNOTATED_DATASET]') - >>> - >>> client.delete_annotated_dataset(name) - - Args: - name (str): Required. Name of the annotated dataset to delete, format: - projects/{project\_id}/datasets/{dataset\_id}/annotatedDatasets/ - {annotated\_dataset\_id} - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_annotated_dataset" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_annotated_dataset" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_annotated_dataset, - default_retry=self._method_configs["DeleteAnnotatedDataset"].retry, - default_timeout=self._method_configs["DeleteAnnotatedDataset"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.DeleteAnnotatedDatasetRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_annotated_dataset"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def label_image( - self, - parent, - basic_config, - feature, - image_classification_config=None, - bounding_poly_config=None, - polyline_config=None, - segmentation_config=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Starts a labeling task for image. The type of image labeling task is - configured by feature in the request. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> from google.cloud.datalabeling_v1beta1 import enums - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> parent = client.dataset_path('[PROJECT]', '[DATASET]') - >>> - >>> # TODO: Initialize `basic_config`: - >>> basic_config = {} - >>> - >>> # TODO: Initialize `feature`: - >>> feature = enums.LabelImageRequest.Feature.FEATURE_UNSPECIFIED - >>> - >>> response = client.label_image(parent, basic_config, feature) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - parent (str): Required. Name of the dataset to request labeling task, format: - projects/{project\_id}/datasets/{dataset\_id} - basic_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.HumanAnnotationConfig]): Required. Basic human annotation config. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.HumanAnnotationConfig` - feature (~google.cloud.datalabeling_v1beta1.types.Feature): Required. The type of image labeling task. - image_classification_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.ImageClassificationConfig]): Configuration for image classification task. One of - image\_classification\_config, bounding\_poly\_config, polyline\_config - and segmentation\_config are required. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.ImageClassificationConfig` - bounding_poly_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.BoundingPolyConfig]): Configuration for bounding box and bounding poly task. One of - image\_classification\_config, bounding\_poly\_config, polyline\_config - and segmentation\_config are required. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.BoundingPolyConfig` - polyline_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.PolylineConfig]): Configuration for polyline task. One of image\_classification\_config, - bounding\_poly\_config, polyline\_config and segmentation\_config are - required. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.PolylineConfig` - segmentation_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.SegmentationConfig]): Configuration for segmentation task. One of - image\_classification\_config, bounding\_poly\_config, polyline\_config - and segmentation\_config are required. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.SegmentationConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datalabeling_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "label_image" not in self._inner_api_calls: - self._inner_api_calls[ - "label_image" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.label_image, - default_retry=self._method_configs["LabelImage"].retry, - default_timeout=self._method_configs["LabelImage"].timeout, - client_info=self._client_info, - ) - - # Sanity check: We have some fields which are mutually exclusive; - # raise ValueError if more than one is sent. - google.api_core.protobuf_helpers.check_oneof( - image_classification_config=image_classification_config, - bounding_poly_config=bounding_poly_config, - polyline_config=polyline_config, - segmentation_config=segmentation_config, - ) - - request = data_labeling_service_pb2.LabelImageRequest( - parent=parent, - basic_config=basic_config, - feature=feature, - image_classification_config=image_classification_config, - bounding_poly_config=bounding_poly_config, - polyline_config=polyline_config, - segmentation_config=segmentation_config, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["label_image"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - dataset_pb2.AnnotatedDataset, - metadata_type=proto_operations_pb2.LabelOperationMetadata, - ) - - def label_video( - self, - parent, - basic_config, - feature, - video_classification_config=None, - object_detection_config=None, - object_tracking_config=None, - event_config=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Starts a labeling task for video. The type of video labeling task is - configured by feature in the request. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> from google.cloud.datalabeling_v1beta1 import enums - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> parent = client.dataset_path('[PROJECT]', '[DATASET]') - >>> - >>> # TODO: Initialize `basic_config`: - >>> basic_config = {} - >>> - >>> # TODO: Initialize `feature`: - >>> feature = enums.LabelVideoRequest.Feature.FEATURE_UNSPECIFIED - >>> - >>> response = client.label_video(parent, basic_config, feature) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - parent (str): Required. Name of the dataset to request labeling task, format: - projects/{project\_id}/datasets/{dataset\_id} - basic_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.HumanAnnotationConfig]): Required. Basic human annotation config. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.HumanAnnotationConfig` - feature (~google.cloud.datalabeling_v1beta1.types.Feature): Required. The type of video labeling task. - video_classification_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.VideoClassificationConfig]): Configuration for video classification task. One of - video\_classification\_config, object\_detection\_config, - object\_tracking\_config and event\_config is required. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.VideoClassificationConfig` - object_detection_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.ObjectDetectionConfig]): Configuration for video object detection task. One of - video\_classification\_config, object\_detection\_config, - object\_tracking\_config and event\_config is required. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.ObjectDetectionConfig` - object_tracking_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.ObjectTrackingConfig]): Configuration for video object tracking task. One of - video\_classification\_config, object\_detection\_config, - object\_tracking\_config and event\_config is required. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.ObjectTrackingConfig` - event_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.EventConfig]): Configuration for video event task. One of - video\_classification\_config, object\_detection\_config, - object\_tracking\_config and event\_config is required. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.EventConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datalabeling_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "label_video" not in self._inner_api_calls: - self._inner_api_calls[ - "label_video" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.label_video, - default_retry=self._method_configs["LabelVideo"].retry, - default_timeout=self._method_configs["LabelVideo"].timeout, - client_info=self._client_info, - ) - - # Sanity check: We have some fields which are mutually exclusive; - # raise ValueError if more than one is sent. - google.api_core.protobuf_helpers.check_oneof( - video_classification_config=video_classification_config, - object_detection_config=object_detection_config, - object_tracking_config=object_tracking_config, - event_config=event_config, - ) - - request = data_labeling_service_pb2.LabelVideoRequest( - parent=parent, - basic_config=basic_config, - feature=feature, - video_classification_config=video_classification_config, - object_detection_config=object_detection_config, - object_tracking_config=object_tracking_config, - event_config=event_config, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["label_video"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - dataset_pb2.AnnotatedDataset, - metadata_type=proto_operations_pb2.LabelOperationMetadata, - ) - - def label_text( - self, - parent, - basic_config, - feature, - text_classification_config=None, - text_entity_extraction_config=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Starts a labeling task for text. The type of text labeling task is - configured by feature in the request. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> from google.cloud.datalabeling_v1beta1 import enums - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> parent = client.dataset_path('[PROJECT]', '[DATASET]') - >>> - >>> # TODO: Initialize `basic_config`: - >>> basic_config = {} - >>> - >>> # TODO: Initialize `feature`: - >>> feature = enums.LabelTextRequest.Feature.FEATURE_UNSPECIFIED - >>> - >>> response = client.label_text(parent, basic_config, feature) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - parent (str): Required. Name of the data set to request labeling task, format: - projects/{project\_id}/datasets/{dataset\_id} - basic_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.HumanAnnotationConfig]): Required. Basic human annotation config. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.HumanAnnotationConfig` - feature (~google.cloud.datalabeling_v1beta1.types.Feature): Required. The type of text labeling task. - text_classification_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.TextClassificationConfig]): Configuration for text classification task. One of - text\_classification\_config and text\_entity\_extraction\_config is - required. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.TextClassificationConfig` - text_entity_extraction_config (Union[dict, ~google.cloud.datalabeling_v1beta1.types.TextEntityExtractionConfig]): Configuration for entity extraction task. One of - text\_classification\_config and text\_entity\_extraction\_config is - required. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.TextEntityExtractionConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datalabeling_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "label_text" not in self._inner_api_calls: - self._inner_api_calls[ - "label_text" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.label_text, - default_retry=self._method_configs["LabelText"].retry, - default_timeout=self._method_configs["LabelText"].timeout, - client_info=self._client_info, - ) - - # Sanity check: We have some fields which are mutually exclusive; - # raise ValueError if more than one is sent. - google.api_core.protobuf_helpers.check_oneof( - text_classification_config=text_classification_config, - text_entity_extraction_config=text_entity_extraction_config, - ) - - request = data_labeling_service_pb2.LabelTextRequest( - parent=parent, - basic_config=basic_config, - feature=feature, - text_classification_config=text_classification_config, - text_entity_extraction_config=text_entity_extraction_config, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["label_text"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - dataset_pb2.AnnotatedDataset, - metadata_type=proto_operations_pb2.LabelOperationMetadata, - ) - - def get_example( - self, - name, - filter_=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets an example by resource name, including both data and annotation. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> name = client.example_path('[PROJECT]', '[DATASET]', '[ANNOTATED_DATASET]', '[EXAMPLE]') - >>> - >>> response = client.get_example(name) - - Args: - name (str): Required. Name of example, format: - projects/{project\_id}/datasets/{dataset\_id}/annotatedDatasets/ - {annotated\_dataset\_id}/examples/{example\_id} - filter_ (str): Optional. An expression for filtering Examples. Filter by - annotation\_spec.display\_name is supported. Format - "annotation\_spec.display\_name = {display\_name}" - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datalabeling_v1beta1.types.Example` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_example" not in self._inner_api_calls: - self._inner_api_calls[ - "get_example" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_example, - default_retry=self._method_configs["GetExample"].retry, - default_timeout=self._method_configs["GetExample"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.GetExampleRequest(name=name, filter=filter_) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_example"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_examples( - self, - parent, - filter_=None, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists examples in an annotated dataset. Pagination is supported. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> parent = client.annotated_dataset_path('[PROJECT]', '[DATASET]', '[ANNOTATED_DATASET]') - >>> - >>> # Iterate over all results - >>> for element in client.list_examples(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_examples(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. Example resource parent. - filter_ (str): Optional. An expression for filtering Examples. For annotated datasets - that have annotation spec set, filter by annotation\_spec.display\_name - is supported. Format "annotation\_spec.display\_name = {display\_name}" - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.datalabeling_v1beta1.types.Example` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_examples" not in self._inner_api_calls: - self._inner_api_calls[ - "list_examples" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_examples, - default_retry=self._method_configs["ListExamples"].retry, - default_timeout=self._method_configs["ListExamples"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.ListExamplesRequest( - parent=parent, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_examples"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="examples", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def create_annotation_spec_set( - self, - parent, - annotation_spec_set, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates an annotation spec set by providing a set of labels. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> # TODO: Initialize `annotation_spec_set`: - >>> annotation_spec_set = {} - >>> - >>> response = client.create_annotation_spec_set(parent, annotation_spec_set) - - Args: - parent (str): Required. AnnotationSpecSet resource parent, format: - projects/{project\_id} - annotation_spec_set (Union[dict, ~google.cloud.datalabeling_v1beta1.types.AnnotationSpecSet]): Required. Annotation spec set to create. Annotation specs must be - included. Only one annotation spec will be accepted for annotation specs - with same display\_name. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.AnnotationSpecSet` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datalabeling_v1beta1.types.AnnotationSpecSet` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_annotation_spec_set" not in self._inner_api_calls: - self._inner_api_calls[ - "create_annotation_spec_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_annotation_spec_set, - default_retry=self._method_configs["CreateAnnotationSpecSet"].retry, - default_timeout=self._method_configs["CreateAnnotationSpecSet"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.CreateAnnotationSpecSetRequest( - parent=parent, annotation_spec_set=annotation_spec_set - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_annotation_spec_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_annotation_spec_set( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets an annotation spec set by resource name. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> name = client.annotation_spec_set_path('[PROJECT]', '[ANNOTATION_SPEC_SET]') - >>> - >>> response = client.get_annotation_spec_set(name) - - Args: - name (str): Required. AnnotationSpecSet resource name, format: - projects/{project\_id}/annotationSpecSets/{annotation\_spec\_set\_id} - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datalabeling_v1beta1.types.AnnotationSpecSet` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_annotation_spec_set" not in self._inner_api_calls: - self._inner_api_calls[ - "get_annotation_spec_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_annotation_spec_set, - default_retry=self._method_configs["GetAnnotationSpecSet"].retry, - default_timeout=self._method_configs["GetAnnotationSpecSet"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.GetAnnotationSpecSetRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_annotation_spec_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_annotation_spec_sets( - self, - parent, - filter_=None, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists annotation spec sets for a project. Pagination is supported. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> # Iterate over all results - >>> for element in client.list_annotation_spec_sets(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_annotation_spec_sets(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. Parent of AnnotationSpecSet resource, format: - projects/{project\_id} - filter_ (str): Optional. Filter is not supported at this moment. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.datalabeling_v1beta1.types.AnnotationSpecSet` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_annotation_spec_sets" not in self._inner_api_calls: - self._inner_api_calls[ - "list_annotation_spec_sets" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_annotation_spec_sets, - default_retry=self._method_configs["ListAnnotationSpecSets"].retry, - default_timeout=self._method_configs["ListAnnotationSpecSets"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.ListAnnotationSpecSetsRequest( - parent=parent, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_annotation_spec_sets"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="annotation_spec_sets", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def delete_annotation_spec_set( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes an annotation spec set by resource name. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> name = client.annotation_spec_set_path('[PROJECT]', '[ANNOTATION_SPEC_SET]') - >>> - >>> client.delete_annotation_spec_set(name) - - Args: - name (str): Required. AnnotationSpec resource name, format: - ``projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_annotation_spec_set" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_annotation_spec_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_annotation_spec_set, - default_retry=self._method_configs["DeleteAnnotationSpecSet"].retry, - default_timeout=self._method_configs["DeleteAnnotationSpecSet"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.DeleteAnnotationSpecSetRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_annotation_spec_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_instruction( - self, - parent, - instruction, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates an instruction for how data should be labeled. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> # TODO: Initialize `instruction`: - >>> instruction = {} - >>> - >>> response = client.create_instruction(parent, instruction) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - parent (str): Required. Instruction resource parent, format: projects/{project\_id} - instruction (Union[dict, ~google.cloud.datalabeling_v1beta1.types.Instruction]): Required. Instruction of how to perform the labeling task. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.Instruction` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datalabeling_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_instruction" not in self._inner_api_calls: - self._inner_api_calls[ - "create_instruction" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_instruction, - default_retry=self._method_configs["CreateInstruction"].retry, - default_timeout=self._method_configs["CreateInstruction"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.CreateInstructionRequest( - parent=parent, instruction=instruction - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["create_instruction"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - instruction_pb2.Instruction, - metadata_type=proto_operations_pb2.CreateInstructionMetadata, - ) - - def get_instruction( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets an instruction by resource name. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> name = client.instruction_path('[PROJECT]', '[INSTRUCTION]') - >>> - >>> response = client.get_instruction(name) - - Args: - name (str): Required. Instruction resource name, format: - projects/{project\_id}/instructions/{instruction\_id} - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datalabeling_v1beta1.types.Instruction` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_instruction" not in self._inner_api_calls: - self._inner_api_calls[ - "get_instruction" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_instruction, - default_retry=self._method_configs["GetInstruction"].retry, - default_timeout=self._method_configs["GetInstruction"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.GetInstructionRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_instruction"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_instructions( - self, - parent, - filter_=None, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists instructions for a project. Pagination is supported. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> # Iterate over all results - >>> for element in client.list_instructions(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_instructions(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. Instruction resource parent, format: projects/{project\_id} - filter_ (str): Optional. Filter is not supported at this moment. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.datalabeling_v1beta1.types.Instruction` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_instructions" not in self._inner_api_calls: - self._inner_api_calls[ - "list_instructions" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_instructions, - default_retry=self._method_configs["ListInstructions"].retry, - default_timeout=self._method_configs["ListInstructions"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.ListInstructionsRequest( - parent=parent, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_instructions"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="instructions", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def delete_instruction( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes an instruction object by resource name. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> name = client.instruction_path('[PROJECT]', '[INSTRUCTION]') - >>> - >>> client.delete_instruction(name) - - Args: - name (str): Required. Instruction resource name, format: - projects/{project\_id}/instructions/{instruction\_id} - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_instruction" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_instruction" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_instruction, - default_retry=self._method_configs["DeleteInstruction"].retry, - default_timeout=self._method_configs["DeleteInstruction"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.DeleteInstructionRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_instruction"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_evaluation( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets an evaluation by resource name (to search, use - ``projects.evaluations.search``). - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> name = client.evaluation_path('[PROJECT]', '[DATASET]', '[EVALUATION]') - >>> - >>> response = client.get_evaluation(name) - - Args: - name (str): Required. Name of the evaluation. Format: - - "projects/{project\_id}/datasets/{dataset\_id}/evaluations/{evaluation\_id}' - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datalabeling_v1beta1.types.Evaluation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_evaluation" not in self._inner_api_calls: - self._inner_api_calls[ - "get_evaluation" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_evaluation, - default_retry=self._method_configs["GetEvaluation"].retry, - default_timeout=self._method_configs["GetEvaluation"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.GetEvaluationRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_evaluation"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def search_evaluations( - self, - parent, - filter_=None, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Searches ``evaluations`` within a project. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> parent = client.evaluation_path('[PROJECT]', '[DATASET]', '[EVALUATION]') - >>> - >>> # Iterate over all results - >>> for element in client.search_evaluations(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.search_evaluations(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. Evaluation search parent (project ID). Format: - "projects/{project\_id}" - filter_ (str): Optional. To search evaluations, you can filter by the following: - - - evaluation\_job.evaluation\_job\_id (the last part of - ``EvaluationJob.name``) - - evaluation\_job.model\_id (the {model\_name} portion of - ``EvaluationJob.modelVersion``) - - evaluation\_job.evaluation\_job\_run\_time\_start (Minimum threshold - for the ``evaluationJobRunTime`` that created the evaluation) - - evaluation\_job.evaluation\_job\_run\_time\_end (Maximum threshold - for the ``evaluationJobRunTime`` that created the evaluation) - - evaluation\_job.job\_state (``EvaluationJob.state``) - - annotation\_spec.display\_name (the Evaluation contains a metric for - the annotation spec with this ``displayName``) - - To filter by multiple critiera, use the ``AND`` operator or the ``OR`` - operator. The following examples shows a string that filters by several - critiera: - - "evaluation\ *job.evaluation\_job\_id = {evaluation\_job\_id} AND - evaluation*\ job.model\_id = {model\_name} AND - evaluation\ *job.evaluation\_job\_run\_time\_start = {timestamp\_1} AND - evaluation*\ job.evaluation\_job\_run\_time\_end = {timestamp\_2} AND - annotation\_spec.display\_name = {display\_name}" - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.datalabeling_v1beta1.types.Evaluation` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "search_evaluations" not in self._inner_api_calls: - self._inner_api_calls[ - "search_evaluations" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.search_evaluations, - default_retry=self._method_configs["SearchEvaluations"].retry, - default_timeout=self._method_configs["SearchEvaluations"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.SearchEvaluationsRequest( - parent=parent, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["search_evaluations"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="evaluations", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def search_example_comparisons( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Searches example comparisons from an evaluation. The return format is a - list of example comparisons that show ground truth and prediction(s) for - a single input. Search by providing an evaluation ID. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> parent = client.evaluation_path('[PROJECT]', '[DATASET]', '[EVALUATION]') - >>> - >>> # Iterate over all results - >>> for element in client.search_example_comparisons(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.search_example_comparisons(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. Name of the ``Evaluation`` resource to search for example - comparisons from. Format: - - "projects/{project\_id}/datasets/{dataset\_id}/evaluations/{evaluation\_id}" - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.datalabeling_v1beta1.types.ExampleComparison` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "search_example_comparisons" not in self._inner_api_calls: - self._inner_api_calls[ - "search_example_comparisons" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.search_example_comparisons, - default_retry=self._method_configs["SearchExampleComparisons"].retry, - default_timeout=self._method_configs[ - "SearchExampleComparisons" - ].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.SearchExampleComparisonsRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["search_example_comparisons"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="example_comparisons", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def create_evaluation_job( - self, - parent, - job, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates an evaluation job. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> # TODO: Initialize `job`: - >>> job = {} - >>> - >>> response = client.create_evaluation_job(parent, job) - - Args: - parent (str): Required. Evaluation job resource parent. Format: - "projects/{project\_id}" - job (Union[dict, ~google.cloud.datalabeling_v1beta1.types.EvaluationJob]): Required. The evaluation job to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.EvaluationJob` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datalabeling_v1beta1.types.EvaluationJob` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_evaluation_job" not in self._inner_api_calls: - self._inner_api_calls[ - "create_evaluation_job" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_evaluation_job, - default_retry=self._method_configs["CreateEvaluationJob"].retry, - default_timeout=self._method_configs["CreateEvaluationJob"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.CreateEvaluationJobRequest( - parent=parent, job=job - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_evaluation_job"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_evaluation_job( - self, - evaluation_job, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates an evaluation job. You can only update certain fields of the - job's ``EvaluationJobConfig``: ``humanAnnotationConfig.instruction``, - ``exampleCount``, and ``exampleSamplePercentage``. - - If you want to change any other aspect of the evaluation job, you must - delete the job and create a new one. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> # TODO: Initialize `evaluation_job`: - >>> evaluation_job = {} - >>> - >>> response = client.update_evaluation_job(evaluation_job) - - Args: - evaluation_job (Union[dict, ~google.cloud.datalabeling_v1beta1.types.EvaluationJob]): Required. Evaluation job that is going to be updated. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.EvaluationJob` - update_mask (Union[dict, ~google.cloud.datalabeling_v1beta1.types.FieldMask]): Optional. Mask for which fields to update. You can only provide the - following fields: - - - ``evaluationJobConfig.humanAnnotationConfig.instruction`` - - ``evaluationJobConfig.exampleCount`` - - ``evaluationJobConfig.exampleSamplePercentage`` - - You can provide more than one of these fields by separating them with - commas. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.datalabeling_v1beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datalabeling_v1beta1.types.EvaluationJob` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_evaluation_job" not in self._inner_api_calls: - self._inner_api_calls[ - "update_evaluation_job" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_evaluation_job, - default_retry=self._method_configs["UpdateEvaluationJob"].retry, - default_timeout=self._method_configs["UpdateEvaluationJob"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.UpdateEvaluationJobRequest( - evaluation_job=evaluation_job, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("evaluation_job.name", evaluation_job.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_evaluation_job"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_evaluation_job( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets an evaluation job by resource name. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> name = client.evaluation_job_path('[PROJECT]', '[EVALUATION_JOB]') - >>> - >>> response = client.get_evaluation_job(name) - - Args: - name (str): Required. Name of the evaluation job. Format: - - "projects/{project\_id}/evaluationJobs/{evaluation\_job\_id}" - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.datalabeling_v1beta1.types.EvaluationJob` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_evaluation_job" not in self._inner_api_calls: - self._inner_api_calls[ - "get_evaluation_job" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_evaluation_job, - default_retry=self._method_configs["GetEvaluationJob"].retry, - default_timeout=self._method_configs["GetEvaluationJob"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.GetEvaluationJobRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_evaluation_job"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def pause_evaluation_job( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Pauses an evaluation job. Pausing an evaluation job that is already in a - ``PAUSED`` state is a no-op. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> name = client.evaluation_job_path('[PROJECT]', '[EVALUATION_JOB]') - >>> - >>> client.pause_evaluation_job(name) - - Args: - name (str): Required. Name of the evaluation job that is going to be paused. Format: - - "projects/{project\_id}/evaluationJobs/{evaluation\_job\_id}" - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "pause_evaluation_job" not in self._inner_api_calls: - self._inner_api_calls[ - "pause_evaluation_job" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.pause_evaluation_job, - default_retry=self._method_configs["PauseEvaluationJob"].retry, - default_timeout=self._method_configs["PauseEvaluationJob"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.PauseEvaluationJobRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["pause_evaluation_job"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def resume_evaluation_job( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Resumes a paused evaluation job. A deleted evaluation job can't be resumed. - Resuming a running or scheduled evaluation job is a no-op. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> name = client.evaluation_job_path('[PROJECT]', '[EVALUATION_JOB]') - >>> - >>> client.resume_evaluation_job(name) - - Args: - name (str): Required. Name of the evaluation job that is going to be resumed. - Format: - - "projects/{project\_id}/evaluationJobs/{evaluation\_job\_id}" - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "resume_evaluation_job" not in self._inner_api_calls: - self._inner_api_calls[ - "resume_evaluation_job" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.resume_evaluation_job, - default_retry=self._method_configs["ResumeEvaluationJob"].retry, - default_timeout=self._method_configs["ResumeEvaluationJob"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.ResumeEvaluationJobRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["resume_evaluation_job"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_evaluation_job( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Stops and deletes an evaluation job. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> name = client.evaluation_job_path('[PROJECT]', '[EVALUATION_JOB]') - >>> - >>> client.delete_evaluation_job(name) - - Args: - name (str): Required. Name of the evaluation job that is going to be deleted. - Format: - - "projects/{project\_id}/evaluationJobs/{evaluation\_job\_id}" - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_evaluation_job" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_evaluation_job" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_evaluation_job, - default_retry=self._method_configs["DeleteEvaluationJob"].retry, - default_timeout=self._method_configs["DeleteEvaluationJob"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.DeleteEvaluationJobRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_evaluation_job"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_evaluation_jobs( - self, - parent, - filter_=None, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists all evaluation jobs within a project with possible filters. - Pagination is supported. - - Example: - >>> from google.cloud import datalabeling_v1beta1 - >>> - >>> client = datalabeling_v1beta1.DataLabelingServiceClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> # Iterate over all results - >>> for element in client.list_evaluation_jobs(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_evaluation_jobs(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. Evaluation job resource parent. Format: - "projects/{project\_id}" - filter_ (str): Optional. You can filter the jobs to list by model\_id (also known as - model\_name, as described in ``EvaluationJob.modelVersion``) or by - evaluation job state (as described in ``EvaluationJob.state``). To - filter by both criteria, use the ``AND`` operator or the ``OR`` - operator. For example, you can use the following string for your filter: - "evaluation\ *job.model\_id = {model\_name} AND evaluation*\ job.state = - {evaluation\_job\_state}" - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.datalabeling_v1beta1.types.EvaluationJob` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_evaluation_jobs" not in self._inner_api_calls: - self._inner_api_calls[ - "list_evaluation_jobs" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_evaluation_jobs, - default_retry=self._method_configs["ListEvaluationJobs"].retry, - default_timeout=self._method_configs["ListEvaluationJobs"].timeout, - client_info=self._client_info, - ) - - request = data_labeling_service_pb2.ListEvaluationJobsRequest( - parent=parent, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_evaluation_jobs"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="evaluation_jobs", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client_config.py b/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client_config.py deleted file mode 100644 index 54d9359b93ce..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client_config.py +++ /dev/null @@ -1,193 +0,0 @@ -config = { - "interfaces": { - "google.cloud.datalabeling.v1beta1.DataLabelingService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "CreateDataset": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetDataset": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListDatasets": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteDataset": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ImportData": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ExportData": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetDataItem": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListDataItems": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetAnnotatedDataset": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListAnnotatedDatasets": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteAnnotatedDataset": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "LabelImage": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "LabelVideo": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "LabelText": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetExample": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListExamples": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateAnnotationSpecSet": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetAnnotationSpecSet": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListAnnotationSpecSets": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteAnnotationSpecSet": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "CreateInstruction": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetInstruction": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListInstructions": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteInstruction": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetEvaluation": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "SearchEvaluations": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "SearchExampleComparisons": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "CreateEvaluationJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateEvaluationJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetEvaluationJob": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "PauseEvaluationJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ResumeEvaluationJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteEvaluationJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListEvaluationJobs": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/gapic/enums.py b/datalabeling/google/cloud/datalabeling_v1beta1/gapic/enums.py deleted file mode 100644 index 2a782589734f..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/gapic/enums.py +++ /dev/null @@ -1,228 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class AnnotationSentiment(enum.IntEnum): - """ - Attributes: - ANNOTATION_SENTIMENT_UNSPECIFIED (int) - NEGATIVE (int): This annotation describes negatively about the data. - POSITIVE (int): This label describes positively about the data. - """ - - ANNOTATION_SENTIMENT_UNSPECIFIED = 0 - NEGATIVE = 1 - POSITIVE = 2 - - -class AnnotationSource(enum.IntEnum): - """ - Specifies where the annotation comes from (whether it was provided by a - human labeler or a different source). - - Attributes: - ANNOTATION_SOURCE_UNSPECIFIED (int) - OPERATOR (int): Answer is provided by a human contributor. - """ - - ANNOTATION_SOURCE_UNSPECIFIED = 0 - OPERATOR = 3 - - -class AnnotationType(enum.IntEnum): - """ - Attributes: - ANNOTATION_TYPE_UNSPECIFIED (int) - IMAGE_CLASSIFICATION_ANNOTATION (int): Classification annotations in an image. Allowed for continuous evaluation. - IMAGE_BOUNDING_BOX_ANNOTATION (int): Bounding box annotations in an image. A form of image object detection. - Allowed for continuous evaluation. - IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION (int): Oriented bounding box. The box does not have to be parallel to horizontal - line. - IMAGE_BOUNDING_POLY_ANNOTATION (int): Bounding poly annotations in an image. - IMAGE_POLYLINE_ANNOTATION (int): Polyline annotations in an image. - IMAGE_SEGMENTATION_ANNOTATION (int): Segmentation annotations in an image. - VIDEO_SHOTS_CLASSIFICATION_ANNOTATION (int): Classification annotations in video shots. - VIDEO_OBJECT_TRACKING_ANNOTATION (int): Video object tracking annotation. - VIDEO_OBJECT_DETECTION_ANNOTATION (int): Video object detection annotation. - VIDEO_EVENT_ANNOTATION (int): Video event annotation. - TEXT_CLASSIFICATION_ANNOTATION (int): Classification for text. Allowed for continuous evaluation. - TEXT_ENTITY_EXTRACTION_ANNOTATION (int): Entity extraction for text. - GENERAL_CLASSIFICATION_ANNOTATION (int): General classification. Allowed for continuous evaluation. - """ - - ANNOTATION_TYPE_UNSPECIFIED = 0 - IMAGE_CLASSIFICATION_ANNOTATION = 1 - IMAGE_BOUNDING_BOX_ANNOTATION = 2 - IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION = 13 - IMAGE_BOUNDING_POLY_ANNOTATION = 10 - IMAGE_POLYLINE_ANNOTATION = 11 - IMAGE_SEGMENTATION_ANNOTATION = 12 - VIDEO_SHOTS_CLASSIFICATION_ANNOTATION = 3 - VIDEO_OBJECT_TRACKING_ANNOTATION = 4 - VIDEO_OBJECT_DETECTION_ANNOTATION = 5 - VIDEO_EVENT_ANNOTATION = 6 - TEXT_CLASSIFICATION_ANNOTATION = 8 - TEXT_ENTITY_EXTRACTION_ANNOTATION = 9 - GENERAL_CLASSIFICATION_ANNOTATION = 14 - - -class DataType(enum.IntEnum): - """ - Attributes: - DATA_TYPE_UNSPECIFIED (int) - IMAGE (int): Allowed for continuous evaluation. - VIDEO (int) - TEXT (int): Allowed for continuous evaluation. - GENERAL_DATA (int): Allowed for continuous evaluation. - """ - - DATA_TYPE_UNSPECIFIED = 0 - IMAGE = 1 - VIDEO = 2 - TEXT = 4 - GENERAL_DATA = 6 - - -class StringAggregationType(enum.IntEnum): - """ - Attributes: - STRING_AGGREGATION_TYPE_UNSPECIFIED (int) - MAJORITY_VOTE (int): Majority vote to aggregate answers. - UNANIMOUS_VOTE (int): Unanimous answers will be adopted. - NO_AGGREGATION (int): Preserve all answers by crowd compute. - """ - - STRING_AGGREGATION_TYPE_UNSPECIFIED = 0 - MAJORITY_VOTE = 1 - UNANIMOUS_VOTE = 2 - NO_AGGREGATION = 3 - - -class EvaluationJob(object): - class State(enum.IntEnum): - """ - State of the job. - - Attributes: - STATE_UNSPECIFIED (int) - SCHEDULED (int): The job is scheduled to run at the ``configured interval``. You can - ``pause`` or ``delete`` the job. - - When the job is in this state, it samples prediction input and output - from your model version into your BigQuery table as predictions occur. - RUNNING (int): The job is currently running. When the job runs, Data Labeling Service - does several things: - - 1. If you have configured your job to use Data Labeling Service for - ground truth labeling, the service creates a ``Dataset`` and a - labeling task for all data sampled since the last time the job ran. - Human labelers provide ground truth labels for your data. Human - labeling may take hours, or even days, depending on how much data has - been sampled. The job remains in the ``RUNNING`` state during this - time, and it can even be running multiple times in parallel if it - gets triggered again (for example 24 hours later) before the earlier - run has completed. When human labelers have finished labeling the - data, the next step occurs. If you have configured your job to - provide your own ground truth labels, Data Labeling Service still - creates a ``Dataset`` for newly sampled data, but it expects that you - have already added ground truth labels to the BigQuery table by this - time. The next step occurs immediately. - - 2. Data Labeling Service creates an ``Evaluation`` by comparing your - model version's predictions with the ground truth labels. - - If the job remains in this state for a long time, it continues to sample - prediction data into your BigQuery table and will run again at the next - interval, even if it causes the job to run multiple times in parallel. - PAUSED (int): The job is not sampling prediction input and output into your BigQuery - table and it will not run according to its schedule. You can ``resume`` - the job. - STOPPED (int): The job has this state right before it is deleted. - """ - - STATE_UNSPECIFIED = 0 - SCHEDULED = 1 - RUNNING = 2 - PAUSED = 3 - STOPPED = 4 - - -class LabelImageRequest(object): - class Feature(enum.IntEnum): - """ - Image labeling task feature. - - Attributes: - FEATURE_UNSPECIFIED (int) - CLASSIFICATION (int): Label whole image with one or more of labels. - BOUNDING_BOX (int): Label image with bounding boxes for labels. - ORIENTED_BOUNDING_BOX (int): Label oriented bounding box. The box does not have to be parallel to - horizontal line. - BOUNDING_POLY (int): Label images with bounding poly. A bounding poly is a plane figure that - is bounded by a finite chain of straight line segments closing in a loop. - POLYLINE (int): Label images with polyline. Polyline is formed by connected line segments - which are not in closed form. - SEGMENTATION (int): Label images with segmentation. Segmentation is different from bounding - poly since it is more fine-grained, pixel level annotation. - """ - - FEATURE_UNSPECIFIED = 0 - CLASSIFICATION = 1 - BOUNDING_BOX = 2 - ORIENTED_BOUNDING_BOX = 6 - BOUNDING_POLY = 3 - POLYLINE = 4 - SEGMENTATION = 5 - - -class LabelTextRequest(object): - class Feature(enum.IntEnum): - """ - Text labeling task feature. - - Attributes: - FEATURE_UNSPECIFIED (int) - TEXT_CLASSIFICATION (int): Label text content to one of more labels. - TEXT_ENTITY_EXTRACTION (int): Label entities and their span in text. - """ - - FEATURE_UNSPECIFIED = 0 - TEXT_CLASSIFICATION = 1 - TEXT_ENTITY_EXTRACTION = 2 - - -class LabelVideoRequest(object): - class Feature(enum.IntEnum): - """ - Video labeling task feature. - - Attributes: - FEATURE_UNSPECIFIED (int) - CLASSIFICATION (int): Label whole video or video segment with one or more labels. - OBJECT_DETECTION (int): Label objects with bounding box on image frames extracted from the video. - OBJECT_TRACKING (int): Label and track objects in video. - EVENT (int): Label the range of video for the specified events. - """ - - FEATURE_UNSPECIFIED = 0 - CLASSIFICATION = 1 - OBJECT_DETECTION = 2 - OBJECT_TRACKING = 3 - EVENT = 4 diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/gapic/transports/__init__.py b/datalabeling/google/cloud/datalabeling_v1beta1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/gapic/transports/data_labeling_service_grpc_transport.py b/datalabeling/google/cloud/datalabeling_v1beta1/gapic/transports/data_labeling_service_grpc_transport.py deleted file mode 100644 index 4e6e56a7d984..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/gapic/transports/data_labeling_service_grpc_transport.py +++ /dev/null @@ -1,580 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers -import google.api_core.operations_v1 - -from google.cloud.datalabeling_v1beta1.proto import data_labeling_service_pb2_grpc - - -class DataLabelingServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.datalabeling.v1beta1 DataLabelingService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="datalabeling.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "data_labeling_service_stub": data_labeling_service_pb2_grpc.DataLabelingServiceStub( - channel - ) - } - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="datalabeling.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def create_dataset(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.create_dataset`. - - Creates dataset. If success return a Dataset resource. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].CreateDataset - - @property - def get_dataset(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.get_dataset`. - - Gets dataset by resource name. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].GetDataset - - @property - def list_datasets(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.list_datasets`. - - Lists datasets under a project. Pagination is supported. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].ListDatasets - - @property - def delete_dataset(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.delete_dataset`. - - Deletes a dataset by resource name. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].DeleteDataset - - @property - def import_data(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.import_data`. - - Imports data into dataset based on source locations defined in request. - It can be called multiple times for the same dataset. Each dataset can - only have one long running operation running on it. For example, no - labeling task (also long running operation) can be started while - importing is still ongoing. Vice versa. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].ImportData - - @property - def export_data(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.export_data`. - - Exports data and annotations from dataset. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].ExportData - - @property - def get_data_item(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.get_data_item`. - - Gets a data item in a dataset by resource name. This API can be - called after data are imported into dataset. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].GetDataItem - - @property - def list_data_items(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.list_data_items`. - - Lists data items in a dataset. This API can be called after data - are imported into dataset. Pagination is supported. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].ListDataItems - - @property - def get_annotated_dataset(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.get_annotated_dataset`. - - Gets an annotated dataset by resource name. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].GetAnnotatedDataset - - @property - def list_annotated_datasets(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.list_annotated_datasets`. - - Lists annotated datasets for a dataset. Pagination is supported. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].ListAnnotatedDatasets - - @property - def delete_annotated_dataset(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.delete_annotated_dataset`. - - Deletes an annotated dataset by resource name. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].DeleteAnnotatedDataset - - @property - def label_image(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.label_image`. - - Starts a labeling task for image. The type of image labeling task is - configured by feature in the request. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].LabelImage - - @property - def label_video(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.label_video`. - - Starts a labeling task for video. The type of video labeling task is - configured by feature in the request. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].LabelVideo - - @property - def label_text(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.label_text`. - - Starts a labeling task for text. The type of text labeling task is - configured by feature in the request. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].LabelText - - @property - def get_example(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.get_example`. - - Gets an example by resource name, including both data and annotation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].GetExample - - @property - def list_examples(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.list_examples`. - - Lists examples in an annotated dataset. Pagination is supported. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].ListExamples - - @property - def create_annotation_spec_set(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.create_annotation_spec_set`. - - Creates an annotation spec set by providing a set of labels. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].CreateAnnotationSpecSet - - @property - def get_annotation_spec_set(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.get_annotation_spec_set`. - - Gets an annotation spec set by resource name. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].GetAnnotationSpecSet - - @property - def list_annotation_spec_sets(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.list_annotation_spec_sets`. - - Lists annotation spec sets for a project. Pagination is supported. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].ListAnnotationSpecSets - - @property - def delete_annotation_spec_set(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.delete_annotation_spec_set`. - - Deletes an annotation spec set by resource name. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].DeleteAnnotationSpecSet - - @property - def create_instruction(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.create_instruction`. - - Creates an instruction for how data should be labeled. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].CreateInstruction - - @property - def get_instruction(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.get_instruction`. - - Gets an instruction by resource name. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].GetInstruction - - @property - def list_instructions(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.list_instructions`. - - Lists instructions for a project. Pagination is supported. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].ListInstructions - - @property - def delete_instruction(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.delete_instruction`. - - Deletes an instruction object by resource name. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].DeleteInstruction - - @property - def get_evaluation(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.get_evaluation`. - - Gets an evaluation by resource name (to search, use - ``projects.evaluations.search``). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].GetEvaluation - - @property - def search_evaluations(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.search_evaluations`. - - Searches ``evaluations`` within a project. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].SearchEvaluations - - @property - def search_example_comparisons(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.search_example_comparisons`. - - Searches example comparisons from an evaluation. The return format is a - list of example comparisons that show ground truth and prediction(s) for - a single input. Search by providing an evaluation ID. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].SearchExampleComparisons - - @property - def create_evaluation_job(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.create_evaluation_job`. - - Creates an evaluation job. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].CreateEvaluationJob - - @property - def update_evaluation_job(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.update_evaluation_job`. - - Updates an evaluation job. You can only update certain fields of the - job's ``EvaluationJobConfig``: ``humanAnnotationConfig.instruction``, - ``exampleCount``, and ``exampleSamplePercentage``. - - If you want to change any other aspect of the evaluation job, you must - delete the job and create a new one. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].UpdateEvaluationJob - - @property - def get_evaluation_job(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.get_evaluation_job`. - - Gets an evaluation job by resource name. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].GetEvaluationJob - - @property - def pause_evaluation_job(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.pause_evaluation_job`. - - Pauses an evaluation job. Pausing an evaluation job that is already in a - ``PAUSED`` state is a no-op. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].PauseEvaluationJob - - @property - def resume_evaluation_job(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.resume_evaluation_job`. - - Resumes a paused evaluation job. A deleted evaluation job can't be resumed. - Resuming a running or scheduled evaluation job is a no-op. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].ResumeEvaluationJob - - @property - def delete_evaluation_job(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.delete_evaluation_job`. - - Stops and deletes an evaluation job. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].DeleteEvaluationJob - - @property - def list_evaluation_jobs(self): - """Return the gRPC stub for :meth:`DataLabelingServiceClient.list_evaluation_jobs`. - - Lists all evaluation jobs within a project with possible filters. - Pagination is supported. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["data_labeling_service_stub"].ListEvaluationJobs diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/__init__.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation.proto b/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation.proto deleted file mode 100644 index 4750fdc3bbac..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation.proto +++ /dev/null @@ -1,344 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datalabeling.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/resource.proto"; -import "google/cloud/datalabeling/v1beta1/annotation_spec_set.proto"; -import "google/protobuf/duration.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datalabeling.v1beta1"; - -// Specifies where the annotation comes from (whether it was provided by a -// human labeler or a different source). -enum AnnotationSource { - ANNOTATION_SOURCE_UNSPECIFIED = 0; - - // Answer is provided by a human contributor. - OPERATOR = 3; -} - -// Annotation for Example. Each example may have one or more annotations. For -// example in image classification problem, each image might have one or more -// labels. We call labels binded with this image an Annotation. -message Annotation { - // Output only. Unique name of this annotation, format is: - // - // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotated_dataset}/examples/{example_id}/annotations/{annotation_id} - string name = 1; - - // Output only. The source of the annotation. - AnnotationSource annotation_source = 2; - - // Output only. This is the actual annotation value, e.g classification, - // bounding box values are stored here. - AnnotationValue annotation_value = 3; - - // Output only. Annotation metadata, including information like votes - // for labels. - AnnotationMetadata annotation_metadata = 4; - - // Output only. Sentiment for this annotation. - AnnotationSentiment annotation_sentiment = 6; -} - -enum AnnotationSentiment { - ANNOTATION_SENTIMENT_UNSPECIFIED = 0; - - // This annotation describes negatively about the data. - NEGATIVE = 1; - - // This label describes positively about the data. - POSITIVE = 2; -} - -enum AnnotationType { - ANNOTATION_TYPE_UNSPECIFIED = 0; - - // Classification annotations in an image. Allowed for continuous evaluation. - IMAGE_CLASSIFICATION_ANNOTATION = 1; - - // Bounding box annotations in an image. A form of image object detection. - // Allowed for continuous evaluation. - IMAGE_BOUNDING_BOX_ANNOTATION = 2; - - // Oriented bounding box. The box does not have to be parallel to horizontal - // line. - IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION = 13; - - // Bounding poly annotations in an image. - IMAGE_BOUNDING_POLY_ANNOTATION = 10; - - // Polyline annotations in an image. - IMAGE_POLYLINE_ANNOTATION = 11; - - // Segmentation annotations in an image. - IMAGE_SEGMENTATION_ANNOTATION = 12; - - // Classification annotations in video shots. - VIDEO_SHOTS_CLASSIFICATION_ANNOTATION = 3; - - // Video object tracking annotation. - VIDEO_OBJECT_TRACKING_ANNOTATION = 4; - - // Video object detection annotation. - VIDEO_OBJECT_DETECTION_ANNOTATION = 5; - - // Video event annotation. - VIDEO_EVENT_ANNOTATION = 6; - - // Classification for text. Allowed for continuous evaluation. - TEXT_CLASSIFICATION_ANNOTATION = 8; - - // Entity extraction for text. - TEXT_ENTITY_EXTRACTION_ANNOTATION = 9; - - // General classification. Allowed for continuous evaluation. - GENERAL_CLASSIFICATION_ANNOTATION = 14; -} - -// Annotation value for an example. -message AnnotationValue { - oneof value_type { - // Annotation value for image classification case. - ImageClassificationAnnotation image_classification_annotation = 1; - - // Annotation value for image bounding box, oriented bounding box - // and polygon cases. - ImageBoundingPolyAnnotation image_bounding_poly_annotation = 2; - - // Annotation value for image polyline cases. - // Polyline here is different from BoundingPoly. It is formed by - // line segments connected to each other but not closed form(Bounding Poly). - // The line segments can cross each other. - ImagePolylineAnnotation image_polyline_annotation = 8; - - // Annotation value for image segmentation. - ImageSegmentationAnnotation image_segmentation_annotation = 9; - - // Annotation value for text classification case. - TextClassificationAnnotation text_classification_annotation = 3; - - // Annotation value for text entity extraction case. - TextEntityExtractionAnnotation text_entity_extraction_annotation = 10; - - // Annotation value for video classification case. - VideoClassificationAnnotation video_classification_annotation = 4; - - // Annotation value for video object detection and tracking case. - VideoObjectTrackingAnnotation video_object_tracking_annotation = 5; - - // Annotation value for video event case. - VideoEventAnnotation video_event_annotation = 6; - } -} - -// Image classification annotation definition. -message ImageClassificationAnnotation { - // Label of image. - AnnotationSpec annotation_spec = 1; -} - -// A vertex represents a 2D point in the image. -// NOTE: the vertex coordinates are in the same scale as the original image. -message Vertex { - // X coordinate. - int32 x = 1; - - // Y coordinate. - int32 y = 2; -} - -// A vertex represents a 2D point in the image. -// NOTE: the normalized vertex coordinates are relative to the original image -// and range from 0 to 1. -message NormalizedVertex { - // X coordinate. - float x = 1; - - // Y coordinate. - float y = 2; -} - -// A bounding polygon in the image. -message BoundingPoly { - // The bounding polygon vertices. - repeated Vertex vertices = 1; -} - -// Normalized bounding polygon. -message NormalizedBoundingPoly { - // The bounding polygon normalized vertices. - repeated NormalizedVertex normalized_vertices = 1; -} - -// Image bounding poly annotation. It represents a polygon including -// bounding box in the image. -message ImageBoundingPolyAnnotation { - // The region of the polygon. If it is a bounding box, it is guaranteed to be - // four points. - oneof bounded_area { - BoundingPoly bounding_poly = 2; - - NormalizedBoundingPoly normalized_bounding_poly = 3; - } - - // Label of object in this bounding polygon. - AnnotationSpec annotation_spec = 1; -} - -// A line with multiple line segments. -message Polyline { - // The polyline vertices. - repeated Vertex vertices = 1; -} - -// Normalized polyline. -message NormalizedPolyline { - // The normalized polyline vertices. - repeated NormalizedVertex normalized_vertices = 1; -} - -// A polyline for the image annotation. -message ImagePolylineAnnotation { - oneof poly { - Polyline polyline = 2; - - NormalizedPolyline normalized_polyline = 3; - } - - // Label of this polyline. - AnnotationSpec annotation_spec = 1; -} - -// Image segmentation annotation. -message ImageSegmentationAnnotation { - // The mapping between rgb color and annotation spec. The key is the rgb - // color represented in format of rgb(0, 0, 0). The value is the - // AnnotationSpec. - map annotation_colors = 1; - - // Image format. - string mime_type = 2; - - // A byte string of a full image's color map. - bytes image_bytes = 3; -} - -// Text classification annotation. -message TextClassificationAnnotation { - // Label of the text. - AnnotationSpec annotation_spec = 1; -} - -// Text entity extraction annotation. -message TextEntityExtractionAnnotation { - // Label of the text entities. - AnnotationSpec annotation_spec = 1; - - // Position of the entity. - SequentialSegment sequential_segment = 2; -} - -// Start and end position in a sequence (e.g. text segment). -message SequentialSegment { - // Start position (inclusive). - int32 start = 1; - - // End position (exclusive). - int32 end = 2; -} - -// A time period inside of an example that has a time dimension (e.g. video). -message TimeSegment { - // Start of the time segment (inclusive), represented as the duration since - // the example start. - google.protobuf.Duration start_time_offset = 1; - - // End of the time segment (exclusive), represented as the duration since the - // example start. - google.protobuf.Duration end_time_offset = 2; -} - -// Video classification annotation. -message VideoClassificationAnnotation { - // The time segment of the video to which the annotation applies. - TimeSegment time_segment = 1; - - // Label of the segment specified by time_segment. - AnnotationSpec annotation_spec = 2; -} - -// Video frame level annotation for object detection and tracking. -message ObjectTrackingFrame { - // The bounding box location of this object track for the frame. - oneof bounded_area { - BoundingPoly bounding_poly = 1; - - NormalizedBoundingPoly normalized_bounding_poly = 2; - } - - // The time offset of this frame relative to the beginning of the video. - google.protobuf.Duration time_offset = 3; -} - -// Video object tracking annotation. -message VideoObjectTrackingAnnotation { - // Label of the object tracked in this annotation. - AnnotationSpec annotation_spec = 1; - - // The time segment of the video to which object tracking applies. - TimeSegment time_segment = 2; - - // The list of frames where this object track appears. - repeated ObjectTrackingFrame object_tracking_frames = 3; -} - -// Video event annotation. -message VideoEventAnnotation { - // Label of the event in this annotation. - AnnotationSpec annotation_spec = 1; - - // The time segment of the video to which the annotation applies. - TimeSegment time_segment = 2; -} - -// Additional information associated with the annotation. -message AnnotationMetadata { - // Metadata related to human labeling. - OperatorMetadata operator_metadata = 2; -} - -// General information useful for labels coming from contributors. -message OperatorMetadata { - // Confidence score corresponding to a label. For examle, if 3 contributors - // have answered the question and 2 of them agree on the final label, the - // confidence score will be 0.67 (2/3). - float score = 1; - - // The total number of contributors that answer this question. - int32 total_votes = 2; - - // The total number of contributors that choose this label. - int32 label_votes = 3; - - // Comments from contributors. - repeated string comments = 4; -} diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_pb2.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_pb2.py deleted file mode 100644 index 5ba2d891f96f..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_pb2.py +++ /dev/null @@ -1,2497 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/datalabeling_v1beta1/proto/annotation.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.datalabeling_v1beta1.proto import ( - annotation_spec_set_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2, -) -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/datalabeling_v1beta1/proto/annotation.proto", - package="google.cloud.datalabeling.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n%com.google.cloud.datalabeling.v1beta1P\001ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling" - ), - serialized_pb=_b( - '\n8google/cloud/datalabeling_v1beta1/proto/annotation.proto\x12!google.cloud.datalabeling.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x19google/api/resource.proto\x1a\x41google/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto\x1a\x1egoogle/protobuf/duration.proto"\xe2\x02\n\nAnnotation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12N\n\x11\x61nnotation_source\x18\x02 \x01(\x0e\x32\x33.google.cloud.datalabeling.v1beta1.AnnotationSource\x12L\n\x10\x61nnotation_value\x18\x03 \x01(\x0b\x32\x32.google.cloud.datalabeling.v1beta1.AnnotationValue\x12R\n\x13\x61nnotation_metadata\x18\x04 \x01(\x0b\x32\x35.google.cloud.datalabeling.v1beta1.AnnotationMetadata\x12T\n\x14\x61nnotation_sentiment\x18\x06 \x01(\x0e\x32\x36.google.cloud.datalabeling.v1beta1.AnnotationSentiment"\xd1\x07\n\x0f\x41nnotationValue\x12k\n\x1fimage_classification_annotation\x18\x01 \x01(\x0b\x32@.google.cloud.datalabeling.v1beta1.ImageClassificationAnnotationH\x00\x12h\n\x1eimage_bounding_poly_annotation\x18\x02 \x01(\x0b\x32>.google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotationH\x00\x12_\n\x19image_polyline_annotation\x18\x08 \x01(\x0b\x32:.google.cloud.datalabeling.v1beta1.ImagePolylineAnnotationH\x00\x12g\n\x1dimage_segmentation_annotation\x18\t \x01(\x0b\x32>.google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotationH\x00\x12i\n\x1etext_classification_annotation\x18\x03 \x01(\x0b\x32?.google.cloud.datalabeling.v1beta1.TextClassificationAnnotationH\x00\x12n\n!text_entity_extraction_annotation\x18\n \x01(\x0b\x32\x41.google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotationH\x00\x12k\n\x1fvideo_classification_annotation\x18\x04 \x01(\x0b\x32@.google.cloud.datalabeling.v1beta1.VideoClassificationAnnotationH\x00\x12l\n video_object_tracking_annotation\x18\x05 \x01(\x0b\x32@.google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotationH\x00\x12Y\n\x16video_event_annotation\x18\x06 \x01(\x0b\x32\x37.google.cloud.datalabeling.v1beta1.VideoEventAnnotationH\x00\x42\x0c\n\nvalue_type"k\n\x1dImageClassificationAnnotation\x12J\n\x0f\x61nnotation_spec\x18\x01 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpec"\x1e\n\x06Vertex\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02"K\n\x0c\x42oundingPoly\x12;\n\x08vertices\x18\x01 \x03(\x0b\x32).google.cloud.datalabeling.v1beta1.Vertex"j\n\x16NormalizedBoundingPoly\x12P\n\x13normalized_vertices\x18\x01 \x03(\x0b\x32\x33.google.cloud.datalabeling.v1beta1.NormalizedVertex"\xa2\x02\n\x1bImageBoundingPolyAnnotation\x12H\n\rbounding_poly\x18\x02 \x01(\x0b\x32/.google.cloud.datalabeling.v1beta1.BoundingPolyH\x00\x12]\n\x18normalized_bounding_poly\x18\x03 \x01(\x0b\x32\x39.google.cloud.datalabeling.v1beta1.NormalizedBoundingPolyH\x00\x12J\n\x0f\x61nnotation_spec\x18\x01 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpecB\x0e\n\x0c\x62ounded_area"G\n\x08Polyline\x12;\n\x08vertices\x18\x01 \x03(\x0b\x32).google.cloud.datalabeling.v1beta1.Vertex"f\n\x12NormalizedPolyline\x12P\n\x13normalized_vertices\x18\x01 \x03(\x0b\x32\x33.google.cloud.datalabeling.v1beta1.NormalizedVertex"\x84\x02\n\x17ImagePolylineAnnotation\x12?\n\x08polyline\x18\x02 \x01(\x0b\x32+.google.cloud.datalabeling.v1beta1.PolylineH\x00\x12T\n\x13normalized_polyline\x18\x03 \x01(\x0b\x32\x35.google.cloud.datalabeling.v1beta1.NormalizedPolylineH\x00\x12J\n\x0f\x61nnotation_spec\x18\x01 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpecB\x06\n\x04poly"\xa2\x02\n\x1bImageSegmentationAnnotation\x12o\n\x11\x61nnotation_colors\x18\x01 \x03(\x0b\x32T.google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.AnnotationColorsEntry\x12\x11\n\tmime_type\x18\x02 \x01(\t\x12\x13\n\x0bimage_bytes\x18\x03 \x01(\x0c\x1aj\n\x15\x41nnotationColorsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12@\n\x05value\x18\x02 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpec:\x02\x38\x01"j\n\x1cTextClassificationAnnotation\x12J\n\x0f\x61nnotation_spec\x18\x01 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpec"\xbe\x01\n\x1eTextEntityExtractionAnnotation\x12J\n\x0f\x61nnotation_spec\x18\x01 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpec\x12P\n\x12sequential_segment\x18\x02 \x01(\x0b\x32\x34.google.cloud.datalabeling.v1beta1.SequentialSegment"/\n\x11SequentialSegment\x12\r\n\x05start\x18\x01 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x05"w\n\x0bTimeSegment\x12\x34\n\x11start_time_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x32\n\x0f\x65nd_time_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"\xb1\x01\n\x1dVideoClassificationAnnotation\x12\x44\n\x0ctime_segment\x18\x01 \x01(\x0b\x32..google.cloud.datalabeling.v1beta1.TimeSegment\x12J\n\x0f\x61nnotation_spec\x18\x02 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpec"\xfe\x01\n\x13ObjectTrackingFrame\x12H\n\rbounding_poly\x18\x01 \x01(\x0b\x32/.google.cloud.datalabeling.v1beta1.BoundingPolyH\x00\x12]\n\x18normalized_bounding_poly\x18\x02 \x01(\x0b\x32\x39.google.cloud.datalabeling.v1beta1.NormalizedBoundingPolyH\x00\x12.\n\x0btime_offset\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\n\x0c\x62ounded_area"\x89\x02\n\x1dVideoObjectTrackingAnnotation\x12J\n\x0f\x61nnotation_spec\x18\x01 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpec\x12\x44\n\x0ctime_segment\x18\x02 \x01(\x0b\x32..google.cloud.datalabeling.v1beta1.TimeSegment\x12V\n\x16object_tracking_frames\x18\x03 \x03(\x0b\x32\x36.google.cloud.datalabeling.v1beta1.ObjectTrackingFrame"\xa8\x01\n\x14VideoEventAnnotation\x12J\n\x0f\x61nnotation_spec\x18\x01 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpec\x12\x44\n\x0ctime_segment\x18\x02 \x01(\x0b\x32..google.cloud.datalabeling.v1beta1.TimeSegment"d\n\x12\x41nnotationMetadata\x12N\n\x11operator_metadata\x18\x02 \x01(\x0b\x32\x33.google.cloud.datalabeling.v1beta1.OperatorMetadata"]\n\x10OperatorMetadata\x12\r\n\x05score\x18\x01 \x01(\x02\x12\x13\n\x0btotal_votes\x18\x02 \x01(\x05\x12\x13\n\x0blabel_votes\x18\x03 \x01(\x05\x12\x10\n\x08\x63omments\x18\x04 \x03(\t*C\n\x10\x41nnotationSource\x12!\n\x1d\x41NNOTATION_SOURCE_UNSPECIFIED\x10\x00\x12\x0c\n\x08OPERATOR\x10\x03*W\n\x13\x41nnotationSentiment\x12$\n ANNOTATION_SENTIMENT_UNSPECIFIED\x10\x00\x12\x0c\n\x08NEGATIVE\x10\x01\x12\x0c\n\x08POSITIVE\x10\x02*\x91\x04\n\x0e\x41nnotationType\x12\x1f\n\x1b\x41NNOTATION_TYPE_UNSPECIFIED\x10\x00\x12#\n\x1fIMAGE_CLASSIFICATION_ANNOTATION\x10\x01\x12!\n\x1dIMAGE_BOUNDING_BOX_ANNOTATION\x10\x02\x12*\n&IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION\x10\r\x12"\n\x1eIMAGE_BOUNDING_POLY_ANNOTATION\x10\n\x12\x1d\n\x19IMAGE_POLYLINE_ANNOTATION\x10\x0b\x12!\n\x1dIMAGE_SEGMENTATION_ANNOTATION\x10\x0c\x12)\n%VIDEO_SHOTS_CLASSIFICATION_ANNOTATION\x10\x03\x12$\n VIDEO_OBJECT_TRACKING_ANNOTATION\x10\x04\x12%\n!VIDEO_OBJECT_DETECTION_ANNOTATION\x10\x05\x12\x1a\n\x16VIDEO_EVENT_ANNOTATION\x10\x06\x12"\n\x1eTEXT_CLASSIFICATION_ANNOTATION\x10\x08\x12%\n!TEXT_ENTITY_EXTRACTION_ANNOTATION\x10\t\x12%\n!GENERAL_CLASSIFICATION_ANNOTATION\x10\x0e\x42x\n%com.google.cloud.datalabeling.v1beta1P\x01ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabelingb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2.DESCRIPTOR, - google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, - ], -) - -_ANNOTATIONSOURCE = _descriptor.EnumDescriptor( - name="AnnotationSource", - full_name="google.cloud.datalabeling.v1beta1.AnnotationSource", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="ANNOTATION_SOURCE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="OPERATOR", index=1, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4526, - serialized_end=4593, -) -_sym_db.RegisterEnumDescriptor(_ANNOTATIONSOURCE) - -AnnotationSource = enum_type_wrapper.EnumTypeWrapper(_ANNOTATIONSOURCE) -_ANNOTATIONSENTIMENT = _descriptor.EnumDescriptor( - name="AnnotationSentiment", - full_name="google.cloud.datalabeling.v1beta1.AnnotationSentiment", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="ANNOTATION_SENTIMENT_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NEGATIVE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="POSITIVE", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4595, - serialized_end=4682, -) -_sym_db.RegisterEnumDescriptor(_ANNOTATIONSENTIMENT) - -AnnotationSentiment = enum_type_wrapper.EnumTypeWrapper(_ANNOTATIONSENTIMENT) -_ANNOTATIONTYPE = _descriptor.EnumDescriptor( - name="AnnotationType", - full_name="google.cloud.datalabeling.v1beta1.AnnotationType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="ANNOTATION_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="IMAGE_CLASSIFICATION_ANNOTATION", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="IMAGE_BOUNDING_BOX_ANNOTATION", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION", - index=3, - number=13, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="IMAGE_BOUNDING_POLY_ANNOTATION", - index=4, - number=10, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="IMAGE_POLYLINE_ANNOTATION", - index=5, - number=11, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="IMAGE_SEGMENTATION_ANNOTATION", - index=6, - number=12, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="VIDEO_SHOTS_CLASSIFICATION_ANNOTATION", - index=7, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="VIDEO_OBJECT_TRACKING_ANNOTATION", - index=8, - number=4, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="VIDEO_OBJECT_DETECTION_ANNOTATION", - index=9, - number=5, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="VIDEO_EVENT_ANNOTATION", - index=10, - number=6, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TEXT_CLASSIFICATION_ANNOTATION", - index=11, - number=8, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TEXT_ENTITY_EXTRACTION_ANNOTATION", - index=12, - number=9, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="GENERAL_CLASSIFICATION_ANNOTATION", - index=13, - number=14, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4685, - serialized_end=5214, -) -_sym_db.RegisterEnumDescriptor(_ANNOTATIONTYPE) - -AnnotationType = enum_type_wrapper.EnumTypeWrapper(_ANNOTATIONTYPE) -ANNOTATION_SOURCE_UNSPECIFIED = 0 -OPERATOR = 3 -ANNOTATION_SENTIMENT_UNSPECIFIED = 0 -NEGATIVE = 1 -POSITIVE = 2 -ANNOTATION_TYPE_UNSPECIFIED = 0 -IMAGE_CLASSIFICATION_ANNOTATION = 1 -IMAGE_BOUNDING_BOX_ANNOTATION = 2 -IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION = 13 -IMAGE_BOUNDING_POLY_ANNOTATION = 10 -IMAGE_POLYLINE_ANNOTATION = 11 -IMAGE_SEGMENTATION_ANNOTATION = 12 -VIDEO_SHOTS_CLASSIFICATION_ANNOTATION = 3 -VIDEO_OBJECT_TRACKING_ANNOTATION = 4 -VIDEO_OBJECT_DETECTION_ANNOTATION = 5 -VIDEO_EVENT_ANNOTATION = 6 -TEXT_CLASSIFICATION_ANNOTATION = 8 -TEXT_ENTITY_EXTRACTION_ANNOTATION = 9 -GENERAL_CLASSIFICATION_ANNOTATION = 14 - - -_ANNOTATION = _descriptor.Descriptor( - name="Annotation", - full_name="google.cloud.datalabeling.v1beta1.Annotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.Annotation.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_source", - full_name="google.cloud.datalabeling.v1beta1.Annotation.annotation_source", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_value", - full_name="google.cloud.datalabeling.v1beta1.Annotation.annotation_value", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_metadata", - full_name="google.cloud.datalabeling.v1beta1.Annotation.annotation_metadata", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_sentiment", - full_name="google.cloud.datalabeling.v1beta1.Annotation.annotation_sentiment", - index=4, - number=6, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=252, - serialized_end=606, -) - - -_ANNOTATIONVALUE = _descriptor.Descriptor( - name="AnnotationValue", - full_name="google.cloud.datalabeling.v1beta1.AnnotationValue", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="image_classification_annotation", - full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.image_classification_annotation", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_bounding_poly_annotation", - full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.image_bounding_poly_annotation", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_polyline_annotation", - full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.image_polyline_annotation", - index=2, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_segmentation_annotation", - full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.image_segmentation_annotation", - index=3, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_classification_annotation", - full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.text_classification_annotation", - index=4, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_entity_extraction_annotation", - full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.text_entity_extraction_annotation", - index=5, - number=10, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_classification_annotation", - full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.video_classification_annotation", - index=6, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_object_tracking_annotation", - full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.video_object_tracking_annotation", - index=7, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_event_annotation", - full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.video_event_annotation", - index=8, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="value_type", - full_name="google.cloud.datalabeling.v1beta1.AnnotationValue.value_type", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=609, - serialized_end=1586, -) - - -_IMAGECLASSIFICATIONANNOTATION = _descriptor.Descriptor( - name="ImageClassificationAnnotation", - full_name="google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec", - full_name="google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation.annotation_spec", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1588, - serialized_end=1695, -) - - -_VERTEX = _descriptor.Descriptor( - name="Vertex", - full_name="google.cloud.datalabeling.v1beta1.Vertex", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.datalabeling.v1beta1.Vertex.x", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.datalabeling.v1beta1.Vertex.y", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1697, - serialized_end=1727, -) - - -_NORMALIZEDVERTEX = _descriptor.Descriptor( - name="NormalizedVertex", - full_name="google.cloud.datalabeling.v1beta1.NormalizedVertex", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.datalabeling.v1beta1.NormalizedVertex.x", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.datalabeling.v1beta1.NormalizedVertex.y", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1729, - serialized_end=1769, -) - - -_BOUNDINGPOLY = _descriptor.Descriptor( - name="BoundingPoly", - full_name="google.cloud.datalabeling.v1beta1.BoundingPoly", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="vertices", - full_name="google.cloud.datalabeling.v1beta1.BoundingPoly.vertices", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1771, - serialized_end=1846, -) - - -_NORMALIZEDBOUNDINGPOLY = _descriptor.Descriptor( - name="NormalizedBoundingPoly", - full_name="google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="normalized_vertices", - full_name="google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly.normalized_vertices", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1848, - serialized_end=1954, -) - - -_IMAGEBOUNDINGPOLYANNOTATION = _descriptor.Descriptor( - name="ImageBoundingPolyAnnotation", - full_name="google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.bounding_poly", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="normalized_bounding_poly", - full_name="google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.normalized_bounding_poly", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_spec", - full_name="google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.annotation_spec", - index=2, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="bounded_area", - full_name="google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation.bounded_area", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1957, - serialized_end=2247, -) - - -_POLYLINE = _descriptor.Descriptor( - name="Polyline", - full_name="google.cloud.datalabeling.v1beta1.Polyline", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="vertices", - full_name="google.cloud.datalabeling.v1beta1.Polyline.vertices", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2249, - serialized_end=2320, -) - - -_NORMALIZEDPOLYLINE = _descriptor.Descriptor( - name="NormalizedPolyline", - full_name="google.cloud.datalabeling.v1beta1.NormalizedPolyline", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="normalized_vertices", - full_name="google.cloud.datalabeling.v1beta1.NormalizedPolyline.normalized_vertices", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2322, - serialized_end=2424, -) - - -_IMAGEPOLYLINEANNOTATION = _descriptor.Descriptor( - name="ImagePolylineAnnotation", - full_name="google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="polyline", - full_name="google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.polyline", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="normalized_polyline", - full_name="google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.normalized_polyline", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_spec", - full_name="google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.annotation_spec", - index=2, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="poly", - full_name="google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation.poly", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=2427, - serialized_end=2687, -) - - -_IMAGESEGMENTATIONANNOTATION_ANNOTATIONCOLORSENTRY = _descriptor.Descriptor( - name="AnnotationColorsEntry", - full_name="google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.AnnotationColorsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.AnnotationColorsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.AnnotationColorsEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2874, - serialized_end=2980, -) - -_IMAGESEGMENTATIONANNOTATION = _descriptor.Descriptor( - name="ImageSegmentationAnnotation", - full_name="google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_colors", - full_name="google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.annotation_colors", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.mime_type", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_bytes", - full_name="google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.image_bytes", - index=2, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_IMAGESEGMENTATIONANNOTATION_ANNOTATIONCOLORSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2690, - serialized_end=2980, -) - - -_TEXTCLASSIFICATIONANNOTATION = _descriptor.Descriptor( - name="TextClassificationAnnotation", - full_name="google.cloud.datalabeling.v1beta1.TextClassificationAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec", - full_name="google.cloud.datalabeling.v1beta1.TextClassificationAnnotation.annotation_spec", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2982, - serialized_end=3088, -) - - -_TEXTENTITYEXTRACTIONANNOTATION = _descriptor.Descriptor( - name="TextEntityExtractionAnnotation", - full_name="google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec", - full_name="google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation.annotation_spec", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="sequential_segment", - full_name="google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation.sequential_segment", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3091, - serialized_end=3281, -) - - -_SEQUENTIALSEGMENT = _descriptor.Descriptor( - name="SequentialSegment", - full_name="google.cloud.datalabeling.v1beta1.SequentialSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start", - full_name="google.cloud.datalabeling.v1beta1.SequentialSegment.start", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end", - full_name="google.cloud.datalabeling.v1beta1.SequentialSegment.end", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3283, - serialized_end=3330, -) - - -_TIMESEGMENT = _descriptor.Descriptor( - name="TimeSegment", - full_name="google.cloud.datalabeling.v1beta1.TimeSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_time_offset", - full_name="google.cloud.datalabeling.v1beta1.TimeSegment.start_time_offset", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time_offset", - full_name="google.cloud.datalabeling.v1beta1.TimeSegment.end_time_offset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3332, - serialized_end=3451, -) - - -_VIDEOCLASSIFICATIONANNOTATION = _descriptor.Descriptor( - name="VideoClassificationAnnotation", - full_name="google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="time_segment", - full_name="google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation.time_segment", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_spec", - full_name="google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation.annotation_spec", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3454, - serialized_end=3631, -) - - -_OBJECTTRACKINGFRAME = _descriptor.Descriptor( - name="ObjectTrackingFrame", - full_name="google.cloud.datalabeling.v1beta1.ObjectTrackingFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.datalabeling.v1beta1.ObjectTrackingFrame.bounding_poly", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="normalized_bounding_poly", - full_name="google.cloud.datalabeling.v1beta1.ObjectTrackingFrame.normalized_bounding_poly", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.datalabeling.v1beta1.ObjectTrackingFrame.time_offset", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="bounded_area", - full_name="google.cloud.datalabeling.v1beta1.ObjectTrackingFrame.bounded_area", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=3634, - serialized_end=3888, -) - - -_VIDEOOBJECTTRACKINGANNOTATION = _descriptor.Descriptor( - name="VideoObjectTrackingAnnotation", - full_name="google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec", - full_name="google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation.annotation_spec", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_segment", - full_name="google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation.time_segment", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="object_tracking_frames", - full_name="google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation.object_tracking_frames", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3891, - serialized_end=4156, -) - - -_VIDEOEVENTANNOTATION = _descriptor.Descriptor( - name="VideoEventAnnotation", - full_name="google.cloud.datalabeling.v1beta1.VideoEventAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec", - full_name="google.cloud.datalabeling.v1beta1.VideoEventAnnotation.annotation_spec", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_segment", - full_name="google.cloud.datalabeling.v1beta1.VideoEventAnnotation.time_segment", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4159, - serialized_end=4327, -) - - -_ANNOTATIONMETADATA = _descriptor.Descriptor( - name="AnnotationMetadata", - full_name="google.cloud.datalabeling.v1beta1.AnnotationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="operator_metadata", - full_name="google.cloud.datalabeling.v1beta1.AnnotationMetadata.operator_metadata", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4329, - serialized_end=4429, -) - - -_OPERATORMETADATA = _descriptor.Descriptor( - name="OperatorMetadata", - full_name="google.cloud.datalabeling.v1beta1.OperatorMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.datalabeling.v1beta1.OperatorMetadata.score", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="total_votes", - full_name="google.cloud.datalabeling.v1beta1.OperatorMetadata.total_votes", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="label_votes", - full_name="google.cloud.datalabeling.v1beta1.OperatorMetadata.label_votes", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="comments", - full_name="google.cloud.datalabeling.v1beta1.OperatorMetadata.comments", - index=3, - number=4, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4431, - serialized_end=4524, -) - -_ANNOTATION.fields_by_name["annotation_source"].enum_type = _ANNOTATIONSOURCE -_ANNOTATION.fields_by_name["annotation_value"].message_type = _ANNOTATIONVALUE -_ANNOTATION.fields_by_name["annotation_metadata"].message_type = _ANNOTATIONMETADATA -_ANNOTATION.fields_by_name["annotation_sentiment"].enum_type = _ANNOTATIONSENTIMENT -_ANNOTATIONVALUE.fields_by_name[ - "image_classification_annotation" -].message_type = _IMAGECLASSIFICATIONANNOTATION -_ANNOTATIONVALUE.fields_by_name[ - "image_bounding_poly_annotation" -].message_type = _IMAGEBOUNDINGPOLYANNOTATION -_ANNOTATIONVALUE.fields_by_name[ - "image_polyline_annotation" -].message_type = _IMAGEPOLYLINEANNOTATION -_ANNOTATIONVALUE.fields_by_name[ - "image_segmentation_annotation" -].message_type = _IMAGESEGMENTATIONANNOTATION -_ANNOTATIONVALUE.fields_by_name[ - "text_classification_annotation" -].message_type = _TEXTCLASSIFICATIONANNOTATION -_ANNOTATIONVALUE.fields_by_name[ - "text_entity_extraction_annotation" -].message_type = _TEXTENTITYEXTRACTIONANNOTATION -_ANNOTATIONVALUE.fields_by_name[ - "video_classification_annotation" -].message_type = _VIDEOCLASSIFICATIONANNOTATION -_ANNOTATIONVALUE.fields_by_name[ - "video_object_tracking_annotation" -].message_type = _VIDEOOBJECTTRACKINGANNOTATION -_ANNOTATIONVALUE.fields_by_name[ - "video_event_annotation" -].message_type = _VIDEOEVENTANNOTATION -_ANNOTATIONVALUE.oneofs_by_name["value_type"].fields.append( - _ANNOTATIONVALUE.fields_by_name["image_classification_annotation"] -) -_ANNOTATIONVALUE.fields_by_name[ - "image_classification_annotation" -].containing_oneof = _ANNOTATIONVALUE.oneofs_by_name["value_type"] -_ANNOTATIONVALUE.oneofs_by_name["value_type"].fields.append( - _ANNOTATIONVALUE.fields_by_name["image_bounding_poly_annotation"] -) -_ANNOTATIONVALUE.fields_by_name[ - "image_bounding_poly_annotation" -].containing_oneof = _ANNOTATIONVALUE.oneofs_by_name["value_type"] -_ANNOTATIONVALUE.oneofs_by_name["value_type"].fields.append( - _ANNOTATIONVALUE.fields_by_name["image_polyline_annotation"] -) -_ANNOTATIONVALUE.fields_by_name[ - "image_polyline_annotation" -].containing_oneof = _ANNOTATIONVALUE.oneofs_by_name["value_type"] -_ANNOTATIONVALUE.oneofs_by_name["value_type"].fields.append( - _ANNOTATIONVALUE.fields_by_name["image_segmentation_annotation"] -) -_ANNOTATIONVALUE.fields_by_name[ - "image_segmentation_annotation" -].containing_oneof = _ANNOTATIONVALUE.oneofs_by_name["value_type"] -_ANNOTATIONVALUE.oneofs_by_name["value_type"].fields.append( - _ANNOTATIONVALUE.fields_by_name["text_classification_annotation"] -) -_ANNOTATIONVALUE.fields_by_name[ - "text_classification_annotation" -].containing_oneof = _ANNOTATIONVALUE.oneofs_by_name["value_type"] -_ANNOTATIONVALUE.oneofs_by_name["value_type"].fields.append( - _ANNOTATIONVALUE.fields_by_name["text_entity_extraction_annotation"] -) -_ANNOTATIONVALUE.fields_by_name[ - "text_entity_extraction_annotation" -].containing_oneof = _ANNOTATIONVALUE.oneofs_by_name["value_type"] -_ANNOTATIONVALUE.oneofs_by_name["value_type"].fields.append( - _ANNOTATIONVALUE.fields_by_name["video_classification_annotation"] -) -_ANNOTATIONVALUE.fields_by_name[ - "video_classification_annotation" -].containing_oneof = _ANNOTATIONVALUE.oneofs_by_name["value_type"] -_ANNOTATIONVALUE.oneofs_by_name["value_type"].fields.append( - _ANNOTATIONVALUE.fields_by_name["video_object_tracking_annotation"] -) -_ANNOTATIONVALUE.fields_by_name[ - "video_object_tracking_annotation" -].containing_oneof = _ANNOTATIONVALUE.oneofs_by_name["value_type"] -_ANNOTATIONVALUE.oneofs_by_name["value_type"].fields.append( - _ANNOTATIONVALUE.fields_by_name["video_event_annotation"] -) -_ANNOTATIONVALUE.fields_by_name[ - "video_event_annotation" -].containing_oneof = _ANNOTATIONVALUE.oneofs_by_name["value_type"] -_IMAGECLASSIFICATIONANNOTATION.fields_by_name[ - "annotation_spec" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC -) -_BOUNDINGPOLY.fields_by_name["vertices"].message_type = _VERTEX -_NORMALIZEDBOUNDINGPOLY.fields_by_name[ - "normalized_vertices" -].message_type = _NORMALIZEDVERTEX -_IMAGEBOUNDINGPOLYANNOTATION.fields_by_name[ - "bounding_poly" -].message_type = _BOUNDINGPOLY -_IMAGEBOUNDINGPOLYANNOTATION.fields_by_name[ - "normalized_bounding_poly" -].message_type = _NORMALIZEDBOUNDINGPOLY -_IMAGEBOUNDINGPOLYANNOTATION.fields_by_name[ - "annotation_spec" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC -) -_IMAGEBOUNDINGPOLYANNOTATION.oneofs_by_name["bounded_area"].fields.append( - _IMAGEBOUNDINGPOLYANNOTATION.fields_by_name["bounding_poly"] -) -_IMAGEBOUNDINGPOLYANNOTATION.fields_by_name[ - "bounding_poly" -].containing_oneof = _IMAGEBOUNDINGPOLYANNOTATION.oneofs_by_name["bounded_area"] -_IMAGEBOUNDINGPOLYANNOTATION.oneofs_by_name["bounded_area"].fields.append( - _IMAGEBOUNDINGPOLYANNOTATION.fields_by_name["normalized_bounding_poly"] -) -_IMAGEBOUNDINGPOLYANNOTATION.fields_by_name[ - "normalized_bounding_poly" -].containing_oneof = _IMAGEBOUNDINGPOLYANNOTATION.oneofs_by_name["bounded_area"] -_POLYLINE.fields_by_name["vertices"].message_type = _VERTEX -_NORMALIZEDPOLYLINE.fields_by_name[ - "normalized_vertices" -].message_type = _NORMALIZEDVERTEX -_IMAGEPOLYLINEANNOTATION.fields_by_name["polyline"].message_type = _POLYLINE -_IMAGEPOLYLINEANNOTATION.fields_by_name[ - "normalized_polyline" -].message_type = _NORMALIZEDPOLYLINE -_IMAGEPOLYLINEANNOTATION.fields_by_name[ - "annotation_spec" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC -) -_IMAGEPOLYLINEANNOTATION.oneofs_by_name["poly"].fields.append( - _IMAGEPOLYLINEANNOTATION.fields_by_name["polyline"] -) -_IMAGEPOLYLINEANNOTATION.fields_by_name[ - "polyline" -].containing_oneof = _IMAGEPOLYLINEANNOTATION.oneofs_by_name["poly"] -_IMAGEPOLYLINEANNOTATION.oneofs_by_name["poly"].fields.append( - _IMAGEPOLYLINEANNOTATION.fields_by_name["normalized_polyline"] -) -_IMAGEPOLYLINEANNOTATION.fields_by_name[ - "normalized_polyline" -].containing_oneof = _IMAGEPOLYLINEANNOTATION.oneofs_by_name["poly"] -_IMAGESEGMENTATIONANNOTATION_ANNOTATIONCOLORSENTRY.fields_by_name[ - "value" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC -) -_IMAGESEGMENTATIONANNOTATION_ANNOTATIONCOLORSENTRY.containing_type = ( - _IMAGESEGMENTATIONANNOTATION -) -_IMAGESEGMENTATIONANNOTATION.fields_by_name[ - "annotation_colors" -].message_type = _IMAGESEGMENTATIONANNOTATION_ANNOTATIONCOLORSENTRY -_TEXTCLASSIFICATIONANNOTATION.fields_by_name[ - "annotation_spec" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC -) -_TEXTENTITYEXTRACTIONANNOTATION.fields_by_name[ - "annotation_spec" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC -) -_TEXTENTITYEXTRACTIONANNOTATION.fields_by_name[ - "sequential_segment" -].message_type = _SEQUENTIALSEGMENT -_TIMESEGMENT.fields_by_name[ - "start_time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_TIMESEGMENT.fields_by_name[ - "end_time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_VIDEOCLASSIFICATIONANNOTATION.fields_by_name[ - "time_segment" -].message_type = _TIMESEGMENT -_VIDEOCLASSIFICATIONANNOTATION.fields_by_name[ - "annotation_spec" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC -) -_OBJECTTRACKINGFRAME.fields_by_name["bounding_poly"].message_type = _BOUNDINGPOLY -_OBJECTTRACKINGFRAME.fields_by_name[ - "normalized_bounding_poly" -].message_type = _NORMALIZEDBOUNDINGPOLY -_OBJECTTRACKINGFRAME.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_OBJECTTRACKINGFRAME.oneofs_by_name["bounded_area"].fields.append( - _OBJECTTRACKINGFRAME.fields_by_name["bounding_poly"] -) -_OBJECTTRACKINGFRAME.fields_by_name[ - "bounding_poly" -].containing_oneof = _OBJECTTRACKINGFRAME.oneofs_by_name["bounded_area"] -_OBJECTTRACKINGFRAME.oneofs_by_name["bounded_area"].fields.append( - _OBJECTTRACKINGFRAME.fields_by_name["normalized_bounding_poly"] -) -_OBJECTTRACKINGFRAME.fields_by_name[ - "normalized_bounding_poly" -].containing_oneof = _OBJECTTRACKINGFRAME.oneofs_by_name["bounded_area"] -_VIDEOOBJECTTRACKINGANNOTATION.fields_by_name[ - "annotation_spec" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC -) -_VIDEOOBJECTTRACKINGANNOTATION.fields_by_name[ - "time_segment" -].message_type = _TIMESEGMENT -_VIDEOOBJECTTRACKINGANNOTATION.fields_by_name[ - "object_tracking_frames" -].message_type = _OBJECTTRACKINGFRAME -_VIDEOEVENTANNOTATION.fields_by_name[ - "annotation_spec" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC -) -_VIDEOEVENTANNOTATION.fields_by_name["time_segment"].message_type = _TIMESEGMENT -_ANNOTATIONMETADATA.fields_by_name["operator_metadata"].message_type = _OPERATORMETADATA -DESCRIPTOR.message_types_by_name["Annotation"] = _ANNOTATION -DESCRIPTOR.message_types_by_name["AnnotationValue"] = _ANNOTATIONVALUE -DESCRIPTOR.message_types_by_name[ - "ImageClassificationAnnotation" -] = _IMAGECLASSIFICATIONANNOTATION -DESCRIPTOR.message_types_by_name["Vertex"] = _VERTEX -DESCRIPTOR.message_types_by_name["NormalizedVertex"] = _NORMALIZEDVERTEX -DESCRIPTOR.message_types_by_name["BoundingPoly"] = _BOUNDINGPOLY -DESCRIPTOR.message_types_by_name["NormalizedBoundingPoly"] = _NORMALIZEDBOUNDINGPOLY -DESCRIPTOR.message_types_by_name[ - "ImageBoundingPolyAnnotation" -] = _IMAGEBOUNDINGPOLYANNOTATION -DESCRIPTOR.message_types_by_name["Polyline"] = _POLYLINE -DESCRIPTOR.message_types_by_name["NormalizedPolyline"] = _NORMALIZEDPOLYLINE -DESCRIPTOR.message_types_by_name["ImagePolylineAnnotation"] = _IMAGEPOLYLINEANNOTATION -DESCRIPTOR.message_types_by_name[ - "ImageSegmentationAnnotation" -] = _IMAGESEGMENTATIONANNOTATION -DESCRIPTOR.message_types_by_name[ - "TextClassificationAnnotation" -] = _TEXTCLASSIFICATIONANNOTATION -DESCRIPTOR.message_types_by_name[ - "TextEntityExtractionAnnotation" -] = _TEXTENTITYEXTRACTIONANNOTATION -DESCRIPTOR.message_types_by_name["SequentialSegment"] = _SEQUENTIALSEGMENT -DESCRIPTOR.message_types_by_name["TimeSegment"] = _TIMESEGMENT -DESCRIPTOR.message_types_by_name[ - "VideoClassificationAnnotation" -] = _VIDEOCLASSIFICATIONANNOTATION -DESCRIPTOR.message_types_by_name["ObjectTrackingFrame"] = _OBJECTTRACKINGFRAME -DESCRIPTOR.message_types_by_name[ - "VideoObjectTrackingAnnotation" -] = _VIDEOOBJECTTRACKINGANNOTATION -DESCRIPTOR.message_types_by_name["VideoEventAnnotation"] = _VIDEOEVENTANNOTATION -DESCRIPTOR.message_types_by_name["AnnotationMetadata"] = _ANNOTATIONMETADATA -DESCRIPTOR.message_types_by_name["OperatorMetadata"] = _OPERATORMETADATA -DESCRIPTOR.enum_types_by_name["AnnotationSource"] = _ANNOTATIONSOURCE -DESCRIPTOR.enum_types_by_name["AnnotationSentiment"] = _ANNOTATIONSENTIMENT -DESCRIPTOR.enum_types_by_name["AnnotationType"] = _ANNOTATIONTYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Annotation = _reflection.GeneratedProtocolMessageType( - "Annotation", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATION, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""Annotation for Example. Each example may have one or more - annotations. For example in image classification problem, each image - might have one or more labels. We call labels binded with this image an - Annotation. - - - Attributes: - name: - Output only. Unique name of this annotation, format is: proje - cts/{project\_id}/datasets/{dataset\_id}/annotatedDatasets/{an - notated\_dataset}/examples/{example\_id}/annotations/{annotati - on\_id} - annotation_source: - Output only. The source of the annotation. - annotation_value: - Output only. This is the actual annotation value, e.g - classification, bounding box values are stored here. - annotation_metadata: - Output only. Annotation metadata, including information like - votes for labels. - annotation_sentiment: - Output only. Sentiment for this annotation. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.Annotation) - ), -) -_sym_db.RegisterMessage(Annotation) - -AnnotationValue = _reflection.GeneratedProtocolMessageType( - "AnnotationValue", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATIONVALUE, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""Annotation value for an example. - - - Attributes: - image_classification_annotation: - Annotation value for image classification case. - image_bounding_poly_annotation: - Annotation value for image bounding box, oriented bounding box - and polygon cases. - image_polyline_annotation: - Annotation value for image polyline cases. Polyline here is - different from BoundingPoly. It is formed by line segments - connected to each other but not closed form(Bounding Poly). - The line segments can cross each other. - image_segmentation_annotation: - Annotation value for image segmentation. - text_classification_annotation: - Annotation value for text classification case. - text_entity_extraction_annotation: - Annotation value for text entity extraction case. - video_classification_annotation: - Annotation value for video classification case. - video_object_tracking_annotation: - Annotation value for video object detection and tracking case. - video_event_annotation: - Annotation value for video event case. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.AnnotationValue) - ), -) -_sym_db.RegisterMessage(AnnotationValue) - -ImageClassificationAnnotation = _reflection.GeneratedProtocolMessageType( - "ImageClassificationAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGECLASSIFICATIONANNOTATION, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""Image classification annotation definition. - - - Attributes: - annotation_spec: - Label of image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImageClassificationAnnotation) - ), -) -_sym_db.RegisterMessage(ImageClassificationAnnotation) - -Vertex = _reflection.GeneratedProtocolMessageType( - "Vertex", - (_message.Message,), - dict( - DESCRIPTOR=_VERTEX, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""X coordinate. - - - Attributes: - y: - Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.Vertex) - ), -) -_sym_db.RegisterMessage(Vertex) - -NormalizedVertex = _reflection.GeneratedProtocolMessageType( - "NormalizedVertex", - (_message.Message,), - dict( - DESCRIPTOR=_NORMALIZEDVERTEX, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""X coordinate. - - - Attributes: - y: - Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.NormalizedVertex) - ), -) -_sym_db.RegisterMessage(NormalizedVertex) - -BoundingPoly = _reflection.GeneratedProtocolMessageType( - "BoundingPoly", - (_message.Message,), - dict( - DESCRIPTOR=_BOUNDINGPOLY, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""A bounding polygon in the image. - - - Attributes: - vertices: - The bounding polygon vertices. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.BoundingPoly) - ), -) -_sym_db.RegisterMessage(BoundingPoly) - -NormalizedBoundingPoly = _reflection.GeneratedProtocolMessageType( - "NormalizedBoundingPoly", - (_message.Message,), - dict( - DESCRIPTOR=_NORMALIZEDBOUNDINGPOLY, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""Normalized bounding polygon. - - - Attributes: - normalized_vertices: - The bounding polygon normalized vertices. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.NormalizedBoundingPoly) - ), -) -_sym_db.RegisterMessage(NormalizedBoundingPoly) - -ImageBoundingPolyAnnotation = _reflection.GeneratedProtocolMessageType( - "ImageBoundingPolyAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGEBOUNDINGPOLYANNOTATION, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""Image bounding poly annotation. It represents a polygon - including bounding box in the image. - - - Attributes: - bounded_area: - The region of the polygon. If it is a bounding box, it is - guaranteed to be four points. - annotation_spec: - Label of object in this bounding polygon. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImageBoundingPolyAnnotation) - ), -) -_sym_db.RegisterMessage(ImageBoundingPolyAnnotation) - -Polyline = _reflection.GeneratedProtocolMessageType( - "Polyline", - (_message.Message,), - dict( - DESCRIPTOR=_POLYLINE, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""A line with multiple line segments. - - - Attributes: - vertices: - The polyline vertices. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.Polyline) - ), -) -_sym_db.RegisterMessage(Polyline) - -NormalizedPolyline = _reflection.GeneratedProtocolMessageType( - "NormalizedPolyline", - (_message.Message,), - dict( - DESCRIPTOR=_NORMALIZEDPOLYLINE, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""Normalized polyline. - - - Attributes: - normalized_vertices: - The normalized polyline vertices. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.NormalizedPolyline) - ), -) -_sym_db.RegisterMessage(NormalizedPolyline) - -ImagePolylineAnnotation = _reflection.GeneratedProtocolMessageType( - "ImagePolylineAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGEPOLYLINEANNOTATION, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""A polyline for the image annotation. - - - Attributes: - annotation_spec: - Label of this polyline. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImagePolylineAnnotation) - ), -) -_sym_db.RegisterMessage(ImagePolylineAnnotation) - -ImageSegmentationAnnotation = _reflection.GeneratedProtocolMessageType( - "ImageSegmentationAnnotation", - (_message.Message,), - dict( - AnnotationColorsEntry=_reflection.GeneratedProtocolMessageType( - "AnnotationColorsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGESEGMENTATIONANNOTATION_ANNOTATIONCOLORSENTRY, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation.AnnotationColorsEntry) - ), - ), - DESCRIPTOR=_IMAGESEGMENTATIONANNOTATION, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""Image segmentation annotation. - - - Attributes: - annotation_colors: - The mapping between rgb color and annotation spec. The key is - the rgb color represented in format of rgb(0, 0, 0). The value - is the AnnotationSpec. - mime_type: - Image format. - image_bytes: - A byte string of a full image's color map. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImageSegmentationAnnotation) - ), -) -_sym_db.RegisterMessage(ImageSegmentationAnnotation) -_sym_db.RegisterMessage(ImageSegmentationAnnotation.AnnotationColorsEntry) - -TextClassificationAnnotation = _reflection.GeneratedProtocolMessageType( - "TextClassificationAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTCLASSIFICATIONANNOTATION, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""Text classification annotation. - - - Attributes: - annotation_spec: - Label of the text. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.TextClassificationAnnotation) - ), -) -_sym_db.RegisterMessage(TextClassificationAnnotation) - -TextEntityExtractionAnnotation = _reflection.GeneratedProtocolMessageType( - "TextEntityExtractionAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTENTITYEXTRACTIONANNOTATION, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""Text entity extraction annotation. - - - Attributes: - annotation_spec: - Label of the text entities. - sequential_segment: - Position of the entity. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.TextEntityExtractionAnnotation) - ), -) -_sym_db.RegisterMessage(TextEntityExtractionAnnotation) - -SequentialSegment = _reflection.GeneratedProtocolMessageType( - "SequentialSegment", - (_message.Message,), - dict( - DESCRIPTOR=_SEQUENTIALSEGMENT, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""Start and end position in a sequence (e.g. text segment). - - - Attributes: - start: - Start position (inclusive). - end: - End position (exclusive). - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.SequentialSegment) - ), -) -_sym_db.RegisterMessage(SequentialSegment) - -TimeSegment = _reflection.GeneratedProtocolMessageType( - "TimeSegment", - (_message.Message,), - dict( - DESCRIPTOR=_TIMESEGMENT, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""A time period inside of an example that has a time - dimension (e.g. video). - - - Attributes: - start_time_offset: - Start of the time segment (inclusive), represented as the - duration since the example start. - end_time_offset: - End of the time segment (exclusive), represented as the - duration since the example start. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.TimeSegment) - ), -) -_sym_db.RegisterMessage(TimeSegment) - -VideoClassificationAnnotation = _reflection.GeneratedProtocolMessageType( - "VideoClassificationAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOCLASSIFICATIONANNOTATION, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""Video classification annotation. - - - Attributes: - time_segment: - The time segment of the video to which the annotation applies. - annotation_spec: - Label of the segment specified by time\_segment. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.VideoClassificationAnnotation) - ), -) -_sym_db.RegisterMessage(VideoClassificationAnnotation) - -ObjectTrackingFrame = _reflection.GeneratedProtocolMessageType( - "ObjectTrackingFrame", - (_message.Message,), - dict( - DESCRIPTOR=_OBJECTTRACKINGFRAME, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""Video frame level annotation for object detection and - tracking. - - - Attributes: - bounded_area: - The bounding box location of this object track for the frame. - time_offset: - The time offset of this frame relative to the beginning of the - video. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ObjectTrackingFrame) - ), -) -_sym_db.RegisterMessage(ObjectTrackingFrame) - -VideoObjectTrackingAnnotation = _reflection.GeneratedProtocolMessageType( - "VideoObjectTrackingAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOOBJECTTRACKINGANNOTATION, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""Video object tracking annotation. - - - Attributes: - annotation_spec: - Label of the object tracked in this annotation. - time_segment: - The time segment of the video to which object tracking - applies. - object_tracking_frames: - The list of frames where this object track appears. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.VideoObjectTrackingAnnotation) - ), -) -_sym_db.RegisterMessage(VideoObjectTrackingAnnotation) - -VideoEventAnnotation = _reflection.GeneratedProtocolMessageType( - "VideoEventAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOEVENTANNOTATION, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""Video event annotation. - - - Attributes: - annotation_spec: - Label of the event in this annotation. - time_segment: - The time segment of the video to which the annotation applies. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.VideoEventAnnotation) - ), -) -_sym_db.RegisterMessage(VideoEventAnnotation) - -AnnotationMetadata = _reflection.GeneratedProtocolMessageType( - "AnnotationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATIONMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""Additional information associated with the annotation. - - - Attributes: - operator_metadata: - Metadata related to human labeling. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.AnnotationMetadata) - ), -) -_sym_db.RegisterMessage(AnnotationMetadata) - -OperatorMetadata = _reflection.GeneratedProtocolMessageType( - "OperatorMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_OPERATORMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_pb2", - __doc__="""General information useful for labels coming from - contributors. - - - Attributes: - score: - Confidence score corresponding to a label. For examle, if 3 - contributors have answered the question and 2 of them agree on - the final label, the confidence score will be 0.67 (2/3). - total_votes: - The total number of contributors that answer this question. - label_votes: - The total number of contributors that choose this label. - comments: - Comments from contributors. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.OperatorMetadata) - ), -) -_sym_db.RegisterMessage(OperatorMetadata) - - -DESCRIPTOR._options = None -_IMAGESEGMENTATIONANNOTATION_ANNOTATIONCOLORSENTRY._options = None -# @@protoc_insertion_point(module_scope) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_pb2_grpc.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto b/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto deleted file mode 100644 index 71bc12a1a67c..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datalabeling.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/resource.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datalabeling.v1beta1"; - -// An AnnotationSpecSet is a collection of label definitions. For example, in -// image classification tasks, you define a set of possible labels for images as -// an AnnotationSpecSet. An AnnotationSpecSet is immutable upon creation. -message AnnotationSpecSet { - option (google.api.resource) = { - type: "datalabeling.googleapis.com/AnnotationSpecSet" - pattern: "projects/{project}/annotationSpecSets/{annotation_spec_set}" - }; - - // Output only. The AnnotationSpecSet resource name in the following format: - // - // "projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}" - string name = 1; - - // Required. The display name for AnnotationSpecSet that you define when you - // create it. Maximum of 64 characters. - string display_name = 2; - - // Optional. User-provided description of the annotation specification set. - // The description can be up to 10,000 characters long. - string description = 3; - - // Required. The array of AnnotationSpecs that you define when you create the - // AnnotationSpecSet. These are the possible labels for the labeling task. - repeated AnnotationSpec annotation_specs = 4; - - // Output only. The names of any related resources that are blocking changes - // to the annotation spec set. - repeated string blocking_resources = 5; -} - -// Container of information related to one possible annotation that can be used -// in a labeling task. For example, an image classification task where images -// are labeled as `dog` or `cat` must reference an AnnotationSpec for `dog` and -// an AnnotationSpec for `cat`. -message AnnotationSpec { - // Required. The display name of the AnnotationSpec. Maximum of 64 characters. - string display_name = 1; - - // Optional. User-provided description of the annotation specification. - // The description can be up to 10,000 characters long. - string description = 2; -} diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set_pb2.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set_pb2.py deleted file mode 100644 index 7201902009ab..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set_pb2.py +++ /dev/null @@ -1,280 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto", - package="google.cloud.datalabeling.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n%com.google.cloud.datalabeling.v1beta1P\001ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling" - ), - serialized_pb=_b( - '\nAgoogle/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto\x12!google.cloud.datalabeling.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x19google/api/resource.proto"\xa6\x02\n\x11\x41nnotationSpecSet\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12K\n\x10\x61nnotation_specs\x18\x04 \x03(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpec\x12\x1a\n\x12\x62locking_resources\x18\x05 \x03(\t:o\xea\x41l\n-datalabeling.googleapis.com/AnnotationSpecSet\x12;projects/{project}/annotationSpecSets/{annotation_spec_set}";\n\x0e\x41nnotationSpec\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\tBx\n%com.google.cloud.datalabeling.v1beta1P\x01ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabelingb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - ], -) - - -_ANNOTATIONSPECSET = _descriptor.Descriptor( - name="AnnotationSpecSet", - full_name="google.cloud.datalabeling.v1beta1.AnnotationSpecSet", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.AnnotationSpecSet.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.datalabeling.v1beta1.AnnotationSpecSet.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.datalabeling.v1beta1.AnnotationSpecSet.description", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_specs", - full_name="google.cloud.datalabeling.v1beta1.AnnotationSpecSet.annotation_specs", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="blocking_resources", - full_name="google.cloud.datalabeling.v1beta1.AnnotationSpecSet.blocking_resources", - index=4, - number=5, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b( - "\352Al\n-datalabeling.googleapis.com/AnnotationSpecSet\022;projects/{project}/annotationSpecSets/{annotation_spec_set}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=162, - serialized_end=456, -) - - -_ANNOTATIONSPEC = _descriptor.Descriptor( - name="AnnotationSpec", - full_name="google.cloud.datalabeling.v1beta1.AnnotationSpec", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.datalabeling.v1beta1.AnnotationSpec.display_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.datalabeling.v1beta1.AnnotationSpec.description", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=458, - serialized_end=517, -) - -_ANNOTATIONSPECSET.fields_by_name["annotation_specs"].message_type = _ANNOTATIONSPEC -DESCRIPTOR.message_types_by_name["AnnotationSpecSet"] = _ANNOTATIONSPECSET -DESCRIPTOR.message_types_by_name["AnnotationSpec"] = _ANNOTATIONSPEC -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -AnnotationSpecSet = _reflection.GeneratedProtocolMessageType( - "AnnotationSpecSet", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATIONSPECSET, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_spec_set_pb2", - __doc__="""An AnnotationSpecSet is a collection of label definitions. - For example, in image classification tasks, you define a set of possible - labels for images as an AnnotationSpecSet. An AnnotationSpecSet is - immutable upon creation. - - - Attributes: - name: - Output only. The AnnotationSpecSet resource name in the - following format: "projects/{project\_id}/annotationSpecSets/ - {annotation\_spec\_set\_id}" - display_name: - Required. The display name for AnnotationSpecSet that you - define when you create it. Maximum of 64 characters. - description: - Optional. User-provided description of the annotation - specification set. The description can be up to 10,000 - characters long. - annotation_specs: - Required. The array of AnnotationSpecs that you define when - you create the AnnotationSpecSet. These are the possible - labels for the labeling task. - blocking_resources: - Output only. The names of any related resources that are - blocking changes to the annotation spec set. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.AnnotationSpecSet) - ), -) -_sym_db.RegisterMessage(AnnotationSpecSet) - -AnnotationSpec = _reflection.GeneratedProtocolMessageType( - "AnnotationSpec", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATIONSPEC, - __module__="google.cloud.datalabeling_v1beta1.proto.annotation_spec_set_pb2", - __doc__="""Container of information related to one possible - annotation that can be used in a labeling task. For example, an image - classification task where images are labeled as ``dog`` or ``cat`` must - reference an AnnotationSpec for ``dog`` and an AnnotationSpec for - ``cat``. - - - Attributes: - display_name: - Required. The display name of the AnnotationSpec. Maximum of - 64 characters. - description: - Optional. User-provided description of the annotation - specification. The description can be up to 10,000 characters - long. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.AnnotationSpec) - ), -) -_sym_db.RegisterMessage(AnnotationSpec) - - -DESCRIPTOR._options = None -_ANNOTATIONSPECSET._options = None -# @@protoc_insertion_point(module_scope) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set_pb2_grpc.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/annotation_spec_set_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service.proto b/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service.proto deleted file mode 100644 index 7616bc2f7a4f..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service.proto +++ /dev/null @@ -1,1232 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datalabeling.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/datalabeling/v1beta1/annotation_spec_set.proto"; -import "google/cloud/datalabeling/v1beta1/dataset.proto"; -import "google/cloud/datalabeling/v1beta1/evaluation.proto"; -import "google/cloud/datalabeling/v1beta1/evaluation_job.proto"; -import "google/cloud/datalabeling/v1beta1/human_annotation_config.proto"; -import "google/cloud/datalabeling/v1beta1/instruction.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datalabeling.v1beta1"; - -service DataLabelingService { - option (google.api.default_host) = "datalabeling.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates dataset. If success return a Dataset resource. - rpc CreateDataset(CreateDatasetRequest) returns (Dataset) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*}/datasets" - body: "*" - }; - option (google.api.method_signature) = "parent,dataset"; - } - - // Gets dataset by resource name. - rpc GetDataset(GetDatasetRequest) returns (Dataset) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/datasets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists datasets under a project. Pagination is supported. - rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*}/datasets" - }; - option (google.api.method_signature) = "parent,filter"; - } - - // Deletes a dataset by resource name. - rpc DeleteDataset(DeleteDatasetRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/datasets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Imports data into dataset based on source locations defined in request. - // It can be called multiple times for the same dataset. Each dataset can - // only have one long running operation running on it. For example, no - // labeling task (also long running operation) can be started while - // importing is still ongoing. Vice versa. - rpc ImportData(ImportDataRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/datasets/*}:importData" - body: "*" - }; - option (google.api.method_signature) = "name,input_config"; - option (google.longrunning.operation_info) = { - response_type: "ImportDataOperationResponse" - metadata_type: "ImportDataOperationMetadata" - }; - } - - // Exports data and annotations from dataset. - rpc ExportData(ExportDataRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/datasets/*}:exportData" - body: "*" - }; - option (google.api.method_signature) = "name,annotated_dataset,filter,output_config"; - option (google.longrunning.operation_info) = { - response_type: "ExportDataOperationResponse" - metadata_type: "ExportDataOperationMetadata" - }; - } - - // Gets a data item in a dataset by resource name. This API can be - // called after data are imported into dataset. - rpc GetDataItem(GetDataItemRequest) returns (DataItem) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/datasets/*/dataItems/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists data items in a dataset. This API can be called after data - // are imported into dataset. Pagination is supported. - rpc ListDataItems(ListDataItemsRequest) returns (ListDataItemsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/datasets/*}/dataItems" - }; - option (google.api.method_signature) = "parent,filter"; - } - - // Gets an annotated dataset by resource name. - rpc GetAnnotatedDataset(GetAnnotatedDatasetRequest) returns (AnnotatedDataset) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists annotated datasets for a dataset. Pagination is supported. - rpc ListAnnotatedDatasets(ListAnnotatedDatasetsRequest) returns (ListAnnotatedDatasetsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/datasets/*}/annotatedDatasets" - }; - option (google.api.method_signature) = "parent,filter"; - } - - // Deletes an annotated dataset by resource name. - rpc DeleteAnnotatedDataset(DeleteAnnotatedDatasetRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}" - }; - } - - // Starts a labeling task for image. The type of image labeling task is - // configured by feature in the request. - rpc LabelImage(LabelImageRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/datasets/*}/image:label" - body: "*" - }; - option (google.api.method_signature) = "parent,basic_config,feature"; - option (google.longrunning.operation_info) = { - response_type: "AnnotatedDataset" - metadata_type: "LabelOperationMetadata" - }; - } - - // Starts a labeling task for video. The type of video labeling task is - // configured by feature in the request. - rpc LabelVideo(LabelVideoRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/datasets/*}/video:label" - body: "*" - }; - option (google.api.method_signature) = "parent,basic_config,feature"; - option (google.longrunning.operation_info) = { - response_type: "AnnotatedDataset" - metadata_type: "LabelOperationMetadata" - }; - } - - // Starts a labeling task for text. The type of text labeling task is - // configured by feature in the request. - rpc LabelText(LabelTextRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/datasets/*}/text:label" - body: "*" - }; - option (google.api.method_signature) = "parent,basic_config,feature"; - option (google.longrunning.operation_info) = { - response_type: "AnnotatedDataset" - metadata_type: "LabelOperationMetadata" - }; - } - - // Gets an example by resource name, including both data and annotation. - rpc GetExample(GetExampleRequest) returns (Example) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*/examples/*}" - }; - option (google.api.method_signature) = "name,filter"; - } - - // Lists examples in an annotated dataset. Pagination is supported. - rpc ListExamples(ListExamplesRequest) returns (ListExamplesResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/datasets/*/annotatedDatasets/*}/examples" - }; - option (google.api.method_signature) = "parent,filter"; - } - - // Creates an annotation spec set by providing a set of labels. - rpc CreateAnnotationSpecSet(CreateAnnotationSpecSetRequest) returns (AnnotationSpecSet) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*}/annotationSpecSets" - body: "*" - }; - option (google.api.method_signature) = "parent,annotation_spec_set"; - } - - // Gets an annotation spec set by resource name. - rpc GetAnnotationSpecSet(GetAnnotationSpecSetRequest) returns (AnnotationSpecSet) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/annotationSpecSets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists annotation spec sets for a project. Pagination is supported. - rpc ListAnnotationSpecSets(ListAnnotationSpecSetsRequest) returns (ListAnnotationSpecSetsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*}/annotationSpecSets" - }; - option (google.api.method_signature) = "parent,filter"; - } - - // Deletes an annotation spec set by resource name. - rpc DeleteAnnotationSpecSet(DeleteAnnotationSpecSetRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/annotationSpecSets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates an instruction for how data should be labeled. - rpc CreateInstruction(CreateInstructionRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*}/instructions" - body: "*" - }; - option (google.api.method_signature) = "parent,instruction"; - option (google.longrunning.operation_info) = { - response_type: "Instruction" - metadata_type: "CreateInstructionMetadata" - }; - } - - // Gets an instruction by resource name. - rpc GetInstruction(GetInstructionRequest) returns (Instruction) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/instructions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists instructions for a project. Pagination is supported. - rpc ListInstructions(ListInstructionsRequest) returns (ListInstructionsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*}/instructions" - }; - option (google.api.method_signature) = "parent,filter"; - } - - // Deletes an instruction object by resource name. - rpc DeleteInstruction(DeleteInstructionRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/instructions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Gets an evaluation by resource name (to search, use - // [projects.evaluations.search][google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations]). - rpc GetEvaluation(GetEvaluationRequest) returns (Evaluation) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/datasets/*/evaluations/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project. - rpc SearchEvaluations(SearchEvaluationsRequest) returns (SearchEvaluationsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*}/evaluations:search" - }; - option (google.api.method_signature) = "parent,filter"; - } - - // Searches example comparisons from an evaluation. The return format is a - // list of example comparisons that show ground truth and prediction(s) for - // a single input. Search by providing an evaluation ID. - rpc SearchExampleComparisons(SearchExampleComparisonsRequest) returns (SearchExampleComparisonsResponse) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/datasets/*/evaluations/*}/exampleComparisons:search" - body: "*" - }; - option (google.api.method_signature) = "parent"; - } - - // Creates an evaluation job. - rpc CreateEvaluationJob(CreateEvaluationJobRequest) returns (EvaluationJob) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*}/evaluationJobs" - body: "*" - }; - option (google.api.method_signature) = "parent,job"; - } - - // Updates an evaluation job. You can only update certain fields of the job's - // [EvaluationJobConfig][google.cloud.datalabeling.v1beta1.EvaluationJobConfig]: `humanAnnotationConfig.instruction`, - // `exampleCount`, and `exampleSamplePercentage`. - // - // If you want to change any other aspect of the evaluation job, you must - // delete the job and create a new one. - rpc UpdateEvaluationJob(UpdateEvaluationJobRequest) returns (EvaluationJob) { - option (google.api.http) = { - patch: "/v1beta1/{evaluation_job.name=projects/*/evaluationJobs/*}" - body: "evaluation_job" - }; - option (google.api.method_signature) = "evaluation_job,update_mask"; - } - - // Gets an evaluation job by resource name. - rpc GetEvaluationJob(GetEvaluationJobRequest) returns (EvaluationJob) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/evaluationJobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Pauses an evaluation job. Pausing an evaluation job that is already in a - // `PAUSED` state is a no-op. - rpc PauseEvaluationJob(PauseEvaluationJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/evaluationJobs/*}:pause" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Resumes a paused evaluation job. A deleted evaluation job can't be resumed. - // Resuming a running or scheduled evaluation job is a no-op. - rpc ResumeEvaluationJob(ResumeEvaluationJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/evaluationJobs/*}:resume" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Stops and deletes an evaluation job. - rpc DeleteEvaluationJob(DeleteEvaluationJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/evaluationJobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists all evaluation jobs within a project with possible filters. - // Pagination is supported. - rpc ListEvaluationJobs(ListEvaluationJobsRequest) returns (ListEvaluationJobsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*}/evaluationJobs" - }; - option (google.api.method_signature) = "parent,filter"; - } -} - -// Request message for CreateDataset. -message CreateDatasetRequest { - // Required. Dataset resource parent, format: - // projects/{project_id} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. The dataset to be created. - Dataset dataset = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for GetDataSet. -message GetDatasetRequest { - // Required. Dataset resource name, format: - // projects/{project_id}/datasets/{dataset_id} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/Dataset" - } - ]; -} - -// Request message for ListDataset. -message ListDatasetsRequest { - // Required. Dataset resource parent, format: - // projects/{project_id} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Optional. Filter on dataset is not supported at this moment. - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Requested page size. Server may return fewer results than - // requested. Default value is 100. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results for the server to return. - // Typically obtained by - // [ListDatasetsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListDatasetsResponse.next_page_token] of the previous - // [DataLabelingService.ListDatasets] call. - // Returns the first page if empty. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Results of listing datasets within a project. -message ListDatasetsResponse { - // The list of datasets to return. - repeated Dataset datasets = 1; - - // A token to retrieve next page of results. - string next_page_token = 2; -} - -// Request message for DeleteDataset. -message DeleteDatasetRequest { - // Required. Dataset resource name, format: - // projects/{project_id}/datasets/{dataset_id} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/Dataset" - } - ]; -} - -// Request message for ImportData API. -message ImportDataRequest { - // Required. Dataset resource name, format: - // projects/{project_id}/datasets/{dataset_id} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/Dataset" - } - ]; - - // Required. Specify the input source of the data. - InputConfig input_config = 2 [(google.api.field_behavior) = REQUIRED]; - - // Email of the user who started the import task and should be notified by - // email. If empty no notification will be sent. - string user_email_address = 3; -} - -// Request message for ExportData API. -message ExportDataRequest { - // Required. Dataset resource name, format: - // projects/{project_id}/datasets/{dataset_id} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/Dataset" - } - ]; - - // Required. Annotated dataset resource name. DataItem in - // Dataset and their annotations in specified annotated dataset will be - // exported. It's in format of - // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ - // {annotated_dataset_id} - string annotated_dataset = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/AnnotatedDataset" - } - ]; - - // Optional. Filter is not supported at this moment. - string filter = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Specify the output destination. - OutputConfig output_config = 4 [(google.api.field_behavior) = REQUIRED]; - - // Email of the user who started the export task and should be notified by - // email. If empty no notification will be sent. - string user_email_address = 5; -} - -// Request message for GetDataItem. -message GetDataItemRequest { - // Required. The name of the data item to get, format: - // projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/DataItem" - } - ]; -} - -// Request message for ListDataItems. -message ListDataItemsRequest { - // Required. Name of the dataset to list data items, format: - // projects/{project_id}/datasets/{dataset_id} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/Dataset" - } - ]; - - // Optional. Filter is not supported at this moment. - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Requested page size. Server may return fewer results than - // requested. Default value is 100. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results for the server to return. - // Typically obtained by - // [ListDataItemsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListDataItemsResponse.next_page_token] of the previous - // [DataLabelingService.ListDataItems] call. - // Return first page if empty. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Results of listing data items in a dataset. -message ListDataItemsResponse { - // The list of data items to return. - repeated DataItem data_items = 1; - - // A token to retrieve next page of results. - string next_page_token = 2; -} - -// Request message for GetAnnotatedDataset. -message GetAnnotatedDatasetRequest { - // Required. Name of the annotated dataset to get, format: - // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ - // {annotated_dataset_id} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/AnnotatedDataset" - } - ]; -} - -// Request message for ListAnnotatedDatasets. -message ListAnnotatedDatasetsRequest { - // Required. Name of the dataset to list annotated datasets, format: - // projects/{project_id}/datasets/{dataset_id} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/Dataset" - } - ]; - - // Optional. Filter is not supported at this moment. - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Requested page size. Server may return fewer results than - // requested. Default value is 100. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results for the server to return. - // Typically obtained by - // [ListAnnotatedDatasetsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.next_page_token] of the previous - // [DataLabelingService.ListAnnotatedDatasets] call. - // Return first page if empty. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Results of listing annotated datasets for a dataset. -message ListAnnotatedDatasetsResponse { - // The list of annotated datasets to return. - repeated AnnotatedDataset annotated_datasets = 1; - - // A token to retrieve next page of results. - string next_page_token = 2; -} - -// Request message for DeleteAnnotatedDataset. -message DeleteAnnotatedDatasetRequest { - // Required. Name of the annotated dataset to delete, format: - // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ - // {annotated_dataset_id} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/AnnotatedDataset" - } - ]; -} - -// Request message for starting an image labeling task. -message LabelImageRequest { - // Image labeling task feature. - enum Feature { - FEATURE_UNSPECIFIED = 0; - - // Label whole image with one or more of labels. - CLASSIFICATION = 1; - - // Label image with bounding boxes for labels. - BOUNDING_BOX = 2; - - // Label oriented bounding box. The box does not have to be parallel to - // horizontal line. - ORIENTED_BOUNDING_BOX = 6; - - // Label images with bounding poly. A bounding poly is a plane figure that - // is bounded by a finite chain of straight line segments closing in a loop. - BOUNDING_POLY = 3; - - // Label images with polyline. Polyline is formed by connected line segments - // which are not in closed form. - POLYLINE = 4; - - // Label images with segmentation. Segmentation is different from bounding - // poly since it is more fine-grained, pixel level annotation. - SEGMENTATION = 5; - } - - // Required. Config for labeling tasks. The type of request config must - // match the selected feature. - oneof request_config { - // Configuration for image classification task. - // One of image_classification_config, bounding_poly_config, - // polyline_config and segmentation_config are required. - ImageClassificationConfig image_classification_config = 4; - - // Configuration for bounding box and bounding poly task. - // One of image_classification_config, bounding_poly_config, - // polyline_config and segmentation_config are required. - BoundingPolyConfig bounding_poly_config = 5; - - // Configuration for polyline task. - // One of image_classification_config, bounding_poly_config, - // polyline_config and segmentation_config are required. - PolylineConfig polyline_config = 6; - - // Configuration for segmentation task. - // One of image_classification_config, bounding_poly_config, - // polyline_config and segmentation_config are required. - SegmentationConfig segmentation_config = 7; - } - - // Required. Name of the dataset to request labeling task, format: - // projects/{project_id}/datasets/{dataset_id} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/Dataset" - } - ]; - - // Required. Basic human annotation config. - HumanAnnotationConfig basic_config = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The type of image labeling task. - Feature feature = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for LabelVideo. -message LabelVideoRequest { - // Video labeling task feature. - enum Feature { - FEATURE_UNSPECIFIED = 0; - - // Label whole video or video segment with one or more labels. - CLASSIFICATION = 1; - - // Label objects with bounding box on image frames extracted from the video. - OBJECT_DETECTION = 2; - - // Label and track objects in video. - OBJECT_TRACKING = 3; - - // Label the range of video for the specified events. - EVENT = 4; - } - - // Required. Config for labeling tasks. The type of request config must - // match the selected feature. - oneof request_config { - // Configuration for video classification task. - // One of video_classification_config, object_detection_config, - // object_tracking_config and event_config is required. - VideoClassificationConfig video_classification_config = 4; - - // Configuration for video object detection task. - // One of video_classification_config, object_detection_config, - // object_tracking_config and event_config is required. - ObjectDetectionConfig object_detection_config = 5; - - // Configuration for video object tracking task. - // One of video_classification_config, object_detection_config, - // object_tracking_config and event_config is required. - ObjectTrackingConfig object_tracking_config = 6; - - // Configuration for video event task. - // One of video_classification_config, object_detection_config, - // object_tracking_config and event_config is required. - EventConfig event_config = 7; - } - - // Required. Name of the dataset to request labeling task, format: - // projects/{project_id}/datasets/{dataset_id} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/Dataset" - } - ]; - - // Required. Basic human annotation config. - HumanAnnotationConfig basic_config = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The type of video labeling task. - Feature feature = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for LabelText. -message LabelTextRequest { - // Text labeling task feature. - enum Feature { - FEATURE_UNSPECIFIED = 0; - - // Label text content to one of more labels. - TEXT_CLASSIFICATION = 1; - - // Label entities and their span in text. - TEXT_ENTITY_EXTRACTION = 2; - } - - // Required. Config for labeling tasks. The type of request config must - // match the selected feature. - oneof request_config { - // Configuration for text classification task. - // One of text_classification_config and text_entity_extraction_config - // is required. - TextClassificationConfig text_classification_config = 4; - - // Configuration for entity extraction task. - // One of text_classification_config and text_entity_extraction_config - // is required. - TextEntityExtractionConfig text_entity_extraction_config = 5; - } - - // Required. Name of the data set to request labeling task, format: - // projects/{project_id}/datasets/{dataset_id} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/Dataset" - } - ]; - - // Required. Basic human annotation config. - HumanAnnotationConfig basic_config = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The type of text labeling task. - Feature feature = 6 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for GetExample -message GetExampleRequest { - // Required. Name of example, format: - // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ - // {annotated_dataset_id}/examples/{example_id} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/Example" - } - ]; - - // Optional. An expression for filtering Examples. Filter by - // annotation_spec.display_name is supported. Format - // "annotation_spec.display_name = {display_name}" - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for ListExamples. -message ListExamplesRequest { - // Required. Example resource parent. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/AnnotatedDataset" - } - ]; - - // Optional. An expression for filtering Examples. For annotated datasets that - // have annotation spec set, filter by - // annotation_spec.display_name is supported. Format - // "annotation_spec.display_name = {display_name}" - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Requested page size. Server may return fewer results than - // requested. Default value is 100. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results for the server to return. - // Typically obtained by - // [ListExamplesResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListExamplesResponse.next_page_token] of the previous - // [DataLabelingService.ListExamples] call. - // Return first page if empty. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Results of listing Examples in and annotated dataset. -message ListExamplesResponse { - // The list of examples to return. - repeated Example examples = 1; - - // A token to retrieve next page of results. - string next_page_token = 2; -} - -// Request message for CreateAnnotationSpecSet. -message CreateAnnotationSpecSetRequest { - // Required. AnnotationSpecSet resource parent, format: - // projects/{project_id} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. Annotation spec set to create. Annotation specs must be included. - // Only one annotation spec will be accepted for annotation specs with same - // display_name. - AnnotationSpecSet annotation_spec_set = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for GetAnnotationSpecSet. -message GetAnnotationSpecSetRequest { - // Required. AnnotationSpecSet resource name, format: - // projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/AnnotationSpecSet" - } - ]; -} - -// Request message for ListAnnotationSpecSets. -message ListAnnotationSpecSetsRequest { - // Required. Parent of AnnotationSpecSet resource, format: - // projects/{project_id} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Optional. Filter is not supported at this moment. - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Requested page size. Server may return fewer results than - // requested. Default value is 100. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results for the server to return. - // Typically obtained by - // [ListAnnotationSpecSetsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.next_page_token] of the previous - // [DataLabelingService.ListAnnotationSpecSets] call. - // Return first page if empty. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Results of listing annotation spec set under a project. -message ListAnnotationSpecSetsResponse { - // The list of annotation spec sets. - repeated AnnotationSpecSet annotation_spec_sets = 1; - - // A token to retrieve next page of results. - string next_page_token = 2; -} - -// Request message for DeleteAnnotationSpecSet. -message DeleteAnnotationSpecSetRequest { - // Required. AnnotationSpec resource name, format: - // `projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/AnnotationSpecSet" - } - ]; -} - -// Request message for CreateInstruction. -message CreateInstructionRequest { - // Required. Instruction resource parent, format: - // projects/{project_id} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. Instruction of how to perform the labeling task. - Instruction instruction = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for GetInstruction. -message GetInstructionRequest { - // Required. Instruction resource name, format: - // projects/{project_id}/instructions/{instruction_id} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/Instruction" - } - ]; -} - -// Request message for DeleteInstruction. -message DeleteInstructionRequest { - // Required. Instruction resource name, format: - // projects/{project_id}/instructions/{instruction_id} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/Instruction" - } - ]; -} - -// Request message for ListInstructions. -message ListInstructionsRequest { - // Required. Instruction resource parent, format: - // projects/{project_id} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Optional. Filter is not supported at this moment. - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Requested page size. Server may return fewer results than - // requested. Default value is 100. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results for the server to return. - // Typically obtained by - // [ListInstructionsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListInstructionsResponse.next_page_token] of the previous - // [DataLabelingService.ListInstructions] call. - // Return first page if empty. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Results of listing instructions under a project. -message ListInstructionsResponse { - // The list of Instructions to return. - repeated Instruction instructions = 1; - - // A token to retrieve next page of results. - string next_page_token = 2; -} - -// Request message for GetEvaluation. -message GetEvaluationRequest { - // Required. Name of the evaluation. Format: - // - // "projects/{project_id}/datasets/{dataset_id}/evaluations/{evaluation_id}' - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/Evaluation" - } - ]; -} - -// Request message for SearchEvaluation. -message SearchEvaluationsRequest { - // Required. Evaluation search parent (project ID). Format: - // "projects/{project_id}" - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/Evaluation" - } - ]; - - // Optional. To search evaluations, you can filter by the following: - // - // * evaluation_job.evaluation_job_id (the last part of - // [EvaluationJob.name][google.cloud.datalabeling.v1beta1.EvaluationJob.name]) - // * evaluation_job.model_id (the {model_name} portion - // of [EvaluationJob.modelVersion][google.cloud.datalabeling.v1beta1.EvaluationJob.model_version]) - // * evaluation_job.evaluation_job_run_time_start (Minimum - // threshold for the - // [evaluationJobRunTime][google.cloud.datalabeling.v1beta1.Evaluation.evaluation_job_run_time] that created - // the evaluation) - // * evaluation_job.evaluation_job_run_time_end (Maximum - // threshold for the - // [evaluationJobRunTime][google.cloud.datalabeling.v1beta1.Evaluation.evaluation_job_run_time] that created - // the evaluation) - // * evaluation_job.job_state ([EvaluationJob.state][google.cloud.datalabeling.v1beta1.EvaluationJob.state]) - // * annotation_spec.display_name (the Evaluation contains a - // metric for the annotation spec with this - // [displayName][google.cloud.datalabeling.v1beta1.AnnotationSpec.display_name]) - // - // To filter by multiple critiera, use the `AND` operator or the `OR` - // operator. The following examples shows a string that filters by several - // critiera: - // - // "evaluation_job.evaluation_job_id = - // {evaluation_job_id} AND evaluation_job.model_id = - // {model_name} AND - // evaluation_job.evaluation_job_run_time_start = - // {timestamp_1} AND - // evaluation_job.evaluation_job_run_time_end = - // {timestamp_2} AND annotation_spec.display_name = - // {display_name}" - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Requested page size. Server may return fewer results than - // requested. Default value is 100. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results for the server to return. - // Typically obtained by the - // [nextPageToken][google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse.next_page_token] of the response - // to a previous search request. - // - // If you don't specify this field, the API call requests the first page of - // the search. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Results of searching evaluations. -message SearchEvaluationsResponse { - // The list of evaluations matching the search. - repeated Evaluation evaluations = 1; - - // A token to retrieve next page of results. - string next_page_token = 2; -} - -// Request message of SearchExampleComparisons. -message SearchExampleComparisonsRequest { - // Required. Name of the [Evaluation][google.cloud.datalabeling.v1beta1.Evaluation] resource to search for example - // comparisons from. Format: - // - // "projects/{project_id}/datasets/{dataset_id}/evaluations/{evaluation_id}" - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/Evaluation" - } - ]; - - // Optional. Requested page size. Server may return fewer results than - // requested. Default value is 100. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results for the server to return. - // Typically obtained by the - // [nextPageToken][SearchExampleComparisons.next_page_token] of the response - // to a previous search rquest. - // - // If you don't specify this field, the API call requests the first page of - // the search. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Results of searching example comparisons. -message SearchExampleComparisonsResponse { - // Example comparisons comparing ground truth output and predictions for a - // specific input. - message ExampleComparison { - // The ground truth output for the input. - Example ground_truth_example = 1; - - // Predictions by the model for the input. - repeated Example model_created_examples = 2; - } - - // A list of example comparisons matching the search criteria. - repeated ExampleComparison example_comparisons = 1; - - // A token to retrieve next page of results. - string next_page_token = 2; -} - -// Request message for CreateEvaluationJob. -message CreateEvaluationJobRequest { - // Required. Evaluation job resource parent. Format: - // "projects/{project_id}" - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. The evaluation job to create. - EvaluationJob job = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for UpdateEvaluationJob. -message UpdateEvaluationJobRequest { - // Required. Evaluation job that is going to be updated. - EvaluationJob evaluation_job = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Mask for which fields to update. You can only provide the - // following fields: - // - // * `evaluationJobConfig.humanAnnotationConfig.instruction` - // * `evaluationJobConfig.exampleCount` - // * `evaluationJobConfig.exampleSamplePercentage` - // - // You can provide more than one of these fields by separating them with - // commas. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for GetEvaluationJob. -message GetEvaluationJobRequest { - // Required. Name of the evaluation job. Format: - // - // "projects/{project_id}/evaluationJobs/{evaluation_job_id}" - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/EvaluationJob" - } - ]; -} - -// Request message for PauseEvaluationJob. -message PauseEvaluationJobRequest { - // Required. Name of the evaluation job that is going to be paused. Format: - // - // "projects/{project_id}/evaluationJobs/{evaluation_job_id}" - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/EvaluationJob" - } - ]; -} - -// Request message ResumeEvaluationJob. -message ResumeEvaluationJobRequest { - // Required. Name of the evaluation job that is going to be resumed. Format: - // - // "projects/{project_id}/evaluationJobs/{evaluation_job_id}" - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/EvaluationJob" - } - ]; -} - -// Request message DeleteEvaluationJob. -message DeleteEvaluationJobRequest { - // Required. Name of the evaluation job that is going to be deleted. Format: - // - // "projects/{project_id}/evaluationJobs/{evaluation_job_id}" - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datalabeling.googleapis.com/EvaluationJob" - } - ]; -} - -// Request message for ListEvaluationJobs. -message ListEvaluationJobsRequest { - // Required. Evaluation job resource parent. Format: - // "projects/{project_id}" - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Optional. You can filter the jobs to list by model_id (also known as - // model_name, as described in - // [EvaluationJob.modelVersion][google.cloud.datalabeling.v1beta1.EvaluationJob.model_version]) or by - // evaluation job state (as described in [EvaluationJob.state][google.cloud.datalabeling.v1beta1.EvaluationJob.state]). To filter - // by both criteria, use the `AND` operator or the `OR` operator. For example, - // you can use the following string for your filter: - // "evaluation_job.model_id = {model_name} AND - // evaluation_job.state = {evaluation_job_state}" - string filter = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Requested page size. Server may return fewer results than - // requested. Default value is 100. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results for the server to return. - // Typically obtained by the - // [nextPageToken][google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse.next_page_token] in the response - // to the previous request. The request returns the first page if this is - // empty. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Results for listing evaluation jobs. -message ListEvaluationJobsResponse { - // The list of evaluation jobs to return. - repeated EvaluationJob evaluation_jobs = 1; - - // A token to retrieve next page of results. - string next_page_token = 2; -} diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service_pb2.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service_pb2.py deleted file mode 100644 index 258d5a0c7dfd..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service_pb2.py +++ /dev/null @@ -1,5027 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/datalabeling_v1beta1/proto/data_labeling_service.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.datalabeling_v1beta1.proto import ( - annotation_spec_set_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2, -) -from google.cloud.datalabeling_v1beta1.proto import ( - dataset_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2, -) -from google.cloud.datalabeling_v1beta1.proto import ( - evaluation_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__pb2, -) -from google.cloud.datalabeling_v1beta1.proto import ( - evaluation_job_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__job__pb2, -) -from google.cloud.datalabeling_v1beta1.proto import ( - human_annotation_config_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2, -) -from google.cloud.datalabeling_v1beta1.proto import ( - instruction_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_instruction__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/datalabeling_v1beta1/proto/data_labeling_service.proto", - package="google.cloud.datalabeling.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n%com.google.cloud.datalabeling.v1beta1P\001ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling" - ), - serialized_pb=_b( - '\nCgoogle/cloud/datalabeling_v1beta1/proto/data_labeling_service.proto\x12!google.cloud.datalabeling.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x41google/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto\x1a\x35google/cloud/datalabeling_v1beta1/proto/dataset.proto\x1a\x38google/cloud/datalabeling_v1beta1/proto/evaluation.proto\x1a\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&datalabeling.googleapis.com/Evaluation\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01"x\n\x19SearchEvaluationsResponse\x12\x42\n\x0b\x65valuations\x18\x01 \x03(\x0b\x32-.google.cloud.datalabeling.v1beta1.Evaluation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\x92\x01\n\x1fSearchExampleComparisonsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&datalabeling.googleapis.com/Evaluation\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01"\xdb\x02\n SearchExampleComparisonsResponse\x12r\n\x13\x65xample_comparisons\x18\x01 \x03(\x0b\x32U.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x1a\xa9\x01\n\x11\x45xampleComparison\x12H\n\x14ground_truth_example\x18\x01 \x01(\x0b\x32*.google.cloud.datalabeling.v1beta1.Example\x12J\n\x16model_created_examples\x18\x02 \x03(\x0b\x32*.google.cloud.datalabeling.v1beta1.Example"\xa5\x01\n\x1a\x43reateEvaluationJobRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x42\n\x03job\x18\x02 \x01(\x0b\x32\x30.google.cloud.datalabeling.v1beta1.EvaluationJobB\x03\xe0\x41\x02"\xa1\x01\n\x1aUpdateEvaluationJobRequest\x12M\n\x0e\x65valuation_job\x18\x01 \x01(\x0b\x32\x30.google.cloud.datalabeling.v1beta1.EvaluationJobB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01"Z\n\x17GetEvaluationJobRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)datalabeling.googleapis.com/EvaluationJob"\\\n\x19PauseEvaluationJobRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)datalabeling.googleapis.com/EvaluationJob"]\n\x1aResumeEvaluationJobRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)datalabeling.googleapis.com/EvaluationJob"]\n\x1a\x44\x65leteEvaluationJobRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)datalabeling.googleapis.com/EvaluationJob"\xa6\x01\n\x19ListEvaluationJobsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01"\x80\x01\n\x1aListEvaluationJobsResponse\x12I\n\x0f\x65valuation_jobs\x18\x01 \x03(\x0b\x32\x30.google.cloud.datalabeling.v1beta1.EvaluationJob\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xa6\x38\n\x13\x44\x61taLabelingService\x12\xb7\x01\n\rCreateDataset\x12\x37.google.cloud.datalabeling.v1beta1.CreateDatasetRequest\x1a*.google.cloud.datalabeling.v1beta1.Dataset"A\x82\xd3\xe4\x93\x02*"%/v1beta1/{parent=projects/*}/datasets:\x01*\xda\x41\x0eparent,dataset\x12\xa4\x01\n\nGetDataset\x12\x34.google.cloud.datalabeling.v1beta1.GetDatasetRequest\x1a*.google.cloud.datalabeling.v1beta1.Dataset"4\x82\xd3\xe4\x93\x02\'\x12%/v1beta1/{name=projects/*/datasets/*}\xda\x41\x04name\x12\xbe\x01\n\x0cListDatasets\x12\x36.google.cloud.datalabeling.v1beta1.ListDatasetsRequest\x1a\x37.google.cloud.datalabeling.v1beta1.ListDatasetsResponse"=\x82\xd3\xe4\x93\x02\'\x12%/v1beta1/{parent=projects/*}/datasets\xda\x41\rparent,filter\x12\x96\x01\n\rDeleteDataset\x12\x37.google.cloud.datalabeling.v1beta1.DeleteDatasetRequest\x1a\x16.google.protobuf.Empty"4\x82\xd3\xe4\x93\x02\'*%/v1beta1/{name=projects/*/datasets/*}\xda\x41\x04name\x12\xf0\x01\n\nImportData\x12\x34.google.cloud.datalabeling.v1beta1.ImportDataRequest\x1a\x1d.google.longrunning.Operation"\x8c\x01\x82\xd3\xe4\x93\x02\x35"0/v1beta1/{name=projects/*/datasets/*}:importData:\x01*\xda\x41\x11name,input_config\xca\x41:\n\x1bImportDataOperationResponse\x12\x1bImportDataOperationMetadata\x12\x8a\x02\n\nExportData\x12\x34.google.cloud.datalabeling.v1beta1.ExportDataRequest\x1a\x1d.google.longrunning.Operation"\xa6\x01\x82\xd3\xe4\x93\x02\x35"0/v1beta1/{name=projects/*/datasets/*}:exportData:\x01*\xda\x41+name,annotated_dataset,filter,output_config\xca\x41:\n\x1b\x45xportDataOperationResponse\x12\x1b\x45xportDataOperationMetadata\x12\xb3\x01\n\x0bGetDataItem\x12\x35.google.cloud.datalabeling.v1beta1.GetDataItemRequest\x1a+.google.cloud.datalabeling.v1beta1.DataItem"@\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta1/{name=projects/*/datasets/*/dataItems/*}\xda\x41\x04name\x12\xcd\x01\n\rListDataItems\x12\x37.google.cloud.datalabeling.v1beta1.ListDataItemsRequest\x1a\x38.google.cloud.datalabeling.v1beta1.ListDataItemsResponse"I\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta1/{parent=projects/*/datasets/*}/dataItems\xda\x41\rparent,filter\x12\xd3\x01\n\x13GetAnnotatedDataset\x12=.google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest\x1a\x33.google.cloud.datalabeling.v1beta1.AnnotatedDataset"H\x82\xd3\xe4\x93\x02;\x12\x39/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}\xda\x41\x04name\x12\xed\x01\n\x15ListAnnotatedDatasets\x12?.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest\x1a@.google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse"Q\x82\xd3\xe4\x93\x02;\x12\x39/v1beta1/{parent=projects/*/datasets/*}/annotatedDatasets\xda\x41\rparent,filter\x12\xb5\x01\n\x16\x44\x65leteAnnotatedDataset\x12@.google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest\x1a\x16.google.protobuf.Empty"A\x82\xd3\xe4\x93\x02;*9/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}\x12\xed\x01\n\nLabelImage\x12\x34.google.cloud.datalabeling.v1beta1.LabelImageRequest\x1a\x1d.google.longrunning.Operation"\x89\x01\x82\xd3\xe4\x93\x02\x38"3/v1beta1/{parent=projects/*/datasets/*}/image:label:\x01*\xda\x41\x1bparent,basic_config,feature\xca\x41*\n\x10\x41nnotatedDataset\x12\x16LabelOperationMetadata\x12\xed\x01\n\nLabelVideo\x12\x34.google.cloud.datalabeling.v1beta1.LabelVideoRequest\x1a\x1d.google.longrunning.Operation"\x89\x01\x82\xd3\xe4\x93\x02\x38"3/v1beta1/{parent=projects/*/datasets/*}/video:label:\x01*\xda\x41\x1bparent,basic_config,feature\xca\x41*\n\x10\x41nnotatedDataset\x12\x16LabelOperationMetadata\x12\xea\x01\n\tLabelText\x12\x33.google.cloud.datalabeling.v1beta1.LabelTextRequest\x1a\x1d.google.longrunning.Operation"\x88\x01\x82\xd3\xe4\x93\x02\x37"2/v1beta1/{parent=projects/*/datasets/*}/text:label:\x01*\xda\x41\x1bparent,basic_config,feature\xca\x41*\n\x10\x41nnotatedDataset\x12\x16LabelOperationMetadata\x12\xca\x01\n\nGetExample\x12\x34.google.cloud.datalabeling.v1beta1.GetExampleRequest\x1a*.google.cloud.datalabeling.v1beta1.Example"Z\x82\xd3\xe4\x93\x02\x46\x12\x44/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*/examples/*}\xda\x41\x0bname,filter\x12\xdd\x01\n\x0cListExamples\x12\x36.google.cloud.datalabeling.v1beta1.ListExamplesRequest\x1a\x37.google.cloud.datalabeling.v1beta1.ListExamplesResponse"\\\x82\xd3\xe4\x93\x02\x46\x12\x44/v1beta1/{parent=projects/*/datasets/*/annotatedDatasets/*}/examples\xda\x41\rparent,filter\x12\xeb\x01\n\x17\x43reateAnnotationSpecSet\x12\x41.google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest\x1a\x34.google.cloud.datalabeling.v1beta1.AnnotationSpecSet"W\x82\xd3\xe4\x93\x02\x34"//v1beta1/{parent=projects/*}/annotationSpecSets:\x01*\xda\x41\x1aparent,annotation_spec_set\x12\xcc\x01\n\x14GetAnnotationSpecSet\x12>.google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest\x1a\x34.google.cloud.datalabeling.v1beta1.AnnotationSpecSet">\x82\xd3\xe4\x93\x02\x31\x12//v1beta1/{name=projects/*/annotationSpecSets/*}\xda\x41\x04name\x12\xe6\x01\n\x16ListAnnotationSpecSets\x12@.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest\x1a\x41.google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse"G\x82\xd3\xe4\x93\x02\x31\x12//v1beta1/{parent=projects/*}/annotationSpecSets\xda\x41\rparent,filter\x12\xb4\x01\n\x17\x44\x65leteAnnotationSpecSet\x12\x41.google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest\x1a\x16.google.protobuf.Empty">\x82\xd3\xe4\x93\x02\x31*//v1beta1/{name=projects/*/annotationSpecSets/*}\xda\x41\x04name\x12\xe5\x01\n\x11\x43reateInstruction\x12;.google.cloud.datalabeling.v1beta1.CreateInstructionRequest\x1a\x1d.google.longrunning.Operation"t\x82\xd3\xe4\x93\x02.")/v1beta1/{parent=projects/*}/instructions:\x01*\xda\x41\x12parent,instruction\xca\x41(\n\x0bInstruction\x12\x19\x43reateInstructionMetadata\x12\xb4\x01\n\x0eGetInstruction\x12\x38.google.cloud.datalabeling.v1beta1.GetInstructionRequest\x1a..google.cloud.datalabeling.v1beta1.Instruction"8\x82\xd3\xe4\x93\x02+\x12)/v1beta1/{name=projects/*/instructions/*}\xda\x41\x04name\x12\xce\x01\n\x10ListInstructions\x12:.google.cloud.datalabeling.v1beta1.ListInstructionsRequest\x1a;.google.cloud.datalabeling.v1beta1.ListInstructionsResponse"A\x82\xd3\xe4\x93\x02+\x12)/v1beta1/{parent=projects/*}/instructions\xda\x41\rparent,filter\x12\xa2\x01\n\x11\x44\x65leteInstruction\x12;.google.cloud.datalabeling.v1beta1.DeleteInstructionRequest\x1a\x16.google.protobuf.Empty"8\x82\xd3\xe4\x93\x02+*)/v1beta1/{name=projects/*/instructions/*}\xda\x41\x04name\x12\xbb\x01\n\rGetEvaluation\x12\x37.google.cloud.datalabeling.v1beta1.GetEvaluationRequest\x1a-.google.cloud.datalabeling.v1beta1.Evaluation"B\x82\xd3\xe4\x93\x02\x35\x12\x33/v1beta1/{name=projects/*/datasets/*/evaluations/*}\xda\x41\x04name\x12\xd7\x01\n\x11SearchEvaluations\x12;.google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest\x1a<.google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse"G\x82\xd3\xe4\x93\x02\x31\x12//v1beta1/{parent=projects/*}/evaluations:search\xda\x41\rparent,filter\x12\x88\x02\n\x18SearchExampleComparisons\x12\x42.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest\x1a\x43.google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse"c\x82\xd3\xe4\x93\x02T"O/v1beta1/{parent=projects/*/datasets/*/evaluations/*}/exampleComparisons:search:\x01*\xda\x41\x06parent\x12\xcb\x01\n\x13\x43reateEvaluationJob\x12=.google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest\x1a\x30.google.cloud.datalabeling.v1beta1.EvaluationJob"C\x82\xd3\xe4\x93\x02\x30"+/v1beta1/{parent=projects/*}/evaluationJobs:\x01*\xda\x41\nparent,job\x12\xf7\x01\n\x13UpdateEvaluationJob\x12=.google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest\x1a\x30.google.cloud.datalabeling.v1beta1.EvaluationJob"o\x82\xd3\xe4\x93\x02L2:/v1beta1/{evaluation_job.name=projects/*/evaluationJobs/*}:\x0e\x65valuation_job\xda\x41\x1a\x65valuation_job,update_mask\x12\xbc\x01\n\x10GetEvaluationJob\x12:.google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest\x1a\x30.google.cloud.datalabeling.v1beta1.EvaluationJob":\x82\xd3\xe4\x93\x02-\x12+/v1beta1/{name=projects/*/evaluationJobs/*}\xda\x41\x04name\x12\xaf\x01\n\x12PauseEvaluationJob\x12<.google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest\x1a\x16.google.protobuf.Empty"C\x82\xd3\xe4\x93\x02\x36"1/v1beta1/{name=projects/*/evaluationJobs/*}:pause:\x01*\xda\x41\x04name\x12\xb2\x01\n\x13ResumeEvaluationJob\x12=.google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest\x1a\x16.google.protobuf.Empty"D\x82\xd3\xe4\x93\x02\x37"2/v1beta1/{name=projects/*/evaluationJobs/*}:resume:\x01*\xda\x41\x04name\x12\xa8\x01\n\x13\x44\x65leteEvaluationJob\x12=.google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest\x1a\x16.google.protobuf.Empty":\x82\xd3\xe4\x93\x02-*+/v1beta1/{name=projects/*/evaluationJobs/*}\xda\x41\x04name\x12\xd6\x01\n\x12ListEvaluationJobs\x12<.google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest\x1a=.google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse"C\x82\xd3\xe4\x93\x02-\x12+/v1beta1/{parent=projects/*}/evaluationJobs\xda\x41\rparent,filter\x1aO\xca\x41\x1b\x64\x61talabeling.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBx\n%com.google.cloud.datalabeling.v1beta1P\x01ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabelingb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2.DESCRIPTOR, - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.DESCRIPTOR, - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__pb2.DESCRIPTOR, - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__job__pb2.DESCRIPTOR, - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2.DESCRIPTOR, - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_instruction__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - ], -) - - -_LABELIMAGEREQUEST_FEATURE = _descriptor.EnumDescriptor( - name="Feature", - full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest.Feature", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="FEATURE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CLASSIFICATION", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="BOUNDING_BOX", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="ORIENTED_BOUNDING_BOX", - index=3, - number=6, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="BOUNDING_POLY", index=4, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="POLYLINE", index=5, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SEGMENTATION", index=6, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3223, - serialized_end=3373, -) -_sym_db.RegisterEnumDescriptor(_LABELIMAGEREQUEST_FEATURE) - -_LABELVIDEOREQUEST_FEATURE = _descriptor.EnumDescriptor( - name="Feature", - full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest.Feature", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="FEATURE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CLASSIFICATION", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="OBJECT_DETECTION", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="OBJECT_TRACKING", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="EVENT", index=4, number=4, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4002, - serialized_end=4110, -) -_sym_db.RegisterEnumDescriptor(_LABELVIDEOREQUEST_FEATURE) - -_LABELTEXTREQUEST_FEATURE = _descriptor.EnumDescriptor( - name="Feature", - full_name="google.cloud.datalabeling.v1beta1.LabelTextRequest.Feature", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="FEATURE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TEXT_CLASSIFICATION", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TEXT_ENTITY_EXTRACTION", - index=2, - number=2, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4583, - serialized_end=4670, -) -_sym_db.RegisterEnumDescriptor(_LABELTEXTREQUEST_FEATURE) - - -_CREATEDATASETREQUEST = _descriptor.Descriptor( - name="CreateDatasetRequest", - full_name="google.cloud.datalabeling.v1beta1.CreateDatasetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datalabeling.v1beta1.CreateDatasetRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A-\n+cloudresourcemanager.googleapis.com/Project" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="dataset", - full_name="google.cloud.datalabeling.v1beta1.CreateDatasetRequest.dataset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=694, - serialized_end=851, -) - - -_GETDATASETREQUEST = _descriptor.Descriptor( - name="GetDatasetRequest", - full_name="google.cloud.datalabeling.v1beta1.GetDatasetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.GetDatasetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A%\n#datalabeling.googleapis.com/Dataset" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=853, - serialized_end=931, -) - - -_LISTDATASETSREQUEST = _descriptor.Descriptor( - name="ListDatasetsRequest", - full_name="google.cloud.datalabeling.v1beta1.ListDatasetsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datalabeling.v1beta1.ListDatasetsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A-\n+cloudresourcemanager.googleapis.com/Project" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.datalabeling.v1beta1.ListDatasetsRequest.filter", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.datalabeling.v1beta1.ListDatasetsRequest.page_size", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.datalabeling.v1beta1.ListDatasetsRequest.page_token", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=934, - serialized_end=1094, -) - - -_LISTDATASETSRESPONSE = _descriptor.Descriptor( - name="ListDatasetsResponse", - full_name="google.cloud.datalabeling.v1beta1.ListDatasetsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="datasets", - full_name="google.cloud.datalabeling.v1beta1.ListDatasetsResponse.datasets", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.datalabeling.v1beta1.ListDatasetsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1096, - serialized_end=1205, -) - - -_DELETEDATASETREQUEST = _descriptor.Descriptor( - name="DeleteDatasetRequest", - full_name="google.cloud.datalabeling.v1beta1.DeleteDatasetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.DeleteDatasetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A%\n#datalabeling.googleapis.com/Dataset" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1207, - serialized_end=1288, -) - - -_IMPORTDATAREQUEST = _descriptor.Descriptor( - name="ImportDataRequest", - full_name="google.cloud.datalabeling.v1beta1.ImportDataRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.ImportDataRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A%\n#datalabeling.googleapis.com/Dataset" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="input_config", - full_name="google.cloud.datalabeling.v1beta1.ImportDataRequest.input_config", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="user_email_address", - full_name="google.cloud.datalabeling.v1beta1.ImportDataRequest.user_email_address", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1291, - serialized_end=1472, -) - - -_EXPORTDATAREQUEST = _descriptor.Descriptor( - name="ExportDataRequest", - full_name="google.cloud.datalabeling.v1beta1.ExportDataRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.ExportDataRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A%\n#datalabeling.googleapis.com/Dataset" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotated_dataset", - full_name="google.cloud.datalabeling.v1beta1.ExportDataRequest.annotated_dataset", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A.\n,datalabeling.googleapis.com/AnnotatedDataset" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.datalabeling.v1beta1.ExportDataRequest.filter", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="output_config", - full_name="google.cloud.datalabeling.v1beta1.ExportDataRequest.output_config", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="user_email_address", - full_name="google.cloud.datalabeling.v1beta1.ExportDataRequest.user_email_address", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1475, - serialized_end=1760, -) - - -_GETDATAITEMREQUEST = _descriptor.Descriptor( - name="GetDataItemRequest", - full_name="google.cloud.datalabeling.v1beta1.GetDataItemRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.GetDataItemRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A&\n$datalabeling.googleapis.com/DataItem" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1762, - serialized_end=1842, -) - - -_LISTDATAITEMSREQUEST = _descriptor.Descriptor( - name="ListDataItemsRequest", - full_name="google.cloud.datalabeling.v1beta1.ListDataItemsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datalabeling.v1beta1.ListDataItemsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A%\n#datalabeling.googleapis.com/Dataset" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.datalabeling.v1beta1.ListDataItemsRequest.filter", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.datalabeling.v1beta1.ListDataItemsRequest.page_size", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.datalabeling.v1beta1.ListDataItemsRequest.page_token", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1845, - serialized_end=1998, -) - - -_LISTDATAITEMSRESPONSE = _descriptor.Descriptor( - name="ListDataItemsResponse", - full_name="google.cloud.datalabeling.v1beta1.ListDataItemsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="data_items", - full_name="google.cloud.datalabeling.v1beta1.ListDataItemsResponse.data_items", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.datalabeling.v1beta1.ListDataItemsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2000, - serialized_end=2113, -) - - -_GETANNOTATEDDATASETREQUEST = _descriptor.Descriptor( - name="GetAnnotatedDatasetRequest", - full_name="google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A.\n,datalabeling.googleapis.com/AnnotatedDataset" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2115, - serialized_end=2211, -) - - -_LISTANNOTATEDDATASETSREQUEST = _descriptor.Descriptor( - name="ListAnnotatedDatasetsRequest", - full_name="google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A%\n#datalabeling.googleapis.com/Dataset" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest.filter", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest.page_size", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest.page_token", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2214, - serialized_end=2375, -) - - -_LISTANNOTATEDDATASETSRESPONSE = _descriptor.Descriptor( - name="ListAnnotatedDatasetsResponse", - full_name="google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotated_datasets", - full_name="google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.annotated_datasets", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2378, - serialized_end=2515, -) - - -_DELETEANNOTATEDDATASETREQUEST = _descriptor.Descriptor( - name="DeleteAnnotatedDatasetRequest", - full_name="google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A.\n,datalabeling.googleapis.com/AnnotatedDataset" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2517, - serialized_end=2616, -) - - -_LABELIMAGEREQUEST = _descriptor.Descriptor( - name="LabelImageRequest", - full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="image_classification_config", - full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest.image_classification_config", - index=0, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_poly_config", - full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest.bounding_poly_config", - index=1, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="polyline_config", - full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest.polyline_config", - index=2, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segmentation_config", - full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest.segmentation_config", - index=3, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest.parent", - index=4, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A%\n#datalabeling.googleapis.com/Dataset" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="basic_config", - full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest.basic_config", - index=5, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="feature", - full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest.feature", - index=6, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_LABELIMAGEREQUEST_FEATURE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="request_config", - full_name="google.cloud.datalabeling.v1beta1.LabelImageRequest.request_config", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=2619, - serialized_end=3391, -) - - -_LABELVIDEOREQUEST = _descriptor.Descriptor( - name="LabelVideoRequest", - full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="video_classification_config", - full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest.video_classification_config", - index=0, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="object_detection_config", - full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest.object_detection_config", - index=1, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="object_tracking_config", - full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest.object_tracking_config", - index=2, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="event_config", - full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest.event_config", - index=3, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest.parent", - index=4, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A%\n#datalabeling.googleapis.com/Dataset" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="basic_config", - full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest.basic_config", - index=5, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="feature", - full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest.feature", - index=6, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_LABELVIDEOREQUEST_FEATURE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="request_config", - full_name="google.cloud.datalabeling.v1beta1.LabelVideoRequest.request_config", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=3394, - serialized_end=4128, -) - - -_LABELTEXTREQUEST = _descriptor.Descriptor( - name="LabelTextRequest", - full_name="google.cloud.datalabeling.v1beta1.LabelTextRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="text_classification_config", - full_name="google.cloud.datalabeling.v1beta1.LabelTextRequest.text_classification_config", - index=0, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_entity_extraction_config", - full_name="google.cloud.datalabeling.v1beta1.LabelTextRequest.text_entity_extraction_config", - index=1, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datalabeling.v1beta1.LabelTextRequest.parent", - index=2, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A%\n#datalabeling.googleapis.com/Dataset" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="basic_config", - full_name="google.cloud.datalabeling.v1beta1.LabelTextRequest.basic_config", - index=3, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="feature", - full_name="google.cloud.datalabeling.v1beta1.LabelTextRequest.feature", - index=4, - number=6, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_LABELTEXTREQUEST_FEATURE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="request_config", - full_name="google.cloud.datalabeling.v1beta1.LabelTextRequest.request_config", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=4131, - serialized_end=4688, -) - - -_GETEXAMPLEREQUEST = _descriptor.Descriptor( - name="GetExampleRequest", - full_name="google.cloud.datalabeling.v1beta1.GetExampleRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.GetExampleRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A%\n#datalabeling.googleapis.com/Example" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.datalabeling.v1beta1.GetExampleRequest.filter", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4690, - serialized_end=4789, -) - - -_LISTEXAMPLESREQUEST = _descriptor.Descriptor( - name="ListExamplesRequest", - full_name="google.cloud.datalabeling.v1beta1.ListExamplesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datalabeling.v1beta1.ListExamplesRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A.\n,datalabeling.googleapis.com/AnnotatedDataset" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.datalabeling.v1beta1.ListExamplesRequest.filter", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.datalabeling.v1beta1.ListExamplesRequest.page_size", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.datalabeling.v1beta1.ListExamplesRequest.page_token", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4792, - serialized_end=4953, -) - - -_LISTEXAMPLESRESPONSE = _descriptor.Descriptor( - name="ListExamplesResponse", - full_name="google.cloud.datalabeling.v1beta1.ListExamplesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="examples", - full_name="google.cloud.datalabeling.v1beta1.ListExamplesResponse.examples", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.datalabeling.v1beta1.ListExamplesResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4955, - serialized_end=5064, -) - - -_CREATEANNOTATIONSPECSETREQUEST = _descriptor.Descriptor( - name="CreateAnnotationSpecSetRequest", - full_name="google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A-\n+cloudresourcemanager.googleapis.com/Project" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_spec_set", - full_name="google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest.annotation_spec_set", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5067, - serialized_end=5256, -) - - -_GETANNOTATIONSPECSETREQUEST = _descriptor.Descriptor( - name="GetAnnotationSpecSetRequest", - full_name="google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A/\n-datalabeling.googleapis.com/AnnotationSpecSet" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5258, - serialized_end=5356, -) - - -_LISTANNOTATIONSPECSETSREQUEST = _descriptor.Descriptor( - name="ListAnnotationSpecSetsRequest", - full_name="google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A-\n+cloudresourcemanager.googleapis.com/Project" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest.filter", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest.page_size", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest.page_token", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5359, - serialized_end=5529, -) - - -_LISTANNOTATIONSPECSETSRESPONSE = _descriptor.Descriptor( - name="ListAnnotationSpecSetsResponse", - full_name="google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec_sets", - full_name="google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.annotation_spec_sets", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5532, - serialized_end=5673, -) - - -_DELETEANNOTATIONSPECSETREQUEST = _descriptor.Descriptor( - name="DeleteAnnotationSpecSetRequest", - full_name="google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A/\n-datalabeling.googleapis.com/AnnotationSpecSet" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5675, - serialized_end=5776, -) - - -_CREATEINSTRUCTIONREQUEST = _descriptor.Descriptor( - name="CreateInstructionRequest", - full_name="google.cloud.datalabeling.v1beta1.CreateInstructionRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datalabeling.v1beta1.CreateInstructionRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A-\n+cloudresourcemanager.googleapis.com/Project" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="instruction", - full_name="google.cloud.datalabeling.v1beta1.CreateInstructionRequest.instruction", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5779, - serialized_end=5948, -) - - -_GETINSTRUCTIONREQUEST = _descriptor.Descriptor( - name="GetInstructionRequest", - full_name="google.cloud.datalabeling.v1beta1.GetInstructionRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.GetInstructionRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A)\n'datalabeling.googleapis.com/Instruction" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5950, - serialized_end=6036, -) - - -_DELETEINSTRUCTIONREQUEST = _descriptor.Descriptor( - name="DeleteInstructionRequest", - full_name="google.cloud.datalabeling.v1beta1.DeleteInstructionRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.DeleteInstructionRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A)\n'datalabeling.googleapis.com/Instruction" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6038, - serialized_end=6127, -) - - -_LISTINSTRUCTIONSREQUEST = _descriptor.Descriptor( - name="ListInstructionsRequest", - full_name="google.cloud.datalabeling.v1beta1.ListInstructionsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datalabeling.v1beta1.ListInstructionsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A-\n+cloudresourcemanager.googleapis.com/Project" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.datalabeling.v1beta1.ListInstructionsRequest.filter", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.datalabeling.v1beta1.ListInstructionsRequest.page_size", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.datalabeling.v1beta1.ListInstructionsRequest.page_token", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6130, - serialized_end=6294, -) - - -_LISTINSTRUCTIONSRESPONSE = _descriptor.Descriptor( - name="ListInstructionsResponse", - full_name="google.cloud.datalabeling.v1beta1.ListInstructionsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="instructions", - full_name="google.cloud.datalabeling.v1beta1.ListInstructionsResponse.instructions", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.datalabeling.v1beta1.ListInstructionsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6296, - serialized_end=6417, -) - - -_GETEVALUATIONREQUEST = _descriptor.Descriptor( - name="GetEvaluationRequest", - full_name="google.cloud.datalabeling.v1beta1.GetEvaluationRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.GetEvaluationRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A(\n&datalabeling.googleapis.com/Evaluation" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6419, - serialized_end=6503, -) - - -_SEARCHEVALUATIONSREQUEST = _descriptor.Descriptor( - name="SearchEvaluationsRequest", - full_name="google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A(\n&datalabeling.googleapis.com/Evaluation" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest.filter", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest.page_size", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest.page_token", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6506, - serialized_end=6666, -) - - -_SEARCHEVALUATIONSRESPONSE = _descriptor.Descriptor( - name="SearchEvaluationsResponse", - full_name="google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="evaluations", - full_name="google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse.evaluations", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6668, - serialized_end=6788, -) - - -_SEARCHEXAMPLECOMPARISONSREQUEST = _descriptor.Descriptor( - name="SearchExampleComparisonsRequest", - full_name="google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A(\n&datalabeling.googleapis.com/Evaluation" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6791, - serialized_end=6937, -) - - -_SEARCHEXAMPLECOMPARISONSRESPONSE_EXAMPLECOMPARISON = _descriptor.Descriptor( - name="ExampleComparison", - full_name="google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="ground_truth_example", - full_name="google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison.ground_truth_example", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model_created_examples", - full_name="google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison.model_created_examples", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7118, - serialized_end=7287, -) - -_SEARCHEXAMPLECOMPARISONSRESPONSE = _descriptor.Descriptor( - name="SearchExampleComparisonsResponse", - full_name="google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="example_comparisons", - full_name="google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.example_comparisons", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_SEARCHEXAMPLECOMPARISONSRESPONSE_EXAMPLECOMPARISON], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6940, - serialized_end=7287, -) - - -_CREATEEVALUATIONJOBREQUEST = _descriptor.Descriptor( - name="CreateEvaluationJobRequest", - full_name="google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A-\n+cloudresourcemanager.googleapis.com/Project" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job", - full_name="google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest.job", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7290, - serialized_end=7455, -) - - -_UPDATEEVALUATIONJOBREQUEST = _descriptor.Descriptor( - name="UpdateEvaluationJobRequest", - full_name="google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="evaluation_job", - full_name="google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest.evaluation_job", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7458, - serialized_end=7619, -) - - -_GETEVALUATIONJOBREQUEST = _descriptor.Descriptor( - name="GetEvaluationJobRequest", - full_name="google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A+\n)datalabeling.googleapis.com/EvaluationJob" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7621, - serialized_end=7711, -) - - -_PAUSEEVALUATIONJOBREQUEST = _descriptor.Descriptor( - name="PauseEvaluationJobRequest", - full_name="google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A+\n)datalabeling.googleapis.com/EvaluationJob" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7713, - serialized_end=7805, -) - - -_RESUMEEVALUATIONJOBREQUEST = _descriptor.Descriptor( - name="ResumeEvaluationJobRequest", - full_name="google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A+\n)datalabeling.googleapis.com/EvaluationJob" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7807, - serialized_end=7900, -) - - -_DELETEEVALUATIONJOBREQUEST = _descriptor.Descriptor( - name="DeleteEvaluationJobRequest", - full_name="google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A+\n)datalabeling.googleapis.com/EvaluationJob" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7902, - serialized_end=7995, -) - - -_LISTEVALUATIONJOBSREQUEST = _descriptor.Descriptor( - name="ListEvaluationJobsRequest", - full_name="google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A-\n+cloudresourcemanager.googleapis.com/Project" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest.filter", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest.page_size", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest.page_token", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7998, - serialized_end=8164, -) - - -_LISTEVALUATIONJOBSRESPONSE = _descriptor.Descriptor( - name="ListEvaluationJobsResponse", - full_name="google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="evaluation_jobs", - full_name="google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse.evaluation_jobs", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8167, - serialized_end=8295, -) - -_CREATEDATASETREQUEST.fields_by_name[ - "dataset" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._DATASET -) -_LISTDATASETSRESPONSE.fields_by_name[ - "datasets" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._DATASET -) -_IMPORTDATAREQUEST.fields_by_name[ - "input_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._INPUTCONFIG -) -_EXPORTDATAREQUEST.fields_by_name[ - "output_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._OUTPUTCONFIG -) -_LISTDATAITEMSRESPONSE.fields_by_name[ - "data_items" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._DATAITEM -) -_LISTANNOTATEDDATASETSRESPONSE.fields_by_name[ - "annotated_datasets" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._ANNOTATEDDATASET -) -_LABELIMAGEREQUEST.fields_by_name[ - "image_classification_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._IMAGECLASSIFICATIONCONFIG -) -_LABELIMAGEREQUEST.fields_by_name[ - "bounding_poly_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._BOUNDINGPOLYCONFIG -) -_LABELIMAGEREQUEST.fields_by_name[ - "polyline_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._POLYLINECONFIG -) -_LABELIMAGEREQUEST.fields_by_name[ - "segmentation_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._SEGMENTATIONCONFIG -) -_LABELIMAGEREQUEST.fields_by_name[ - "basic_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG -) -_LABELIMAGEREQUEST.fields_by_name["feature"].enum_type = _LABELIMAGEREQUEST_FEATURE -_LABELIMAGEREQUEST_FEATURE.containing_type = _LABELIMAGEREQUEST -_LABELIMAGEREQUEST.oneofs_by_name["request_config"].fields.append( - _LABELIMAGEREQUEST.fields_by_name["image_classification_config"] -) -_LABELIMAGEREQUEST.fields_by_name[ - "image_classification_config" -].containing_oneof = _LABELIMAGEREQUEST.oneofs_by_name["request_config"] -_LABELIMAGEREQUEST.oneofs_by_name["request_config"].fields.append( - _LABELIMAGEREQUEST.fields_by_name["bounding_poly_config"] -) -_LABELIMAGEREQUEST.fields_by_name[ - "bounding_poly_config" -].containing_oneof = _LABELIMAGEREQUEST.oneofs_by_name["request_config"] -_LABELIMAGEREQUEST.oneofs_by_name["request_config"].fields.append( - _LABELIMAGEREQUEST.fields_by_name["polyline_config"] -) -_LABELIMAGEREQUEST.fields_by_name[ - "polyline_config" -].containing_oneof = _LABELIMAGEREQUEST.oneofs_by_name["request_config"] -_LABELIMAGEREQUEST.oneofs_by_name["request_config"].fields.append( - _LABELIMAGEREQUEST.fields_by_name["segmentation_config"] -) -_LABELIMAGEREQUEST.fields_by_name[ - "segmentation_config" -].containing_oneof = _LABELIMAGEREQUEST.oneofs_by_name["request_config"] -_LABELVIDEOREQUEST.fields_by_name[ - "video_classification_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._VIDEOCLASSIFICATIONCONFIG -) -_LABELVIDEOREQUEST.fields_by_name[ - "object_detection_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._OBJECTDETECTIONCONFIG -) -_LABELVIDEOREQUEST.fields_by_name[ - "object_tracking_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._OBJECTTRACKINGCONFIG -) -_LABELVIDEOREQUEST.fields_by_name[ - "event_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._EVENTCONFIG -) -_LABELVIDEOREQUEST.fields_by_name[ - "basic_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG -) -_LABELVIDEOREQUEST.fields_by_name["feature"].enum_type = _LABELVIDEOREQUEST_FEATURE -_LABELVIDEOREQUEST_FEATURE.containing_type = _LABELVIDEOREQUEST -_LABELVIDEOREQUEST.oneofs_by_name["request_config"].fields.append( - _LABELVIDEOREQUEST.fields_by_name["video_classification_config"] -) -_LABELVIDEOREQUEST.fields_by_name[ - "video_classification_config" -].containing_oneof = _LABELVIDEOREQUEST.oneofs_by_name["request_config"] -_LABELVIDEOREQUEST.oneofs_by_name["request_config"].fields.append( - _LABELVIDEOREQUEST.fields_by_name["object_detection_config"] -) -_LABELVIDEOREQUEST.fields_by_name[ - "object_detection_config" -].containing_oneof = _LABELVIDEOREQUEST.oneofs_by_name["request_config"] -_LABELVIDEOREQUEST.oneofs_by_name["request_config"].fields.append( - _LABELVIDEOREQUEST.fields_by_name["object_tracking_config"] -) -_LABELVIDEOREQUEST.fields_by_name[ - "object_tracking_config" -].containing_oneof = _LABELVIDEOREQUEST.oneofs_by_name["request_config"] -_LABELVIDEOREQUEST.oneofs_by_name["request_config"].fields.append( - _LABELVIDEOREQUEST.fields_by_name["event_config"] -) -_LABELVIDEOREQUEST.fields_by_name[ - "event_config" -].containing_oneof = _LABELVIDEOREQUEST.oneofs_by_name["request_config"] -_LABELTEXTREQUEST.fields_by_name[ - "text_classification_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._TEXTCLASSIFICATIONCONFIG -) -_LABELTEXTREQUEST.fields_by_name[ - "text_entity_extraction_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._TEXTENTITYEXTRACTIONCONFIG -) -_LABELTEXTREQUEST.fields_by_name[ - "basic_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG -) -_LABELTEXTREQUEST.fields_by_name["feature"].enum_type = _LABELTEXTREQUEST_FEATURE -_LABELTEXTREQUEST_FEATURE.containing_type = _LABELTEXTREQUEST -_LABELTEXTREQUEST.oneofs_by_name["request_config"].fields.append( - _LABELTEXTREQUEST.fields_by_name["text_classification_config"] -) -_LABELTEXTREQUEST.fields_by_name[ - "text_classification_config" -].containing_oneof = _LABELTEXTREQUEST.oneofs_by_name["request_config"] -_LABELTEXTREQUEST.oneofs_by_name["request_config"].fields.append( - _LABELTEXTREQUEST.fields_by_name["text_entity_extraction_config"] -) -_LABELTEXTREQUEST.fields_by_name[ - "text_entity_extraction_config" -].containing_oneof = _LABELTEXTREQUEST.oneofs_by_name["request_config"] -_LISTEXAMPLESRESPONSE.fields_by_name[ - "examples" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._EXAMPLE -) -_CREATEANNOTATIONSPECSETREQUEST.fields_by_name[ - "annotation_spec_set" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPECSET -) -_LISTANNOTATIONSPECSETSRESPONSE.fields_by_name[ - "annotation_spec_sets" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPECSET -) -_CREATEINSTRUCTIONREQUEST.fields_by_name[ - "instruction" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_instruction__pb2._INSTRUCTION -) -_LISTINSTRUCTIONSRESPONSE.fields_by_name[ - "instructions" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_instruction__pb2._INSTRUCTION -) -_SEARCHEVALUATIONSRESPONSE.fields_by_name[ - "evaluations" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__pb2._EVALUATION -) -_SEARCHEXAMPLECOMPARISONSRESPONSE_EXAMPLECOMPARISON.fields_by_name[ - "ground_truth_example" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._EXAMPLE -) -_SEARCHEXAMPLECOMPARISONSRESPONSE_EXAMPLECOMPARISON.fields_by_name[ - "model_created_examples" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._EXAMPLE -) -_SEARCHEXAMPLECOMPARISONSRESPONSE_EXAMPLECOMPARISON.containing_type = ( - _SEARCHEXAMPLECOMPARISONSRESPONSE -) -_SEARCHEXAMPLECOMPARISONSRESPONSE.fields_by_name[ - "example_comparisons" -].message_type = _SEARCHEXAMPLECOMPARISONSRESPONSE_EXAMPLECOMPARISON -_CREATEEVALUATIONJOBREQUEST.fields_by_name[ - "job" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__job__pb2._EVALUATIONJOB -) -_UPDATEEVALUATIONJOBREQUEST.fields_by_name[ - "evaluation_job" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__job__pb2._EVALUATIONJOB -) -_UPDATEEVALUATIONJOBREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_LISTEVALUATIONJOBSRESPONSE.fields_by_name[ - "evaluation_jobs" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__job__pb2._EVALUATIONJOB -) -DESCRIPTOR.message_types_by_name["CreateDatasetRequest"] = _CREATEDATASETREQUEST -DESCRIPTOR.message_types_by_name["GetDatasetRequest"] = _GETDATASETREQUEST -DESCRIPTOR.message_types_by_name["ListDatasetsRequest"] = _LISTDATASETSREQUEST -DESCRIPTOR.message_types_by_name["ListDatasetsResponse"] = _LISTDATASETSRESPONSE -DESCRIPTOR.message_types_by_name["DeleteDatasetRequest"] = _DELETEDATASETREQUEST -DESCRIPTOR.message_types_by_name["ImportDataRequest"] = _IMPORTDATAREQUEST -DESCRIPTOR.message_types_by_name["ExportDataRequest"] = _EXPORTDATAREQUEST -DESCRIPTOR.message_types_by_name["GetDataItemRequest"] = _GETDATAITEMREQUEST -DESCRIPTOR.message_types_by_name["ListDataItemsRequest"] = _LISTDATAITEMSREQUEST -DESCRIPTOR.message_types_by_name["ListDataItemsResponse"] = _LISTDATAITEMSRESPONSE -DESCRIPTOR.message_types_by_name[ - "GetAnnotatedDatasetRequest" -] = _GETANNOTATEDDATASETREQUEST -DESCRIPTOR.message_types_by_name[ - "ListAnnotatedDatasetsRequest" -] = _LISTANNOTATEDDATASETSREQUEST -DESCRIPTOR.message_types_by_name[ - "ListAnnotatedDatasetsResponse" -] = _LISTANNOTATEDDATASETSRESPONSE -DESCRIPTOR.message_types_by_name[ - "DeleteAnnotatedDatasetRequest" -] = _DELETEANNOTATEDDATASETREQUEST -DESCRIPTOR.message_types_by_name["LabelImageRequest"] = _LABELIMAGEREQUEST -DESCRIPTOR.message_types_by_name["LabelVideoRequest"] = _LABELVIDEOREQUEST -DESCRIPTOR.message_types_by_name["LabelTextRequest"] = _LABELTEXTREQUEST -DESCRIPTOR.message_types_by_name["GetExampleRequest"] = _GETEXAMPLEREQUEST -DESCRIPTOR.message_types_by_name["ListExamplesRequest"] = _LISTEXAMPLESREQUEST -DESCRIPTOR.message_types_by_name["ListExamplesResponse"] = _LISTEXAMPLESRESPONSE -DESCRIPTOR.message_types_by_name[ - "CreateAnnotationSpecSetRequest" -] = _CREATEANNOTATIONSPECSETREQUEST -DESCRIPTOR.message_types_by_name[ - "GetAnnotationSpecSetRequest" -] = _GETANNOTATIONSPECSETREQUEST -DESCRIPTOR.message_types_by_name[ - "ListAnnotationSpecSetsRequest" -] = _LISTANNOTATIONSPECSETSREQUEST -DESCRIPTOR.message_types_by_name[ - "ListAnnotationSpecSetsResponse" -] = _LISTANNOTATIONSPECSETSRESPONSE -DESCRIPTOR.message_types_by_name[ - "DeleteAnnotationSpecSetRequest" -] = _DELETEANNOTATIONSPECSETREQUEST -DESCRIPTOR.message_types_by_name["CreateInstructionRequest"] = _CREATEINSTRUCTIONREQUEST -DESCRIPTOR.message_types_by_name["GetInstructionRequest"] = _GETINSTRUCTIONREQUEST -DESCRIPTOR.message_types_by_name["DeleteInstructionRequest"] = _DELETEINSTRUCTIONREQUEST -DESCRIPTOR.message_types_by_name["ListInstructionsRequest"] = _LISTINSTRUCTIONSREQUEST -DESCRIPTOR.message_types_by_name["ListInstructionsResponse"] = _LISTINSTRUCTIONSRESPONSE -DESCRIPTOR.message_types_by_name["GetEvaluationRequest"] = _GETEVALUATIONREQUEST -DESCRIPTOR.message_types_by_name["SearchEvaluationsRequest"] = _SEARCHEVALUATIONSREQUEST -DESCRIPTOR.message_types_by_name[ - "SearchEvaluationsResponse" -] = _SEARCHEVALUATIONSRESPONSE -DESCRIPTOR.message_types_by_name[ - "SearchExampleComparisonsRequest" -] = _SEARCHEXAMPLECOMPARISONSREQUEST -DESCRIPTOR.message_types_by_name[ - "SearchExampleComparisonsResponse" -] = _SEARCHEXAMPLECOMPARISONSRESPONSE -DESCRIPTOR.message_types_by_name[ - "CreateEvaluationJobRequest" -] = _CREATEEVALUATIONJOBREQUEST -DESCRIPTOR.message_types_by_name[ - "UpdateEvaluationJobRequest" -] = _UPDATEEVALUATIONJOBREQUEST -DESCRIPTOR.message_types_by_name["GetEvaluationJobRequest"] = _GETEVALUATIONJOBREQUEST -DESCRIPTOR.message_types_by_name[ - "PauseEvaluationJobRequest" -] = _PAUSEEVALUATIONJOBREQUEST -DESCRIPTOR.message_types_by_name[ - "ResumeEvaluationJobRequest" -] = _RESUMEEVALUATIONJOBREQUEST -DESCRIPTOR.message_types_by_name[ - "DeleteEvaluationJobRequest" -] = _DELETEEVALUATIONJOBREQUEST -DESCRIPTOR.message_types_by_name[ - "ListEvaluationJobsRequest" -] = _LISTEVALUATIONJOBSREQUEST -DESCRIPTOR.message_types_by_name[ - "ListEvaluationJobsResponse" -] = _LISTEVALUATIONJOBSRESPONSE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -CreateDatasetRequest = _reflection.GeneratedProtocolMessageType( - "CreateDatasetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEDATASETREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for CreateDataset. - - - Attributes: - parent: - Required. Dataset resource parent, format: - projects/{project\_id} - dataset: - Required. The dataset to be created. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.CreateDatasetRequest) - ), -) -_sym_db.RegisterMessage(CreateDatasetRequest) - -GetDatasetRequest = _reflection.GeneratedProtocolMessageType( - "GetDatasetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETDATASETREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for GetDataSet. - - - Attributes: - name: - Required. Dataset resource name, format: - projects/{project\_id}/datasets/{dataset\_id} - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GetDatasetRequest) - ), -) -_sym_db.RegisterMessage(GetDatasetRequest) - -ListDatasetsRequest = _reflection.GeneratedProtocolMessageType( - "ListDatasetsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTDATASETSREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for ListDataset. - - - Attributes: - parent: - Required. Dataset resource parent, format: - projects/{project\_id} - filter: - Optional. Filter on dataset is not supported at this moment. - page_size: - Optional. Requested page size. Server may return fewer results - than requested. Default value is 100. - page_token: - Optional. A token identifying a page of results for the server - to return. Typically obtained by [ListDatasetsResponse.next\_p - age\_token][google.cloud.datalabeling.v1beta1.ListDatasetsResp - onse.next\_page\_token] of the previous - [DataLabelingService.ListDatasets] call. Returns the first - page if empty. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListDatasetsRequest) - ), -) -_sym_db.RegisterMessage(ListDatasetsRequest) - -ListDatasetsResponse = _reflection.GeneratedProtocolMessageType( - "ListDatasetsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTDATASETSRESPONSE, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Results of listing datasets within a project. - - - Attributes: - datasets: - The list of datasets to return. - next_page_token: - A token to retrieve next page of results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListDatasetsResponse) - ), -) -_sym_db.RegisterMessage(ListDatasetsResponse) - -DeleteDatasetRequest = _reflection.GeneratedProtocolMessageType( - "DeleteDatasetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEDATASETREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for DeleteDataset. - - - Attributes: - name: - Required. Dataset resource name, format: - projects/{project\_id}/datasets/{dataset\_id} - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.DeleteDatasetRequest) - ), -) -_sym_db.RegisterMessage(DeleteDatasetRequest) - -ImportDataRequest = _reflection.GeneratedProtocolMessageType( - "ImportDataRequest", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTDATAREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for ImportData API. - - - Attributes: - name: - Required. Dataset resource name, format: - projects/{project\_id}/datasets/{dataset\_id} - input_config: - Required. Specify the input source of the data. - user_email_address: - Email of the user who started the import task and should be - notified by email. If empty no notification will be sent. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImportDataRequest) - ), -) -_sym_db.RegisterMessage(ImportDataRequest) - -ExportDataRequest = _reflection.GeneratedProtocolMessageType( - "ExportDataRequest", - (_message.Message,), - dict( - DESCRIPTOR=_EXPORTDATAREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for ExportData API. - - - Attributes: - name: - Required. Dataset resource name, format: - projects/{project\_id}/datasets/{dataset\_id} - annotated_dataset: - Required. Annotated dataset resource name. DataItem in Dataset - and their annotations in specified annotated dataset will be - exported. It's in format of projects/{project\_id}/datasets/{d - ataset\_id}/annotatedDatasets/ {annotated\_dataset\_id} - filter: - Optional. Filter is not supported at this moment. - output_config: - Required. Specify the output destination. - user_email_address: - Email of the user who started the export task and should be - notified by email. If empty no notification will be sent. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ExportDataRequest) - ), -) -_sym_db.RegisterMessage(ExportDataRequest) - -GetDataItemRequest = _reflection.GeneratedProtocolMessageType( - "GetDataItemRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETDATAITEMREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for GetDataItem. - - - Attributes: - name: - Required. The name of the data item to get, format: projects/{ - project\_id}/datasets/{dataset\_id}/dataItems/{data\_item\_id} - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GetDataItemRequest) - ), -) -_sym_db.RegisterMessage(GetDataItemRequest) - -ListDataItemsRequest = _reflection.GeneratedProtocolMessageType( - "ListDataItemsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTDATAITEMSREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for ListDataItems. - - - Attributes: - parent: - Required. Name of the dataset to list data items, format: - projects/{project\_id}/datasets/{dataset\_id} - filter: - Optional. Filter is not supported at this moment. - page_size: - Optional. Requested page size. Server may return fewer results - than requested. Default value is 100. - page_token: - Optional. A token identifying a page of results for the server - to return. Typically obtained by [ListDataItemsResponse.next\_ - page\_token][google.cloud.datalabeling.v1beta1.ListDataItemsRe - sponse.next\_page\_token] of the previous - [DataLabelingService.ListDataItems] call. Return first page if - empty. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListDataItemsRequest) - ), -) -_sym_db.RegisterMessage(ListDataItemsRequest) - -ListDataItemsResponse = _reflection.GeneratedProtocolMessageType( - "ListDataItemsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTDATAITEMSRESPONSE, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Results of listing data items in a dataset. - - - Attributes: - data_items: - The list of data items to return. - next_page_token: - A token to retrieve next page of results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListDataItemsResponse) - ), -) -_sym_db.RegisterMessage(ListDataItemsResponse) - -GetAnnotatedDatasetRequest = _reflection.GeneratedProtocolMessageType( - "GetAnnotatedDatasetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETANNOTATEDDATASETREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for GetAnnotatedDataset. - - - Attributes: - name: - Required. Name of the annotated dataset to get, format: projec - ts/{project\_id}/datasets/{dataset\_id}/annotatedDatasets/ - {annotated\_dataset\_id} - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GetAnnotatedDatasetRequest) - ), -) -_sym_db.RegisterMessage(GetAnnotatedDatasetRequest) - -ListAnnotatedDatasetsRequest = _reflection.GeneratedProtocolMessageType( - "ListAnnotatedDatasetsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTANNOTATEDDATASETSREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for ListAnnotatedDatasets. - - - Attributes: - parent: - Required. Name of the dataset to list annotated datasets, - format: projects/{project\_id}/datasets/{dataset\_id} - filter: - Optional. Filter is not supported at this moment. - page_size: - Optional. Requested page size. Server may return fewer results - than requested. Default value is 100. - page_token: - Optional. A token identifying a page of results for the server - to return. Typically obtained by [ListAnnotatedDatasetsRespons - e.next\_page\_token][google.cloud.datalabeling.v1beta1.ListAnn - otatedDatasetsResponse.next\_page\_token] of the previous - [DataLabelingService.ListAnnotatedDatasets] call. Return first - page if empty. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsRequest) - ), -) -_sym_db.RegisterMessage(ListAnnotatedDatasetsRequest) - -ListAnnotatedDatasetsResponse = _reflection.GeneratedProtocolMessageType( - "ListAnnotatedDatasetsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTANNOTATEDDATASETSRESPONSE, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Results of listing annotated datasets for a dataset. - - - Attributes: - annotated_datasets: - The list of annotated datasets to return. - next_page_token: - A token to retrieve next page of results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse) - ), -) -_sym_db.RegisterMessage(ListAnnotatedDatasetsResponse) - -DeleteAnnotatedDatasetRequest = _reflection.GeneratedProtocolMessageType( - "DeleteAnnotatedDatasetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEANNOTATEDDATASETREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for DeleteAnnotatedDataset. - - - Attributes: - name: - Required. Name of the annotated dataset to delete, format: pro - jects/{project\_id}/datasets/{dataset\_id}/annotatedDatasets/ - {annotated\_dataset\_id} - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.DeleteAnnotatedDatasetRequest) - ), -) -_sym_db.RegisterMessage(DeleteAnnotatedDatasetRequest) - -LabelImageRequest = _reflection.GeneratedProtocolMessageType( - "LabelImageRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LABELIMAGEREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for starting an image labeling task. - - - Attributes: - request_config: - Required. Config for labeling tasks. The type of request - config must match the selected feature. - image_classification_config: - Configuration for image classification task. One of - image\_classification\_config, bounding\_poly\_config, - polyline\_config and segmentation\_config are required. - bounding_poly_config: - Configuration for bounding box and bounding poly task. One of - image\_classification\_config, bounding\_poly\_config, - polyline\_config and segmentation\_config are required. - polyline_config: - Configuration for polyline task. One of - image\_classification\_config, bounding\_poly\_config, - polyline\_config and segmentation\_config are required. - segmentation_config: - Configuration for segmentation task. One of - image\_classification\_config, bounding\_poly\_config, - polyline\_config and segmentation\_config are required. - parent: - Required. Name of the dataset to request labeling task, - format: projects/{project\_id}/datasets/{dataset\_id} - basic_config: - Required. Basic human annotation config. - feature: - Required. The type of image labeling task. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelImageRequest) - ), -) -_sym_db.RegisterMessage(LabelImageRequest) - -LabelVideoRequest = _reflection.GeneratedProtocolMessageType( - "LabelVideoRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LABELVIDEOREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for LabelVideo. - - - Attributes: - request_config: - Required. Config for labeling tasks. The type of request - config must match the selected feature. - video_classification_config: - Configuration for video classification task. One of - video\_classification\_config, object\_detection\_config, - object\_tracking\_config and event\_config is required. - object_detection_config: - Configuration for video object detection task. One of - video\_classification\_config, object\_detection\_config, - object\_tracking\_config and event\_config is required. - object_tracking_config: - Configuration for video object tracking task. One of - video\_classification\_config, object\_detection\_config, - object\_tracking\_config and event\_config is required. - event_config: - Configuration for video event task. One of - video\_classification\_config, object\_detection\_config, - object\_tracking\_config and event\_config is required. - parent: - Required. Name of the dataset to request labeling task, - format: projects/{project\_id}/datasets/{dataset\_id} - basic_config: - Required. Basic human annotation config. - feature: - Required. The type of video labeling task. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelVideoRequest) - ), -) -_sym_db.RegisterMessage(LabelVideoRequest) - -LabelTextRequest = _reflection.GeneratedProtocolMessageType( - "LabelTextRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LABELTEXTREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for LabelText. - - - Attributes: - request_config: - Required. Config for labeling tasks. The type of request - config must match the selected feature. - text_classification_config: - Configuration for text classification task. One of - text\_classification\_config and - text\_entity\_extraction\_config is required. - text_entity_extraction_config: - Configuration for entity extraction task. One of - text\_classification\_config and - text\_entity\_extraction\_config is required. - parent: - Required. Name of the data set to request labeling task, - format: projects/{project\_id}/datasets/{dataset\_id} - basic_config: - Required. Basic human annotation config. - feature: - Required. The type of text labeling task. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelTextRequest) - ), -) -_sym_db.RegisterMessage(LabelTextRequest) - -GetExampleRequest = _reflection.GeneratedProtocolMessageType( - "GetExampleRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETEXAMPLEREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for GetExample - - - Attributes: - name: - Required. Name of example, format: projects/{project\_id}/data - sets/{dataset\_id}/annotatedDatasets/ - {annotated\_dataset\_id}/examples/{example\_id} - filter: - Optional. An expression for filtering Examples. Filter by - annotation\_spec.display\_name is supported. Format - "annotation\_spec.display\_name = {display\_name}" - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GetExampleRequest) - ), -) -_sym_db.RegisterMessage(GetExampleRequest) - -ListExamplesRequest = _reflection.GeneratedProtocolMessageType( - "ListExamplesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTEXAMPLESREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for ListExamples. - - - Attributes: - parent: - Required. Example resource parent. - filter: - Optional. An expression for filtering Examples. For annotated - datasets that have annotation spec set, filter by - annotation\_spec.display\_name is supported. Format - "annotation\_spec.display\_name = {display\_name}" - page_size: - Optional. Requested page size. Server may return fewer results - than requested. Default value is 100. - page_token: - Optional. A token identifying a page of results for the server - to return. Typically obtained by [ListExamplesResponse.next\_p - age\_token][google.cloud.datalabeling.v1beta1.ListExamplesResp - onse.next\_page\_token] of the previous - [DataLabelingService.ListExamples] call. Return first page if - empty. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListExamplesRequest) - ), -) -_sym_db.RegisterMessage(ListExamplesRequest) - -ListExamplesResponse = _reflection.GeneratedProtocolMessageType( - "ListExamplesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTEXAMPLESRESPONSE, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Results of listing Examples in and annotated dataset. - - - Attributes: - examples: - The list of examples to return. - next_page_token: - A token to retrieve next page of results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListExamplesResponse) - ), -) -_sym_db.RegisterMessage(ListExamplesResponse) - -CreateAnnotationSpecSetRequest = _reflection.GeneratedProtocolMessageType( - "CreateAnnotationSpecSetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEANNOTATIONSPECSETREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for CreateAnnotationSpecSet. - - - Attributes: - parent: - Required. AnnotationSpecSet resource parent, format: - projects/{project\_id} - annotation_spec_set: - Required. Annotation spec set to create. Annotation specs must - be included. Only one annotation spec will be accepted for - annotation specs with same display\_name. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.CreateAnnotationSpecSetRequest) - ), -) -_sym_db.RegisterMessage(CreateAnnotationSpecSetRequest) - -GetAnnotationSpecSetRequest = _reflection.GeneratedProtocolMessageType( - "GetAnnotationSpecSetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETANNOTATIONSPECSETREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for GetAnnotationSpecSet. - - - Attributes: - name: - Required. AnnotationSpecSet resource name, format: projects/{p - roject\_id}/annotationSpecSets/{annotation\_spec\_set\_id} - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GetAnnotationSpecSetRequest) - ), -) -_sym_db.RegisterMessage(GetAnnotationSpecSetRequest) - -ListAnnotationSpecSetsRequest = _reflection.GeneratedProtocolMessageType( - "ListAnnotationSpecSetsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTANNOTATIONSPECSETSREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for ListAnnotationSpecSets. - - - Attributes: - parent: - Required. Parent of AnnotationSpecSet resource, format: - projects/{project\_id} - filter: - Optional. Filter is not supported at this moment. - page_size: - Optional. Requested page size. Server may return fewer results - than requested. Default value is 100. - page_token: - Optional. A token identifying a page of results for the server - to return. Typically obtained by [ListAnnotationSpecSetsRespon - se.next\_page\_token][google.cloud.datalabeling.v1beta1.ListAn - notationSpecSetsResponse.next\_page\_token] of the previous - [DataLabelingService.ListAnnotationSpecSets] call. Return - first page if empty. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsRequest) - ), -) -_sym_db.RegisterMessage(ListAnnotationSpecSetsRequest) - -ListAnnotationSpecSetsResponse = _reflection.GeneratedProtocolMessageType( - "ListAnnotationSpecSetsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTANNOTATIONSPECSETSRESPONSE, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Results of listing annotation spec set under a project. - - - Attributes: - annotation_spec_sets: - The list of annotation spec sets. - next_page_token: - A token to retrieve next page of results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse) - ), -) -_sym_db.RegisterMessage(ListAnnotationSpecSetsResponse) - -DeleteAnnotationSpecSetRequest = _reflection.GeneratedProtocolMessageType( - "DeleteAnnotationSpecSetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEANNOTATIONSPECSETREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for DeleteAnnotationSpecSet. - - - Attributes: - name: - Required. AnnotationSpec resource name, format: ``projects/{pr - oject_id}/annotationSpecSets/{annotation_spec_set_id}``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.DeleteAnnotationSpecSetRequest) - ), -) -_sym_db.RegisterMessage(DeleteAnnotationSpecSetRequest) - -CreateInstructionRequest = _reflection.GeneratedProtocolMessageType( - "CreateInstructionRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEINSTRUCTIONREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for CreateInstruction. - - - Attributes: - parent: - Required. Instruction resource parent, format: - projects/{project\_id} - instruction: - Required. Instruction of how to perform the labeling task. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.CreateInstructionRequest) - ), -) -_sym_db.RegisterMessage(CreateInstructionRequest) - -GetInstructionRequest = _reflection.GeneratedProtocolMessageType( - "GetInstructionRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETINSTRUCTIONREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for GetInstruction. - - - Attributes: - name: - Required. Instruction resource name, format: - projects/{project\_id}/instructions/{instruction\_id} - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GetInstructionRequest) - ), -) -_sym_db.RegisterMessage(GetInstructionRequest) - -DeleteInstructionRequest = _reflection.GeneratedProtocolMessageType( - "DeleteInstructionRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEINSTRUCTIONREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for DeleteInstruction. - - - Attributes: - name: - Required. Instruction resource name, format: - projects/{project\_id}/instructions/{instruction\_id} - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.DeleteInstructionRequest) - ), -) -_sym_db.RegisterMessage(DeleteInstructionRequest) - -ListInstructionsRequest = _reflection.GeneratedProtocolMessageType( - "ListInstructionsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTINSTRUCTIONSREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for ListInstructions. - - - Attributes: - parent: - Required. Instruction resource parent, format: - projects/{project\_id} - filter: - Optional. Filter is not supported at this moment. - page_size: - Optional. Requested page size. Server may return fewer results - than requested. Default value is 100. - page_token: - Optional. A token identifying a page of results for the server - to return. Typically obtained by [ListInstructionsResponse.nex - t\_page\_token][google.cloud.datalabeling.v1beta1.ListInstruct - ionsResponse.next\_page\_token] of the previous - [DataLabelingService.ListInstructions] call. Return first page - if empty. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListInstructionsRequest) - ), -) -_sym_db.RegisterMessage(ListInstructionsRequest) - -ListInstructionsResponse = _reflection.GeneratedProtocolMessageType( - "ListInstructionsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTINSTRUCTIONSRESPONSE, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Results of listing instructions under a project. - - - Attributes: - instructions: - The list of Instructions to return. - next_page_token: - A token to retrieve next page of results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListInstructionsResponse) - ), -) -_sym_db.RegisterMessage(ListInstructionsResponse) - -GetEvaluationRequest = _reflection.GeneratedProtocolMessageType( - "GetEvaluationRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETEVALUATIONREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for GetEvaluation. - - - Attributes: - name: - Required. Name of the evaluation. Format: "projects/{project\ - _id}/datasets/{dataset\_id}/evaluations/{evaluation\_id}' - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GetEvaluationRequest) - ), -) -_sym_db.RegisterMessage(GetEvaluationRequest) - -SearchEvaluationsRequest = _reflection.GeneratedProtocolMessageType( - "SearchEvaluationsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SEARCHEVALUATIONSREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for SearchEvaluation. - - - Attributes: - parent: - Required. Evaluation search parent (project ID). Format: - "projects/{project\_id}" - filter: - Optional. To search evaluations, you can filter by the - following: - evaluation\_job.evaluation\_job\_id (the last - part of [EvaluationJob.name][google.cloud.datalabeling.v1be - ta1.EvaluationJob.name]) - evaluation\_job.model\_id (the - {model\_name} portion of [EvaluationJob.modelVersion][googl - e.cloud.datalabeling.v1beta1.EvaluationJob.model\_version]) - - evaluation\_job.evaluation\_job\_run\_time\_start (Minimum - threshold for the [evaluationJobRunTime][google.cloud.da - talabeling.v1beta1.Evaluation.evaluation\_job\_run\_time] - that created the evaluation) - - evaluation\_job.evaluation\_job\_run\_time\_end (Maximum - threshold for the [evaluationJobRunTime][google.cloud.da - talabeling.v1beta1.Evaluation.evaluation\_job\_run\_time] - that created the evaluation) - evaluation\_job.job\_state - ([EvaluationJob.state][google.cloud.datalabeling.v1beta1.Evalu - ationJob.state]) - annotation\_spec.display\_name (the - Evaluation contains a metric for the annotation spec with - this [displayName][google.cloud.datalabeling.v1beta1.Annota - tionSpec.display\_name]) To filter by multiple critiera, use - the ``AND`` operator or the ``OR`` operator. The following - examples shows a string that filters by several critiera: - "evaluation\_job.evaluation\_job\_id = {evaluation\_job\_id} - AND evaluation\ *job.model\_id = {model\_name} AND - evaluation*\ job.evaluation\_job\_run\_time\_start = - {timestamp\_1} AND evaluation\ - *job.evaluation\_job\_run\_time\_end = {timestamp\_2} AND - annotation*\ spec.display\_name = {display\_name}" - page_size: - Optional. Requested page size. Server may return fewer results - than requested. Default value is 100. - page_token: - Optional. A token identifying a page of results for the server - to return. Typically obtained by the [nextPageToken][google.cl - oud.datalabeling.v1beta1.SearchEvaluationsResponse.next\_page\ - _token] of the response to a previous search request. If you - don't specify this field, the API call requests the first page - of the search. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.SearchEvaluationsRequest) - ), -) -_sym_db.RegisterMessage(SearchEvaluationsRequest) - -SearchEvaluationsResponse = _reflection.GeneratedProtocolMessageType( - "SearchEvaluationsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_SEARCHEVALUATIONSRESPONSE, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Results of searching evaluations. - - - Attributes: - evaluations: - The list of evaluations matching the search. - next_page_token: - A token to retrieve next page of results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.SearchEvaluationsResponse) - ), -) -_sym_db.RegisterMessage(SearchEvaluationsResponse) - -SearchExampleComparisonsRequest = _reflection.GeneratedProtocolMessageType( - "SearchExampleComparisonsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SEARCHEXAMPLECOMPARISONSREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message of SearchExampleComparisons. - - - Attributes: - parent: - Required. Name of the - [Evaluation][google.cloud.datalabeling.v1beta1.Evaluation] - resource to search for example comparisons from. Format: "pro - jects/{project\_id}/datasets/{dataset\_id}/evaluations/{evalua - tion\_id}" - page_size: - Optional. Requested page size. Server may return fewer results - than requested. Default value is 100. - page_token: - Optional. A token identifying a page of results for the server - to return. Typically obtained by the - [nextPageToken][SearchExampleComparisons.next\_page\_token] of - the response to a previous search rquest. If you don't - specify this field, the API call requests the first page of - the search. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.SearchExampleComparisonsRequest) - ), -) -_sym_db.RegisterMessage(SearchExampleComparisonsRequest) - -SearchExampleComparisonsResponse = _reflection.GeneratedProtocolMessageType( - "SearchExampleComparisonsResponse", - (_message.Message,), - dict( - ExampleComparison=_reflection.GeneratedProtocolMessageType( - "ExampleComparison", - (_message.Message,), - dict( - DESCRIPTOR=_SEARCHEXAMPLECOMPARISONSRESPONSE_EXAMPLECOMPARISON, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Example comparisons comparing ground truth output and - predictions for a specific input. - - - Attributes: - ground_truth_example: - The ground truth output for the input. - model_created_examples: - Predictions by the model for the input. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse.ExampleComparison) - ), - ), - DESCRIPTOR=_SEARCHEXAMPLECOMPARISONSRESPONSE, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Results of searching example comparisons. - - - Attributes: - example_comparisons: - A list of example comparisons matching the search criteria. - next_page_token: - A token to retrieve next page of results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.SearchExampleComparisonsResponse) - ), -) -_sym_db.RegisterMessage(SearchExampleComparisonsResponse) -_sym_db.RegisterMessage(SearchExampleComparisonsResponse.ExampleComparison) - -CreateEvaluationJobRequest = _reflection.GeneratedProtocolMessageType( - "CreateEvaluationJobRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEEVALUATIONJOBREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for CreateEvaluationJob. - - - Attributes: - parent: - Required. Evaluation job resource parent. Format: - "projects/{project\_id}" - job: - Required. The evaluation job to create. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.CreateEvaluationJobRequest) - ), -) -_sym_db.RegisterMessage(CreateEvaluationJobRequest) - -UpdateEvaluationJobRequest = _reflection.GeneratedProtocolMessageType( - "UpdateEvaluationJobRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEEVALUATIONJOBREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for UpdateEvaluationJob. - - - Attributes: - evaluation_job: - Required. Evaluation job that is going to be updated. - update_mask: - Optional. Mask for which fields to update. You can only - provide the following fields: - - ``evaluationJobConfig.humanAnnotationConfig.instruction`` - - ``evaluationJobConfig.exampleCount`` - - ``evaluationJobConfig.exampleSamplePercentage`` You can - provide more than one of these fields by separating them with - commas. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.UpdateEvaluationJobRequest) - ), -) -_sym_db.RegisterMessage(UpdateEvaluationJobRequest) - -GetEvaluationJobRequest = _reflection.GeneratedProtocolMessageType( - "GetEvaluationJobRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETEVALUATIONJOBREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for GetEvaluationJob. - - - Attributes: - name: - Required. Name of the evaluation job. Format: - "projects/{project\_id}/evaluationJobs/{evaluation\_job\_id}" - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GetEvaluationJobRequest) - ), -) -_sym_db.RegisterMessage(GetEvaluationJobRequest) - -PauseEvaluationJobRequest = _reflection.GeneratedProtocolMessageType( - "PauseEvaluationJobRequest", - (_message.Message,), - dict( - DESCRIPTOR=_PAUSEEVALUATIONJOBREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for PauseEvaluationJob. - - - Attributes: - name: - Required. Name of the evaluation job that is going to be - paused. Format: - "projects/{project\_id}/evaluationJobs/{evaluation\_job\_id}" - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.PauseEvaluationJobRequest) - ), -) -_sym_db.RegisterMessage(PauseEvaluationJobRequest) - -ResumeEvaluationJobRequest = _reflection.GeneratedProtocolMessageType( - "ResumeEvaluationJobRequest", - (_message.Message,), - dict( - DESCRIPTOR=_RESUMEEVALUATIONJOBREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message ResumeEvaluationJob. - - - Attributes: - name: - Required. Name of the evaluation job that is going to be - resumed. Format: - "projects/{project\_id}/evaluationJobs/{evaluation\_job\_id}" - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ResumeEvaluationJobRequest) - ), -) -_sym_db.RegisterMessage(ResumeEvaluationJobRequest) - -DeleteEvaluationJobRequest = _reflection.GeneratedProtocolMessageType( - "DeleteEvaluationJobRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEEVALUATIONJOBREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message DeleteEvaluationJob. - - - Attributes: - name: - Required. Name of the evaluation job that is going to be - deleted. Format: - "projects/{project\_id}/evaluationJobs/{evaluation\_job\_id}" - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.DeleteEvaluationJobRequest) - ), -) -_sym_db.RegisterMessage(DeleteEvaluationJobRequest) - -ListEvaluationJobsRequest = _reflection.GeneratedProtocolMessageType( - "ListEvaluationJobsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTEVALUATIONJOBSREQUEST, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Request message for ListEvaluationJobs. - - - Attributes: - parent: - Required. Evaluation job resource parent. Format: - "projects/{project\_id}" - filter: - Optional. You can filter the jobs to list by model\_id (also - known as model\_name, as described in [EvaluationJob.modelVers - ion][google.cloud.datalabeling.v1beta1.EvaluationJob.model\_ve - rsion]) or by evaluation job state (as described in [Evaluatio - nJob.state][google.cloud.datalabeling.v1beta1.EvaluationJob.st - ate]). To filter by both criteria, use the ``AND`` operator or - the ``OR`` operator. For example, you can use the following - string for your filter: "evaluation*job.model\_id = - {model\_name} AND evaluation*\ job.state = - {evaluation\_job\_state}" - page_size: - Optional. Requested page size. Server may return fewer results - than requested. Default value is 100. - page_token: - Optional. A token identifying a page of results for the server - to return. Typically obtained by the [nextPageToken][google.cl - oud.datalabeling.v1beta1.ListEvaluationJobsResponse.next\_page - \_token] in the response to the previous request. The request - returns the first page if this is empty. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListEvaluationJobsRequest) - ), -) -_sym_db.RegisterMessage(ListEvaluationJobsRequest) - -ListEvaluationJobsResponse = _reflection.GeneratedProtocolMessageType( - "ListEvaluationJobsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTEVALUATIONJOBSRESPONSE, - __module__="google.cloud.datalabeling_v1beta1.proto.data_labeling_service_pb2", - __doc__="""Results for listing evaluation jobs. - - - Attributes: - evaluation_jobs: - The list of evaluation jobs to return. - next_page_token: - A token to retrieve next page of results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ListEvaluationJobsResponse) - ), -) -_sym_db.RegisterMessage(ListEvaluationJobsResponse) - - -DESCRIPTOR._options = None -_CREATEDATASETREQUEST.fields_by_name["parent"]._options = None -_CREATEDATASETREQUEST.fields_by_name["dataset"]._options = None -_GETDATASETREQUEST.fields_by_name["name"]._options = None -_LISTDATASETSREQUEST.fields_by_name["parent"]._options = None -_LISTDATASETSREQUEST.fields_by_name["filter"]._options = None -_LISTDATASETSREQUEST.fields_by_name["page_size"]._options = None -_LISTDATASETSREQUEST.fields_by_name["page_token"]._options = None -_DELETEDATASETREQUEST.fields_by_name["name"]._options = None -_IMPORTDATAREQUEST.fields_by_name["name"]._options = None -_IMPORTDATAREQUEST.fields_by_name["input_config"]._options = None -_EXPORTDATAREQUEST.fields_by_name["name"]._options = None -_EXPORTDATAREQUEST.fields_by_name["annotated_dataset"]._options = None -_EXPORTDATAREQUEST.fields_by_name["filter"]._options = None -_EXPORTDATAREQUEST.fields_by_name["output_config"]._options = None -_GETDATAITEMREQUEST.fields_by_name["name"]._options = None -_LISTDATAITEMSREQUEST.fields_by_name["parent"]._options = None -_LISTDATAITEMSREQUEST.fields_by_name["filter"]._options = None -_LISTDATAITEMSREQUEST.fields_by_name["page_size"]._options = None -_LISTDATAITEMSREQUEST.fields_by_name["page_token"]._options = None -_GETANNOTATEDDATASETREQUEST.fields_by_name["name"]._options = None -_LISTANNOTATEDDATASETSREQUEST.fields_by_name["parent"]._options = None -_LISTANNOTATEDDATASETSREQUEST.fields_by_name["filter"]._options = None -_LISTANNOTATEDDATASETSREQUEST.fields_by_name["page_size"]._options = None -_LISTANNOTATEDDATASETSREQUEST.fields_by_name["page_token"]._options = None -_DELETEANNOTATEDDATASETREQUEST.fields_by_name["name"]._options = None -_LABELIMAGEREQUEST.fields_by_name["parent"]._options = None -_LABELIMAGEREQUEST.fields_by_name["basic_config"]._options = None -_LABELIMAGEREQUEST.fields_by_name["feature"]._options = None -_LABELVIDEOREQUEST.fields_by_name["parent"]._options = None -_LABELVIDEOREQUEST.fields_by_name["basic_config"]._options = None -_LABELVIDEOREQUEST.fields_by_name["feature"]._options = None -_LABELTEXTREQUEST.fields_by_name["parent"]._options = None -_LABELTEXTREQUEST.fields_by_name["basic_config"]._options = None -_LABELTEXTREQUEST.fields_by_name["feature"]._options = None -_GETEXAMPLEREQUEST.fields_by_name["name"]._options = None -_GETEXAMPLEREQUEST.fields_by_name["filter"]._options = None -_LISTEXAMPLESREQUEST.fields_by_name["parent"]._options = None -_LISTEXAMPLESREQUEST.fields_by_name["filter"]._options = None -_LISTEXAMPLESREQUEST.fields_by_name["page_size"]._options = None -_LISTEXAMPLESREQUEST.fields_by_name["page_token"]._options = None -_CREATEANNOTATIONSPECSETREQUEST.fields_by_name["parent"]._options = None -_CREATEANNOTATIONSPECSETREQUEST.fields_by_name["annotation_spec_set"]._options = None -_GETANNOTATIONSPECSETREQUEST.fields_by_name["name"]._options = None -_LISTANNOTATIONSPECSETSREQUEST.fields_by_name["parent"]._options = None -_LISTANNOTATIONSPECSETSREQUEST.fields_by_name["filter"]._options = None -_LISTANNOTATIONSPECSETSREQUEST.fields_by_name["page_size"]._options = None -_LISTANNOTATIONSPECSETSREQUEST.fields_by_name["page_token"]._options = None -_DELETEANNOTATIONSPECSETREQUEST.fields_by_name["name"]._options = None -_CREATEINSTRUCTIONREQUEST.fields_by_name["parent"]._options = None -_CREATEINSTRUCTIONREQUEST.fields_by_name["instruction"]._options = None -_GETINSTRUCTIONREQUEST.fields_by_name["name"]._options = None -_DELETEINSTRUCTIONREQUEST.fields_by_name["name"]._options = None -_LISTINSTRUCTIONSREQUEST.fields_by_name["parent"]._options = None -_LISTINSTRUCTIONSREQUEST.fields_by_name["filter"]._options = None -_LISTINSTRUCTIONSREQUEST.fields_by_name["page_size"]._options = None -_LISTINSTRUCTIONSREQUEST.fields_by_name["page_token"]._options = None -_GETEVALUATIONREQUEST.fields_by_name["name"]._options = None -_SEARCHEVALUATIONSREQUEST.fields_by_name["parent"]._options = None -_SEARCHEVALUATIONSREQUEST.fields_by_name["filter"]._options = None -_SEARCHEVALUATIONSREQUEST.fields_by_name["page_size"]._options = None -_SEARCHEVALUATIONSREQUEST.fields_by_name["page_token"]._options = None -_SEARCHEXAMPLECOMPARISONSREQUEST.fields_by_name["parent"]._options = None -_SEARCHEXAMPLECOMPARISONSREQUEST.fields_by_name["page_size"]._options = None -_SEARCHEXAMPLECOMPARISONSREQUEST.fields_by_name["page_token"]._options = None -_CREATEEVALUATIONJOBREQUEST.fields_by_name["parent"]._options = None -_CREATEEVALUATIONJOBREQUEST.fields_by_name["job"]._options = None -_UPDATEEVALUATIONJOBREQUEST.fields_by_name["evaluation_job"]._options = None -_UPDATEEVALUATIONJOBREQUEST.fields_by_name["update_mask"]._options = None -_GETEVALUATIONJOBREQUEST.fields_by_name["name"]._options = None -_PAUSEEVALUATIONJOBREQUEST.fields_by_name["name"]._options = None -_RESUMEEVALUATIONJOBREQUEST.fields_by_name["name"]._options = None -_DELETEEVALUATIONJOBREQUEST.fields_by_name["name"]._options = None -_LISTEVALUATIONJOBSREQUEST.fields_by_name["parent"]._options = None -_LISTEVALUATIONJOBSREQUEST.fields_by_name["filter"]._options = None -_LISTEVALUATIONJOBSREQUEST.fields_by_name["page_size"]._options = None -_LISTEVALUATIONJOBSREQUEST.fields_by_name["page_token"]._options = None - -_DATALABELINGSERVICE = _descriptor.ServiceDescriptor( - name="DataLabelingService", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\033datalabeling.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=8298, - serialized_end=15504, - methods=[ - _descriptor.MethodDescriptor( - name="CreateDataset", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.CreateDataset", - index=0, - containing_service=None, - input_type=_CREATEDATASETREQUEST, - output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._DATASET, - serialized_options=_b( - '\202\323\344\223\002*"%/v1beta1/{parent=projects/*}/datasets:\001*\332A\016parent,dataset' - ), - ), - _descriptor.MethodDescriptor( - name="GetDataset", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.GetDataset", - index=1, - containing_service=None, - input_type=_GETDATASETREQUEST, - output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._DATASET, - serialized_options=_b( - "\202\323\344\223\002'\022%/v1beta1/{name=projects/*/datasets/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ListDatasets", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.ListDatasets", - index=2, - containing_service=None, - input_type=_LISTDATASETSREQUEST, - output_type=_LISTDATASETSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002'\022%/v1beta1/{parent=projects/*}/datasets\332A\rparent,filter" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteDataset", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteDataset", - index=3, - containing_service=None, - input_type=_DELETEDATASETREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002'*%/v1beta1/{name=projects/*/datasets/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ImportData", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.ImportData", - index=4, - containing_service=None, - input_type=_IMPORTDATAREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\0025"0/v1beta1/{name=projects/*/datasets/*}:importData:\001*\332A\021name,input_config\312A:\n\033ImportDataOperationResponse\022\033ImportDataOperationMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="ExportData", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.ExportData", - index=5, - containing_service=None, - input_type=_EXPORTDATAREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\0025"0/v1beta1/{name=projects/*/datasets/*}:exportData:\001*\332A+name,annotated_dataset,filter,output_config\312A:\n\033ExportDataOperationResponse\022\033ExportDataOperationMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="GetDataItem", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.GetDataItem", - index=6, - containing_service=None, - input_type=_GETDATAITEMREQUEST, - output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._DATAITEM, - serialized_options=_b( - "\202\323\344\223\0023\0221/v1beta1/{name=projects/*/datasets/*/dataItems/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ListDataItems", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.ListDataItems", - index=7, - containing_service=None, - input_type=_LISTDATAITEMSREQUEST, - output_type=_LISTDATAITEMSRESPONSE, - serialized_options=_b( - "\202\323\344\223\0023\0221/v1beta1/{parent=projects/*/datasets/*}/dataItems\332A\rparent,filter" - ), - ), - _descriptor.MethodDescriptor( - name="GetAnnotatedDataset", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.GetAnnotatedDataset", - index=8, - containing_service=None, - input_type=_GETANNOTATEDDATASETREQUEST, - output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._ANNOTATEDDATASET, - serialized_options=_b( - "\202\323\344\223\002;\0229/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ListAnnotatedDatasets", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.ListAnnotatedDatasets", - index=9, - containing_service=None, - input_type=_LISTANNOTATEDDATASETSREQUEST, - output_type=_LISTANNOTATEDDATASETSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002;\0229/v1beta1/{parent=projects/*/datasets/*}/annotatedDatasets\332A\rparent,filter" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteAnnotatedDataset", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteAnnotatedDataset", - index=10, - containing_service=None, - input_type=_DELETEANNOTATEDDATASETREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002;*9/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}" - ), - ), - _descriptor.MethodDescriptor( - name="LabelImage", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.LabelImage", - index=11, - containing_service=None, - input_type=_LABELIMAGEREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\0028"3/v1beta1/{parent=projects/*/datasets/*}/image:label:\001*\332A\033parent,basic_config,feature\312A*\n\020AnnotatedDataset\022\026LabelOperationMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="LabelVideo", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.LabelVideo", - index=12, - containing_service=None, - input_type=_LABELVIDEOREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\0028"3/v1beta1/{parent=projects/*/datasets/*}/video:label:\001*\332A\033parent,basic_config,feature\312A*\n\020AnnotatedDataset\022\026LabelOperationMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="LabelText", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.LabelText", - index=13, - containing_service=None, - input_type=_LABELTEXTREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\0027"2/v1beta1/{parent=projects/*/datasets/*}/text:label:\001*\332A\033parent,basic_config,feature\312A*\n\020AnnotatedDataset\022\026LabelOperationMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="GetExample", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.GetExample", - index=14, - containing_service=None, - input_type=_GETEXAMPLEREQUEST, - output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._EXAMPLE, - serialized_options=_b( - "\202\323\344\223\002F\022D/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*/examples/*}\332A\013name,filter" - ), - ), - _descriptor.MethodDescriptor( - name="ListExamples", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.ListExamples", - index=15, - containing_service=None, - input_type=_LISTEXAMPLESREQUEST, - output_type=_LISTEXAMPLESRESPONSE, - serialized_options=_b( - "\202\323\344\223\002F\022D/v1beta1/{parent=projects/*/datasets/*/annotatedDatasets/*}/examples\332A\rparent,filter" - ), - ), - _descriptor.MethodDescriptor( - name="CreateAnnotationSpecSet", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.CreateAnnotationSpecSet", - index=16, - containing_service=None, - input_type=_CREATEANNOTATIONSPECSETREQUEST, - output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPECSET, - serialized_options=_b( - '\202\323\344\223\0024"//v1beta1/{parent=projects/*}/annotationSpecSets:\001*\332A\032parent,annotation_spec_set' - ), - ), - _descriptor.MethodDescriptor( - name="GetAnnotationSpecSet", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.GetAnnotationSpecSet", - index=17, - containing_service=None, - input_type=_GETANNOTATIONSPECSETREQUEST, - output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPECSET, - serialized_options=_b( - "\202\323\344\223\0021\022//v1beta1/{name=projects/*/annotationSpecSets/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ListAnnotationSpecSets", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.ListAnnotationSpecSets", - index=18, - containing_service=None, - input_type=_LISTANNOTATIONSPECSETSREQUEST, - output_type=_LISTANNOTATIONSPECSETSRESPONSE, - serialized_options=_b( - "\202\323\344\223\0021\022//v1beta1/{parent=projects/*}/annotationSpecSets\332A\rparent,filter" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteAnnotationSpecSet", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteAnnotationSpecSet", - index=19, - containing_service=None, - input_type=_DELETEANNOTATIONSPECSETREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\0021*//v1beta1/{name=projects/*/annotationSpecSets/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="CreateInstruction", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.CreateInstruction", - index=20, - containing_service=None, - input_type=_CREATEINSTRUCTIONREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002.")/v1beta1/{parent=projects/*}/instructions:\001*\332A\022parent,instruction\312A(\n\013Instruction\022\031CreateInstructionMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="GetInstruction", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.GetInstruction", - index=21, - containing_service=None, - input_type=_GETINSTRUCTIONREQUEST, - output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_instruction__pb2._INSTRUCTION, - serialized_options=_b( - "\202\323\344\223\002+\022)/v1beta1/{name=projects/*/instructions/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ListInstructions", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.ListInstructions", - index=22, - containing_service=None, - input_type=_LISTINSTRUCTIONSREQUEST, - output_type=_LISTINSTRUCTIONSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002+\022)/v1beta1/{parent=projects/*}/instructions\332A\rparent,filter" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteInstruction", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteInstruction", - index=23, - containing_service=None, - input_type=_DELETEINSTRUCTIONREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002+*)/v1beta1/{name=projects/*/instructions/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="GetEvaluation", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.GetEvaluation", - index=24, - containing_service=None, - input_type=_GETEVALUATIONREQUEST, - output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__pb2._EVALUATION, - serialized_options=_b( - "\202\323\344\223\0025\0223/v1beta1/{name=projects/*/datasets/*/evaluations/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="SearchEvaluations", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations", - index=25, - containing_service=None, - input_type=_SEARCHEVALUATIONSREQUEST, - output_type=_SEARCHEVALUATIONSRESPONSE, - serialized_options=_b( - "\202\323\344\223\0021\022//v1beta1/{parent=projects/*}/evaluations:search\332A\rparent,filter" - ), - ), - _descriptor.MethodDescriptor( - name="SearchExampleComparisons", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.SearchExampleComparisons", - index=26, - containing_service=None, - input_type=_SEARCHEXAMPLECOMPARISONSREQUEST, - output_type=_SEARCHEXAMPLECOMPARISONSRESPONSE, - serialized_options=_b( - '\202\323\344\223\002T"O/v1beta1/{parent=projects/*/datasets/*/evaluations/*}/exampleComparisons:search:\001*\332A\006parent' - ), - ), - _descriptor.MethodDescriptor( - name="CreateEvaluationJob", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.CreateEvaluationJob", - index=27, - containing_service=None, - input_type=_CREATEEVALUATIONJOBREQUEST, - output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__job__pb2._EVALUATIONJOB, - serialized_options=_b( - '\202\323\344\223\0020"+/v1beta1/{parent=projects/*}/evaluationJobs:\001*\332A\nparent,job' - ), - ), - _descriptor.MethodDescriptor( - name="UpdateEvaluationJob", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.UpdateEvaluationJob", - index=28, - containing_service=None, - input_type=_UPDATEEVALUATIONJOBREQUEST, - output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__job__pb2._EVALUATIONJOB, - serialized_options=_b( - "\202\323\344\223\002L2:/v1beta1/{evaluation_job.name=projects/*/evaluationJobs/*}:\016evaluation_job\332A\032evaluation_job,update_mask" - ), - ), - _descriptor.MethodDescriptor( - name="GetEvaluationJob", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.GetEvaluationJob", - index=29, - containing_service=None, - input_type=_GETEVALUATIONJOBREQUEST, - output_type=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__job__pb2._EVALUATIONJOB, - serialized_options=_b( - "\202\323\344\223\002-\022+/v1beta1/{name=projects/*/evaluationJobs/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="PauseEvaluationJob", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.PauseEvaluationJob", - index=30, - containing_service=None, - input_type=_PAUSEEVALUATIONJOBREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - '\202\323\344\223\0026"1/v1beta1/{name=projects/*/evaluationJobs/*}:pause:\001*\332A\004name' - ), - ), - _descriptor.MethodDescriptor( - name="ResumeEvaluationJob", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.ResumeEvaluationJob", - index=31, - containing_service=None, - input_type=_RESUMEEVALUATIONJOBREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - '\202\323\344\223\0027"2/v1beta1/{name=projects/*/evaluationJobs/*}:resume:\001*\332A\004name' - ), - ), - _descriptor.MethodDescriptor( - name="DeleteEvaluationJob", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteEvaluationJob", - index=32, - containing_service=None, - input_type=_DELETEEVALUATIONJOBREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002-*+/v1beta1/{name=projects/*/evaluationJobs/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ListEvaluationJobs", - full_name="google.cloud.datalabeling.v1beta1.DataLabelingService.ListEvaluationJobs", - index=33, - containing_service=None, - input_type=_LISTEVALUATIONJOBSREQUEST, - output_type=_LISTEVALUATIONJOBSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002-\022+/v1beta1/{parent=projects/*}/evaluationJobs\332A\rparent,filter" - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_DATALABELINGSERVICE) - -DESCRIPTOR.services_by_name["DataLabelingService"] = _DATALABELINGSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service_pb2_grpc.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service_pb2_grpc.py deleted file mode 100644 index 0fd76723ce2f..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_labeling_service_pb2_grpc.py +++ /dev/null @@ -1,649 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.datalabeling_v1beta1.proto import ( - annotation_spec_set_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2, -) -from google.cloud.datalabeling_v1beta1.proto import ( - data_labeling_service_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2, -) -from google.cloud.datalabeling_v1beta1.proto import ( - dataset_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2, -) -from google.cloud.datalabeling_v1beta1.proto import ( - evaluation_job_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__job__pb2, -) -from google.cloud.datalabeling_v1beta1.proto import ( - evaluation_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__pb2, -) -from google.cloud.datalabeling_v1beta1.proto import ( - instruction_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_instruction__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class DataLabelingServiceStub(object): - # missing associated documentation comment in .proto file - pass - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateDataset = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/CreateDataset", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.CreateDatasetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.Dataset.FromString, - ) - self.GetDataset = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/GetDataset", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetDatasetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.Dataset.FromString, - ) - self.ListDatasets = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/ListDatasets", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListDatasetsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListDatasetsResponse.FromString, - ) - self.DeleteDataset = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/DeleteDataset", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.DeleteDatasetRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.ImportData = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/ImportData", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ImportDataRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.ExportData = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/ExportData", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ExportDataRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.GetDataItem = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/GetDataItem", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetDataItemRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.DataItem.FromString, - ) - self.ListDataItems = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/ListDataItems", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListDataItemsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListDataItemsResponse.FromString, - ) - self.GetAnnotatedDataset = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/GetAnnotatedDataset", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetAnnotatedDatasetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.AnnotatedDataset.FromString, - ) - self.ListAnnotatedDatasets = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/ListAnnotatedDatasets", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListAnnotatedDatasetsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListAnnotatedDatasetsResponse.FromString, - ) - self.DeleteAnnotatedDataset = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/DeleteAnnotatedDataset", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.DeleteAnnotatedDatasetRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.LabelImage = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/LabelImage", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.LabelImageRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.LabelVideo = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/LabelVideo", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.LabelVideoRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.LabelText = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/LabelText", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.LabelTextRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.GetExample = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/GetExample", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetExampleRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.Example.FromString, - ) - self.ListExamples = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/ListExamples", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListExamplesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListExamplesResponse.FromString, - ) - self.CreateAnnotationSpecSet = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/CreateAnnotationSpecSet", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.CreateAnnotationSpecSetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2.AnnotationSpecSet.FromString, - ) - self.GetAnnotationSpecSet = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/GetAnnotationSpecSet", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetAnnotationSpecSetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2.AnnotationSpecSet.FromString, - ) - self.ListAnnotationSpecSets = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/ListAnnotationSpecSets", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListAnnotationSpecSetsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListAnnotationSpecSetsResponse.FromString, - ) - self.DeleteAnnotationSpecSet = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/DeleteAnnotationSpecSet", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.DeleteAnnotationSpecSetRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.CreateInstruction = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/CreateInstruction", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.CreateInstructionRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.GetInstruction = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/GetInstruction", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetInstructionRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_instruction__pb2.Instruction.FromString, - ) - self.ListInstructions = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/ListInstructions", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListInstructionsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListInstructionsResponse.FromString, - ) - self.DeleteInstruction = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/DeleteInstruction", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.DeleteInstructionRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.GetEvaluation = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/GetEvaluation", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetEvaluationRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__pb2.Evaluation.FromString, - ) - self.SearchEvaluations = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/SearchEvaluations", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.SearchEvaluationsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.SearchEvaluationsResponse.FromString, - ) - self.SearchExampleComparisons = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/SearchExampleComparisons", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.SearchExampleComparisonsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.SearchExampleComparisonsResponse.FromString, - ) - self.CreateEvaluationJob = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/CreateEvaluationJob", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.CreateEvaluationJobRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__job__pb2.EvaluationJob.FromString, - ) - self.UpdateEvaluationJob = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/UpdateEvaluationJob", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.UpdateEvaluationJobRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__job__pb2.EvaluationJob.FromString, - ) - self.GetEvaluationJob = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/GetEvaluationJob", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetEvaluationJobRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__job__pb2.EvaluationJob.FromString, - ) - self.PauseEvaluationJob = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/PauseEvaluationJob", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.PauseEvaluationJobRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.ResumeEvaluationJob = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/ResumeEvaluationJob", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ResumeEvaluationJobRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.DeleteEvaluationJob = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/DeleteEvaluationJob", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.DeleteEvaluationJobRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.ListEvaluationJobs = channel.unary_unary( - "/google.cloud.datalabeling.v1beta1.DataLabelingService/ListEvaluationJobs", - request_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListEvaluationJobsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListEvaluationJobsResponse.FromString, - ) - - -class DataLabelingServiceServicer(object): - # missing associated documentation comment in .proto file - pass - - def CreateDataset(self, request, context): - """Creates dataset. If success return a Dataset resource. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetDataset(self, request, context): - """Gets dataset by resource name. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListDatasets(self, request, context): - """Lists datasets under a project. Pagination is supported. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteDataset(self, request, context): - """Deletes a dataset by resource name. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ImportData(self, request, context): - """Imports data into dataset based on source locations defined in request. - It can be called multiple times for the same dataset. Each dataset can - only have one long running operation running on it. For example, no - labeling task (also long running operation) can be started while - importing is still ongoing. Vice versa. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ExportData(self, request, context): - """Exports data and annotations from dataset. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetDataItem(self, request, context): - """Gets a data item in a dataset by resource name. This API can be - called after data are imported into dataset. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListDataItems(self, request, context): - """Lists data items in a dataset. This API can be called after data - are imported into dataset. Pagination is supported. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetAnnotatedDataset(self, request, context): - """Gets an annotated dataset by resource name. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListAnnotatedDatasets(self, request, context): - """Lists annotated datasets for a dataset. Pagination is supported. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteAnnotatedDataset(self, request, context): - """Deletes an annotated dataset by resource name. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def LabelImage(self, request, context): - """Starts a labeling task for image. The type of image labeling task is - configured by feature in the request. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def LabelVideo(self, request, context): - """Starts a labeling task for video. The type of video labeling task is - configured by feature in the request. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def LabelText(self, request, context): - """Starts a labeling task for text. The type of text labeling task is - configured by feature in the request. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetExample(self, request, context): - """Gets an example by resource name, including both data and annotation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListExamples(self, request, context): - """Lists examples in an annotated dataset. Pagination is supported. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateAnnotationSpecSet(self, request, context): - """Creates an annotation spec set by providing a set of labels. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetAnnotationSpecSet(self, request, context): - """Gets an annotation spec set by resource name. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListAnnotationSpecSets(self, request, context): - """Lists annotation spec sets for a project. Pagination is supported. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteAnnotationSpecSet(self, request, context): - """Deletes an annotation spec set by resource name. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateInstruction(self, request, context): - """Creates an instruction for how data should be labeled. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetInstruction(self, request, context): - """Gets an instruction by resource name. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListInstructions(self, request, context): - """Lists instructions for a project. Pagination is supported. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteInstruction(self, request, context): - """Deletes an instruction object by resource name. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetEvaluation(self, request, context): - """Gets an evaluation by resource name (to search, use - [projects.evaluations.search][google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations]). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SearchEvaluations(self, request, context): - """Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SearchExampleComparisons(self, request, context): - """Searches example comparisons from an evaluation. The return format is a - list of example comparisons that show ground truth and prediction(s) for - a single input. Search by providing an evaluation ID. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateEvaluationJob(self, request, context): - """Creates an evaluation job. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateEvaluationJob(self, request, context): - """Updates an evaluation job. You can only update certain fields of the job's - [EvaluationJobConfig][google.cloud.datalabeling.v1beta1.EvaluationJobConfig]: `humanAnnotationConfig.instruction`, - `exampleCount`, and `exampleSamplePercentage`. - - If you want to change any other aspect of the evaluation job, you must - delete the job and create a new one. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetEvaluationJob(self, request, context): - """Gets an evaluation job by resource name. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def PauseEvaluationJob(self, request, context): - """Pauses an evaluation job. Pausing an evaluation job that is already in a - `PAUSED` state is a no-op. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ResumeEvaluationJob(self, request, context): - """Resumes a paused evaluation job. A deleted evaluation job can't be resumed. - Resuming a running or scheduled evaluation job is a no-op. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteEvaluationJob(self, request, context): - """Stops and deletes an evaluation job. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListEvaluationJobs(self, request, context): - """Lists all evaluation jobs within a project with possible filters. - Pagination is supported. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_DataLabelingServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "CreateDataset": grpc.unary_unary_rpc_method_handler( - servicer.CreateDataset, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.CreateDatasetRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.Dataset.SerializeToString, - ), - "GetDataset": grpc.unary_unary_rpc_method_handler( - servicer.GetDataset, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetDatasetRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.Dataset.SerializeToString, - ), - "ListDatasets": grpc.unary_unary_rpc_method_handler( - servicer.ListDatasets, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListDatasetsRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListDatasetsResponse.SerializeToString, - ), - "DeleteDataset": grpc.unary_unary_rpc_method_handler( - servicer.DeleteDataset, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.DeleteDatasetRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "ImportData": grpc.unary_unary_rpc_method_handler( - servicer.ImportData, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ImportDataRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "ExportData": grpc.unary_unary_rpc_method_handler( - servicer.ExportData, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ExportDataRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "GetDataItem": grpc.unary_unary_rpc_method_handler( - servicer.GetDataItem, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetDataItemRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.DataItem.SerializeToString, - ), - "ListDataItems": grpc.unary_unary_rpc_method_handler( - servicer.ListDataItems, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListDataItemsRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListDataItemsResponse.SerializeToString, - ), - "GetAnnotatedDataset": grpc.unary_unary_rpc_method_handler( - servicer.GetAnnotatedDataset, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetAnnotatedDatasetRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.AnnotatedDataset.SerializeToString, - ), - "ListAnnotatedDatasets": grpc.unary_unary_rpc_method_handler( - servicer.ListAnnotatedDatasets, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListAnnotatedDatasetsRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListAnnotatedDatasetsResponse.SerializeToString, - ), - "DeleteAnnotatedDataset": grpc.unary_unary_rpc_method_handler( - servicer.DeleteAnnotatedDataset, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.DeleteAnnotatedDatasetRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "LabelImage": grpc.unary_unary_rpc_method_handler( - servicer.LabelImage, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.LabelImageRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "LabelVideo": grpc.unary_unary_rpc_method_handler( - servicer.LabelVideo, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.LabelVideoRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "LabelText": grpc.unary_unary_rpc_method_handler( - servicer.LabelText, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.LabelTextRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "GetExample": grpc.unary_unary_rpc_method_handler( - servicer.GetExample, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetExampleRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.Example.SerializeToString, - ), - "ListExamples": grpc.unary_unary_rpc_method_handler( - servicer.ListExamples, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListExamplesRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListExamplesResponse.SerializeToString, - ), - "CreateAnnotationSpecSet": grpc.unary_unary_rpc_method_handler( - servicer.CreateAnnotationSpecSet, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.CreateAnnotationSpecSetRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2.AnnotationSpecSet.SerializeToString, - ), - "GetAnnotationSpecSet": grpc.unary_unary_rpc_method_handler( - servicer.GetAnnotationSpecSet, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetAnnotationSpecSetRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2.AnnotationSpecSet.SerializeToString, - ), - "ListAnnotationSpecSets": grpc.unary_unary_rpc_method_handler( - servicer.ListAnnotationSpecSets, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListAnnotationSpecSetsRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListAnnotationSpecSetsResponse.SerializeToString, - ), - "DeleteAnnotationSpecSet": grpc.unary_unary_rpc_method_handler( - servicer.DeleteAnnotationSpecSet, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.DeleteAnnotationSpecSetRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "CreateInstruction": grpc.unary_unary_rpc_method_handler( - servicer.CreateInstruction, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.CreateInstructionRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "GetInstruction": grpc.unary_unary_rpc_method_handler( - servicer.GetInstruction, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetInstructionRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_instruction__pb2.Instruction.SerializeToString, - ), - "ListInstructions": grpc.unary_unary_rpc_method_handler( - servicer.ListInstructions, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListInstructionsRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListInstructionsResponse.SerializeToString, - ), - "DeleteInstruction": grpc.unary_unary_rpc_method_handler( - servicer.DeleteInstruction, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.DeleteInstructionRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "GetEvaluation": grpc.unary_unary_rpc_method_handler( - servicer.GetEvaluation, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetEvaluationRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__pb2.Evaluation.SerializeToString, - ), - "SearchEvaluations": grpc.unary_unary_rpc_method_handler( - servicer.SearchEvaluations, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.SearchEvaluationsRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.SearchEvaluationsResponse.SerializeToString, - ), - "SearchExampleComparisons": grpc.unary_unary_rpc_method_handler( - servicer.SearchExampleComparisons, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.SearchExampleComparisonsRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.SearchExampleComparisonsResponse.SerializeToString, - ), - "CreateEvaluationJob": grpc.unary_unary_rpc_method_handler( - servicer.CreateEvaluationJob, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.CreateEvaluationJobRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__job__pb2.EvaluationJob.SerializeToString, - ), - "UpdateEvaluationJob": grpc.unary_unary_rpc_method_handler( - servicer.UpdateEvaluationJob, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.UpdateEvaluationJobRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__job__pb2.EvaluationJob.SerializeToString, - ), - "GetEvaluationJob": grpc.unary_unary_rpc_method_handler( - servicer.GetEvaluationJob, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.GetEvaluationJobRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__job__pb2.EvaluationJob.SerializeToString, - ), - "PauseEvaluationJob": grpc.unary_unary_rpc_method_handler( - servicer.PauseEvaluationJob, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.PauseEvaluationJobRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "ResumeEvaluationJob": grpc.unary_unary_rpc_method_handler( - servicer.ResumeEvaluationJob, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ResumeEvaluationJobRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "DeleteEvaluationJob": grpc.unary_unary_rpc_method_handler( - servicer.DeleteEvaluationJob, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.DeleteEvaluationJobRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "ListEvaluationJobs": grpc.unary_unary_rpc_method_handler( - servicer.ListEvaluationJobs, - request_deserializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListEvaluationJobsRequest.FromString, - response_serializer=google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__labeling__service__pb2.ListEvaluationJobsResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.datalabeling.v1beta1.DataLabelingService", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_payloads.proto b/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_payloads.proto deleted file mode 100644 index 721e20019e39..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_payloads.proto +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datalabeling.v1beta1; - -import "google/api/annotations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datalabeling.v1beta1"; - -// Container of information about an image. -message ImagePayload { - // Image format. - string mime_type = 1; - - // A byte string of a thumbnail image. - bytes image_thumbnail = 2; - - // Image uri from the user bucket. - string image_uri = 3; - - // Signed uri of the image file in the service bucket. - string signed_uri = 4; -} - -// Container of information about a piece of text. -message TextPayload { - // Text content. - string text_content = 1; -} - -// Container of information of a video thumbnail. -message VideoThumbnail { - // A byte string of the video frame. - bytes thumbnail = 1; - - // Time offset relative to the beginning of the video, corresponding to the - // video frame where the thumbnail has been extracted from. - google.protobuf.Duration time_offset = 2; -} - -// Container of information of a video. -message VideoPayload { - // Video format. - string mime_type = 1; - - // Video uri from the user bucket. - string video_uri = 2; - - // The list of video thumbnails. - repeated VideoThumbnail video_thumbnails = 3; - - // FPS of the video. - float frame_rate = 4; - - // Signed uri of the video file in the service bucket. - string signed_uri = 5; -} diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_payloads_pb2.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_payloads_pb2.py deleted file mode 100644 index 36b898b591e4..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_payloads_pb2.py +++ /dev/null @@ -1,442 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/datalabeling_v1beta1/proto/data_payloads.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/datalabeling_v1beta1/proto/data_payloads.proto", - package="google.cloud.datalabeling.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n%com.google.cloud.datalabeling.v1beta1P\001ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling" - ), - serialized_pb=_b( - '\n;google/cloud/datalabeling_v1beta1/proto/data_payloads.proto\x12!google.cloud.datalabeling.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto"a\n\x0cImagePayload\x12\x11\n\tmime_type\x18\x01 \x01(\t\x12\x17\n\x0fimage_thumbnail\x18\x02 \x01(\x0c\x12\x11\n\timage_uri\x18\x03 \x01(\t\x12\x12\n\nsigned_uri\x18\x04 \x01(\t"#\n\x0bTextPayload\x12\x14\n\x0ctext_content\x18\x01 \x01(\t"S\n\x0eVideoThumbnail\x12\x11\n\tthumbnail\x18\x01 \x01(\x0c\x12.\n\x0btime_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"\xa9\x01\n\x0cVideoPayload\x12\x11\n\tmime_type\x18\x01 \x01(\t\x12\x11\n\tvideo_uri\x18\x02 \x01(\t\x12K\n\x10video_thumbnails\x18\x03 \x03(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.VideoThumbnail\x12\x12\n\nframe_rate\x18\x04 \x01(\x02\x12\x12\n\nsigned_uri\x18\x05 \x01(\tBx\n%com.google.cloud.datalabeling.v1beta1P\x01ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabelingb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_IMAGEPAYLOAD = _descriptor.Descriptor( - name="ImagePayload", - full_name="google.cloud.datalabeling.v1beta1.ImagePayload", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.datalabeling.v1beta1.ImagePayload.mime_type", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_thumbnail", - full_name="google.cloud.datalabeling.v1beta1.ImagePayload.image_thumbnail", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_uri", - full_name="google.cloud.datalabeling.v1beta1.ImagePayload.image_uri", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="signed_uri", - full_name="google.cloud.datalabeling.v1beta1.ImagePayload.signed_uri", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=193, - serialized_end=290, -) - - -_TEXTPAYLOAD = _descriptor.Descriptor( - name="TextPayload", - full_name="google.cloud.datalabeling.v1beta1.TextPayload", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="text_content", - full_name="google.cloud.datalabeling.v1beta1.TextPayload.text_content", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=292, - serialized_end=327, -) - - -_VIDEOTHUMBNAIL = _descriptor.Descriptor( - name="VideoThumbnail", - full_name="google.cloud.datalabeling.v1beta1.VideoThumbnail", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="thumbnail", - full_name="google.cloud.datalabeling.v1beta1.VideoThumbnail.thumbnail", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.datalabeling.v1beta1.VideoThumbnail.time_offset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=329, - serialized_end=412, -) - - -_VIDEOPAYLOAD = _descriptor.Descriptor( - name="VideoPayload", - full_name="google.cloud.datalabeling.v1beta1.VideoPayload", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.datalabeling.v1beta1.VideoPayload.mime_type", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_uri", - full_name="google.cloud.datalabeling.v1beta1.VideoPayload.video_uri", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_thumbnails", - full_name="google.cloud.datalabeling.v1beta1.VideoPayload.video_thumbnails", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frame_rate", - full_name="google.cloud.datalabeling.v1beta1.VideoPayload.frame_rate", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="signed_uri", - full_name="google.cloud.datalabeling.v1beta1.VideoPayload.signed_uri", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=415, - serialized_end=584, -) - -_VIDEOTHUMBNAIL.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_VIDEOPAYLOAD.fields_by_name["video_thumbnails"].message_type = _VIDEOTHUMBNAIL -DESCRIPTOR.message_types_by_name["ImagePayload"] = _IMAGEPAYLOAD -DESCRIPTOR.message_types_by_name["TextPayload"] = _TEXTPAYLOAD -DESCRIPTOR.message_types_by_name["VideoThumbnail"] = _VIDEOTHUMBNAIL -DESCRIPTOR.message_types_by_name["VideoPayload"] = _VIDEOPAYLOAD -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ImagePayload = _reflection.GeneratedProtocolMessageType( - "ImagePayload", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGEPAYLOAD, - __module__="google.cloud.datalabeling_v1beta1.proto.data_payloads_pb2", - __doc__="""Container of information about an image. - - - Attributes: - mime_type: - Image format. - image_thumbnail: - A byte string of a thumbnail image. - image_uri: - Image uri from the user bucket. - signed_uri: - Signed uri of the image file in the service bucket. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImagePayload) - ), -) -_sym_db.RegisterMessage(ImagePayload) - -TextPayload = _reflection.GeneratedProtocolMessageType( - "TextPayload", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTPAYLOAD, - __module__="google.cloud.datalabeling_v1beta1.proto.data_payloads_pb2", - __doc__="""Container of information about a piece of text. - - - Attributes: - text_content: - Text content. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.TextPayload) - ), -) -_sym_db.RegisterMessage(TextPayload) - -VideoThumbnail = _reflection.GeneratedProtocolMessageType( - "VideoThumbnail", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOTHUMBNAIL, - __module__="google.cloud.datalabeling_v1beta1.proto.data_payloads_pb2", - __doc__="""Container of information of a video thumbnail. - - - Attributes: - thumbnail: - A byte string of the video frame. - time_offset: - Time offset relative to the beginning of the video, - corresponding to the video frame where the thumbnail has been - extracted from. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.VideoThumbnail) - ), -) -_sym_db.RegisterMessage(VideoThumbnail) - -VideoPayload = _reflection.GeneratedProtocolMessageType( - "VideoPayload", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOPAYLOAD, - __module__="google.cloud.datalabeling_v1beta1.proto.data_payloads_pb2", - __doc__="""Container of information of a video. - - - Attributes: - mime_type: - Video format. - video_uri: - Video uri from the user bucket. - video_thumbnails: - The list of video thumbnails. - frame_rate: - FPS of the video. - signed_uri: - Signed uri of the video file in the service bucket. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.VideoPayload) - ), -) -_sym_db.RegisterMessage(VideoPayload) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_payloads_pb2_grpc.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_payloads_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/data_payloads_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset.proto b/datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset.proto deleted file mode 100644 index a0bc9a433f4c..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset.proto +++ /dev/null @@ -1,345 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datalabeling.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/resource.proto"; -import "google/cloud/datalabeling/v1beta1/annotation.proto"; -import "google/cloud/datalabeling/v1beta1/annotation_spec_set.proto"; -import "google/cloud/datalabeling/v1beta1/data_payloads.proto"; -import "google/cloud/datalabeling/v1beta1/human_annotation_config.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datalabeling.v1beta1"; - -enum DataType { - DATA_TYPE_UNSPECIFIED = 0; - - // Allowed for continuous evaluation. - IMAGE = 1; - - VIDEO = 2; - - // Allowed for continuous evaluation. - TEXT = 4; - - // Allowed for continuous evaluation. - GENERAL_DATA = 6; -} - -// Dataset is the resource to hold your data. You can request multiple labeling -// tasks for a dataset while each one will generate an AnnotatedDataset. -message Dataset { - option (google.api.resource) = { - type: "datalabeling.googleapis.com/Dataset" - pattern: "projects/{project}/datasets/{dataset}" - }; - - // Output only. Dataset resource name, format is: - // projects/{project_id}/datasets/{dataset_id} - string name = 1; - - // Required. The display name of the dataset. Maximum of 64 characters. - string display_name = 2; - - // Optional. User-provided description of the annotation specification set. - // The description can be up to 10000 characters long. - string description = 3; - - // Output only. Time the dataset is created. - google.protobuf.Timestamp create_time = 4; - - // Output only. This is populated with the original input configs - // where ImportData is called. It is available only after the clients - // import data to this dataset. - repeated InputConfig input_configs = 5; - - // Output only. The names of any related resources that are blocking changes - // to the dataset. - repeated string blocking_resources = 6; - - // Output only. The number of data items in the dataset. - int64 data_item_count = 7; -} - -// The configuration of input data, including data type, location, etc. -message InputConfig { - // Optional. The metadata associated with each data type. - oneof data_type_metadata { - // Required for text import, as language code must be specified. - TextMetadata text_metadata = 6; - } - - // Required. Where the data is from. - oneof source { - // Source located in Cloud Storage. - GcsSource gcs_source = 2; - - // Source located in BigQuery. You must specify this field if you are using - // this InputConfig in an [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob]. - BigQuerySource bigquery_source = 5; - } - - // Required. Data type must be specifed when user tries to import data. - DataType data_type = 1; - - // Optional. The type of annotation to be performed on this data. You must - // specify this field if you are using this InputConfig in an - // [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob]. - AnnotationType annotation_type = 3; - - // Optional. Metadata about annotations for the input. You must specify this - // field if you are using this InputConfig in an [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob] for a - // model version that performs classification. - ClassificationMetadata classification_metadata = 4; -} - -// Metadata for the text. -message TextMetadata { - // The language of this text, as a - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). - // Default value is en-US. - string language_code = 1; -} - -// Metadata for classification annotations. -message ClassificationMetadata { - // Whether the classification task is multi-label or not. - bool is_multi_label = 1; -} - -// Source of the Cloud Storage file to be imported. -message GcsSource { - // Required. The input URI of source file. This must be a Cloud Storage path - // (`gs://...`). - string input_uri = 1; - - // Required. The format of the source file. Only "text/csv" is supported. - string mime_type = 2; -} - -// The BigQuery location for input data. If used in an [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob], this -// is where the service saves the prediction input and output sampled from the -// model version. -message BigQuerySource { - // Required. BigQuery URI to a table, up to 2,000 characters long. If you - // specify the URI of a table that does not exist, Data Labeling Service - // creates a table at the URI with the correct schema when you create your - // [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob]. If you specify the URI of a table that already exists, - // it must have the - // [correct - // schema](/ml-engine/docs/continuous-evaluation/create-job#table-schema). - // - // Provide the table URI in the following format: - // - // "bq://{your_project_id}/{your_dataset_name}/{your_table_name}" - // - // [Learn - // more](/ml-engine/docs/continuous-evaluation/create-job#table-schema). - string input_uri = 1; -} - -// The configuration of output data. -message OutputConfig { - // Required. Location to output data to. - oneof destination { - // Output to a file in Cloud Storage. Should be used for labeling output - // other than image segmentation. - GcsDestination gcs_destination = 1; - - // Output to a folder in Cloud Storage. Should be used for image - // segmentation labeling output. - GcsFolderDestination gcs_folder_destination = 2; - } -} - -// Export destination of the data.Only gcs path is allowed in -// output_uri. -message GcsDestination { - // Required. The output uri of destination file. - string output_uri = 1; - - // Required. The format of the gcs destination. Only "text/csv" and - // "application/json" - // are supported. - string mime_type = 2; -} - -// Export folder destination of the data. -message GcsFolderDestination { - // Required. Cloud Storage directory to export data to. - string output_folder_uri = 1; -} - -// DataItem is a piece of data, without annotation. For example, an image. -message DataItem { - option (google.api.resource) = { - type: "datalabeling.googleapis.com/DataItem" - pattern: "projects/{project}/datasets/{dataset}/dataItems/{data_item}" - }; - - // Output only. - oneof payload { - // The image payload, a container of the image bytes/uri. - ImagePayload image_payload = 2; - - // The text payload, a container of text content. - TextPayload text_payload = 3; - - // The video payload, a container of the video uri. - VideoPayload video_payload = 4; - } - - // Output only. Name of the data item, in format of: - // projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} - string name = 1; -} - -// AnnotatedDataset is a set holding annotations for data in a Dataset. Each -// labeling task will generate an AnnotatedDataset under the Dataset that the -// task is requested for. -message AnnotatedDataset { - option (google.api.resource) = { - type: "datalabeling.googleapis.com/AnnotatedDataset" - pattern: "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}" - }; - - // Output only. AnnotatedDataset resource name in format of: - // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ - // {annotated_dataset_id} - string name = 1; - - // Output only. The display name of the AnnotatedDataset. It is specified in - // HumanAnnotationConfig when user starts a labeling task. Maximum of 64 - // characters. - string display_name = 2; - - // Output only. The description of the AnnotatedDataset. It is specified in - // HumanAnnotationConfig when user starts a labeling task. Maximum of 10000 - // characters. - string description = 9; - - // Output only. Source of the annotation. - AnnotationSource annotation_source = 3; - - // Output only. Type of the annotation. It is specified when starting labeling - // task. - AnnotationType annotation_type = 8; - - // Output only. Number of examples in the annotated dataset. - int64 example_count = 4; - - // Output only. Number of examples that have annotation in the annotated - // dataset. - int64 completed_example_count = 5; - - // Output only. Per label statistics. - LabelStats label_stats = 6; - - // Output only. Time the AnnotatedDataset was created. - google.protobuf.Timestamp create_time = 7; - - // Output only. Additional information about AnnotatedDataset. - AnnotatedDatasetMetadata metadata = 10; - - // Output only. The names of any related resources that are blocking changes - // to the annotated dataset. - repeated string blocking_resources = 11; -} - -// Statistics about annotation specs. -message LabelStats { - // Map of each annotation spec's example count. Key is the annotation spec - // name and value is the number of examples for that annotation spec. - // If the annotated dataset does not have annotation spec, the map will return - // a pair where the key is empty string and value is the total number of - // annotations. - map example_count = 1; -} - -// Metadata on AnnotatedDataset. -message AnnotatedDatasetMetadata { - // Specific request configuration used when requesting the labeling task. - oneof annotation_request_config { - // Configuration for image classification task. - ImageClassificationConfig image_classification_config = 2; - - // Configuration for image bounding box and bounding poly task. - BoundingPolyConfig bounding_poly_config = 3; - - // Configuration for image polyline task. - PolylineConfig polyline_config = 4; - - // Configuration for image segmentation task. - SegmentationConfig segmentation_config = 5; - - // Configuration for video classification task. - VideoClassificationConfig video_classification_config = 6; - - // Configuration for video object detection task. - ObjectDetectionConfig object_detection_config = 7; - - // Configuration for video object tracking task. - ObjectTrackingConfig object_tracking_config = 8; - - // Configuration for video event labeling task. - EventConfig event_config = 9; - - // Configuration for text classification task. - TextClassificationConfig text_classification_config = 10; - - // Configuration for text entity extraction task. - TextEntityExtractionConfig text_entity_extraction_config = 11; - } - - // HumanAnnotationConfig used when requesting the human labeling task for this - // AnnotatedDataset. - HumanAnnotationConfig human_annotation_config = 1; -} - -// An Example is a piece of data and its annotation. For example, an image with -// label "house". -message Example { - option (google.api.resource) = { - type: "datalabeling.googleapis.com/Example" - pattern: "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}" - }; - - // Output only. The data part of Example. - oneof payload { - // The image payload, a container of the image bytes/uri. - ImagePayload image_payload = 2; - - // The text payload, a container of the text content. - TextPayload text_payload = 6; - - // The video payload, a container of the video uri. - VideoPayload video_payload = 7; - } - - // Output only. Name of the example, in format of: - // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ - // {annotated_dataset_id}/examples/{example_id} - string name = 1; - - // Output only. Annotations for the piece of data in Example. - // One piece of data can have multiple annotations. - repeated Annotation annotations = 5; -} diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset_pb2.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset_pb2.py deleted file mode 100644 index 8f798fa61518..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset_pb2.py +++ /dev/null @@ -1,2207 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/datalabeling_v1beta1/proto/dataset.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.datalabeling_v1beta1.proto import ( - annotation_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__pb2, -) -from google.cloud.datalabeling_v1beta1.proto import ( - annotation_spec_set_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2, -) -from google.cloud.datalabeling_v1beta1.proto import ( - data_payloads_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__payloads__pb2, -) -from google.cloud.datalabeling_v1beta1.proto import ( - human_annotation_config_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/datalabeling_v1beta1/proto/dataset.proto", - package="google.cloud.datalabeling.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n%com.google.cloud.datalabeling.v1beta1P\001ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling" - ), - serialized_pb=_b( - '\n5google/cloud/datalabeling_v1beta1/proto/dataset.proto\x12!google.cloud.datalabeling.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x19google/api/resource.proto\x1a\x38google/cloud/datalabeling_v1beta1/proto/annotation.proto\x1a\x41google/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto\x1a;google/cloud/datalabeling_v1beta1/proto/data_payloads.proto\x1a\x45google/cloud/datalabeling_v1beta1/proto/human_annotation_config.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xc0\x02\n\x07\x44\x61taset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12/\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x45\n\rinput_configs\x18\x05 \x03(\x0b\x32..google.cloud.datalabeling.v1beta1.InputConfig\x12\x1a\n\x12\x62locking_resources\x18\x06 \x03(\t\x12\x17\n\x0f\x64\x61ta_item_count\x18\x07 \x01(\x03:O\xea\x41L\n#datalabeling.googleapis.com/Dataset\x12%projects/{project}/datasets/{dataset}"\xf1\x03\n\x0bInputConfig\x12H\n\rtext_metadata\x18\x06 \x01(\x0b\x32/.google.cloud.datalabeling.v1beta1.TextMetadataH\x00\x12\x42\n\ngcs_source\x18\x02 \x01(\x0b\x32,.google.cloud.datalabeling.v1beta1.GcsSourceH\x01\x12L\n\x0f\x62igquery_source\x18\x05 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.BigQuerySourceH\x01\x12>\n\tdata_type\x18\x01 \x01(\x0e\x32+.google.cloud.datalabeling.v1beta1.DataType\x12J\n\x0f\x61nnotation_type\x18\x03 \x01(\x0e\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationType\x12Z\n\x17\x63lassification_metadata\x18\x04 \x01(\x0b\x32\x39.google.cloud.datalabeling.v1beta1.ClassificationMetadataB\x14\n\x12\x64\x61ta_type_metadataB\x08\n\x06source"%\n\x0cTextMetadata\x12\x15\n\rlanguage_code\x18\x01 \x01(\t"0\n\x16\x43lassificationMetadata\x12\x16\n\x0eis_multi_label\x18\x01 \x01(\x08"1\n\tGcsSource\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t"#\n\x0e\x42igQuerySource\x12\x11\n\tinput_uri\x18\x01 \x01(\t"\xc6\x01\n\x0cOutputConfig\x12L\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.GcsDestinationH\x00\x12Y\n\x16gcs_folder_destination\x18\x02 \x01(\x0b\x32\x37.google.cloud.datalabeling.v1beta1.GcsFolderDestinationH\x00\x42\r\n\x0b\x64\x65stination"7\n\x0eGcsDestination\x12\x12\n\noutput_uri\x18\x01 \x01(\t\x12\x11\n\tmime_type\x18\x02 \x01(\t"1\n\x14GcsFolderDestination\x12\x19\n\x11output_folder_uri\x18\x01 \x01(\t"\xe7\x02\n\x08\x44\x61taItem\x12H\n\rimage_payload\x18\x02 \x01(\x0b\x32/.google.cloud.datalabeling.v1beta1.ImagePayloadH\x00\x12\x46\n\x0ctext_payload\x18\x03 \x01(\x0b\x32..google.cloud.datalabeling.v1beta1.TextPayloadH\x00\x12H\n\rvideo_payload\x18\x04 \x01(\x0b\x32/.google.cloud.datalabeling.v1beta1.VideoPayloadH\x00\x12\x0c\n\x04name\x18\x01 \x01(\t:f\xea\x41\x63\n$datalabeling.googleapis.com/DataItem\x12;projects/{project}/datasets/{dataset}/dataItems/{data_item}B\t\n\x07payload"\xff\x04\n\x10\x41nnotatedDataset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\t \x01(\t\x12N\n\x11\x61nnotation_source\x18\x03 \x01(\x0e\x32\x33.google.cloud.datalabeling.v1beta1.AnnotationSource\x12J\n\x0f\x61nnotation_type\x18\x08 \x01(\x0e\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationType\x12\x15\n\rexample_count\x18\x04 \x01(\x03\x12\x1f\n\x17\x63ompleted_example_count\x18\x05 \x01(\x03\x12\x42\n\x0blabel_stats\x18\x06 \x01(\x0b\x32-.google.cloud.datalabeling.v1beta1.LabelStats\x12/\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12M\n\x08metadata\x18\n \x01(\x0b\x32;.google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata\x12\x1a\n\x12\x62locking_resources\x18\x0b \x03(\t:~\xea\x41{\n,datalabeling.googleapis.com/AnnotatedDataset\x12Kprojects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}"\x99\x01\n\nLabelStats\x12V\n\rexample_count\x18\x01 \x03(\x0b\x32?.google.cloud.datalabeling.v1beta1.LabelStats.ExampleCountEntry\x1a\x33\n\x11\x45xampleCountEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01"\xa2\x08\n\x18\x41nnotatedDatasetMetadata\x12\x63\n\x1bimage_classification_config\x18\x02 \x01(\x0b\x32<.google.cloud.datalabeling.v1beta1.ImageClassificationConfigH\x00\x12U\n\x14\x62ounding_poly_config\x18\x03 \x01(\x0b\x32\x35.google.cloud.datalabeling.v1beta1.BoundingPolyConfigH\x00\x12L\n\x0fpolyline_config\x18\x04 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.PolylineConfigH\x00\x12T\n\x13segmentation_config\x18\x05 \x01(\x0b\x32\x35.google.cloud.datalabeling.v1beta1.SegmentationConfigH\x00\x12\x63\n\x1bvideo_classification_config\x18\x06 \x01(\x0b\x32<.google.cloud.datalabeling.v1beta1.VideoClassificationConfigH\x00\x12[\n\x17object_detection_config\x18\x07 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.ObjectDetectionConfigH\x00\x12Y\n\x16object_tracking_config\x18\x08 \x01(\x0b\x32\x37.google.cloud.datalabeling.v1beta1.ObjectTrackingConfigH\x00\x12\x46\n\x0c\x65vent_config\x18\t \x01(\x0b\x32..google.cloud.datalabeling.v1beta1.EventConfigH\x00\x12\x61\n\x1atext_classification_config\x18\n \x01(\x0b\x32;.google.cloud.datalabeling.v1beta1.TextClassificationConfigH\x00\x12\x66\n\x1dtext_entity_extraction_config\x18\x0b \x01(\x0b\x32=.google.cloud.datalabeling.v1beta1.TextEntityExtractionConfigH\x00\x12Y\n\x17human_annotation_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfigB\x1b\n\x19\x61nnotation_request_config"\xce\x03\n\x07\x45xample\x12H\n\rimage_payload\x18\x02 \x01(\x0b\x32/.google.cloud.datalabeling.v1beta1.ImagePayloadH\x00\x12\x46\n\x0ctext_payload\x18\x06 \x01(\x0b\x32..google.cloud.datalabeling.v1beta1.TextPayloadH\x00\x12H\n\rvideo_payload\x18\x07 \x01(\x0b\x32/.google.cloud.datalabeling.v1beta1.VideoPayloadH\x00\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x42\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32-.google.cloud.datalabeling.v1beta1.Annotation:\x89\x01\xea\x41\x85\x01\n#datalabeling.googleapis.com/Example\x12^projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}B\t\n\x07payload*W\n\x08\x44\x61taType\x12\x19\n\x15\x44\x41TA_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05IMAGE\x10\x01\x12\t\n\x05VIDEO\x10\x02\x12\x08\n\x04TEXT\x10\x04\x12\x10\n\x0cGENERAL_DATA\x10\x06\x42x\n%com.google.cloud.datalabeling.v1beta1P\x01ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabelingb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__pb2.DESCRIPTOR, - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2.DESCRIPTOR, - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__payloads__pb2.DESCRIPTOR, - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - -_DATATYPE = _descriptor.EnumDescriptor( - name="DataType", - full_name="google.cloud.datalabeling.v1beta1.DataType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="DATA_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="IMAGE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VIDEO", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TEXT", index=3, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="GENERAL_DATA", index=4, number=6, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4434, - serialized_end=4521, -) -_sym_db.RegisterEnumDescriptor(_DATATYPE) - -DataType = enum_type_wrapper.EnumTypeWrapper(_DATATYPE) -DATA_TYPE_UNSPECIFIED = 0 -IMAGE = 1 -VIDEO = 2 -TEXT = 4 -GENERAL_DATA = 6 - - -_DATASET = _descriptor.Descriptor( - name="Dataset", - full_name="google.cloud.datalabeling.v1beta1.Dataset", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.Dataset.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.datalabeling.v1beta1.Dataset.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.datalabeling.v1beta1.Dataset.description", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.datalabeling.v1beta1.Dataset.create_time", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="input_configs", - full_name="google.cloud.datalabeling.v1beta1.Dataset.input_configs", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="blocking_resources", - full_name="google.cloud.datalabeling.v1beta1.Dataset.blocking_resources", - index=5, - number=6, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="data_item_count", - full_name="google.cloud.datalabeling.v1beta1.Dataset.data_item_count", - index=6, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b( - "\352AL\n#datalabeling.googleapis.com/Dataset\022%projects/{project}/datasets/{dataset}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=440, - serialized_end=760, -) - - -_INPUTCONFIG = _descriptor.Descriptor( - name="InputConfig", - full_name="google.cloud.datalabeling.v1beta1.InputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="text_metadata", - full_name="google.cloud.datalabeling.v1beta1.InputConfig.text_metadata", - index=0, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="gcs_source", - full_name="google.cloud.datalabeling.v1beta1.InputConfig.gcs_source", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bigquery_source", - full_name="google.cloud.datalabeling.v1beta1.InputConfig.bigquery_source", - index=2, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="data_type", - full_name="google.cloud.datalabeling.v1beta1.InputConfig.data_type", - index=3, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_type", - full_name="google.cloud.datalabeling.v1beta1.InputConfig.annotation_type", - index=4, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="classification_metadata", - full_name="google.cloud.datalabeling.v1beta1.InputConfig.classification_metadata", - index=5, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="data_type_metadata", - full_name="google.cloud.datalabeling.v1beta1.InputConfig.data_type_metadata", - index=0, - containing_type=None, - fields=[], - ), - _descriptor.OneofDescriptor( - name="source", - full_name="google.cloud.datalabeling.v1beta1.InputConfig.source", - index=1, - containing_type=None, - fields=[], - ), - ], - serialized_start=763, - serialized_end=1260, -) - - -_TEXTMETADATA = _descriptor.Descriptor( - name="TextMetadata", - full_name="google.cloud.datalabeling.v1beta1.TextMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.datalabeling.v1beta1.TextMetadata.language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1262, - serialized_end=1299, -) - - -_CLASSIFICATIONMETADATA = _descriptor.Descriptor( - name="ClassificationMetadata", - full_name="google.cloud.datalabeling.v1beta1.ClassificationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="is_multi_label", - full_name="google.cloud.datalabeling.v1beta1.ClassificationMetadata.is_multi_label", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1301, - serialized_end=1349, -) - - -_GCSSOURCE = _descriptor.Descriptor( - name="GcsSource", - full_name="google.cloud.datalabeling.v1beta1.GcsSource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.datalabeling.v1beta1.GcsSource.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.datalabeling.v1beta1.GcsSource.mime_type", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1351, - serialized_end=1400, -) - - -_BIGQUERYSOURCE = _descriptor.Descriptor( - name="BigQuerySource", - full_name="google.cloud.datalabeling.v1beta1.BigQuerySource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.datalabeling.v1beta1.BigQuerySource.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1402, - serialized_end=1437, -) - - -_OUTPUTCONFIG = _descriptor.Descriptor( - name="OutputConfig", - full_name="google.cloud.datalabeling.v1beta1.OutputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_destination", - full_name="google.cloud.datalabeling.v1beta1.OutputConfig.gcs_destination", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="gcs_folder_destination", - full_name="google.cloud.datalabeling.v1beta1.OutputConfig.gcs_folder_destination", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="destination", - full_name="google.cloud.datalabeling.v1beta1.OutputConfig.destination", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1440, - serialized_end=1638, -) - - -_GCSDESTINATION = _descriptor.Descriptor( - name="GcsDestination", - full_name="google.cloud.datalabeling.v1beta1.GcsDestination", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="output_uri", - full_name="google.cloud.datalabeling.v1beta1.GcsDestination.output_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.datalabeling.v1beta1.GcsDestination.mime_type", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1640, - serialized_end=1695, -) - - -_GCSFOLDERDESTINATION = _descriptor.Descriptor( - name="GcsFolderDestination", - full_name="google.cloud.datalabeling.v1beta1.GcsFolderDestination", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="output_folder_uri", - full_name="google.cloud.datalabeling.v1beta1.GcsFolderDestination.output_folder_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1697, - serialized_end=1746, -) - - -_DATAITEM = _descriptor.Descriptor( - name="DataItem", - full_name="google.cloud.datalabeling.v1beta1.DataItem", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="image_payload", - full_name="google.cloud.datalabeling.v1beta1.DataItem.image_payload", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_payload", - full_name="google.cloud.datalabeling.v1beta1.DataItem.text_payload", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_payload", - full_name="google.cloud.datalabeling.v1beta1.DataItem.video_payload", - index=2, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.DataItem.name", - index=3, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b( - "\352Ac\n$datalabeling.googleapis.com/DataItem\022;projects/{project}/datasets/{dataset}/dataItems/{data_item}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="payload", - full_name="google.cloud.datalabeling.v1beta1.DataItem.payload", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1749, - serialized_end=2108, -) - - -_ANNOTATEDDATASET = _descriptor.Descriptor( - name="AnnotatedDataset", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.description", - index=2, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_source", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.annotation_source", - index=3, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_type", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.annotation_type", - index=4, - number=8, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="example_count", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.example_count", - index=5, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="completed_example_count", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.completed_example_count", - index=6, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="label_stats", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.label_stats", - index=7, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.create_time", - index=8, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="metadata", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.metadata", - index=9, - number=10, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="blocking_resources", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDataset.blocking_resources", - index=10, - number=11, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b( - "\352A{\n,datalabeling.googleapis.com/AnnotatedDataset\022Kprojects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2111, - serialized_end=2750, -) - - -_LABELSTATS_EXAMPLECOUNTENTRY = _descriptor.Descriptor( - name="ExampleCountEntry", - full_name="google.cloud.datalabeling.v1beta1.LabelStats.ExampleCountEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.datalabeling.v1beta1.LabelStats.ExampleCountEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.datalabeling.v1beta1.LabelStats.ExampleCountEntry.value", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2855, - serialized_end=2906, -) - -_LABELSTATS = _descriptor.Descriptor( - name="LabelStats", - full_name="google.cloud.datalabeling.v1beta1.LabelStats", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="example_count", - full_name="google.cloud.datalabeling.v1beta1.LabelStats.example_count", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[_LABELSTATS_EXAMPLECOUNTENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2753, - serialized_end=2906, -) - - -_ANNOTATEDDATASETMETADATA = _descriptor.Descriptor( - name="AnnotatedDatasetMetadata", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="image_classification_config", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.image_classification_config", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_poly_config", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.bounding_poly_config", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="polyline_config", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.polyline_config", - index=2, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segmentation_config", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.segmentation_config", - index=3, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_classification_config", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.video_classification_config", - index=4, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="object_detection_config", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.object_detection_config", - index=5, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="object_tracking_config", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.object_tracking_config", - index=6, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="event_config", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.event_config", - index=7, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_classification_config", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.text_classification_config", - index=8, - number=10, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_entity_extraction_config", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.text_entity_extraction_config", - index=9, - number=11, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="human_annotation_config", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.human_annotation_config", - index=10, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="annotation_request_config", - full_name="google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata.annotation_request_config", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=2909, - serialized_end=3967, -) - - -_EXAMPLE = _descriptor.Descriptor( - name="Example", - full_name="google.cloud.datalabeling.v1beta1.Example", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="image_payload", - full_name="google.cloud.datalabeling.v1beta1.Example.image_payload", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_payload", - full_name="google.cloud.datalabeling.v1beta1.Example.text_payload", - index=1, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_payload", - full_name="google.cloud.datalabeling.v1beta1.Example.video_payload", - index=2, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.Example.name", - index=3, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotations", - full_name="google.cloud.datalabeling.v1beta1.Example.annotations", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b( - "\352A\205\001\n#datalabeling.googleapis.com/Example\022^projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="payload", - full_name="google.cloud.datalabeling.v1beta1.Example.payload", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=3970, - serialized_end=4432, -) - -_DATASET.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_DATASET.fields_by_name["input_configs"].message_type = _INPUTCONFIG -_INPUTCONFIG.fields_by_name["text_metadata"].message_type = _TEXTMETADATA -_INPUTCONFIG.fields_by_name["gcs_source"].message_type = _GCSSOURCE -_INPUTCONFIG.fields_by_name["bigquery_source"].message_type = _BIGQUERYSOURCE -_INPUTCONFIG.fields_by_name["data_type"].enum_type = _DATATYPE -_INPUTCONFIG.fields_by_name[ - "annotation_type" -].enum_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__pb2._ANNOTATIONTYPE -) -_INPUTCONFIG.fields_by_name[ - "classification_metadata" -].message_type = _CLASSIFICATIONMETADATA -_INPUTCONFIG.oneofs_by_name["data_type_metadata"].fields.append( - _INPUTCONFIG.fields_by_name["text_metadata"] -) -_INPUTCONFIG.fields_by_name[ - "text_metadata" -].containing_oneof = _INPUTCONFIG.oneofs_by_name["data_type_metadata"] -_INPUTCONFIG.oneofs_by_name["source"].fields.append( - _INPUTCONFIG.fields_by_name["gcs_source"] -) -_INPUTCONFIG.fields_by_name[ - "gcs_source" -].containing_oneof = _INPUTCONFIG.oneofs_by_name["source"] -_INPUTCONFIG.oneofs_by_name["source"].fields.append( - _INPUTCONFIG.fields_by_name["bigquery_source"] -) -_INPUTCONFIG.fields_by_name[ - "bigquery_source" -].containing_oneof = _INPUTCONFIG.oneofs_by_name["source"] -_OUTPUTCONFIG.fields_by_name["gcs_destination"].message_type = _GCSDESTINATION -_OUTPUTCONFIG.fields_by_name[ - "gcs_folder_destination" -].message_type = _GCSFOLDERDESTINATION -_OUTPUTCONFIG.oneofs_by_name["destination"].fields.append( - _OUTPUTCONFIG.fields_by_name["gcs_destination"] -) -_OUTPUTCONFIG.fields_by_name[ - "gcs_destination" -].containing_oneof = _OUTPUTCONFIG.oneofs_by_name["destination"] -_OUTPUTCONFIG.oneofs_by_name["destination"].fields.append( - _OUTPUTCONFIG.fields_by_name["gcs_folder_destination"] -) -_OUTPUTCONFIG.fields_by_name[ - "gcs_folder_destination" -].containing_oneof = _OUTPUTCONFIG.oneofs_by_name["destination"] -_DATAITEM.fields_by_name[ - "image_payload" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__payloads__pb2._IMAGEPAYLOAD -) -_DATAITEM.fields_by_name[ - "text_payload" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__payloads__pb2._TEXTPAYLOAD -) -_DATAITEM.fields_by_name[ - "video_payload" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__payloads__pb2._VIDEOPAYLOAD -) -_DATAITEM.oneofs_by_name["payload"].fields.append( - _DATAITEM.fields_by_name["image_payload"] -) -_DATAITEM.fields_by_name["image_payload"].containing_oneof = _DATAITEM.oneofs_by_name[ - "payload" -] -_DATAITEM.oneofs_by_name["payload"].fields.append( - _DATAITEM.fields_by_name["text_payload"] -) -_DATAITEM.fields_by_name["text_payload"].containing_oneof = _DATAITEM.oneofs_by_name[ - "payload" -] -_DATAITEM.oneofs_by_name["payload"].fields.append( - _DATAITEM.fields_by_name["video_payload"] -) -_DATAITEM.fields_by_name["video_payload"].containing_oneof = _DATAITEM.oneofs_by_name[ - "payload" -] -_ANNOTATEDDATASET.fields_by_name[ - "annotation_source" -].enum_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__pb2._ANNOTATIONSOURCE -) -_ANNOTATEDDATASET.fields_by_name[ - "annotation_type" -].enum_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__pb2._ANNOTATIONTYPE -) -_ANNOTATEDDATASET.fields_by_name["label_stats"].message_type = _LABELSTATS -_ANNOTATEDDATASET.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_ANNOTATEDDATASET.fields_by_name["metadata"].message_type = _ANNOTATEDDATASETMETADATA -_LABELSTATS_EXAMPLECOUNTENTRY.containing_type = _LABELSTATS -_LABELSTATS.fields_by_name["example_count"].message_type = _LABELSTATS_EXAMPLECOUNTENTRY -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "image_classification_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._IMAGECLASSIFICATIONCONFIG -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "bounding_poly_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._BOUNDINGPOLYCONFIG -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "polyline_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._POLYLINECONFIG -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "segmentation_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._SEGMENTATIONCONFIG -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "video_classification_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._VIDEOCLASSIFICATIONCONFIG -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "object_detection_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._OBJECTDETECTIONCONFIG -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "object_tracking_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._OBJECTTRACKINGCONFIG -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "event_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._EVENTCONFIG -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "text_classification_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._TEXTCLASSIFICATIONCONFIG -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "text_entity_extraction_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._TEXTENTITYEXTRACTIONCONFIG -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "human_annotation_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG -) -_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( - _ANNOTATEDDATASETMETADATA.fields_by_name["image_classification_config"] -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "image_classification_config" -].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ - "annotation_request_config" -] -_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( - _ANNOTATEDDATASETMETADATA.fields_by_name["bounding_poly_config"] -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "bounding_poly_config" -].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ - "annotation_request_config" -] -_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( - _ANNOTATEDDATASETMETADATA.fields_by_name["polyline_config"] -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "polyline_config" -].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ - "annotation_request_config" -] -_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( - _ANNOTATEDDATASETMETADATA.fields_by_name["segmentation_config"] -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "segmentation_config" -].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ - "annotation_request_config" -] -_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( - _ANNOTATEDDATASETMETADATA.fields_by_name["video_classification_config"] -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "video_classification_config" -].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ - "annotation_request_config" -] -_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( - _ANNOTATEDDATASETMETADATA.fields_by_name["object_detection_config"] -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "object_detection_config" -].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ - "annotation_request_config" -] -_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( - _ANNOTATEDDATASETMETADATA.fields_by_name["object_tracking_config"] -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "object_tracking_config" -].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ - "annotation_request_config" -] -_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( - _ANNOTATEDDATASETMETADATA.fields_by_name["event_config"] -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "event_config" -].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ - "annotation_request_config" -] -_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( - _ANNOTATEDDATASETMETADATA.fields_by_name["text_classification_config"] -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "text_classification_config" -].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ - "annotation_request_config" -] -_ANNOTATEDDATASETMETADATA.oneofs_by_name["annotation_request_config"].fields.append( - _ANNOTATEDDATASETMETADATA.fields_by_name["text_entity_extraction_config"] -) -_ANNOTATEDDATASETMETADATA.fields_by_name[ - "text_entity_extraction_config" -].containing_oneof = _ANNOTATEDDATASETMETADATA.oneofs_by_name[ - "annotation_request_config" -] -_EXAMPLE.fields_by_name[ - "image_payload" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__payloads__pb2._IMAGEPAYLOAD -) -_EXAMPLE.fields_by_name[ - "text_payload" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__payloads__pb2._TEXTPAYLOAD -) -_EXAMPLE.fields_by_name[ - "video_payload" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_data__payloads__pb2._VIDEOPAYLOAD -) -_EXAMPLE.fields_by_name[ - "annotations" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__pb2._ANNOTATION -) -_EXAMPLE.oneofs_by_name["payload"].fields.append( - _EXAMPLE.fields_by_name["image_payload"] -) -_EXAMPLE.fields_by_name["image_payload"].containing_oneof = _EXAMPLE.oneofs_by_name[ - "payload" -] -_EXAMPLE.oneofs_by_name["payload"].fields.append( - _EXAMPLE.fields_by_name["text_payload"] -) -_EXAMPLE.fields_by_name["text_payload"].containing_oneof = _EXAMPLE.oneofs_by_name[ - "payload" -] -_EXAMPLE.oneofs_by_name["payload"].fields.append( - _EXAMPLE.fields_by_name["video_payload"] -) -_EXAMPLE.fields_by_name["video_payload"].containing_oneof = _EXAMPLE.oneofs_by_name[ - "payload" -] -DESCRIPTOR.message_types_by_name["Dataset"] = _DATASET -DESCRIPTOR.message_types_by_name["InputConfig"] = _INPUTCONFIG -DESCRIPTOR.message_types_by_name["TextMetadata"] = _TEXTMETADATA -DESCRIPTOR.message_types_by_name["ClassificationMetadata"] = _CLASSIFICATIONMETADATA -DESCRIPTOR.message_types_by_name["GcsSource"] = _GCSSOURCE -DESCRIPTOR.message_types_by_name["BigQuerySource"] = _BIGQUERYSOURCE -DESCRIPTOR.message_types_by_name["OutputConfig"] = _OUTPUTCONFIG -DESCRIPTOR.message_types_by_name["GcsDestination"] = _GCSDESTINATION -DESCRIPTOR.message_types_by_name["GcsFolderDestination"] = _GCSFOLDERDESTINATION -DESCRIPTOR.message_types_by_name["DataItem"] = _DATAITEM -DESCRIPTOR.message_types_by_name["AnnotatedDataset"] = _ANNOTATEDDATASET -DESCRIPTOR.message_types_by_name["LabelStats"] = _LABELSTATS -DESCRIPTOR.message_types_by_name["AnnotatedDatasetMetadata"] = _ANNOTATEDDATASETMETADATA -DESCRIPTOR.message_types_by_name["Example"] = _EXAMPLE -DESCRIPTOR.enum_types_by_name["DataType"] = _DATATYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Dataset = _reflection.GeneratedProtocolMessageType( - "Dataset", - (_message.Message,), - dict( - DESCRIPTOR=_DATASET, - __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", - __doc__="""Dataset is the resource to hold your data. You can request - multiple labeling tasks for a dataset while each one will generate an - AnnotatedDataset. - - - Attributes: - name: - Output only. Dataset resource name, format is: - projects/{project\_id}/datasets/{dataset\_id} - display_name: - Required. The display name of the dataset. Maximum of 64 - characters. - description: - Optional. User-provided description of the annotation - specification set. The description can be up to 10000 - characters long. - create_time: - Output only. Time the dataset is created. - input_configs: - Output only. This is populated with the original input configs - where ImportData is called. It is available only after the - clients import data to this dataset. - blocking_resources: - Output only. The names of any related resources that are - blocking changes to the dataset. - data_item_count: - Output only. The number of data items in the dataset. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.Dataset) - ), -) -_sym_db.RegisterMessage(Dataset) - -InputConfig = _reflection.GeneratedProtocolMessageType( - "InputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_INPUTCONFIG, - __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", - __doc__="""The configuration of input data, including data type, - location, etc. - - - Attributes: - data_type_metadata: - Optional. The metadata associated with each data type. - text_metadata: - Required for text import, as language code must be specified. - source: - Required. Where the data is from. - gcs_source: - Source located in Cloud Storage. - bigquery_source: - Source located in BigQuery. You must specify this field if you - are using this InputConfig in an [EvaluationJob][google.cloud. - datalabeling.v1beta1.EvaluationJob]. - data_type: - Required. Data type must be specifed when user tries to import - data. - annotation_type: - Optional. The type of annotation to be performed on this data. - You must specify this field if you are using this InputConfig - in an [EvaluationJob][google.cloud.datalabeling.v1beta1.Evalua - tionJob]. - classification_metadata: - Optional. Metadata about annotations for the input. You must - specify this field if you are using this InputConfig in an [Ev - aluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob] - for a model version that performs classification. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.InputConfig) - ), -) -_sym_db.RegisterMessage(InputConfig) - -TextMetadata = _reflection.GeneratedProtocolMessageType( - "TextMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", - __doc__="""Metadata for the text. - - - Attributes: - language_code: - The language of this text, as a `BCP-47 `__. Default value is en-US. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.TextMetadata) - ), -) -_sym_db.RegisterMessage(TextMetadata) - -ClassificationMetadata = _reflection.GeneratedProtocolMessageType( - "ClassificationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_CLASSIFICATIONMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", - __doc__="""Metadata for classification annotations. - - - Attributes: - is_multi_label: - Whether the classification task is multi-label or not. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ClassificationMetadata) - ), -) -_sym_db.RegisterMessage(ClassificationMetadata) - -GcsSource = _reflection.GeneratedProtocolMessageType( - "GcsSource", - (_message.Message,), - dict( - DESCRIPTOR=_GCSSOURCE, - __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", - __doc__="""Source of the Cloud Storage file to be imported. - - - Attributes: - input_uri: - Required. The input URI of source file. This must be a Cloud - Storage path (``gs://...``). - mime_type: - Required. The format of the source file. Only "text/csv" is - supported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GcsSource) - ), -) -_sym_db.RegisterMessage(GcsSource) - -BigQuerySource = _reflection.GeneratedProtocolMessageType( - "BigQuerySource", - (_message.Message,), - dict( - DESCRIPTOR=_BIGQUERYSOURCE, - __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", - __doc__="""The BigQuery location for input data. If used in an - [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob], this - is where the service saves the prediction input and output sampled from - the model version. - - - Attributes: - input_uri: - Required. BigQuery URI to a table, up to 2,000 characters - long. If you specify the URI of a table that does not exist, - Data Labeling Service creates a table at the URI with the - correct schema when you create your [EvaluationJob][google.clo - ud.datalabeling.v1beta1.EvaluationJob]. If you specify the URI - of a table that already exists, it must have the `correct - schema `__. Provide the table URI in the following - format: "bq://{your\_project\_id}/{your\_dataset\_name}/{your - \_table\_name}" `Learn more `__. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.BigQuerySource) - ), -) -_sym_db.RegisterMessage(BigQuerySource) - -OutputConfig = _reflection.GeneratedProtocolMessageType( - "OutputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_OUTPUTCONFIG, - __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", - __doc__="""The configuration of output data. - - - Attributes: - destination: - Required. Location to output data to. - gcs_destination: - Output to a file in Cloud Storage. Should be used for labeling - output other than image segmentation. - gcs_folder_destination: - Output to a folder in Cloud Storage. Should be used for image - segmentation labeling output. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.OutputConfig) - ), -) -_sym_db.RegisterMessage(OutputConfig) - -GcsDestination = _reflection.GeneratedProtocolMessageType( - "GcsDestination", - (_message.Message,), - dict( - DESCRIPTOR=_GCSDESTINATION, - __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", - __doc__="""Export destination of the data.Only gcs path is allowed in - output\_uri. - - - Attributes: - output_uri: - Required. The output uri of destination file. - mime_type: - Required. The format of the gcs destination. Only "text/csv" - and "application/json" are supported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GcsDestination) - ), -) -_sym_db.RegisterMessage(GcsDestination) - -GcsFolderDestination = _reflection.GeneratedProtocolMessageType( - "GcsFolderDestination", - (_message.Message,), - dict( - DESCRIPTOR=_GCSFOLDERDESTINATION, - __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", - __doc__="""Export folder destination of the data. - - - Attributes: - output_folder_uri: - Required. Cloud Storage directory to export data to. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.GcsFolderDestination) - ), -) -_sym_db.RegisterMessage(GcsFolderDestination) - -DataItem = _reflection.GeneratedProtocolMessageType( - "DataItem", - (_message.Message,), - dict( - DESCRIPTOR=_DATAITEM, - __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", - __doc__="""DataItem is a piece of data, without annotation. For - example, an image. - - - Attributes: - payload: - Output only. - image_payload: - The image payload, a container of the image bytes/uri. - text_payload: - The text payload, a container of text content. - video_payload: - The video payload, a container of the video uri. - name: - Output only. Name of the data item, in format of: projects/{pr - oject\_id}/datasets/{dataset\_id}/dataItems/{data\_item\_id} - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.DataItem) - ), -) -_sym_db.RegisterMessage(DataItem) - -AnnotatedDataset = _reflection.GeneratedProtocolMessageType( - "AnnotatedDataset", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEDDATASET, - __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", - __doc__="""AnnotatedDataset is a set holding annotations for data in - a Dataset. Each labeling task will generate an AnnotatedDataset under - the Dataset that the task is requested for. - - - Attributes: - name: - Output only. AnnotatedDataset resource name in format of: proj - ects/{project\_id}/datasets/{dataset\_id}/annotatedDatasets/ - {annotated\_dataset\_id} - display_name: - Output only. The display name of the AnnotatedDataset. It is - specified in HumanAnnotationConfig when user starts a labeling - task. Maximum of 64 characters. - description: - Output only. The description of the AnnotatedDataset. It is - specified in HumanAnnotationConfig when user starts a labeling - task. Maximum of 10000 characters. - annotation_source: - Output only. Source of the annotation. - annotation_type: - Output only. Type of the annotation. It is specified when - starting labeling task. - example_count: - Output only. Number of examples in the annotated dataset. - completed_example_count: - Output only. Number of examples that have annotation in the - annotated dataset. - label_stats: - Output only. Per label statistics. - create_time: - Output only. Time the AnnotatedDataset was created. - metadata: - Output only. Additional information about AnnotatedDataset. - blocking_resources: - Output only. The names of any related resources that are - blocking changes to the annotated dataset. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.AnnotatedDataset) - ), -) -_sym_db.RegisterMessage(AnnotatedDataset) - -LabelStats = _reflection.GeneratedProtocolMessageType( - "LabelStats", - (_message.Message,), - dict( - ExampleCountEntry=_reflection.GeneratedProtocolMessageType( - "ExampleCountEntry", - (_message.Message,), - dict( - DESCRIPTOR=_LABELSTATS_EXAMPLECOUNTENTRY, - __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelStats.ExampleCountEntry) - ), - ), - DESCRIPTOR=_LABELSTATS, - __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", - __doc__="""Statistics about annotation specs. - - - Attributes: - example_count: - Map of each annotation spec's example count. Key is the - annotation spec name and value is the number of examples for - that annotation spec. If the annotated dataset does not have - annotation spec, the map will return a pair where the key is - empty string and value is the total number of annotations. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelStats) - ), -) -_sym_db.RegisterMessage(LabelStats) -_sym_db.RegisterMessage(LabelStats.ExampleCountEntry) - -AnnotatedDatasetMetadata = _reflection.GeneratedProtocolMessageType( - "AnnotatedDatasetMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEDDATASETMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", - __doc__="""Metadata on AnnotatedDataset. - - - Attributes: - annotation_request_config: - Specific request configuration used when requesting the - labeling task. - image_classification_config: - Configuration for image classification task. - bounding_poly_config: - Configuration for image bounding box and bounding poly task. - polyline_config: - Configuration for image polyline task. - segmentation_config: - Configuration for image segmentation task. - video_classification_config: - Configuration for video classification task. - object_detection_config: - Configuration for video object detection task. - object_tracking_config: - Configuration for video object tracking task. - event_config: - Configuration for video event labeling task. - text_classification_config: - Configuration for text classification task. - text_entity_extraction_config: - Configuration for text entity extraction task. - human_annotation_config: - HumanAnnotationConfig used when requesting the human labeling - task for this AnnotatedDataset. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.AnnotatedDatasetMetadata) - ), -) -_sym_db.RegisterMessage(AnnotatedDatasetMetadata) - -Example = _reflection.GeneratedProtocolMessageType( - "Example", - (_message.Message,), - dict( - DESCRIPTOR=_EXAMPLE, - __module__="google.cloud.datalabeling_v1beta1.proto.dataset_pb2", - __doc__="""An Example is a piece of data and its annotation. For - example, an image with label "house". - - - Attributes: - payload: - Output only. The data part of Example. - image_payload: - The image payload, a container of the image bytes/uri. - text_payload: - The text payload, a container of the text content. - video_payload: - The video payload, a container of the video uri. - name: - Output only. Name of the example, in format of: projects/{proj - ect\_id}/datasets/{dataset\_id}/annotatedDatasets/ - {annotated\_dataset\_id}/examples/{example\_id} - annotations: - Output only. Annotations for the piece of data in Example. One - piece of data can have multiple annotations. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.Example) - ), -) -_sym_db.RegisterMessage(Example) - - -DESCRIPTOR._options = None -_DATASET._options = None -_DATAITEM._options = None -_ANNOTATEDDATASET._options = None -_LABELSTATS_EXAMPLECOUNTENTRY._options = None -_EXAMPLE._options = None -# @@protoc_insertion_point(module_scope) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset_pb2_grpc.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/dataset_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation.proto b/datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation.proto deleted file mode 100644 index fde0366d31dc..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation.proto +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datalabeling.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/resource.proto"; -import "google/cloud/datalabeling/v1beta1/annotation.proto"; -import "google/cloud/datalabeling/v1beta1/annotation_spec_set.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datalabeling.v1beta1"; - -// Describes an evaluation between a machine learning model's predictions and -// ground truth labels. Created when an [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob] runs successfully. -message Evaluation { - option (google.api.resource) = { - type: "datalabeling.googleapis.com/Evaluation" - pattern: "projects/{project}/datasets/{dataset}/evaluations/{evaluation}" - }; - - // Output only. Resource name of an evaluation. The name has the following - // format: - // - // "projects/{project_id}/datasets/{dataset_id}/evaluations/{evaluation_id}' - string name = 1; - - // Output only. Options used in the evaluation job that created this - // evaluation. - EvaluationConfig config = 2; - - // Output only. Timestamp for when the evaluation job that created this - // evaluation ran. - google.protobuf.Timestamp evaluation_job_run_time = 3; - - // Output only. Timestamp for when this evaluation was created. - google.protobuf.Timestamp create_time = 4; - - // Output only. Metrics comparing predictions to ground truth labels. - EvaluationMetrics evaluation_metrics = 5; - - // Output only. Type of task that the model version being evaluated performs, - // as defined in the - // - // [evaluationJobConfig.inputConfig.annotationType][google.cloud.datalabeling.v1beta1.EvaluationJobConfig.input_config] - // field of the evaluation job that created this evaluation. - AnnotationType annotation_type = 6; - - // Output only. The number of items in the ground truth dataset that were used - // for this evaluation. Only populated when the evaulation is for certain - // AnnotationTypes. - int64 evaluated_item_count = 7; -} - -// Configuration details used for calculating evaluation metrics and creating an -// [Evaluation][google.cloud.datalabeling.v1beta1.Evaluation]. -message EvaluationConfig { - // Vertical specific options for general metrics. - oneof vertical_option { - // Only specify this field if the related model performs image object - // detection (`IMAGE_BOUNDING_BOX_ANNOTATION`). Describes how to evaluate - // bounding boxes. - BoundingBoxEvaluationOptions bounding_box_evaluation_options = 1; - } -} - -// Options regarding evaluation between bounding boxes. -message BoundingBoxEvaluationOptions { - // Minimum - // [intersection-over-union - // - // (IOU)](/vision/automl/object-detection/docs/evaluate#intersection-over-union) - // required for 2 bounding boxes to be considered a match. This must be a - // number between 0 and 1. - float iou_threshold = 1; -} - -message EvaluationMetrics { - // Common metrics covering most general cases. - oneof metrics { - ClassificationMetrics classification_metrics = 1; - - ObjectDetectionMetrics object_detection_metrics = 2; - } -} - -// Metrics calculated for a classification model. -message ClassificationMetrics { - // Precision-recall curve based on ground truth labels, predicted labels, and - // scores for the predicted labels. - PrCurve pr_curve = 1; - - // Confusion matrix of predicted labels vs. ground truth labels. - ConfusionMatrix confusion_matrix = 2; -} - -// Metrics calculated for an image object detection (bounding box) model. -message ObjectDetectionMetrics { - // Precision-recall curve. - PrCurve pr_curve = 1; -} - -message PrCurve { - message ConfidenceMetricsEntry { - // Threshold used for this entry. - // - // For classification tasks, this is a classification threshold: a - // predicted label is categorized as positive or negative (in the context of - // this point on the PR curve) based on whether the label's score meets this - // threshold. - // - // For image object detection (bounding box) tasks, this is the - // [intersection-over-union - // - // (IOU)](/vision/automl/object-detection/docs/evaluate#intersection-over-union) - // threshold for the context of this point on the PR curve. - float confidence_threshold = 1; - - // Recall value. - float recall = 2; - - // Precision value. - float precision = 3; - - // Harmonic mean of recall and precision. - float f1_score = 4; - - // Recall value for entries with label that has highest score. - float recall_at1 = 5; - - // Precision value for entries with label that has highest score. - float precision_at1 = 6; - - // The harmonic mean of [recall_at1][google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.precision_at1]. - float f1_score_at1 = 7; - - // Recall value for entries with label that has highest 5 scores. - float recall_at5 = 8; - - // Precision value for entries with label that has highest 5 scores. - float precision_at5 = 9; - - // The harmonic mean of [recall_at5][google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.recall_at5] and [precision_at5][google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.precision_at5]. - float f1_score_at5 = 10; - } - - // The annotation spec of the label for which the precision-recall curve - // calculated. If this field is empty, that means the precision-recall curve - // is an aggregate curve for all labels. - AnnotationSpec annotation_spec = 1; - - // Area under the precision-recall curve. Not to be confused with area under - // a receiver operating characteristic (ROC) curve. - float area_under_curve = 2; - - // Entries that make up the precision-recall graph. Each entry is a "point" on - // the graph drawn for a different `confidence_threshold`. - repeated ConfidenceMetricsEntry confidence_metrics_entries = 3; - - // Mean average prcision of this curve. - float mean_average_precision = 4; -} - -// Confusion matrix of the model running the classification. Only applicable -// when the metrics entry aggregates multiple labels. Not applicable when the -// entry is for a single label. -message ConfusionMatrix { - message ConfusionMatrixEntry { - // The annotation spec of a predicted label. - AnnotationSpec annotation_spec = 1; - - // Number of items predicted to have this label. (The ground truth label for - // these items is the `Row.annotationSpec` of this entry's parent.) - int32 item_count = 2; - } - - // A row in the confusion matrix. Each entry in this row has the same - // ground truth label. - message Row { - // The annotation spec of the ground truth label for this row. - AnnotationSpec annotation_spec = 1; - - // A list of the confusion matrix entries. One entry for each possible - // predicted label. - repeated ConfusionMatrixEntry entries = 2; - } - - repeated Row row = 1; -} diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_job.proto b/datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_job.proto deleted file mode 100644 index 49270feea45d..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_job.proto +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datalabeling.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/resource.proto"; -import "google/cloud/datalabeling/v1beta1/dataset.proto"; -import "google/cloud/datalabeling/v1beta1/evaluation.proto"; -import "google/cloud/datalabeling/v1beta1/human_annotation_config.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datalabeling.v1beta1"; - -// Defines an evaluation job that runs periodically to generate -// [Evaluations][google.cloud.datalabeling.v1beta1.Evaluation]. [Creating an evaluation -// job](/ml-engine/docs/continuous-evaluation/create-job) is the starting point -// for using continuous evaluation. -message EvaluationJob { - option (google.api.resource) = { - type: "datalabeling.googleapis.com/EvaluationJob" - pattern: "projects/{project}/evaluationJobs/{evaluation_job}" - }; - - // State of the job. - enum State { - STATE_UNSPECIFIED = 0; - - // The job is scheduled to run at the [configured interval][google.cloud.datalabeling.v1beta1.EvaluationJob.schedule]. You - // can [pause][google.cloud.datalabeling.v1beta1.DataLabelingService.PauseEvaluationJob] or - // [delete][google.cloud.datalabeling.v1beta1.DataLabelingService.DeleteEvaluationJob] the job. - // - // When the job is in this state, it samples prediction input and output - // from your model version into your BigQuery table as predictions occur. - SCHEDULED = 1; - - // The job is currently running. When the job runs, Data Labeling Service - // does several things: - // - // 1. If you have configured your job to use Data Labeling Service for - // ground truth labeling, the service creates a - // [Dataset][google.cloud.datalabeling.v1beta1.Dataset] and a labeling task for all data sampled - // since the last time the job ran. Human labelers provide ground truth - // labels for your data. Human labeling may take hours, or even days, - // depending on how much data has been sampled. The job remains in the - // `RUNNING` state during this time, and it can even be running multiple - // times in parallel if it gets triggered again (for example 24 hours - // later) before the earlier run has completed. When human labelers have - // finished labeling the data, the next step occurs. - //

- // If you have configured your job to provide your own ground truth - // labels, Data Labeling Service still creates a [Dataset][google.cloud.datalabeling.v1beta1.Dataset] for newly - // sampled data, but it expects that you have already added ground truth - // labels to the BigQuery table by this time. The next step occurs - // immediately. - // - // 2. Data Labeling Service creates an [Evaluation][google.cloud.datalabeling.v1beta1.Evaluation] by comparing your - // model version's predictions with the ground truth labels. - // - // If the job remains in this state for a long time, it continues to sample - // prediction data into your BigQuery table and will run again at the next - // interval, even if it causes the job to run multiple times in parallel. - RUNNING = 2; - - // The job is not sampling prediction input and output into your BigQuery - // table and it will not run according to its schedule. You can - // [resume][google.cloud.datalabeling.v1beta1.DataLabelingService.ResumeEvaluationJob] the job. - PAUSED = 3; - - // The job has this state right before it is deleted. - STOPPED = 4; - } - - // Output only. After you create a job, Data Labeling Service assigns a name - // to the job with the following format: - // - // "projects/{project_id}/evaluationJobs/{evaluation_job_id}" - string name = 1; - - // Required. Description of the job. The description can be up to 25,000 - // characters long. - string description = 2; - - // Output only. Describes the current state of the job. - State state = 3; - - // Required. Describes the interval at which the job runs. This interval must - // be at least 1 day, and it is rounded to the nearest day. For example, if - // you specify a 50-hour interval, the job runs every 2 days. - // - // You can provide the schedule in - // [crontab format](/scheduler/docs/configuring/cron-job-schedules) or in an - // [English-like - // format](/appengine/docs/standard/python/config/cronref#schedule_format). - // - // Regardless of what you specify, the job will run at 10:00 AM UTC. Only the - // interval from this schedule is used, not the specific time of day. - string schedule = 4; - - // Required. The [AI Platform Prediction model - // version](/ml-engine/docs/prediction-overview) to be evaluated. Prediction - // input and output is sampled from this model version. When creating an - // evaluation job, specify the model version in the following format: - // - // "projects/{project_id}/models/{model_name}/versions/{version_name}" - // - // There can only be one evaluation job per model version. - string model_version = 5; - - // Required. Configuration details for the evaluation job. - EvaluationJobConfig evaluation_job_config = 6; - - // Required. Name of the [AnnotationSpecSet][google.cloud.datalabeling.v1beta1.AnnotationSpecSet] describing all the - // labels that your machine learning model outputs. You must create this - // resource before you create an evaluation job and provide its name in the - // following format: - // - // "projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}" - string annotation_spec_set = 7; - - // Required. Whether you want Data Labeling Service to provide ground truth - // labels for prediction input. If you want the service to assign human - // labelers to annotate your data, set this to `true`. If you want to provide - // your own ground truth labels in the evaluation job's BigQuery table, set - // this to `false`. - bool label_missing_ground_truth = 8; - - // Output only. Every time the evaluation job runs and an error occurs, the - // failed attempt is appended to this array. - repeated Attempt attempts = 9; - - // Output only. Timestamp of when this evaluation job was created. - google.protobuf.Timestamp create_time = 10; -} - -// Configures specific details of how a continuous evaluation job works. Provide -// this configuration when you create an EvaluationJob. -message EvaluationJobConfig { - // Required. Details for how you want human reviewers to provide ground truth - // labels. - oneof human_annotation_request_config { - // Specify this field if your model version performs image classification or - // general classification. - // - // `annotationSpecSet` in this configuration must match - // [EvaluationJob.annotationSpecSet][google.cloud.datalabeling.v1beta1.EvaluationJob.annotation_spec_set]. - // `allowMultiLabel` in this configuration must match - // `classificationMetadata.isMultiLabel` in [input_config][google.cloud.datalabeling.v1beta1.EvaluationJobConfig.input_config]. - ImageClassificationConfig image_classification_config = 4; - - // Specify this field if your model version performs image object detection - // (bounding box detection). - // - // `annotationSpecSet` in this configuration must match - // [EvaluationJob.annotationSpecSet][google.cloud.datalabeling.v1beta1.EvaluationJob.annotation_spec_set]. - BoundingPolyConfig bounding_poly_config = 5; - - // Specify this field if your model version performs text classification. - // - // `annotationSpecSet` in this configuration must match - // [EvaluationJob.annotationSpecSet][google.cloud.datalabeling.v1beta1.EvaluationJob.annotation_spec_set]. - // `allowMultiLabel` in this configuration must match - // `classificationMetadata.isMultiLabel` in [input_config][google.cloud.datalabeling.v1beta1.EvaluationJobConfig.input_config]. - TextClassificationConfig text_classification_config = 8; - } - - // Rquired. Details for the sampled prediction input. Within this - // configuration, there are requirements for several fields: - // - // * `dataType` must be one of `IMAGE`, `TEXT`, or `GENERAL_DATA`. - // * `annotationType` must be one of `IMAGE_CLASSIFICATION_ANNOTATION`, - // `TEXT_CLASSIFICATION_ANNOTATION`, `GENERAL_CLASSIFICATION_ANNOTATION`, - // or `IMAGE_BOUNDING_BOX_ANNOTATION` (image object detection). - // * If your machine learning model performs classification, you must specify - // `classificationMetadata.isMultiLabel`. - // * You must specify `bigquerySource` (not `gcsSource`). - InputConfig input_config = 1; - - // Required. Details for calculating evaluation metrics and creating - // [Evaulations][google.cloud.datalabeling.v1beta1.Evaluation]. If your model version performs image object - // detection, you must specify the `boundingBoxEvaluationOptions` field within - // this configuration. Otherwise, provide an empty object for this - // configuration. - EvaluationConfig evaluation_config = 2; - - // Optional. Details for human annotation of your data. If you set - // [labelMissingGroundTruth][google.cloud.datalabeling.v1beta1.EvaluationJob.label_missing_ground_truth] to - // `true` for this evaluation job, then you must specify this field. If you - // plan to provide your own ground truth labels, then omit this field. - // - // Note that you must create an [Instruction][google.cloud.datalabeling.v1beta1.Instruction] resource before you can - // specify this field. Provide the name of the instruction resource in the - // `instruction` field within this configuration. - HumanAnnotationConfig human_annotation_config = 3; - - // Required. Prediction keys that tell Data Labeling Service where to find the - // data for evaluation in your BigQuery table. When the service samples - // prediction input and output from your model version and saves it to - // BigQuery, the data gets stored as JSON strings in the BigQuery table. These - // keys tell Data Labeling Service how to parse the JSON. - // - // You can provide the following entries in this field: - // - // * `data_json_key`: the data key for prediction input. You must provide - // either this key or `reference_json_key`. - // * `reference_json_key`: the data reference key for prediction input. You - // must provide either this key or `data_json_key`. - // * `label_json_key`: the label key for prediction output. Required. - // * `label_score_json_key`: the score key for prediction output. Required. - // * `bounding_box_json_key`: the bounding box key for prediction output. - // Required if your model version perform image object detection. - // - // Learn [how to configure prediction - // keys](/ml-engine/docs/continuous-evaluation/create-job#prediction-keys). - map bigquery_import_keys = 9; - - // Required. The maximum number of predictions to sample and save to BigQuery - // during each [evaluation interval][google.cloud.datalabeling.v1beta1.EvaluationJob.schedule]. This limit - // overrides `example_sample_percentage`: even if the service has not sampled - // enough predictions to fulfill `example_sample_perecentage` during an - // interval, it stops sampling predictions when it meets this limit. - int32 example_count = 10; - - // Required. Fraction of predictions to sample and save to BigQuery during - // each [evaluation interval][google.cloud.datalabeling.v1beta1.EvaluationJob.schedule]. For example, 0.1 means - // 10% of predictions served by your model version get saved to BigQuery. - double example_sample_percentage = 11; - - // Optional. Configuration details for evaluation job alerts. Specify this - // field if you want to receive email alerts if the evaluation job finds that - // your predictions have low mean average precision during a run. - EvaluationJobAlertConfig evaluation_job_alert_config = 13; -} - -// Provides details for how an evaluation job sends email alerts based on the -// results of a run. -message EvaluationJobAlertConfig { - // Required. An email address to send alerts to. - string email = 1; - - // Required. A number between 0 and 1 that describes a minimum mean average - // precision threshold. When the evaluation job runs, if it calculates that - // your model version's predictions from the recent interval have - // [meanAveragePrecision][google.cloud.datalabeling.v1beta1.PrCurve.mean_average_precision] below this - // threshold, then it sends an alert to your specified email. - double min_acceptable_mean_average_precision = 2; -} - -// Records a failed evaluation job run. -message Attempt { - google.protobuf.Timestamp attempt_time = 1; - - // Details of errors that occurred. - repeated google.rpc.Status partial_failures = 2; -} diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_job_pb2.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_job_pb2.py deleted file mode 100644 index b9a42700b433..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_job_pb2.py +++ /dev/null @@ -1,995 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/datalabeling_v1beta1/proto/evaluation_job.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.datalabeling_v1beta1.proto import ( - dataset_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2, -) -from google.cloud.datalabeling_v1beta1.proto import ( - evaluation_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_evaluation__pb2, -) -from google.cloud.datalabeling_v1beta1.proto import ( - human_annotation_config_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/datalabeling_v1beta1/proto/evaluation_job.proto", - package="google.cloud.datalabeling.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n%com.google.cloud.datalabeling.v1beta1P\001ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling" - ), - serialized_pb=_b( - '\n`__ is the - starting point for using continuous evaluation. - - - Attributes: - name: - Output only. After you create a job, Data Labeling Service - assigns a name to the job with the following format: - "projects/{project\_id}/evaluationJobs/{evaluation\_job\_id}" - description: - Required. Description of the job. The description can be up to - 25,000 characters long. - state: - Output only. Describes the current state of the job. - schedule: - Required. Describes the interval at which the job runs. This - interval must be at least 1 day, and it is rounded to the - nearest day. For example, if you specify a 50-hour interval, - the job runs every 2 days. You can provide the schedule in - `crontab format `__ or in an `English-like format `__. Regardless - of what you specify, the job will run at 10:00 AM UTC. Only - the interval from this schedule is used, not the specific time - of day. - model_version: - Required. The `AI Platform Prediction model version `__ to be evaluated. - Prediction input and output is sampled from this model - version. When creating an evaluation job, specify the model - version in the following format: "projects/{project\_id}/mode - ls/{model\_name}/versions/{version\_name}" There can only be - one evaluation job per model version. - evaluation_job_config: - Required. Configuration details for the evaluation job. - annotation_spec_set: - Required. Name of the [AnnotationSpecSet][google.cloud.datalab - eling.v1beta1.AnnotationSpecSet] describing all the labels - that your machine learning model outputs. You must create this - resource before you create an evaluation job and provide its - name in the following format: "projects/{project\_id}/annotat - ionSpecSets/{annotation\_spec\_set\_id}" - label_missing_ground_truth: - Required. Whether you want Data Labeling Service to provide - ground truth labels for prediction input. If you want the - service to assign human labelers to annotate your data, set - this to ``true``. If you want to provide your own ground truth - labels in the evaluation job's BigQuery table, set this to - ``false``. - attempts: - Output only. Every time the evaluation job runs and an error - occurs, the failed attempt is appended to this array. - create_time: - Output only. Timestamp of when this evaluation job was - created. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.EvaluationJob) - ), -) -_sym_db.RegisterMessage(EvaluationJob) - -EvaluationJobConfig = _reflection.GeneratedProtocolMessageType( - "EvaluationJobConfig", - (_message.Message,), - dict( - BigqueryImportKeysEntry=_reflection.GeneratedProtocolMessageType( - "BigqueryImportKeysEntry", - (_message.Message,), - dict( - DESCRIPTOR=_EVALUATIONJOBCONFIG_BIGQUERYIMPORTKEYSENTRY, - __module__="google.cloud.datalabeling_v1beta1.proto.evaluation_job_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.EvaluationJobConfig.BigqueryImportKeysEntry) - ), - ), - DESCRIPTOR=_EVALUATIONJOBCONFIG, - __module__="google.cloud.datalabeling_v1beta1.proto.evaluation_job_pb2", - __doc__="""Configures specific details of how a continuous evaluation - job works. Provide this configuration when you create an EvaluationJob. - - - Attributes: - human_annotation_request_config: - Required. Details for how you want human reviewers to provide - ground truth labels. - image_classification_config: - Specify this field if your model version performs image - classification or general classification. - ``annotationSpecSet`` in this configuration must match [Evalua - tionJob.annotationSpecSet][google.cloud.datalabeling.v1beta1.E - valuationJob.annotation\_spec\_set]. ``allowMultiLabel`` in - this configuration must match - ``classificationMetadata.isMultiLabel`` in [input\_config][goo - gle.cloud.datalabeling.v1beta1.EvaluationJobConfig.input\_conf - ig]. - bounding_poly_config: - Specify this field if your model version performs image object - detection (bounding box detection). ``annotationSpecSet`` in - this configuration must match [EvaluationJob.annotationSpecSet - ][google.cloud.datalabeling.v1beta1.EvaluationJob.annotation\_ - spec\_set]. - text_classification_config: - Specify this field if your model version performs text - classification. ``annotationSpecSet`` in this configuration - must match [EvaluationJob.annotationSpecSet][google.cloud.data - labeling.v1beta1.EvaluationJob.annotation\_spec\_set]. - ``allowMultiLabel`` in this configuration must match - ``classificationMetadata.isMultiLabel`` in [input\_config][goo - gle.cloud.datalabeling.v1beta1.EvaluationJobConfig.input\_conf - ig]. - input_config: - Rquired. Details for the sampled prediction input. Within this - configuration, there are requirements for several fields: - - ``dataType`` must be one of ``IMAGE``, ``TEXT``, or - ``GENERAL_DATA``. - ``annotationType`` must be one of - ``IMAGE_CLASSIFICATION_ANNOTATION``, - ``TEXT_CLASSIFICATION_ANNOTATION``, - ``GENERAL_CLASSIFICATION_ANNOTATION``, or - ``IMAGE_BOUNDING_BOX_ANNOTATION`` (image object detection). - - If your machine learning model performs classification, you - must specify ``classificationMetadata.isMultiLabel``. - - You must specify ``bigquerySource`` (not ``gcsSource``). - evaluation_config: - Required. Details for calculating evaluation metrics and - creating - [Evaulations][google.cloud.datalabeling.v1beta1.Evaluation]. - If your model version performs image object detection, you - must specify the ``boundingBoxEvaluationOptions`` field within - this configuration. Otherwise, provide an empty object for - this configuration. - human_annotation_config: - Optional. Details for human annotation of your data. If you - set [labelMissingGroundTruth][google.cloud.datalabeling.v1beta - 1.EvaluationJob.label\_missing\_ground\_truth] to ``true`` for - this evaluation job, then you must specify this field. If you - plan to provide your own ground truth labels, then omit this - field. Note that you must create an - [Instruction][google.cloud.datalabeling.v1beta1.Instruction] - resource before you can specify this field. Provide the name - of the instruction resource in the ``instruction`` field - within this configuration. - bigquery_import_keys: - Required. Prediction keys that tell Data Labeling Service - where to find the data for evaluation in your BigQuery table. - When the service samples prediction input and output from your - model version and saves it to BigQuery, the data gets stored - as JSON strings in the BigQuery table. These keys tell Data - Labeling Service how to parse the JSON. You can provide the - following entries in this field: - ``data_json_key``: the - data key for prediction input. You must provide either this - key or ``reference_json_key``. - ``reference_json_key``: the - data reference key for prediction input. You must provide - either this key or ``data_json_key``. - ``label_json_key``: - the label key for prediction output. Required. - - ``label_score_json_key``: the score key for prediction output. - Required. - ``bounding_box_json_key``: the bounding box key - for prediction output. Required if your model version - perform image object detection. Learn `how to configure - prediction keys `__. - example_count: - Required. The maximum number of predictions to sample and save - to BigQuery during each [evaluation interval][google.cloud.dat - alabeling.v1beta1.EvaluationJob.schedule]. This limit - overrides ``example_sample_percentage``: even if the service - has not sampled enough predictions to fulfill - ``example_sample_perecentage`` during an interval, it stops - sampling predictions when it meets this limit. - example_sample_percentage: - Required. Fraction of predictions to sample and save to - BigQuery during each [evaluation interval][google.cloud.datala - beling.v1beta1.EvaluationJob.schedule]. For example, 0.1 means - 10% of predictions served by your model version get saved to - BigQuery. - evaluation_job_alert_config: - Optional. Configuration details for evaluation job alerts. - Specify this field if you want to receive email alerts if the - evaluation job finds that your predictions have low mean - average precision during a run. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.EvaluationJobConfig) - ), -) -_sym_db.RegisterMessage(EvaluationJobConfig) -_sym_db.RegisterMessage(EvaluationJobConfig.BigqueryImportKeysEntry) - -EvaluationJobAlertConfig = _reflection.GeneratedProtocolMessageType( - "EvaluationJobAlertConfig", - (_message.Message,), - dict( - DESCRIPTOR=_EVALUATIONJOBALERTCONFIG, - __module__="google.cloud.datalabeling_v1beta1.proto.evaluation_job_pb2", - __doc__="""Provides details for how an evaluation job sends email - alerts based on the results of a run. - - - Attributes: - email: - Required. An email address to send alerts to. - min_acceptable_mean_average_precision: - Required. A number between 0 and 1 that describes a minimum - mean average precision threshold. When the evaluation job - runs, if it calculates that your model version's predictions - from the recent interval have [meanAveragePrecision][google.cl - oud.datalabeling.v1beta1.PrCurve.mean\_average\_precision] - below this threshold, then it sends an alert to your specified - email. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.EvaluationJobAlertConfig) - ), -) -_sym_db.RegisterMessage(EvaluationJobAlertConfig) - -Attempt = _reflection.GeneratedProtocolMessageType( - "Attempt", - (_message.Message,), - dict( - DESCRIPTOR=_ATTEMPT, - __module__="google.cloud.datalabeling_v1beta1.proto.evaluation_job_pb2", - __doc__="""Records a failed evaluation job run. - - - Attributes: - partial_failures: - Details of errors that occurred. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.Attempt) - ), -) -_sym_db.RegisterMessage(Attempt) - - -DESCRIPTOR._options = None -_EVALUATIONJOB._options = None -_EVALUATIONJOBCONFIG_BIGQUERYIMPORTKEYSENTRY._options = None -# @@protoc_insertion_point(module_scope) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_job_pb2_grpc.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_job_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_job_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_pb2.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_pb2.py deleted file mode 100644 index 5c96508cfd15..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_pb2.py +++ /dev/null @@ -1,1251 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/datalabeling_v1beta1/proto/evaluation.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.datalabeling_v1beta1.proto import ( - annotation_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__pb2, -) -from google.cloud.datalabeling_v1beta1.proto import ( - annotation_spec_set_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/datalabeling_v1beta1/proto/evaluation.proto", - package="google.cloud.datalabeling.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n%com.google.cloud.datalabeling.v1beta1P\001ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling" - ), - serialized_pb=_b( - '\n8google/cloud/datalabeling_v1beta1/proto/evaluation.proto\x12!google.cloud.datalabeling.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x19google/api/resource.proto\x1a\x38google/cloud/datalabeling_v1beta1/proto/annotation.proto\x1a\x41google/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xf6\x03\n\nEvaluation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x43\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x33.google.cloud.datalabeling.v1beta1.EvaluationConfig\x12;\n\x17\x65valuation_job_run_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12P\n\x12\x65valuation_metrics\x18\x05 \x01(\x0b\x32\x34.google.cloud.datalabeling.v1beta1.EvaluationMetrics\x12J\n\x0f\x61nnotation_type\x18\x06 \x01(\x0e\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationType\x12\x1c\n\x14\x65valuated_item_count\x18\x07 \x01(\x03:k\xea\x41h\n&datalabeling.googleapis.com/Evaluation\x12>projects/{project}/datasets/{dataset}/evaluations/{evaluation}"\x91\x01\n\x10\x45valuationConfig\x12j\n\x1f\x62ounding_box_evaluation_options\x18\x01 \x01(\x0b\x32?.google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptionsH\x00\x42\x11\n\x0fvertical_option"5\n\x1c\x42oundingBoxEvaluationOptions\x12\x15\n\riou_threshold\x18\x01 \x01(\x02"\xd9\x01\n\x11\x45valuationMetrics\x12Z\n\x16\x63lassification_metrics\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.ClassificationMetricsH\x00\x12]\n\x18object_detection_metrics\x18\x02 \x01(\x0b\x32\x39.google.cloud.datalabeling.v1beta1.ObjectDetectionMetricsH\x00\x42\t\n\x07metrics"\xa3\x01\n\x15\x43lassificationMetrics\x12<\n\x08pr_curve\x18\x01 \x01(\x0b\x32*.google.cloud.datalabeling.v1beta1.PrCurve\x12L\n\x10\x63onfusion_matrix\x18\x02 \x01(\x0b\x32\x32.google.cloud.datalabeling.v1beta1.ConfusionMatrix"V\n\x16ObjectDetectionMetrics\x12<\n\x08pr_curve\x18\x01 \x01(\x0b\x32*.google.cloud.datalabeling.v1beta1.PrCurve"\xe6\x03\n\x07PrCurve\x12J\n\x0f\x61nnotation_spec\x18\x01 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpec\x12\x18\n\x10\x61rea_under_curve\x18\x02 \x01(\x02\x12\x65\n\x1a\x63onfidence_metrics_entries\x18\x03 \x03(\x0b\x32\x41.google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry\x12\x1e\n\x16mean_average_precision\x18\x04 \x01(\x02\x1a\xed\x01\n\x16\x43onfidenceMetricsEntry\x12\x1c\n\x14\x63onfidence_threshold\x18\x01 \x01(\x02\x12\x0e\n\x06recall\x18\x02 \x01(\x02\x12\x11\n\tprecision\x18\x03 \x01(\x02\x12\x10\n\x08\x66\x31_score\x18\x04 \x01(\x02\x12\x12\n\nrecall_at1\x18\x05 \x01(\x02\x12\x15\n\rprecision_at1\x18\x06 \x01(\x02\x12\x14\n\x0c\x66\x31_score_at1\x18\x07 \x01(\x02\x12\x12\n\nrecall_at5\x18\x08 \x01(\x02\x12\x15\n\rprecision_at5\x18\t \x01(\x02\x12\x14\n\x0c\x66\x31_score_at5\x18\n \x01(\x02"\xfc\x02\n\x0f\x43onfusionMatrix\x12\x43\n\x03row\x18\x01 \x03(\x0b\x32\x36.google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row\x1av\n\x14\x43onfusionMatrixEntry\x12J\n\x0f\x61nnotation_spec\x18\x01 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpec\x12\x12\n\nitem_count\x18\x02 \x01(\x05\x1a\xab\x01\n\x03Row\x12J\n\x0f\x61nnotation_spec\x18\x01 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.AnnotationSpec\x12X\n\x07\x65ntries\x18\x02 \x03(\x0b\x32G.google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntryBx\n%com.google.cloud.datalabeling.v1beta1P\x01ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabelingb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__pb2.DESCRIPTOR, - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_EVALUATION = _descriptor.Descriptor( - name="Evaluation", - full_name="google.cloud.datalabeling.v1beta1.Evaluation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.Evaluation.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="config", - full_name="google.cloud.datalabeling.v1beta1.Evaluation.config", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="evaluation_job_run_time", - full_name="google.cloud.datalabeling.v1beta1.Evaluation.evaluation_job_run_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.datalabeling.v1beta1.Evaluation.create_time", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="evaluation_metrics", - full_name="google.cloud.datalabeling.v1beta1.Evaluation.evaluation_metrics", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_type", - full_name="google.cloud.datalabeling.v1beta1.Evaluation.annotation_type", - index=5, - number=6, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="evaluated_item_count", - full_name="google.cloud.datalabeling.v1beta1.Evaluation.evaluated_item_count", - index=6, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b( - "\352Ah\n&datalabeling.googleapis.com/Evaluation\022>projects/{project}/datasets/{dataset}/evaluations/{evaluation}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=311, - serialized_end=813, -) - - -_EVALUATIONCONFIG = _descriptor.Descriptor( - name="EvaluationConfig", - full_name="google.cloud.datalabeling.v1beta1.EvaluationConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bounding_box_evaluation_options", - full_name="google.cloud.datalabeling.v1beta1.EvaluationConfig.bounding_box_evaluation_options", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="vertical_option", - full_name="google.cloud.datalabeling.v1beta1.EvaluationConfig.vertical_option", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=816, - serialized_end=961, -) - - -_BOUNDINGBOXEVALUATIONOPTIONS = _descriptor.Descriptor( - name="BoundingBoxEvaluationOptions", - full_name="google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="iou_threshold", - full_name="google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions.iou_threshold", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=963, - serialized_end=1016, -) - - -_EVALUATIONMETRICS = _descriptor.Descriptor( - name="EvaluationMetrics", - full_name="google.cloud.datalabeling.v1beta1.EvaluationMetrics", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="classification_metrics", - full_name="google.cloud.datalabeling.v1beta1.EvaluationMetrics.classification_metrics", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="object_detection_metrics", - full_name="google.cloud.datalabeling.v1beta1.EvaluationMetrics.object_detection_metrics", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="metrics", - full_name="google.cloud.datalabeling.v1beta1.EvaluationMetrics.metrics", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1019, - serialized_end=1236, -) - - -_CLASSIFICATIONMETRICS = _descriptor.Descriptor( - name="ClassificationMetrics", - full_name="google.cloud.datalabeling.v1beta1.ClassificationMetrics", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="pr_curve", - full_name="google.cloud.datalabeling.v1beta1.ClassificationMetrics.pr_curve", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confusion_matrix", - full_name="google.cloud.datalabeling.v1beta1.ClassificationMetrics.confusion_matrix", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1239, - serialized_end=1402, -) - - -_OBJECTDETECTIONMETRICS = _descriptor.Descriptor( - name="ObjectDetectionMetrics", - full_name="google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="pr_curve", - full_name="google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics.pr_curve", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1404, - serialized_end=1490, -) - - -_PRCURVE_CONFIDENCEMETRICSENTRY = _descriptor.Descriptor( - name="ConfidenceMetricsEntry", - full_name="google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="confidence_threshold", - full_name="google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.confidence_threshold", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="recall", - full_name="google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.recall", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="precision", - full_name="google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.precision", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="f1_score", - full_name="google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.f1_score", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="recall_at1", - full_name="google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.recall_at1", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="precision_at1", - full_name="google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.precision_at1", - index=5, - number=6, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="f1_score_at1", - full_name="google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.f1_score_at1", - index=6, - number=7, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="recall_at5", - full_name="google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.recall_at5", - index=7, - number=8, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="precision_at5", - full_name="google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.precision_at5", - index=8, - number=9, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="f1_score_at5", - full_name="google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry.f1_score_at5", - index=9, - number=10, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1742, - serialized_end=1979, -) - -_PRCURVE = _descriptor.Descriptor( - name="PrCurve", - full_name="google.cloud.datalabeling.v1beta1.PrCurve", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec", - full_name="google.cloud.datalabeling.v1beta1.PrCurve.annotation_spec", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="area_under_curve", - full_name="google.cloud.datalabeling.v1beta1.PrCurve.area_under_curve", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence_metrics_entries", - full_name="google.cloud.datalabeling.v1beta1.PrCurve.confidence_metrics_entries", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mean_average_precision", - full_name="google.cloud.datalabeling.v1beta1.PrCurve.mean_average_precision", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_PRCURVE_CONFIDENCEMETRICSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1493, - serialized_end=1979, -) - - -_CONFUSIONMATRIX_CONFUSIONMATRIXENTRY = _descriptor.Descriptor( - name="ConfusionMatrixEntry", - full_name="google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec", - full_name="google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.annotation_spec", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="item_count", - full_name="google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry.item_count", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2070, - serialized_end=2188, -) - -_CONFUSIONMATRIX_ROW = _descriptor.Descriptor( - name="Row", - full_name="google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec", - full_name="google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.annotation_spec", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="entries", - full_name="google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row.entries", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2191, - serialized_end=2362, -) - -_CONFUSIONMATRIX = _descriptor.Descriptor( - name="ConfusionMatrix", - full_name="google.cloud.datalabeling.v1beta1.ConfusionMatrix", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="row", - full_name="google.cloud.datalabeling.v1beta1.ConfusionMatrix.row", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[_CONFUSIONMATRIX_CONFUSIONMATRIXENTRY, _CONFUSIONMATRIX_ROW], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1982, - serialized_end=2362, -) - -_EVALUATION.fields_by_name["config"].message_type = _EVALUATIONCONFIG -_EVALUATION.fields_by_name[ - "evaluation_job_run_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_EVALUATION.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_EVALUATION.fields_by_name["evaluation_metrics"].message_type = _EVALUATIONMETRICS -_EVALUATION.fields_by_name[ - "annotation_type" -].enum_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__pb2._ANNOTATIONTYPE -) -_EVALUATIONCONFIG.fields_by_name[ - "bounding_box_evaluation_options" -].message_type = _BOUNDINGBOXEVALUATIONOPTIONS -_EVALUATIONCONFIG.oneofs_by_name["vertical_option"].fields.append( - _EVALUATIONCONFIG.fields_by_name["bounding_box_evaluation_options"] -) -_EVALUATIONCONFIG.fields_by_name[ - "bounding_box_evaluation_options" -].containing_oneof = _EVALUATIONCONFIG.oneofs_by_name["vertical_option"] -_EVALUATIONMETRICS.fields_by_name[ - "classification_metrics" -].message_type = _CLASSIFICATIONMETRICS -_EVALUATIONMETRICS.fields_by_name[ - "object_detection_metrics" -].message_type = _OBJECTDETECTIONMETRICS -_EVALUATIONMETRICS.oneofs_by_name["metrics"].fields.append( - _EVALUATIONMETRICS.fields_by_name["classification_metrics"] -) -_EVALUATIONMETRICS.fields_by_name[ - "classification_metrics" -].containing_oneof = _EVALUATIONMETRICS.oneofs_by_name["metrics"] -_EVALUATIONMETRICS.oneofs_by_name["metrics"].fields.append( - _EVALUATIONMETRICS.fields_by_name["object_detection_metrics"] -) -_EVALUATIONMETRICS.fields_by_name[ - "object_detection_metrics" -].containing_oneof = _EVALUATIONMETRICS.oneofs_by_name["metrics"] -_CLASSIFICATIONMETRICS.fields_by_name["pr_curve"].message_type = _PRCURVE -_CLASSIFICATIONMETRICS.fields_by_name[ - "confusion_matrix" -].message_type = _CONFUSIONMATRIX -_OBJECTDETECTIONMETRICS.fields_by_name["pr_curve"].message_type = _PRCURVE -_PRCURVE_CONFIDENCEMETRICSENTRY.containing_type = _PRCURVE -_PRCURVE.fields_by_name[ - "annotation_spec" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC -) -_PRCURVE.fields_by_name[ - "confidence_metrics_entries" -].message_type = _PRCURVE_CONFIDENCEMETRICSENTRY -_CONFUSIONMATRIX_CONFUSIONMATRIXENTRY.fields_by_name[ - "annotation_spec" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC -) -_CONFUSIONMATRIX_CONFUSIONMATRIXENTRY.containing_type = _CONFUSIONMATRIX -_CONFUSIONMATRIX_ROW.fields_by_name[ - "annotation_spec" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_annotation__spec__set__pb2._ANNOTATIONSPEC -) -_CONFUSIONMATRIX_ROW.fields_by_name[ - "entries" -].message_type = _CONFUSIONMATRIX_CONFUSIONMATRIXENTRY -_CONFUSIONMATRIX_ROW.containing_type = _CONFUSIONMATRIX -_CONFUSIONMATRIX.fields_by_name["row"].message_type = _CONFUSIONMATRIX_ROW -DESCRIPTOR.message_types_by_name["Evaluation"] = _EVALUATION -DESCRIPTOR.message_types_by_name["EvaluationConfig"] = _EVALUATIONCONFIG -DESCRIPTOR.message_types_by_name[ - "BoundingBoxEvaluationOptions" -] = _BOUNDINGBOXEVALUATIONOPTIONS -DESCRIPTOR.message_types_by_name["EvaluationMetrics"] = _EVALUATIONMETRICS -DESCRIPTOR.message_types_by_name["ClassificationMetrics"] = _CLASSIFICATIONMETRICS -DESCRIPTOR.message_types_by_name["ObjectDetectionMetrics"] = _OBJECTDETECTIONMETRICS -DESCRIPTOR.message_types_by_name["PrCurve"] = _PRCURVE -DESCRIPTOR.message_types_by_name["ConfusionMatrix"] = _CONFUSIONMATRIX -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Evaluation = _reflection.GeneratedProtocolMessageType( - "Evaluation", - (_message.Message,), - dict( - DESCRIPTOR=_EVALUATION, - __module__="google.cloud.datalabeling_v1beta1.proto.evaluation_pb2", - __doc__="""Describes an evaluation between a machine learning model's - predictions and ground truth labels. Created when an - [EvaluationJob][google.cloud.datalabeling.v1beta1.EvaluationJob] runs - successfully. - - - Attributes: - name: - Output only. Resource name of an evaluation. The name has the - following format: "projects/{project\_id}/datasets/{dataset\_ - id}/evaluations/{evaluation\_id}' - config: - Output only. Options used in the evaluation job that created - this evaluation. - evaluation_job_run_time: - Output only. Timestamp for when the evaluation job that - created this evaluation ran. - create_time: - Output only. Timestamp for when this evaluation was created. - evaluation_metrics: - Output only. Metrics comparing predictions to ground truth - labels. - annotation_type: - Output only. Type of task that the model version being - evaluated performs, as defined in the [evaluationJobConfig.in - putConfig.annotationType][google.cloud.datalabeling.v1beta1.Ev - aluationJobConfig.input\_config] field of the evaluation job - that created this evaluation. - evaluated_item_count: - Output only. The number of items in the ground truth dataset - that were used for this evaluation. Only populated when the - evaulation is for certain AnnotationTypes. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.Evaluation) - ), -) -_sym_db.RegisterMessage(Evaluation) - -EvaluationConfig = _reflection.GeneratedProtocolMessageType( - "EvaluationConfig", - (_message.Message,), - dict( - DESCRIPTOR=_EVALUATIONCONFIG, - __module__="google.cloud.datalabeling_v1beta1.proto.evaluation_pb2", - __doc__="""Configuration details used for calculating evaluation - metrics and creating an - [Evaluation][google.cloud.datalabeling.v1beta1.Evaluation]. - - - Attributes: - vertical_option: - Vertical specific options for general metrics. - bounding_box_evaluation_options: - Only specify this field if the related model performs image - object detection (``IMAGE_BOUNDING_BOX_ANNOTATION``). - Describes how to evaluate bounding boxes. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.EvaluationConfig) - ), -) -_sym_db.RegisterMessage(EvaluationConfig) - -BoundingBoxEvaluationOptions = _reflection.GeneratedProtocolMessageType( - "BoundingBoxEvaluationOptions", - (_message.Message,), - dict( - DESCRIPTOR=_BOUNDINGBOXEVALUATIONOPTIONS, - __module__="google.cloud.datalabeling_v1beta1.proto.evaluation_pb2", - __doc__="""Options regarding evaluation between bounding boxes. - - - Attributes: - iou_threshold: - Minimum [intersection-over-union - (IOU)](/vision/automl/object- - detection/docs/evaluate#intersection-over-union) required for - 2 bounding boxes to be considered a match. This must be a - number between 0 and 1. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.BoundingBoxEvaluationOptions) - ), -) -_sym_db.RegisterMessage(BoundingBoxEvaluationOptions) - -EvaluationMetrics = _reflection.GeneratedProtocolMessageType( - "EvaluationMetrics", - (_message.Message,), - dict( - DESCRIPTOR=_EVALUATIONMETRICS, - __module__="google.cloud.datalabeling_v1beta1.proto.evaluation_pb2", - __doc__=""" - Attributes: - metrics: - Common metrics covering most general cases. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.EvaluationMetrics) - ), -) -_sym_db.RegisterMessage(EvaluationMetrics) - -ClassificationMetrics = _reflection.GeneratedProtocolMessageType( - "ClassificationMetrics", - (_message.Message,), - dict( - DESCRIPTOR=_CLASSIFICATIONMETRICS, - __module__="google.cloud.datalabeling_v1beta1.proto.evaluation_pb2", - __doc__="""Metrics calculated for a classification model. - - - Attributes: - pr_curve: - Precision-recall curve based on ground truth labels, predicted - labels, and scores for the predicted labels. - confusion_matrix: - Confusion matrix of predicted labels vs. ground truth labels. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ClassificationMetrics) - ), -) -_sym_db.RegisterMessage(ClassificationMetrics) - -ObjectDetectionMetrics = _reflection.GeneratedProtocolMessageType( - "ObjectDetectionMetrics", - (_message.Message,), - dict( - DESCRIPTOR=_OBJECTDETECTIONMETRICS, - __module__="google.cloud.datalabeling_v1beta1.proto.evaluation_pb2", - __doc__="""Metrics calculated for an image object detection (bounding - box) model. - - - Attributes: - pr_curve: - Precision-recall curve. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ObjectDetectionMetrics) - ), -) -_sym_db.RegisterMessage(ObjectDetectionMetrics) - -PrCurve = _reflection.GeneratedProtocolMessageType( - "PrCurve", - (_message.Message,), - dict( - ConfidenceMetricsEntry=_reflection.GeneratedProtocolMessageType( - "ConfidenceMetricsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_PRCURVE_CONFIDENCEMETRICSENTRY, - __module__="google.cloud.datalabeling_v1beta1.proto.evaluation_pb2", - __doc__=""" - Attributes: - confidence_threshold: - Threshold used for this entry. For classification tasks, this - is a classification threshold: a predicted label is - categorized as positive or negative (in the context of this - point on the PR curve) based on whether the label's score - meets this threshold. For image object detection (bounding - box) tasks, this is the [intersection-over-union - (IOU)](/vision/automl/object- - detection/docs/evaluate#intersection-over-union) threshold for - the context of this point on the PR curve. - recall: - Recall value. - precision: - Precision value. - f1_score: - Harmonic mean of recall and precision. - recall_at1: - Recall value for entries with label that has highest score. - precision_at1: - Precision value for entries with label that has highest score. - f1_score_at1: - The harmonic mean of [recall\_at1][google.cloud.datalabeling.v - 1beta1.PrCurve.ConfidenceMetricsEntry.recall\_at1] and [precis - ion\_at1][google.cloud.datalabeling.v1beta1.PrCurve.Confidence - MetricsEntry.precision\_at1]. - recall_at5: - Recall value for entries with label that has highest 5 scores. - precision_at5: - Precision value for entries with label that has highest 5 - scores. - f1_score_at5: - The harmonic mean of [recall\_at5][google.cloud.datalabeling.v - 1beta1.PrCurve.ConfidenceMetricsEntry.recall\_at5] and [precis - ion\_at5][google.cloud.datalabeling.v1beta1.PrCurve.Confidence - MetricsEntry.precision\_at5]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.PrCurve.ConfidenceMetricsEntry) - ), - ), - DESCRIPTOR=_PRCURVE, - __module__="google.cloud.datalabeling_v1beta1.proto.evaluation_pb2", - __doc__=""" - Attributes: - annotation_spec: - The annotation spec of the label for which the precision- - recall curve calculated. If this field is empty, that means - the precision-recall curve is an aggregate curve for all - labels. - area_under_curve: - Area under the precision-recall curve. Not to be confused with - area under a receiver operating characteristic (ROC) curve. - confidence_metrics_entries: - Entries that make up the precision-recall graph. Each entry is - a "point" on the graph drawn for a different - ``confidence_threshold``. - mean_average_precision: - Mean average prcision of this curve. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.PrCurve) - ), -) -_sym_db.RegisterMessage(PrCurve) -_sym_db.RegisterMessage(PrCurve.ConfidenceMetricsEntry) - -ConfusionMatrix = _reflection.GeneratedProtocolMessageType( - "ConfusionMatrix", - (_message.Message,), - dict( - ConfusionMatrixEntry=_reflection.GeneratedProtocolMessageType( - "ConfusionMatrixEntry", - (_message.Message,), - dict( - DESCRIPTOR=_CONFUSIONMATRIX_CONFUSIONMATRIXENTRY, - __module__="google.cloud.datalabeling_v1beta1.proto.evaluation_pb2", - __doc__=""" - Attributes: - annotation_spec: - The annotation spec of a predicted label. - item_count: - Number of items predicted to have this label. (The ground - truth label for these items is the ``Row.annotationSpec`` of - this entry's parent.) - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ConfusionMatrix.ConfusionMatrixEntry) - ), - ), - Row=_reflection.GeneratedProtocolMessageType( - "Row", - (_message.Message,), - dict( - DESCRIPTOR=_CONFUSIONMATRIX_ROW, - __module__="google.cloud.datalabeling_v1beta1.proto.evaluation_pb2", - __doc__="""A row in the confusion matrix. Each entry in this row has - the same ground truth label. - - - Attributes: - annotation_spec: - The annotation spec of the ground truth label for this row. - entries: - A list of the confusion matrix entries. One entry for each - possible predicted label. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ConfusionMatrix.Row) - ), - ), - DESCRIPTOR=_CONFUSIONMATRIX, - __module__="google.cloud.datalabeling_v1beta1.proto.evaluation_pb2", - __doc__="""Confusion matrix of the model running the classification. - Only applicable when the metrics entry aggregates multiple labels. Not - applicable when the entry is for a single label. - - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ConfusionMatrix) - ), -) -_sym_db.RegisterMessage(ConfusionMatrix) -_sym_db.RegisterMessage(ConfusionMatrix.ConfusionMatrixEntry) -_sym_db.RegisterMessage(ConfusionMatrix.Row) - - -DESCRIPTOR._options = None -_EVALUATION._options = None -# @@protoc_insertion_point(module_scope) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_pb2_grpc.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/evaluation_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config.proto b/datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config.proto deleted file mode 100644 index 5658bb9b80c9..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config.proto +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datalabeling.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/field_behavior.proto"; -import "google/protobuf/duration.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datalabeling.v1beta1"; - -enum StringAggregationType { - STRING_AGGREGATION_TYPE_UNSPECIFIED = 0; - - // Majority vote to aggregate answers. - MAJORITY_VOTE = 1; - - // Unanimous answers will be adopted. - UNANIMOUS_VOTE = 2; - - // Preserve all answers by crowd compute. - NO_AGGREGATION = 3; -} - -// Configuration for how human labeling task should be done. -message HumanAnnotationConfig { - // Required. Instruction resource name. - string instruction = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A human-readable name for AnnotatedDataset defined by - // users. Maximum of 64 characters - // . - string annotated_dataset_display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A human-readable description for AnnotatedDataset. - // The description can be up to 10000 characters long. - string annotated_dataset_description = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A human-readable label used to logically group labeling tasks. - // This string must match the regular expression `[a-zA-Z\\d_-]{0,128}`. - string label_group = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Language of this question, as a - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). - // Default value is en-US. - // Only need to set this when task is language related. For example, French - // text classification. - string language_code = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Replication of questions. Each question will be sent to up to - // this number of contributors to label. Aggregated answers will be returned. - // Default is set to 1. - // For image related labeling, valid values are 1, 3, 5. - int32 replica_count = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Maximum duration for contributors to answer a question. Maximum - // is 3600 seconds. Default is 3600 seconds. - google.protobuf.Duration question_duration = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If you want your own labeling contributors to manage and work on - // this labeling request, you can set these contributors here. We will give - // them access to the question types in crowdcompute. Note that these - // emails must be registered in crowdcompute worker UI: - // https://crowd-compute.appspot.com/ - repeated string contributor_emails = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Email of the user who started the labeling task and should be notified by - // email. If empty no notification will be sent. - string user_email_address = 10; -} - -// Config for image classification human labeling task. -message ImageClassificationConfig { - // Required. Annotation spec set resource name. - string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. If allow_multi_label is true, contributors are able to choose - // multiple labels for one image. - bool allow_multi_label = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The type of how to aggregate answers. - StringAggregationType answer_aggregation_type = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Config for image bounding poly (and bounding box) human labeling task. -message BoundingPolyConfig { - // Required. Annotation spec set resource name. - string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Instruction message showed on contributors UI. - string instruction_message = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Config for image polyline human labeling task. -message PolylineConfig { - // Required. Annotation spec set resource name. - string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Instruction message showed on contributors UI. - string instruction_message = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Config for image segmentation -message SegmentationConfig { - // Required. Annotation spec set resource name. format: - // projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} - string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED]; - - // Instruction message showed on labelers UI. - string instruction_message = 2; -} - -// Config for video classification human labeling task. -// Currently two types of video classification are supported: -// 1. Assign labels on the entire video. -// 2. Split the video into multiple video clips based on camera shot, and -// assign labels on each video clip. -message VideoClassificationConfig { - // Annotation spec set with the setting of allowing multi labels or not. - message AnnotationSpecSetConfig { - // Required. Annotation spec set resource name. - string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. If allow_multi_label is true, contributors are able to - // choose multiple labels from one annotation spec set. - bool allow_multi_label = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. The list of annotation spec set configs. - // Since watching a video clip takes much longer time than an image, we - // support label with multiple AnnotationSpecSet at the same time. Labels - // in each AnnotationSpecSet will be shown in a group to contributors. - // Contributors can select one or more (depending on whether to allow multi - // label) from each group. - repeated AnnotationSpecSetConfig annotation_spec_set_configs = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Option to apply shot detection on the video. - bool apply_shot_detection = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Config for video object detection human labeling task. -// Object detection will be conducted on the images extracted from the video, -// and those objects will be labeled with bounding boxes. -// User need to specify the number of images to be extracted per second as the -// extraction frame rate. -message ObjectDetectionConfig { - // Required. Annotation spec set resource name. - string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Number of frames per second to be extracted from the video. - double extraction_frame_rate = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Config for video object tracking human labeling task. -message ObjectTrackingConfig { - // Required. Annotation spec set resource name. - string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Config for video event human labeling task. -message EventConfig { - // Required. The list of annotation spec set resource name. Similar to video - // classification, we support selecting event from multiple AnnotationSpecSet - // at the same time. - repeated string annotation_spec_sets = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Config for text classification human labeling task. -message TextClassificationConfig { - // Optional. If allow_multi_label is true, contributors are able to choose - // multiple labels for one text segment. - bool allow_multi_label = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Annotation spec set resource name. - string annotation_spec_set = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Configs for sentiment selection. - SentimentConfig sentiment_config = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Config for setting up sentiments. -message SentimentConfig { - // If set to true, contributors will have the option to select sentiment of - // the label they selected, to mark it as negative or positive label. Default - // is false. - bool enable_label_sentiment_selection = 1; -} - -// Config for text entity extraction human labeling task. -message TextEntityExtractionConfig { - // Required. Annotation spec set resource name. - string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config_pb2.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config_pb2.py deleted file mode 100644 index 26b57cca48a8..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config_pb2.py +++ /dev/null @@ -1,1286 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/datalabeling_v1beta1/proto/human_annotation_config.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/datalabeling_v1beta1/proto/human_annotation_config.proto", - package="google.cloud.datalabeling.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n%com.google.cloud.datalabeling.v1beta1P\001ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling" - ), - serialized_pb=_b( - '\nEgoogle/cloud/datalabeling_v1beta1/proto/human_annotation_config.proto\x12!google.cloud.datalabeling.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1egoogle/protobuf/duration.proto"\xd4\x02\n\x15HumanAnnotationConfig\x12\x18\n\x0binstruction\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12+\n\x1e\x61nnotated_dataset_display_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12*\n\x1d\x61nnotated_dataset_description\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0blabel_group\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rlanguage_code\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rreplica_count\x18\x06 \x01(\x05\x42\x03\xe0\x41\x01\x12\x39\n\x11question_duration\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x1f\n\x12\x63ontributor_emails\x18\t \x03(\tB\x03\xe0\x41\x01\x12\x1a\n\x12user_email_address\x18\n \x01(\t"\xbd\x01\n\x19ImageClassificationConfig\x12 \n\x13\x61nnotation_spec_set\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1e\n\x11\x61llow_multi_label\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12^\n\x17\x61nswer_aggregation_type\x18\x03 \x01(\x0e\x32\x38.google.cloud.datalabeling.v1beta1.StringAggregationTypeB\x03\xe0\x41\x01"X\n\x12\x42oundingPolyConfig\x12 \n\x13\x61nnotation_spec_set\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12 \n\x13instruction_message\x18\x02 \x01(\tB\x03\xe0\x41\x01"T\n\x0ePolylineConfig\x12 \n\x13\x61nnotation_spec_set\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12 \n\x13instruction_message\x18\x02 \x01(\tB\x03\xe0\x41\x01"S\n\x12SegmentationConfig\x12 \n\x13\x61nnotation_spec_set\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1b\n\x13instruction_message\x18\x02 \x01(\t"\x9b\x02\n\x19VideoClassificationConfig\x12~\n\x1b\x61nnotation_spec_set_configs\x18\x01 \x03(\x0b\x32T.google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfigB\x03\xe0\x41\x02\x12!\n\x14\x61pply_shot_detection\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x1a[\n\x17\x41nnotationSpecSetConfig\x12 \n\x13\x61nnotation_spec_set\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1e\n\x11\x61llow_multi_label\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01"]\n\x15ObjectDetectionConfig\x12 \n\x13\x61nnotation_spec_set\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12"\n\x15\x65xtraction_frame_rate\x18\x03 \x01(\x01\x42\x03\xe0\x41\x02"8\n\x14ObjectTrackingConfig\x12 \n\x13\x61nnotation_spec_set\x18\x01 \x01(\tB\x03\xe0\x41\x02"0\n\x0b\x45ventConfig\x12!\n\x14\x61nnotation_spec_sets\x18\x01 \x03(\tB\x03\xe0\x41\x02"\xaf\x01\n\x18TextClassificationConfig\x12\x1e\n\x11\x61llow_multi_label\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12 \n\x13\x61nnotation_spec_set\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12Q\n\x10sentiment_config\x18\x03 \x01(\x0b\x32\x32.google.cloud.datalabeling.v1beta1.SentimentConfigB\x03\xe0\x41\x01";\n\x0fSentimentConfig\x12(\n enable_label_sentiment_selection\x18\x01 \x01(\x08">\n\x1aTextEntityExtractionConfig\x12 \n\x13\x61nnotation_spec_set\x18\x01 \x01(\tB\x03\xe0\x41\x02*{\n\x15StringAggregationType\x12\'\n#STRING_AGGREGATION_TYPE_UNSPECIFIED\x10\x00\x12\x11\n\rMAJORITY_VOTE\x10\x01\x12\x12\n\x0eUNANIMOUS_VOTE\x10\x02\x12\x12\n\x0eNO_AGGREGATION\x10\x03\x42x\n%com.google.cloud.datalabeling.v1beta1P\x01ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabelingb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, - ], -) - -_STRINGAGGREGATIONTYPE = _descriptor.EnumDescriptor( - name="StringAggregationType", - full_name="google.cloud.datalabeling.v1beta1.StringAggregationType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STRING_AGGREGATION_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="MAJORITY_VOTE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UNANIMOUS_VOTE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="NO_AGGREGATION", index=3, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1791, - serialized_end=1914, -) -_sym_db.RegisterEnumDescriptor(_STRINGAGGREGATIONTYPE) - -StringAggregationType = enum_type_wrapper.EnumTypeWrapper(_STRINGAGGREGATIONTYPE) -STRING_AGGREGATION_TYPE_UNSPECIFIED = 0 -MAJORITY_VOTE = 1 -UNANIMOUS_VOTE = 2 -NO_AGGREGATION = 3 - - -_HUMANANNOTATIONCONFIG = _descriptor.Descriptor( - name="HumanAnnotationConfig", - full_name="google.cloud.datalabeling.v1beta1.HumanAnnotationConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="instruction", - full_name="google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.instruction", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotated_dataset_display_name", - full_name="google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.annotated_dataset_display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotated_dataset_description", - full_name="google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.annotated_dataset_description", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="label_group", - full_name="google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.label_group", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.language_code", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="replica_count", - full_name="google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.replica_count", - index=5, - number=6, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="question_duration", - full_name="google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.question_duration", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="contributor_emails", - full_name="google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.contributor_emails", - index=7, - number=9, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="user_email_address", - full_name="google.cloud.datalabeling.v1beta1.HumanAnnotationConfig.user_email_address", - index=8, - number=10, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=204, - serialized_end=544, -) - - -_IMAGECLASSIFICATIONCONFIG = _descriptor.Descriptor( - name="ImageClassificationConfig", - full_name="google.cloud.datalabeling.v1beta1.ImageClassificationConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec_set", - full_name="google.cloud.datalabeling.v1beta1.ImageClassificationConfig.annotation_spec_set", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="allow_multi_label", - full_name="google.cloud.datalabeling.v1beta1.ImageClassificationConfig.allow_multi_label", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="answer_aggregation_type", - full_name="google.cloud.datalabeling.v1beta1.ImageClassificationConfig.answer_aggregation_type", - index=2, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=547, - serialized_end=736, -) - - -_BOUNDINGPOLYCONFIG = _descriptor.Descriptor( - name="BoundingPolyConfig", - full_name="google.cloud.datalabeling.v1beta1.BoundingPolyConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec_set", - full_name="google.cloud.datalabeling.v1beta1.BoundingPolyConfig.annotation_spec_set", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="instruction_message", - full_name="google.cloud.datalabeling.v1beta1.BoundingPolyConfig.instruction_message", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=738, - serialized_end=826, -) - - -_POLYLINECONFIG = _descriptor.Descriptor( - name="PolylineConfig", - full_name="google.cloud.datalabeling.v1beta1.PolylineConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec_set", - full_name="google.cloud.datalabeling.v1beta1.PolylineConfig.annotation_spec_set", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="instruction_message", - full_name="google.cloud.datalabeling.v1beta1.PolylineConfig.instruction_message", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=828, - serialized_end=912, -) - - -_SEGMENTATIONCONFIG = _descriptor.Descriptor( - name="SegmentationConfig", - full_name="google.cloud.datalabeling.v1beta1.SegmentationConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec_set", - full_name="google.cloud.datalabeling.v1beta1.SegmentationConfig.annotation_spec_set", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="instruction_message", - full_name="google.cloud.datalabeling.v1beta1.SegmentationConfig.instruction_message", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=914, - serialized_end=997, -) - - -_VIDEOCLASSIFICATIONCONFIG_ANNOTATIONSPECSETCONFIG = _descriptor.Descriptor( - name="AnnotationSpecSetConfig", - full_name="google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec_set", - full_name="google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig.annotation_spec_set", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="allow_multi_label", - full_name="google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig.allow_multi_label", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1192, - serialized_end=1283, -) - -_VIDEOCLASSIFICATIONCONFIG = _descriptor.Descriptor( - name="VideoClassificationConfig", - full_name="google.cloud.datalabeling.v1beta1.VideoClassificationConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec_set_configs", - full_name="google.cloud.datalabeling.v1beta1.VideoClassificationConfig.annotation_spec_set_configs", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="apply_shot_detection", - full_name="google.cloud.datalabeling.v1beta1.VideoClassificationConfig.apply_shot_detection", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_VIDEOCLASSIFICATIONCONFIG_ANNOTATIONSPECSETCONFIG], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1000, - serialized_end=1283, -) - - -_OBJECTDETECTIONCONFIG = _descriptor.Descriptor( - name="ObjectDetectionConfig", - full_name="google.cloud.datalabeling.v1beta1.ObjectDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec_set", - full_name="google.cloud.datalabeling.v1beta1.ObjectDetectionConfig.annotation_spec_set", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="extraction_frame_rate", - full_name="google.cloud.datalabeling.v1beta1.ObjectDetectionConfig.extraction_frame_rate", - index=1, - number=3, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1285, - serialized_end=1378, -) - - -_OBJECTTRACKINGCONFIG = _descriptor.Descriptor( - name="ObjectTrackingConfig", - full_name="google.cloud.datalabeling.v1beta1.ObjectTrackingConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec_set", - full_name="google.cloud.datalabeling.v1beta1.ObjectTrackingConfig.annotation_spec_set", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1380, - serialized_end=1436, -) - - -_EVENTCONFIG = _descriptor.Descriptor( - name="EventConfig", - full_name="google.cloud.datalabeling.v1beta1.EventConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec_sets", - full_name="google.cloud.datalabeling.v1beta1.EventConfig.annotation_spec_sets", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1438, - serialized_end=1486, -) - - -_TEXTCLASSIFICATIONCONFIG = _descriptor.Descriptor( - name="TextClassificationConfig", - full_name="google.cloud.datalabeling.v1beta1.TextClassificationConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="allow_multi_label", - full_name="google.cloud.datalabeling.v1beta1.TextClassificationConfig.allow_multi_label", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_spec_set", - full_name="google.cloud.datalabeling.v1beta1.TextClassificationConfig.annotation_spec_set", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="sentiment_config", - full_name="google.cloud.datalabeling.v1beta1.TextClassificationConfig.sentiment_config", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1489, - serialized_end=1664, -) - - -_SENTIMENTCONFIG = _descriptor.Descriptor( - name="SentimentConfig", - full_name="google.cloud.datalabeling.v1beta1.SentimentConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="enable_label_sentiment_selection", - full_name="google.cloud.datalabeling.v1beta1.SentimentConfig.enable_label_sentiment_selection", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1666, - serialized_end=1725, -) - - -_TEXTENTITYEXTRACTIONCONFIG = _descriptor.Descriptor( - name="TextEntityExtractionConfig", - full_name="google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_spec_set", - full_name="google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig.annotation_spec_set", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1727, - serialized_end=1789, -) - -_HUMANANNOTATIONCONFIG.fields_by_name[ - "question_duration" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_IMAGECLASSIFICATIONCONFIG.fields_by_name[ - "answer_aggregation_type" -].enum_type = _STRINGAGGREGATIONTYPE -_VIDEOCLASSIFICATIONCONFIG_ANNOTATIONSPECSETCONFIG.containing_type = ( - _VIDEOCLASSIFICATIONCONFIG -) -_VIDEOCLASSIFICATIONCONFIG.fields_by_name[ - "annotation_spec_set_configs" -].message_type = _VIDEOCLASSIFICATIONCONFIG_ANNOTATIONSPECSETCONFIG -_TEXTCLASSIFICATIONCONFIG.fields_by_name[ - "sentiment_config" -].message_type = _SENTIMENTCONFIG -DESCRIPTOR.message_types_by_name["HumanAnnotationConfig"] = _HUMANANNOTATIONCONFIG -DESCRIPTOR.message_types_by_name[ - "ImageClassificationConfig" -] = _IMAGECLASSIFICATIONCONFIG -DESCRIPTOR.message_types_by_name["BoundingPolyConfig"] = _BOUNDINGPOLYCONFIG -DESCRIPTOR.message_types_by_name["PolylineConfig"] = _POLYLINECONFIG -DESCRIPTOR.message_types_by_name["SegmentationConfig"] = _SEGMENTATIONCONFIG -DESCRIPTOR.message_types_by_name[ - "VideoClassificationConfig" -] = _VIDEOCLASSIFICATIONCONFIG -DESCRIPTOR.message_types_by_name["ObjectDetectionConfig"] = _OBJECTDETECTIONCONFIG -DESCRIPTOR.message_types_by_name["ObjectTrackingConfig"] = _OBJECTTRACKINGCONFIG -DESCRIPTOR.message_types_by_name["EventConfig"] = _EVENTCONFIG -DESCRIPTOR.message_types_by_name["TextClassificationConfig"] = _TEXTCLASSIFICATIONCONFIG -DESCRIPTOR.message_types_by_name["SentimentConfig"] = _SENTIMENTCONFIG -DESCRIPTOR.message_types_by_name[ - "TextEntityExtractionConfig" -] = _TEXTENTITYEXTRACTIONCONFIG -DESCRIPTOR.enum_types_by_name["StringAggregationType"] = _STRINGAGGREGATIONTYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -HumanAnnotationConfig = _reflection.GeneratedProtocolMessageType( - "HumanAnnotationConfig", - (_message.Message,), - dict( - DESCRIPTOR=_HUMANANNOTATIONCONFIG, - __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", - __doc__="""Configuration for how human labeling task should be done. - - - Attributes: - instruction: - Required. Instruction resource name. - annotated_dataset_display_name: - Required. A human-readable name for AnnotatedDataset defined - by users. Maximum of 64 characters . - annotated_dataset_description: - Optional. A human-readable description for AnnotatedDataset. - The description can be up to 10000 characters long. - label_group: - Optional. A human-readable label used to logically group - labeling tasks. This string must match the regular expression - ``[a-zA-Z\\d_-]{0,128}``. - language_code: - Optional. The Language of this question, as a `BCP-47 - `__. Default - value is en-US. Only need to set this when task is language - related. For example, French text classification. - replica_count: - Optional. Replication of questions. Each question will be sent - to up to this number of contributors to label. Aggregated - answers will be returned. Default is set to 1. For image - related labeling, valid values are 1, 3, 5. - question_duration: - Optional. Maximum duration for contributors to answer a - question. Maximum is 3600 seconds. Default is 3600 seconds. - contributor_emails: - Optional. If you want your own labeling contributors to manage - and work on this labeling request, you can set these - contributors here. We will give them access to the question - types in crowdcompute. Note that these emails must be - registered in crowdcompute worker UI: https://crowd- - compute.appspot.com/ - user_email_address: - Email of the user who started the labeling task and should be - notified by email. If empty no notification will be sent. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.HumanAnnotationConfig) - ), -) -_sym_db.RegisterMessage(HumanAnnotationConfig) - -ImageClassificationConfig = _reflection.GeneratedProtocolMessageType( - "ImageClassificationConfig", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGECLASSIFICATIONCONFIG, - __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", - __doc__="""Config for image classification human labeling task. - - - Attributes: - annotation_spec_set: - Required. Annotation spec set resource name. - allow_multi_label: - Optional. If allow\_multi\_label is true, contributors are - able to choose multiple labels for one image. - answer_aggregation_type: - Optional. The type of how to aggregate answers. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImageClassificationConfig) - ), -) -_sym_db.RegisterMessage(ImageClassificationConfig) - -BoundingPolyConfig = _reflection.GeneratedProtocolMessageType( - "BoundingPolyConfig", - (_message.Message,), - dict( - DESCRIPTOR=_BOUNDINGPOLYCONFIG, - __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", - __doc__="""Config for image bounding poly (and bounding box) human - labeling task. - - - Attributes: - annotation_spec_set: - Required. Annotation spec set resource name. - instruction_message: - Optional. Instruction message showed on contributors UI. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.BoundingPolyConfig) - ), -) -_sym_db.RegisterMessage(BoundingPolyConfig) - -PolylineConfig = _reflection.GeneratedProtocolMessageType( - "PolylineConfig", - (_message.Message,), - dict( - DESCRIPTOR=_POLYLINECONFIG, - __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", - __doc__="""Config for image polyline human labeling task. - - - Attributes: - annotation_spec_set: - Required. Annotation spec set resource name. - instruction_message: - Optional. Instruction message showed on contributors UI. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.PolylineConfig) - ), -) -_sym_db.RegisterMessage(PolylineConfig) - -SegmentationConfig = _reflection.GeneratedProtocolMessageType( - "SegmentationConfig", - (_message.Message,), - dict( - DESCRIPTOR=_SEGMENTATIONCONFIG, - __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", - __doc__="""Config for image segmentation - - - Attributes: - annotation_spec_set: - Required. Annotation spec set resource name. format: projects/ - {project\_id}/annotationSpecSets/{annotation\_spec\_set\_id} - instruction_message: - Instruction message showed on labelers UI. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.SegmentationConfig) - ), -) -_sym_db.RegisterMessage(SegmentationConfig) - -VideoClassificationConfig = _reflection.GeneratedProtocolMessageType( - "VideoClassificationConfig", - (_message.Message,), - dict( - AnnotationSpecSetConfig=_reflection.GeneratedProtocolMessageType( - "AnnotationSpecSetConfig", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOCLASSIFICATIONCONFIG_ANNOTATIONSPECSETCONFIG, - __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", - __doc__="""Annotation spec set with the setting of allowing multi - labels or not. - - - Attributes: - annotation_spec_set: - Required. Annotation spec set resource name. - allow_multi_label: - Optional. If allow\_multi\_label is true, contributors are - able to choose multiple labels from one annotation spec set. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.VideoClassificationConfig.AnnotationSpecSetConfig) - ), - ), - DESCRIPTOR=_VIDEOCLASSIFICATIONCONFIG, - __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", - __doc__="""Config for video classification human labeling task. - Currently two types of video classification are supported: 1. Assign - labels on the entire video. 2. Split the video into multiple video clips - based on camera shot, and assign labels on each video clip. - - - Attributes: - annotation_spec_set_configs: - Required. The list of annotation spec set configs. Since - watching a video clip takes much longer time than an image, we - support label with multiple AnnotationSpecSet at the same - time. Labels in each AnnotationSpecSet will be shown in a - group to contributors. Contributors can select one or more - (depending on whether to allow multi label) from each group. - apply_shot_detection: - Optional. Option to apply shot detection on the video. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.VideoClassificationConfig) - ), -) -_sym_db.RegisterMessage(VideoClassificationConfig) -_sym_db.RegisterMessage(VideoClassificationConfig.AnnotationSpecSetConfig) - -ObjectDetectionConfig = _reflection.GeneratedProtocolMessageType( - "ObjectDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_OBJECTDETECTIONCONFIG, - __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", - __doc__="""Config for video object detection human labeling task. - Object detection will be conducted on the images extracted from the - video, and those objects will be labeled with bounding boxes. User need - to specify the number of images to be extracted per second as the - extraction frame rate. - - - Attributes: - annotation_spec_set: - Required. Annotation spec set resource name. - extraction_frame_rate: - Required. Number of frames per second to be extracted from the - video. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ObjectDetectionConfig) - ), -) -_sym_db.RegisterMessage(ObjectDetectionConfig) - -ObjectTrackingConfig = _reflection.GeneratedProtocolMessageType( - "ObjectTrackingConfig", - (_message.Message,), - dict( - DESCRIPTOR=_OBJECTTRACKINGCONFIG, - __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", - __doc__="""Config for video object tracking human labeling task. - - - Attributes: - annotation_spec_set: - Required. Annotation spec set resource name. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ObjectTrackingConfig) - ), -) -_sym_db.RegisterMessage(ObjectTrackingConfig) - -EventConfig = _reflection.GeneratedProtocolMessageType( - "EventConfig", - (_message.Message,), - dict( - DESCRIPTOR=_EVENTCONFIG, - __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", - __doc__="""Config for video event human labeling task. - - - Attributes: - annotation_spec_sets: - Required. The list of annotation spec set resource name. - Similar to video classification, we support selecting event - from multiple AnnotationSpecSet at the same time. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.EventConfig) - ), -) -_sym_db.RegisterMessage(EventConfig) - -TextClassificationConfig = _reflection.GeneratedProtocolMessageType( - "TextClassificationConfig", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTCLASSIFICATIONCONFIG, - __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", - __doc__="""Config for text classification human labeling task. - - - Attributes: - allow_multi_label: - Optional. If allow\_multi\_label is true, contributors are - able to choose multiple labels for one text segment. - annotation_spec_set: - Required. Annotation spec set resource name. - sentiment_config: - Optional. Configs for sentiment selection. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.TextClassificationConfig) - ), -) -_sym_db.RegisterMessage(TextClassificationConfig) - -SentimentConfig = _reflection.GeneratedProtocolMessageType( - "SentimentConfig", - (_message.Message,), - dict( - DESCRIPTOR=_SENTIMENTCONFIG, - __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", - __doc__="""Config for setting up sentiments. - - - Attributes: - enable_label_sentiment_selection: - If set to true, contributors will have the option to select - sentiment of the label they selected, to mark it as negative - or positive label. Default is false. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.SentimentConfig) - ), -) -_sym_db.RegisterMessage(SentimentConfig) - -TextEntityExtractionConfig = _reflection.GeneratedProtocolMessageType( - "TextEntityExtractionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTENTITYEXTRACTIONCONFIG, - __module__="google.cloud.datalabeling_v1beta1.proto.human_annotation_config_pb2", - __doc__="""Config for text entity extraction human labeling task. - - - Attributes: - annotation_spec_set: - Required. Annotation spec set resource name. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.TextEntityExtractionConfig) - ), -) -_sym_db.RegisterMessage(TextEntityExtractionConfig) - - -DESCRIPTOR._options = None -_HUMANANNOTATIONCONFIG.fields_by_name["instruction"]._options = None -_HUMANANNOTATIONCONFIG.fields_by_name["annotated_dataset_display_name"]._options = None -_HUMANANNOTATIONCONFIG.fields_by_name["annotated_dataset_description"]._options = None -_HUMANANNOTATIONCONFIG.fields_by_name["label_group"]._options = None -_HUMANANNOTATIONCONFIG.fields_by_name["language_code"]._options = None -_HUMANANNOTATIONCONFIG.fields_by_name["replica_count"]._options = None -_HUMANANNOTATIONCONFIG.fields_by_name["question_duration"]._options = None -_HUMANANNOTATIONCONFIG.fields_by_name["contributor_emails"]._options = None -_IMAGECLASSIFICATIONCONFIG.fields_by_name["annotation_spec_set"]._options = None -_IMAGECLASSIFICATIONCONFIG.fields_by_name["allow_multi_label"]._options = None -_IMAGECLASSIFICATIONCONFIG.fields_by_name["answer_aggregation_type"]._options = None -_BOUNDINGPOLYCONFIG.fields_by_name["annotation_spec_set"]._options = None -_BOUNDINGPOLYCONFIG.fields_by_name["instruction_message"]._options = None -_POLYLINECONFIG.fields_by_name["annotation_spec_set"]._options = None -_POLYLINECONFIG.fields_by_name["instruction_message"]._options = None -_SEGMENTATIONCONFIG.fields_by_name["annotation_spec_set"]._options = None -_VIDEOCLASSIFICATIONCONFIG_ANNOTATIONSPECSETCONFIG.fields_by_name[ - "annotation_spec_set" -]._options = None -_VIDEOCLASSIFICATIONCONFIG_ANNOTATIONSPECSETCONFIG.fields_by_name[ - "allow_multi_label" -]._options = None -_VIDEOCLASSIFICATIONCONFIG.fields_by_name["annotation_spec_set_configs"]._options = None -_VIDEOCLASSIFICATIONCONFIG.fields_by_name["apply_shot_detection"]._options = None -_OBJECTDETECTIONCONFIG.fields_by_name["annotation_spec_set"]._options = None -_OBJECTDETECTIONCONFIG.fields_by_name["extraction_frame_rate"]._options = None -_OBJECTTRACKINGCONFIG.fields_by_name["annotation_spec_set"]._options = None -_EVENTCONFIG.fields_by_name["annotation_spec_sets"]._options = None -_TEXTCLASSIFICATIONCONFIG.fields_by_name["allow_multi_label"]._options = None -_TEXTCLASSIFICATIONCONFIG.fields_by_name["annotation_spec_set"]._options = None -_TEXTCLASSIFICATIONCONFIG.fields_by_name["sentiment_config"]._options = None -_TEXTENTITYEXTRACTIONCONFIG.fields_by_name["annotation_spec_set"]._options = None -# @@protoc_insertion_point(module_scope) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config_pb2_grpc.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/human_annotation_config_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction.proto b/datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction.proto deleted file mode 100644 index 50839614a547..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction.proto +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datalabeling.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/resource.proto"; -import "google/cloud/datalabeling/v1beta1/dataset.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datalabeling.v1beta1"; - -// Instruction of how to perform the labeling task for human operators. -// Currently only PDF instruction is supported. -message Instruction { - option (google.api.resource) = { - type: "datalabeling.googleapis.com/Instruction" - pattern: "projects/{project}/instructions/{instruction}" - }; - - // Output only. Instruction resource name, format: - // projects/{project_id}/instructions/{instruction_id} - string name = 1; - - // Required. The display name of the instruction. Maximum of 64 characters. - string display_name = 2; - - // Optional. User-provided description of the instruction. - // The description can be up to 10000 characters long. - string description = 3; - - // Output only. Creation time of instruction. - google.protobuf.Timestamp create_time = 4; - - // Output only. Last update time of instruction. - google.protobuf.Timestamp update_time = 5; - - // Required. The data type of this instruction. - DataType data_type = 6; - - // Deprecated: this instruction format is not supported any more. - // Instruction from a CSV file, such as for classification task. - // The CSV file should have exact two columns, in the following format: - // - // * The first column is labeled data, such as an image reference, text. - // * The second column is comma separated labels associated with data. - CsvInstruction csv_instruction = 7 [deprecated = true]; - - // Instruction from a PDF document. The PDF should be in a Cloud Storage - // bucket. - PdfInstruction pdf_instruction = 9; - - // Output only. The names of any related resources that are blocking changes - // to the instruction. - repeated string blocking_resources = 10; -} - -// Deprecated: this instruction format is not supported any more. -// Instruction from a CSV file. -message CsvInstruction { - // CSV file for the instruction. Only gcs path is allowed. - string gcs_file_uri = 1; -} - -// Instruction from a PDF file. -message PdfInstruction { - // PDF file for the instruction. Only gcs path is allowed. - string gcs_file_uri = 1; -} diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction_pb2.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction_pb2.py deleted file mode 100644 index f6d0e0bf4ae8..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction_pb2.py +++ /dev/null @@ -1,411 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/datalabeling_v1beta1/proto/instruction.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.datalabeling_v1beta1.proto import ( - dataset_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/datalabeling_v1beta1/proto/instruction.proto", - package="google.cloud.datalabeling.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n%com.google.cloud.datalabeling.v1beta1P\001ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling" - ), - serialized_pb=_b( - '\n9google/cloud/datalabeling_v1beta1/proto/instruction.proto\x12!google.cloud.datalabeling.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x19google/api/resource.proto\x1a\x35google/cloud/datalabeling_v1beta1/proto/dataset.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xfd\x03\n\x0bInstruction\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12/\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12>\n\tdata_type\x18\x06 \x01(\x0e\x32+.google.cloud.datalabeling.v1beta1.DataType\x12N\n\x0f\x63sv_instruction\x18\x07 \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.CsvInstructionB\x02\x18\x01\x12J\n\x0fpdf_instruction\x18\t \x01(\x0b\x32\x31.google.cloud.datalabeling.v1beta1.PdfInstruction\x12\x1a\n\x12\x62locking_resources\x18\n \x03(\t:[\xea\x41X\n\'datalabeling.googleapis.com/Instruction\x12-projects/{project}/instructions/{instruction}"&\n\x0e\x43svInstruction\x12\x14\n\x0cgcs_file_uri\x18\x01 \x01(\t"&\n\x0ePdfInstruction\x12\x14\n\x0cgcs_file_uri\x18\x01 \x01(\tBx\n%com.google.cloud.datalabeling.v1beta1P\x01ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabelingb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_INSTRUCTION = _descriptor.Descriptor( - name="Instruction", - full_name="google.cloud.datalabeling.v1beta1.Instruction", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.datalabeling.v1beta1.Instruction.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.datalabeling.v1beta1.Instruction.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.datalabeling.v1beta1.Instruction.description", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.datalabeling.v1beta1.Instruction.create_time", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_time", - full_name="google.cloud.datalabeling.v1beta1.Instruction.update_time", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="data_type", - full_name="google.cloud.datalabeling.v1beta1.Instruction.data_type", - index=5, - number=6, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="csv_instruction", - full_name="google.cloud.datalabeling.v1beta1.Instruction.csv_instruction", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pdf_instruction", - full_name="google.cloud.datalabeling.v1beta1.Instruction.pdf_instruction", - index=7, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="blocking_resources", - full_name="google.cloud.datalabeling.v1beta1.Instruction.blocking_resources", - index=8, - number=10, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b( - "\352AX\n'datalabeling.googleapis.com/Instruction\022-projects/{project}/instructions/{instruction}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=242, - serialized_end=751, -) - - -_CSVINSTRUCTION = _descriptor.Descriptor( - name="CsvInstruction", - full_name="google.cloud.datalabeling.v1beta1.CsvInstruction", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_file_uri", - full_name="google.cloud.datalabeling.v1beta1.CsvInstruction.gcs_file_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=753, - serialized_end=791, -) - - -_PDFINSTRUCTION = _descriptor.Descriptor( - name="PdfInstruction", - full_name="google.cloud.datalabeling.v1beta1.PdfInstruction", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_file_uri", - full_name="google.cloud.datalabeling.v1beta1.PdfInstruction.gcs_file_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=793, - serialized_end=831, -) - -_INSTRUCTION.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_INSTRUCTION.fields_by_name[ - "update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_INSTRUCTION.fields_by_name[ - "data_type" -].enum_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._DATATYPE -) -_INSTRUCTION.fields_by_name["csv_instruction"].message_type = _CSVINSTRUCTION -_INSTRUCTION.fields_by_name["pdf_instruction"].message_type = _PDFINSTRUCTION -DESCRIPTOR.message_types_by_name["Instruction"] = _INSTRUCTION -DESCRIPTOR.message_types_by_name["CsvInstruction"] = _CSVINSTRUCTION -DESCRIPTOR.message_types_by_name["PdfInstruction"] = _PDFINSTRUCTION -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Instruction = _reflection.GeneratedProtocolMessageType( - "Instruction", - (_message.Message,), - dict( - DESCRIPTOR=_INSTRUCTION, - __module__="google.cloud.datalabeling_v1beta1.proto.instruction_pb2", - __doc__="""Instruction of how to perform the labeling task for human - operators. Currently only PDF instruction is supported. - - - Attributes: - name: - Output only. Instruction resource name, format: - projects/{project\_id}/instructions/{instruction\_id} - display_name: - Required. The display name of the instruction. Maximum of 64 - characters. - description: - Optional. User-provided description of the instruction. The - description can be up to 10000 characters long. - create_time: - Output only. Creation time of instruction. - update_time: - Output only. Last update time of instruction. - data_type: - Required. The data type of this instruction. - csv_instruction: - Deprecated: this instruction format is not supported any more. - Instruction from a CSV file, such as for classification task. - The CSV file should have exact two columns, in the following - format: - The first column is labeled data, such as an image - reference, text. - The second column is comma separated - labels associated with data. - pdf_instruction: - Instruction from a PDF document. The PDF should be in a Cloud - Storage bucket. - blocking_resources: - Output only. The names of any related resources that are - blocking changes to the instruction. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.Instruction) - ), -) -_sym_db.RegisterMessage(Instruction) - -CsvInstruction = _reflection.GeneratedProtocolMessageType( - "CsvInstruction", - (_message.Message,), - dict( - DESCRIPTOR=_CSVINSTRUCTION, - __module__="google.cloud.datalabeling_v1beta1.proto.instruction_pb2", - __doc__="""Deprecated: this instruction format is not supported any - more. Instruction from a CSV file. - - - Attributes: - gcs_file_uri: - CSV file for the instruction. Only gcs path is allowed. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.CsvInstruction) - ), -) -_sym_db.RegisterMessage(CsvInstruction) - -PdfInstruction = _reflection.GeneratedProtocolMessageType( - "PdfInstruction", - (_message.Message,), - dict( - DESCRIPTOR=_PDFINSTRUCTION, - __module__="google.cloud.datalabeling_v1beta1.proto.instruction_pb2", - __doc__="""Instruction from a PDF file. - - - Attributes: - gcs_file_uri: - PDF file for the instruction. Only gcs path is allowed. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.PdfInstruction) - ), -) -_sym_db.RegisterMessage(PdfInstruction) - - -DESCRIPTOR._options = None -_INSTRUCTION.fields_by_name["csv_instruction"]._options = None -_INSTRUCTION._options = None -# @@protoc_insertion_point(module_scope) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction_pb2_grpc.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/instruction_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/operations.proto b/datalabeling/google/cloud/datalabeling_v1beta1/proto/operations.proto deleted file mode 100644 index 7f0692443860..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/operations.proto +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datalabeling.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/resource.proto"; -import "google/cloud/datalabeling/v1beta1/dataset.proto"; -import "google/cloud/datalabeling/v1beta1/human_annotation_config.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datalabeling.v1beta1"; - -// Response used for ImportData longrunning operation. -message ImportDataOperationResponse { - // Ouptut only. The name of imported dataset. - string dataset = 1; - - // Output only. Total number of examples requested to import - int32 total_count = 2; - - // Output only. Number of examples imported successfully. - int32 import_count = 3; -} - -// Response used for ExportDataset longrunning operation. -message ExportDataOperationResponse { - // Ouptut only. The name of dataset. - // "projects/*/datasets/*" - string dataset = 1; - - // Output only. Total number of examples requested to export - int32 total_count = 2; - - // Output only. Number of examples exported successfully. - int32 export_count = 3; - - // Output only. Statistic infos of labels in the exported dataset. - LabelStats label_stats = 4; - - // Output only. output_config in the ExportData request. - OutputConfig output_config = 5; -} - -// Metadata of an ImportData operation. -message ImportDataOperationMetadata { - // Output only. The name of imported dataset. - // "projects/*/datasets/*" - string dataset = 1; - - // Output only. Partial failures encountered. - // E.g. single files that couldn't be read. - // Status details field will contain standard GCP error details. - repeated google.rpc.Status partial_failures = 2; - - // Output only. Timestamp when import dataset request was created. - google.protobuf.Timestamp create_time = 3; -} - -// Metadata of an ExportData operation. -message ExportDataOperationMetadata { - // Output only. The name of dataset to be exported. - // "projects/*/datasets/*" - string dataset = 1; - - // Output only. Partial failures encountered. - // E.g. single files that couldn't be read. - // Status details field will contain standard GCP error details. - repeated google.rpc.Status partial_failures = 2; - - // Output only. Timestamp when export dataset request was created. - google.protobuf.Timestamp create_time = 3; -} - -// Metadata of a labeling operation, such as LabelImage or LabelVideo. -// Next tag: 20 -message LabelOperationMetadata { - // Ouptut only. Details of specific label operation. - oneof details { - // Details of label image classification operation. - LabelImageClassificationOperationMetadata image_classification_details = 3; - - // Details of label image bounding box operation. - LabelImageBoundingBoxOperationMetadata image_bounding_box_details = 4; - - // Details of label image bounding poly operation. - LabelImageBoundingPolyOperationMetadata image_bounding_poly_details = 11; - - // Details of label image oriented bounding box operation. - LabelImageOrientedBoundingBoxOperationMetadata image_oriented_bounding_box_details = 14; - - // Details of label image polyline operation. - LabelImagePolylineOperationMetadata image_polyline_details = 12; - - // Details of label image segmentation operation. - LabelImageSegmentationOperationMetadata image_segmentation_details = 15; - - // Details of label video classification operation. - LabelVideoClassificationOperationMetadata video_classification_details = 5; - - // Details of label video object detection operation. - LabelVideoObjectDetectionOperationMetadata video_object_detection_details = 6; - - // Details of label video object tracking operation. - LabelVideoObjectTrackingOperationMetadata video_object_tracking_details = 7; - - // Details of label video event operation. - LabelVideoEventOperationMetadata video_event_details = 8; - - // Details of label text classification operation. - LabelTextClassificationOperationMetadata text_classification_details = 9; - - // Details of label text entity extraction operation. - LabelTextEntityExtractionOperationMetadata text_entity_extraction_details = 13; - } - - // Output only. Progress of label operation. Range: [0, 100]. - int32 progress_percent = 1; - - // Output only. Partial failures encountered. - // E.g. single files that couldn't be read. - // Status details field will contain standard GCP error details. - repeated google.rpc.Status partial_failures = 2; - - // Output only. Timestamp when labeling request was created. - google.protobuf.Timestamp create_time = 16; -} - -// Metadata of a LabelImageClassification operation. -message LabelImageClassificationOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Details of a LabelImageBoundingBox operation metadata. -message LabelImageBoundingBoxOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Details of a LabelImageOrientedBoundingBox operation metadata. -message LabelImageOrientedBoundingBoxOperationMetadata { - // Basic human annotation config. - HumanAnnotationConfig basic_config = 1; -} - -// Details of LabelImageBoundingPoly operation metadata. -message LabelImageBoundingPolyOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Details of LabelImagePolyline operation metadata. -message LabelImagePolylineOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Details of a LabelImageSegmentation operation metadata. -message LabelImageSegmentationOperationMetadata { - // Basic human annotation config. - HumanAnnotationConfig basic_config = 1; -} - -// Details of a LabelVideoClassification operation metadata. -message LabelVideoClassificationOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Details of a LabelVideoObjectDetection operation metadata. -message LabelVideoObjectDetectionOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Details of a LabelVideoObjectTracking operation metadata. -message LabelVideoObjectTrackingOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Details of a LabelVideoEvent operation metadata. -message LabelVideoEventOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Details of a LabelTextClassification operation metadata. -message LabelTextClassificationOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Details of a LabelTextEntityExtraction operation metadata. -message LabelTextEntityExtractionOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Metadata of a CreateInstruction operation. -message CreateInstructionMetadata { - // The name of the created Instruction. - // projects/{project_id}/instructions/{instruction_id} - string instruction = 1; - - // Partial failures encountered. - // E.g. single files that couldn't be read. - // Status details field will contain standard GCP error details. - repeated google.rpc.Status partial_failures = 2; - - // Timestamp when create instruction request was created. - google.protobuf.Timestamp create_time = 3; -} diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/operations_pb2.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/operations_pb2.py deleted file mode 100644 index 9c7f6f6cff98..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/operations_pb2.py +++ /dev/null @@ -1,1880 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/datalabeling_v1beta1/proto/operations.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.datalabeling_v1beta1.proto import ( - dataset_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2, -) -from google.cloud.datalabeling_v1beta1.proto import ( - human_annotation_config_pb2 as google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/datalabeling_v1beta1/proto/operations.proto", - package="google.cloud.datalabeling.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n%com.google.cloud.datalabeling.v1beta1P\001ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling" - ), - serialized_pb=_b( - '\n8google/cloud/datalabeling_v1beta1/proto/operations.proto\x12!google.cloud.datalabeling.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x19google/api/resource.proto\x1a\x35google/cloud/datalabeling_v1beta1/proto/dataset.proto\x1a\x45google/cloud/datalabeling_v1beta1/proto/human_annotation_config.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto"Y\n\x1bImportDataOperationResponse\x12\x0f\n\x07\x64\x61taset\x18\x01 \x01(\t\x12\x13\n\x0btotal_count\x18\x02 \x01(\x05\x12\x14\n\x0cimport_count\x18\x03 \x01(\x05"\xe5\x01\n\x1b\x45xportDataOperationResponse\x12\x0f\n\x07\x64\x61taset\x18\x01 \x01(\t\x12\x13\n\x0btotal_count\x18\x02 \x01(\x05\x12\x14\n\x0c\x65xport_count\x18\x03 \x01(\x05\x12\x42\n\x0blabel_stats\x18\x04 \x01(\x0b\x32-.google.cloud.datalabeling.v1beta1.LabelStats\x12\x46\n\routput_config\x18\x05 \x01(\x0b\x32/.google.cloud.datalabeling.v1beta1.OutputConfig"\x8d\x01\n\x1bImportDataOperationMetadata\x12\x0f\n\x07\x64\x61taset\x18\x01 \x01(\t\x12,\n\x10partial_failures\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"\x8d\x01\n\x1b\x45xportDataOperationMetadata\x12\x0f\n\x07\x64\x61taset\x18\x01 \x01(\t\x12,\n\x10partial_failures\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"\x8c\x0c\n\x16LabelOperationMetadata\x12t\n\x1cimage_classification_details\x18\x03 \x01(\x0b\x32L.google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadataH\x00\x12o\n\x1aimage_bounding_box_details\x18\x04 \x01(\x0b\x32I.google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadataH\x00\x12q\n\x1bimage_bounding_poly_details\x18\x0b \x01(\x0b\x32J.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadataH\x00\x12\x80\x01\n#image_oriented_bounding_box_details\x18\x0e \x01(\x0b\x32Q.google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadataH\x00\x12h\n\x16image_polyline_details\x18\x0c \x01(\x0b\x32\x46.google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadataH\x00\x12p\n\x1aimage_segmentation_details\x18\x0f \x01(\x0b\x32J.google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadataH\x00\x12t\n\x1cvideo_classification_details\x18\x05 \x01(\x0b\x32L.google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadataH\x00\x12w\n\x1evideo_object_detection_details\x18\x06 \x01(\x0b\x32M.google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadataH\x00\x12u\n\x1dvideo_object_tracking_details\x18\x07 \x01(\x0b\x32L.google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadataH\x00\x12\x62\n\x13video_event_details\x18\x08 \x01(\x0b\x32\x43.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadataH\x00\x12r\n\x1btext_classification_details\x18\t \x01(\x0b\x32K.google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadataH\x00\x12w\n\x1etext_entity_extraction_details\x18\r \x01(\x0b\x32M.google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadataH\x00\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12,\n\x10partial_failures\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\x12/\n\x0b\x63reate_time\x18\x10 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\t\n\x07\x64\x65tails"{\n)LabelImageClassificationOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"x\n&LabelImageBoundingBoxOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"\x80\x01\n.LabelImageOrientedBoundingBoxOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"y\n\'LabelImageBoundingPolyOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"u\n#LabelImagePolylineOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"y\n\'LabelImageSegmentationOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"{\n)LabelVideoClassificationOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"|\n*LabelVideoObjectDetectionOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"{\n)LabelVideoObjectTrackingOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"r\n LabelVideoEventOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"z\n(LabelTextClassificationOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"|\n*LabelTextEntityExtractionOperationMetadata\x12N\n\x0c\x62\x61sic_config\x18\x01 \x01(\x0b\x32\x38.google.cloud.datalabeling.v1beta1.HumanAnnotationConfig"\x8f\x01\n\x19\x43reateInstructionMetadata\x12\x13\n\x0binstruction\x18\x01 \x01(\t\x12,\n\x10partial_failures\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampBx\n%com.google.cloud.datalabeling.v1beta1P\x01ZMgoogle.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabelingb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2.DESCRIPTOR, - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - ], -) - - -_IMPORTDATAOPERATIONRESPONSE = _descriptor.Descriptor( - name="ImportDataOperationResponse", - full_name="google.cloud.datalabeling.v1beta1.ImportDataOperationResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="dataset", - full_name="google.cloud.datalabeling.v1beta1.ImportDataOperationResponse.dataset", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="total_count", - full_name="google.cloud.datalabeling.v1beta1.ImportDataOperationResponse.total_count", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="import_count", - full_name="google.cloud.datalabeling.v1beta1.ImportDataOperationResponse.import_count", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=336, - serialized_end=425, -) - - -_EXPORTDATAOPERATIONRESPONSE = _descriptor.Descriptor( - name="ExportDataOperationResponse", - full_name="google.cloud.datalabeling.v1beta1.ExportDataOperationResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="dataset", - full_name="google.cloud.datalabeling.v1beta1.ExportDataOperationResponse.dataset", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="total_count", - full_name="google.cloud.datalabeling.v1beta1.ExportDataOperationResponse.total_count", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="export_count", - full_name="google.cloud.datalabeling.v1beta1.ExportDataOperationResponse.export_count", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="label_stats", - full_name="google.cloud.datalabeling.v1beta1.ExportDataOperationResponse.label_stats", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="output_config", - full_name="google.cloud.datalabeling.v1beta1.ExportDataOperationResponse.output_config", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=428, - serialized_end=657, -) - - -_IMPORTDATAOPERATIONMETADATA = _descriptor.Descriptor( - name="ImportDataOperationMetadata", - full_name="google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="dataset", - full_name="google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata.dataset", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="partial_failures", - full_name="google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata.partial_failures", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata.create_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=660, - serialized_end=801, -) - - -_EXPORTDATAOPERATIONMETADATA = _descriptor.Descriptor( - name="ExportDataOperationMetadata", - full_name="google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="dataset", - full_name="google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata.dataset", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="partial_failures", - full_name="google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata.partial_failures", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata.create_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=804, - serialized_end=945, -) - - -_LABELOPERATIONMETADATA = _descriptor.Descriptor( - name="LabelOperationMetadata", - full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="image_classification_details", - full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.image_classification_details", - index=0, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_bounding_box_details", - full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.image_bounding_box_details", - index=1, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_bounding_poly_details", - full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.image_bounding_poly_details", - index=2, - number=11, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_oriented_bounding_box_details", - full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.image_oriented_bounding_box_details", - index=3, - number=14, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_polyline_details", - full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.image_polyline_details", - index=4, - number=12, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_segmentation_details", - full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.image_segmentation_details", - index=5, - number=15, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_classification_details", - full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.video_classification_details", - index=6, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_object_detection_details", - full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.video_object_detection_details", - index=7, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_object_tracking_details", - full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.video_object_tracking_details", - index=8, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_event_details", - full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.video_event_details", - index=9, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_classification_details", - full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.text_classification_details", - index=10, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_entity_extraction_details", - full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.text_entity_extraction_details", - index=11, - number=13, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="progress_percent", - full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.progress_percent", - index=12, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="partial_failures", - full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.partial_failures", - index=13, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.create_time", - index=14, - number=16, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="details", - full_name="google.cloud.datalabeling.v1beta1.LabelOperationMetadata.details", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=948, - serialized_end=2496, -) - - -_LABELIMAGECLASSIFICATIONOPERATIONMETADATA = _descriptor.Descriptor( - name="LabelImageClassificationOperationMetadata", - full_name="google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="basic_config", - full_name="google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata.basic_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2498, - serialized_end=2621, -) - - -_LABELIMAGEBOUNDINGBOXOPERATIONMETADATA = _descriptor.Descriptor( - name="LabelImageBoundingBoxOperationMetadata", - full_name="google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="basic_config", - full_name="google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata.basic_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2623, - serialized_end=2743, -) - - -_LABELIMAGEORIENTEDBOUNDINGBOXOPERATIONMETADATA = _descriptor.Descriptor( - name="LabelImageOrientedBoundingBoxOperationMetadata", - full_name="google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="basic_config", - full_name="google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata.basic_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2746, - serialized_end=2874, -) - - -_LABELIMAGEBOUNDINGPOLYOPERATIONMETADATA = _descriptor.Descriptor( - name="LabelImageBoundingPolyOperationMetadata", - full_name="google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="basic_config", - full_name="google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata.basic_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2876, - serialized_end=2997, -) - - -_LABELIMAGEPOLYLINEOPERATIONMETADATA = _descriptor.Descriptor( - name="LabelImagePolylineOperationMetadata", - full_name="google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="basic_config", - full_name="google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata.basic_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2999, - serialized_end=3116, -) - - -_LABELIMAGESEGMENTATIONOPERATIONMETADATA = _descriptor.Descriptor( - name="LabelImageSegmentationOperationMetadata", - full_name="google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="basic_config", - full_name="google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata.basic_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3118, - serialized_end=3239, -) - - -_LABELVIDEOCLASSIFICATIONOPERATIONMETADATA = _descriptor.Descriptor( - name="LabelVideoClassificationOperationMetadata", - full_name="google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="basic_config", - full_name="google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata.basic_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3241, - serialized_end=3364, -) - - -_LABELVIDEOOBJECTDETECTIONOPERATIONMETADATA = _descriptor.Descriptor( - name="LabelVideoObjectDetectionOperationMetadata", - full_name="google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="basic_config", - full_name="google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata.basic_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3366, - serialized_end=3490, -) - - -_LABELVIDEOOBJECTTRACKINGOPERATIONMETADATA = _descriptor.Descriptor( - name="LabelVideoObjectTrackingOperationMetadata", - full_name="google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="basic_config", - full_name="google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata.basic_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3492, - serialized_end=3615, -) - - -_LABELVIDEOEVENTOPERATIONMETADATA = _descriptor.Descriptor( - name="LabelVideoEventOperationMetadata", - full_name="google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="basic_config", - full_name="google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata.basic_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3617, - serialized_end=3731, -) - - -_LABELTEXTCLASSIFICATIONOPERATIONMETADATA = _descriptor.Descriptor( - name="LabelTextClassificationOperationMetadata", - full_name="google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="basic_config", - full_name="google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata.basic_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3733, - serialized_end=3855, -) - - -_LABELTEXTENTITYEXTRACTIONOPERATIONMETADATA = _descriptor.Descriptor( - name="LabelTextEntityExtractionOperationMetadata", - full_name="google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="basic_config", - full_name="google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata.basic_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3857, - serialized_end=3981, -) - - -_CREATEINSTRUCTIONMETADATA = _descriptor.Descriptor( - name="CreateInstructionMetadata", - full_name="google.cloud.datalabeling.v1beta1.CreateInstructionMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="instruction", - full_name="google.cloud.datalabeling.v1beta1.CreateInstructionMetadata.instruction", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="partial_failures", - full_name="google.cloud.datalabeling.v1beta1.CreateInstructionMetadata.partial_failures", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.datalabeling.v1beta1.CreateInstructionMetadata.create_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3984, - serialized_end=4127, -) - -_EXPORTDATAOPERATIONRESPONSE.fields_by_name[ - "label_stats" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._LABELSTATS -) -_EXPORTDATAOPERATIONRESPONSE.fields_by_name[ - "output_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_dataset__pb2._OUTPUTCONFIG -) -_IMPORTDATAOPERATIONMETADATA.fields_by_name[ - "partial_failures" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_IMPORTDATAOPERATIONMETADATA.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_EXPORTDATAOPERATIONMETADATA.fields_by_name[ - "partial_failures" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_EXPORTDATAOPERATIONMETADATA.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_LABELOPERATIONMETADATA.fields_by_name[ - "image_classification_details" -].message_type = _LABELIMAGECLASSIFICATIONOPERATIONMETADATA -_LABELOPERATIONMETADATA.fields_by_name[ - "image_bounding_box_details" -].message_type = _LABELIMAGEBOUNDINGBOXOPERATIONMETADATA -_LABELOPERATIONMETADATA.fields_by_name[ - "image_bounding_poly_details" -].message_type = _LABELIMAGEBOUNDINGPOLYOPERATIONMETADATA -_LABELOPERATIONMETADATA.fields_by_name[ - "image_oriented_bounding_box_details" -].message_type = _LABELIMAGEORIENTEDBOUNDINGBOXOPERATIONMETADATA -_LABELOPERATIONMETADATA.fields_by_name[ - "image_polyline_details" -].message_type = _LABELIMAGEPOLYLINEOPERATIONMETADATA -_LABELOPERATIONMETADATA.fields_by_name[ - "image_segmentation_details" -].message_type = _LABELIMAGESEGMENTATIONOPERATIONMETADATA -_LABELOPERATIONMETADATA.fields_by_name[ - "video_classification_details" -].message_type = _LABELVIDEOCLASSIFICATIONOPERATIONMETADATA -_LABELOPERATIONMETADATA.fields_by_name[ - "video_object_detection_details" -].message_type = _LABELVIDEOOBJECTDETECTIONOPERATIONMETADATA -_LABELOPERATIONMETADATA.fields_by_name[ - "video_object_tracking_details" -].message_type = _LABELVIDEOOBJECTTRACKINGOPERATIONMETADATA -_LABELOPERATIONMETADATA.fields_by_name[ - "video_event_details" -].message_type = _LABELVIDEOEVENTOPERATIONMETADATA -_LABELOPERATIONMETADATA.fields_by_name[ - "text_classification_details" -].message_type = _LABELTEXTCLASSIFICATIONOPERATIONMETADATA -_LABELOPERATIONMETADATA.fields_by_name[ - "text_entity_extraction_details" -].message_type = _LABELTEXTENTITYEXTRACTIONOPERATIONMETADATA -_LABELOPERATIONMETADATA.fields_by_name[ - "partial_failures" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_LABELOPERATIONMETADATA.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _LABELOPERATIONMETADATA.fields_by_name["image_classification_details"] -) -_LABELOPERATIONMETADATA.fields_by_name[ - "image_classification_details" -].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] -_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _LABELOPERATIONMETADATA.fields_by_name["image_bounding_box_details"] -) -_LABELOPERATIONMETADATA.fields_by_name[ - "image_bounding_box_details" -].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] -_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _LABELOPERATIONMETADATA.fields_by_name["image_bounding_poly_details"] -) -_LABELOPERATIONMETADATA.fields_by_name[ - "image_bounding_poly_details" -].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] -_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _LABELOPERATIONMETADATA.fields_by_name["image_oriented_bounding_box_details"] -) -_LABELOPERATIONMETADATA.fields_by_name[ - "image_oriented_bounding_box_details" -].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] -_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _LABELOPERATIONMETADATA.fields_by_name["image_polyline_details"] -) -_LABELOPERATIONMETADATA.fields_by_name[ - "image_polyline_details" -].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] -_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _LABELOPERATIONMETADATA.fields_by_name["image_segmentation_details"] -) -_LABELOPERATIONMETADATA.fields_by_name[ - "image_segmentation_details" -].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] -_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _LABELOPERATIONMETADATA.fields_by_name["video_classification_details"] -) -_LABELOPERATIONMETADATA.fields_by_name[ - "video_classification_details" -].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] -_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _LABELOPERATIONMETADATA.fields_by_name["video_object_detection_details"] -) -_LABELOPERATIONMETADATA.fields_by_name[ - "video_object_detection_details" -].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] -_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _LABELOPERATIONMETADATA.fields_by_name["video_object_tracking_details"] -) -_LABELOPERATIONMETADATA.fields_by_name[ - "video_object_tracking_details" -].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] -_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _LABELOPERATIONMETADATA.fields_by_name["video_event_details"] -) -_LABELOPERATIONMETADATA.fields_by_name[ - "video_event_details" -].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] -_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _LABELOPERATIONMETADATA.fields_by_name["text_classification_details"] -) -_LABELOPERATIONMETADATA.fields_by_name[ - "text_classification_details" -].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] -_LABELOPERATIONMETADATA.oneofs_by_name["details"].fields.append( - _LABELOPERATIONMETADATA.fields_by_name["text_entity_extraction_details"] -) -_LABELOPERATIONMETADATA.fields_by_name[ - "text_entity_extraction_details" -].containing_oneof = _LABELOPERATIONMETADATA.oneofs_by_name["details"] -_LABELIMAGECLASSIFICATIONOPERATIONMETADATA.fields_by_name[ - "basic_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG -) -_LABELIMAGEBOUNDINGBOXOPERATIONMETADATA.fields_by_name[ - "basic_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG -) -_LABELIMAGEORIENTEDBOUNDINGBOXOPERATIONMETADATA.fields_by_name[ - "basic_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG -) -_LABELIMAGEBOUNDINGPOLYOPERATIONMETADATA.fields_by_name[ - "basic_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG -) -_LABELIMAGEPOLYLINEOPERATIONMETADATA.fields_by_name[ - "basic_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG -) -_LABELIMAGESEGMENTATIONOPERATIONMETADATA.fields_by_name[ - "basic_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG -) -_LABELVIDEOCLASSIFICATIONOPERATIONMETADATA.fields_by_name[ - "basic_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG -) -_LABELVIDEOOBJECTDETECTIONOPERATIONMETADATA.fields_by_name[ - "basic_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG -) -_LABELVIDEOOBJECTTRACKINGOPERATIONMETADATA.fields_by_name[ - "basic_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG -) -_LABELVIDEOEVENTOPERATIONMETADATA.fields_by_name[ - "basic_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG -) -_LABELTEXTCLASSIFICATIONOPERATIONMETADATA.fields_by_name[ - "basic_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG -) -_LABELTEXTENTITYEXTRACTIONOPERATIONMETADATA.fields_by_name[ - "basic_config" -].message_type = ( - google_dot_cloud_dot_datalabeling__v1beta1_dot_proto_dot_human__annotation__config__pb2._HUMANANNOTATIONCONFIG -) -_CREATEINSTRUCTIONMETADATA.fields_by_name[ - "partial_failures" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_CREATEINSTRUCTIONMETADATA.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -DESCRIPTOR.message_types_by_name[ - "ImportDataOperationResponse" -] = _IMPORTDATAOPERATIONRESPONSE -DESCRIPTOR.message_types_by_name[ - "ExportDataOperationResponse" -] = _EXPORTDATAOPERATIONRESPONSE -DESCRIPTOR.message_types_by_name[ - "ImportDataOperationMetadata" -] = _IMPORTDATAOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "ExportDataOperationMetadata" -] = _EXPORTDATAOPERATIONMETADATA -DESCRIPTOR.message_types_by_name["LabelOperationMetadata"] = _LABELOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "LabelImageClassificationOperationMetadata" -] = _LABELIMAGECLASSIFICATIONOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "LabelImageBoundingBoxOperationMetadata" -] = _LABELIMAGEBOUNDINGBOXOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "LabelImageOrientedBoundingBoxOperationMetadata" -] = _LABELIMAGEORIENTEDBOUNDINGBOXOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "LabelImageBoundingPolyOperationMetadata" -] = _LABELIMAGEBOUNDINGPOLYOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "LabelImagePolylineOperationMetadata" -] = _LABELIMAGEPOLYLINEOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "LabelImageSegmentationOperationMetadata" -] = _LABELIMAGESEGMENTATIONOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "LabelVideoClassificationOperationMetadata" -] = _LABELVIDEOCLASSIFICATIONOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "LabelVideoObjectDetectionOperationMetadata" -] = _LABELVIDEOOBJECTDETECTIONOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "LabelVideoObjectTrackingOperationMetadata" -] = _LABELVIDEOOBJECTTRACKINGOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "LabelVideoEventOperationMetadata" -] = _LABELVIDEOEVENTOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "LabelTextClassificationOperationMetadata" -] = _LABELTEXTCLASSIFICATIONOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "LabelTextEntityExtractionOperationMetadata" -] = _LABELTEXTENTITYEXTRACTIONOPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "CreateInstructionMetadata" -] = _CREATEINSTRUCTIONMETADATA -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ImportDataOperationResponse = _reflection.GeneratedProtocolMessageType( - "ImportDataOperationResponse", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTDATAOPERATIONRESPONSE, - __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", - __doc__="""Response used for ImportData longrunning operation. - - - Attributes: - dataset: - Ouptut only. The name of imported dataset. - total_count: - Output only. Total number of examples requested to import - import_count: - Output only. Number of examples imported successfully. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImportDataOperationResponse) - ), -) -_sym_db.RegisterMessage(ImportDataOperationResponse) - -ExportDataOperationResponse = _reflection.GeneratedProtocolMessageType( - "ExportDataOperationResponse", - (_message.Message,), - dict( - DESCRIPTOR=_EXPORTDATAOPERATIONRESPONSE, - __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", - __doc__="""Response used for ExportDataset longrunning operation. - - - Attributes: - dataset: - Ouptut only. The name of dataset. "projects/*/datasets/*" - total_count: - Output only. Total number of examples requested to export - export_count: - Output only. Number of examples exported successfully. - label_stats: - Output only. Statistic infos of labels in the exported - dataset. - output_config: - Output only. output\_config in the ExportData request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ExportDataOperationResponse) - ), -) -_sym_db.RegisterMessage(ExportDataOperationResponse) - -ImportDataOperationMetadata = _reflection.GeneratedProtocolMessageType( - "ImportDataOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTDATAOPERATIONMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", - __doc__="""Metadata of an ImportData operation. - - - Attributes: - dataset: - Output only. The name of imported dataset. - "projects/*/datasets/*" - partial_failures: - Output only. Partial failures encountered. E.g. single files - that couldn't be read. Status details field will contain - standard GCP error details. - create_time: - Output only. Timestamp when import dataset request was - created. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ImportDataOperationMetadata) - ), -) -_sym_db.RegisterMessage(ImportDataOperationMetadata) - -ExportDataOperationMetadata = _reflection.GeneratedProtocolMessageType( - "ExportDataOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_EXPORTDATAOPERATIONMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", - __doc__="""Metadata of an ExportData operation. - - - Attributes: - dataset: - Output only. The name of dataset to be exported. - "projects/*/datasets/*" - partial_failures: - Output only. Partial failures encountered. E.g. single files - that couldn't be read. Status details field will contain - standard GCP error details. - create_time: - Output only. Timestamp when export dataset request was - created. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.ExportDataOperationMetadata) - ), -) -_sym_db.RegisterMessage(ExportDataOperationMetadata) - -LabelOperationMetadata = _reflection.GeneratedProtocolMessageType( - "LabelOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_LABELOPERATIONMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", - __doc__="""Metadata of a labeling operation, such as LabelImage or - LabelVideo. Next tag: 20 - - - Attributes: - details: - Ouptut only. Details of specific label operation. - image_classification_details: - Details of label image classification operation. - image_bounding_box_details: - Details of label image bounding box operation. - image_bounding_poly_details: - Details of label image bounding poly operation. - image_oriented_bounding_box_details: - Details of label image oriented bounding box operation. - image_polyline_details: - Details of label image polyline operation. - image_segmentation_details: - Details of label image segmentation operation. - video_classification_details: - Details of label video classification operation. - video_object_detection_details: - Details of label video object detection operation. - video_object_tracking_details: - Details of label video object tracking operation. - video_event_details: - Details of label video event operation. - text_classification_details: - Details of label text classification operation. - text_entity_extraction_details: - Details of label text entity extraction operation. - progress_percent: - Output only. Progress of label operation. Range: [0, 100]. - partial_failures: - Output only. Partial failures encountered. E.g. single files - that couldn't be read. Status details field will contain - standard GCP error details. - create_time: - Output only. Timestamp when labeling request was created. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelOperationMetadata) - ), -) -_sym_db.RegisterMessage(LabelOperationMetadata) - -LabelImageClassificationOperationMetadata = _reflection.GeneratedProtocolMessageType( - "LabelImageClassificationOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_LABELIMAGECLASSIFICATIONOPERATIONMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", - __doc__="""Metadata of a LabelImageClassification operation. - - - Attributes: - basic_config: - Basic human annotation config used in labeling request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelImageClassificationOperationMetadata) - ), -) -_sym_db.RegisterMessage(LabelImageClassificationOperationMetadata) - -LabelImageBoundingBoxOperationMetadata = _reflection.GeneratedProtocolMessageType( - "LabelImageBoundingBoxOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_LABELIMAGEBOUNDINGBOXOPERATIONMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", - __doc__="""Details of a LabelImageBoundingBox operation metadata. - - - Attributes: - basic_config: - Basic human annotation config used in labeling request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelImageBoundingBoxOperationMetadata) - ), -) -_sym_db.RegisterMessage(LabelImageBoundingBoxOperationMetadata) - -LabelImageOrientedBoundingBoxOperationMetadata = _reflection.GeneratedProtocolMessageType( - "LabelImageOrientedBoundingBoxOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_LABELIMAGEORIENTEDBOUNDINGBOXOPERATIONMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", - __doc__="""Details of a LabelImageOrientedBoundingBox operation - metadata. - - - Attributes: - basic_config: - Basic human annotation config. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelImageOrientedBoundingBoxOperationMetadata) - ), -) -_sym_db.RegisterMessage(LabelImageOrientedBoundingBoxOperationMetadata) - -LabelImageBoundingPolyOperationMetadata = _reflection.GeneratedProtocolMessageType( - "LabelImageBoundingPolyOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_LABELIMAGEBOUNDINGPOLYOPERATIONMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", - __doc__="""Details of LabelImageBoundingPoly operation metadata. - - - Attributes: - basic_config: - Basic human annotation config used in labeling request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata) - ), -) -_sym_db.RegisterMessage(LabelImageBoundingPolyOperationMetadata) - -LabelImagePolylineOperationMetadata = _reflection.GeneratedProtocolMessageType( - "LabelImagePolylineOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_LABELIMAGEPOLYLINEOPERATIONMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", - __doc__="""Details of LabelImagePolyline operation metadata. - - - Attributes: - basic_config: - Basic human annotation config used in labeling request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata) - ), -) -_sym_db.RegisterMessage(LabelImagePolylineOperationMetadata) - -LabelImageSegmentationOperationMetadata = _reflection.GeneratedProtocolMessageType( - "LabelImageSegmentationOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_LABELIMAGESEGMENTATIONOPERATIONMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", - __doc__="""Details of a LabelImageSegmentation operation metadata. - - - Attributes: - basic_config: - Basic human annotation config. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata) - ), -) -_sym_db.RegisterMessage(LabelImageSegmentationOperationMetadata) - -LabelVideoClassificationOperationMetadata = _reflection.GeneratedProtocolMessageType( - "LabelVideoClassificationOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_LABELVIDEOCLASSIFICATIONOPERATIONMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", - __doc__="""Details of a LabelVideoClassification operation metadata. - - - Attributes: - basic_config: - Basic human annotation config used in labeling request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelVideoClassificationOperationMetadata) - ), -) -_sym_db.RegisterMessage(LabelVideoClassificationOperationMetadata) - -LabelVideoObjectDetectionOperationMetadata = _reflection.GeneratedProtocolMessageType( - "LabelVideoObjectDetectionOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_LABELVIDEOOBJECTDETECTIONOPERATIONMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", - __doc__="""Details of a LabelVideoObjectDetection operation metadata. - - - Attributes: - basic_config: - Basic human annotation config used in labeling request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelVideoObjectDetectionOperationMetadata) - ), -) -_sym_db.RegisterMessage(LabelVideoObjectDetectionOperationMetadata) - -LabelVideoObjectTrackingOperationMetadata = _reflection.GeneratedProtocolMessageType( - "LabelVideoObjectTrackingOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_LABELVIDEOOBJECTTRACKINGOPERATIONMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", - __doc__="""Details of a LabelVideoObjectTracking operation metadata. - - - Attributes: - basic_config: - Basic human annotation config used in labeling request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelVideoObjectTrackingOperationMetadata) - ), -) -_sym_db.RegisterMessage(LabelVideoObjectTrackingOperationMetadata) - -LabelVideoEventOperationMetadata = _reflection.GeneratedProtocolMessageType( - "LabelVideoEventOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_LABELVIDEOEVENTOPERATIONMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", - __doc__="""Details of a LabelVideoEvent operation metadata. - - - Attributes: - basic_config: - Basic human annotation config used in labeling request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata) - ), -) -_sym_db.RegisterMessage(LabelVideoEventOperationMetadata) - -LabelTextClassificationOperationMetadata = _reflection.GeneratedProtocolMessageType( - "LabelTextClassificationOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_LABELTEXTCLASSIFICATIONOPERATIONMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", - __doc__="""Details of a LabelTextClassification operation metadata. - - - Attributes: - basic_config: - Basic human annotation config used in labeling request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelTextClassificationOperationMetadata) - ), -) -_sym_db.RegisterMessage(LabelTextClassificationOperationMetadata) - -LabelTextEntityExtractionOperationMetadata = _reflection.GeneratedProtocolMessageType( - "LabelTextEntityExtractionOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_LABELTEXTENTITYEXTRACTIONOPERATIONMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", - __doc__="""Details of a LabelTextEntityExtraction operation metadata. - - - Attributes: - basic_config: - Basic human annotation config used in labeling request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata) - ), -) -_sym_db.RegisterMessage(LabelTextEntityExtractionOperationMetadata) - -CreateInstructionMetadata = _reflection.GeneratedProtocolMessageType( - "CreateInstructionMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEINSTRUCTIONMETADATA, - __module__="google.cloud.datalabeling_v1beta1.proto.operations_pb2", - __doc__="""Metadata of a CreateInstruction operation. - - - Attributes: - instruction: - The name of the created Instruction. - projects/{project\_id}/instructions/{instruction\_id} - partial_failures: - Partial failures encountered. E.g. single files that couldn't - be read. Status details field will contain standard GCP error - details. - create_time: - Timestamp when create instruction request was created. - """, - # @@protoc_insertion_point(class_scope:google.cloud.datalabeling.v1beta1.CreateInstructionMetadata) - ), -) -_sym_db.RegisterMessage(CreateInstructionMetadata) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/proto/operations_pb2_grpc.py b/datalabeling/google/cloud/datalabeling_v1beta1/proto/operations_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/proto/operations_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/datalabeling/google/cloud/datalabeling_v1beta1/types.py b/datalabeling/google/cloud/datalabeling_v1beta1/types.py deleted file mode 100644 index 6d9d3134d5ab..000000000000 --- a/datalabeling/google/cloud/datalabeling_v1beta1/types.py +++ /dev/null @@ -1,80 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.datalabeling_v1beta1.proto import annotation_pb2 -from google.cloud.datalabeling_v1beta1.proto import annotation_spec_set_pb2 -from google.cloud.datalabeling_v1beta1.proto import data_labeling_service_pb2 -from google.cloud.datalabeling_v1beta1.proto import data_payloads_pb2 -from google.cloud.datalabeling_v1beta1.proto import dataset_pb2 -from google.cloud.datalabeling_v1beta1.proto import evaluation_job_pb2 -from google.cloud.datalabeling_v1beta1.proto import evaluation_pb2 -from google.cloud.datalabeling_v1beta1.proto import human_annotation_config_pb2 -from google.cloud.datalabeling_v1beta1.proto import instruction_pb2 -from google.cloud.datalabeling_v1beta1.proto import ( - operations_pb2 as proto_operations_pb2, -) -from google.longrunning import operations_pb2 as longrunning_operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import duration_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 -from google.protobuf import timestamp_pb2 -from google.rpc import status_pb2 - - -_shared_modules = [ - longrunning_operations_pb2, - any_pb2, - duration_pb2, - empty_pb2, - field_mask_pb2, - timestamp_pb2, - status_pb2, -] - -_local_modules = [ - annotation_pb2, - annotation_spec_set_pb2, - data_labeling_service_pb2, - data_payloads_pb2, - dataset_pb2, - evaluation_job_pb2, - evaluation_pb2, - human_annotation_config_pb2, - instruction_pb2, - proto_operations_pb2, -] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.datalabeling_v1beta1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/datalabeling/noxfile.py b/datalabeling/noxfile.py deleted file mode 100644 index 08c709fad17b..000000000000 --- a/datalabeling/noxfile.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=80") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/datalabeling/protos/annotation.proto b/datalabeling/protos/annotation.proto deleted file mode 100644 index d2f77344bbbc..000000000000 --- a/datalabeling/protos/annotation.proto +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright 2018 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datalabeling.v1beta1; - -import "google/cloud/datalabeling/v1beta1/annotation_spec_set.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datalabeling.v1beta1"; - - -// Specifies where is the answer from. -enum AnnotationSource { - ANNOTATION_SOURCE_UNSPECIFIED = 0; - - // Answer is provided by a human contributor. - OPERATOR = 3; -} - -enum AnnotationSentiment { - ANNOTATION_SENTIMENT_UNSPECIFIED = 0; - - // This annotation describes negatively about the data. - NEGATIVE = 1; - - // This label describes positively about the data. - POSITIVE = 2; -} - -enum AnnotationType { - ANNOTATION_TYPE_UNSPECIFIED = 0; - - // Classification annotations in an image. - IMAGE_CLASSIFICATION_ANNOTATION = 1; - - // Bounding box annotations in an image. - IMAGE_BOUNDING_BOX_ANNOTATION = 2; - - // Bounding poly annotations in an image. - IMAGE_BOUNDING_POLY_ANNOTATION = 10; - - // Polyline annotations in an image. - IMAGE_POLYLINE_ANNOTATION = 11; - - // Classification annotations in video shots. - VIDEO_SHOTS_CLASSIFICATION_ANNOTATION = 3; - - // Video object tracking annotation. - VIDEO_OBJECT_TRACKING_ANNOTATION = 4; - - // Video object detection annotation. - VIDEO_OBJECT_DETECTION_ANNOTATION = 5; - - // Video event annotation. - VIDEO_EVENT_ANNOTATION = 6; - - // Classification for text. - TEXT_CLASSIFICATION_ANNOTATION = 8; - - // Entity extraction for text. - TEXT_ENTITY_EXTRACTION_ANNOTATION = 9; -} - -// Annotation for Example. Each example may have one or more annotations. For -// example in image classification problem, each image might have one or more -// labels. We call labels binded with this image an Annotation. -message Annotation { - // Output only. Unique name of this annotation, format is: - // - // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotated_dataset}/examples/{example_id}/annotations/{annotation_id} - string name = 1; - - // Output only. The source of the annotation. - AnnotationSource annotation_source = 2; - - // Output only. This is the actual annotation value, e.g classification, - // bounding box values are stored here. - AnnotationValue annotation_value = 3; - - // Output only. Annotation metadata, including information like votes - // for labels. - AnnotationMetadata annotation_metadata = 4; - - // Output only. Sentiment for this annotation. - AnnotationSentiment annotation_sentiment = 6; -} - -// Annotation value for an example. -message AnnotationValue { - oneof value_type { - // Annotation value for image classification case. - ImageClassificationAnnotation image_classification_annotation = 1; - - // Annotation value for image bounding box and polygon cases. - ImageBoundingPolyAnnotation image_bounding_poly_annotation = 2; - - // Annotation value for image polyline cases. - // Polyline here is different from BoundingPoly. It is formed by - // line segments connected to each other but not closed form(Bounding Poly). - // The line segments can cross each other. - ImagePolylineAnnotation image_polyline_annotation = 8; - - // Annotation value for text classification case. - TextClassificationAnnotation text_classification_annotation = 3; - - // Annotation value for video classification case. - VideoClassificationAnnotation video_classification_annotation = 4; - - // Annotation value for video object detection and tracking case. - VideoObjectTrackingAnnotation video_object_tracking_annotation = 5; - - // Annotation value for video event case. - VideoEventAnnotation video_event_annotation = 6; - } -} - -// Image classification annotation definition. -message ImageClassificationAnnotation { - // Label of image. - AnnotationSpec annotation_spec = 1; -} - -// A vertex represents a 2D point in the image. -// NOTE: the vertex coordinates are in the same scale as the original image. -message Vertex { - // X coordinate. - int32 x = 1; - - // Y coordinate. - int32 y = 2; -} - -// A vertex represents a 2D point in the image. -// NOTE: the normalized vertex coordinates are relative to the original image -// and range from 0 to 1. -message NormalizedVertex { - // X coordinate. - float x = 1; - - // Y coordinate. - float y = 2; -} - -// A bounding polygon in the image. -message BoundingPoly { - // The bounding polygon vertices. - repeated Vertex vertices = 1; -} - -// Normalized bounding polygon. -message NormalizedBoundingPoly { - // The bounding polygon normalized vertices. - repeated NormalizedVertex normalized_vertices = 1; -} - -// Image bounding poly annotation. It represents a polygon including -// bounding box in the image. -message ImageBoundingPolyAnnotation { - // The region of the polygon. If it is a bounding box, it is guaranteed to be - // four points. - oneof bounded_area { - BoundingPoly bounding_poly = 2; - - NormalizedBoundingPoly normalized_bounding_poly = 3; - } - - // Label of object in this bounding polygon. - AnnotationSpec annotation_spec = 1; -} - -// A line with multiple line segments. -message Polyline { - // The polyline vertices. - repeated Vertex vertices = 1; -} - -// Normalized polyline. -message NormalizedPolyline { - // The normalized polyline vertices. - repeated NormalizedVertex normalized_vertices = 1; -} - -// A polyline for the image annotation. -message ImagePolylineAnnotation { - oneof poly { - Polyline polyline = 2; - - NormalizedPolyline normalized_polyline = 3; - } - - // Label of this polyline. - AnnotationSpec annotation_spec = 1; -} - -// Text classification annotation. -message TextClassificationAnnotation { - // Label of the text. - AnnotationSpec annotation_spec = 1; -} - -// A time period inside of an example that has a time dimension (e.g. video). -message TimeSegment { - // Start of the time segment (inclusive), represented as the duration since - // the example start. - google.protobuf.Duration start_time_offset = 1; - - // End of the time segment (exclusive), represented as the duration since the - // example start. - google.protobuf.Duration end_time_offset = 2; -} - -// Video classification annotation. -message VideoClassificationAnnotation { - // The time segment of the video to which the annotation applies. - TimeSegment time_segment = 1; - - // Label of the segment specified by time_segment. - AnnotationSpec annotation_spec = 2; -} - -// Video frame level annotation for object detection and tracking. -message ObjectTrackingFrame { - // The bounding box location of this object track for the frame. - oneof bounded_area { - BoundingPoly bounding_poly = 1; - - NormalizedBoundingPoly normalized_bounding_poly = 2; - } - - // The time offset of this frame relative to the beginning of the video. - google.protobuf.Duration time_offset = 3; -} - -// Video object tracking annotation. -message VideoObjectTrackingAnnotation { - // Label of the object tracked in this annotation. - AnnotationSpec annotation_spec = 1; - - // The time segment of the video to which object tracking applies. - TimeSegment time_segment = 2; - - // The list of frames where this object track appears. - repeated ObjectTrackingFrame object_tracking_frames = 3; -} - -// Video event annotation. -message VideoEventAnnotation { - // Label of the event in this annotation. - AnnotationSpec annotation_spec = 1; - - // The time segment of the video to which the annotation applies. - TimeSegment time_segment = 2; -} - -// Additional information associated with the annotation. -message AnnotationMetadata { - // Metadata related to human labeling. - OperatorMetadata operator_metadata = 2; -} - -// General information useful for labels coming from contributors. -message OperatorMetadata { - // Confidence score corresponding to a label. For examle, if 3 contributors - // have answered the question and 2 of them agree on the final label, the - // confidence score will be 0.67 (2/3). - float score = 1; - - // The total number of contributors that answer this question. - int32 total_votes = 2; - - // The total number of contributors that choose this label. - int32 label_votes = 3; - - repeated string comments = 4; -} diff --git a/datalabeling/protos/annotation_spec_set.proto b/datalabeling/protos/annotation_spec_set.proto deleted file mode 100644 index 20fdec73c4d9..000000000000 --- a/datalabeling/protos/annotation_spec_set.proto +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2018 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datalabeling.v1beta1; - -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datalabeling.v1beta1"; - - -// AnnotationSpecSet is a collection of label definitions. For example, in -// image classification tasks, we define a set of labels, this set is called -// AnnotationSpecSet. AnnotationSpecSet is immutable upon creation. -message AnnotationSpecSet { - // Output only. - // AnnotationSpecSet resource name, format: - // projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} - string name = 1; - - // Required. The display name for AnnotationSpecSet defined by user. - // Maximum of 64 characters. - string display_name = 2; - - // Optional. User-provided description of the annotation specification set. - // The description can be up to 10000 characters long. - string description = 3; - - // Required. The actual spec set defined by the users. - repeated AnnotationSpec annotation_specs = 4; -} - -// Container of information related to one annotation spec. -message AnnotationSpec { - // Required. The display name of the AnnotationSpec. Maximum of 64 characters. - string display_name = 1; - - // Optional. User-provided description of the annotation specification. - // The description can be up to 10000 characters long. - string description = 2; -} diff --git a/datalabeling/protos/data_labeling_service.proto b/datalabeling/protos/data_labeling_service.proto deleted file mode 100644 index ee044911b874..000000000000 --- a/datalabeling/protos/data_labeling_service.proto +++ /dev/null @@ -1,727 +0,0 @@ -// Copyright 2018 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datalabeling.v1beta1; - -import "google/api/annotations.proto"; -import "google/cloud/datalabeling/v1beta1/annotation_spec_set.proto"; -import "google/cloud/datalabeling/v1beta1/dataset.proto"; -import "google/cloud/datalabeling/v1beta1/human_annotation_config.proto"; -import "google/cloud/datalabeling/v1beta1/instruction.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datalabeling.v1beta1"; - - -service DataLabelingService { - // Creates dataset. If success return a Dataset resource. - rpc CreateDataset(CreateDatasetRequest) returns (Dataset) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*}/datasets" - body: "*" - }; - } - - // Gets dataset by resource name. - rpc GetDataset(GetDatasetRequest) returns (Dataset) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/datasets/*}" - }; - } - - // Lists datasets under a project. Pagination is supported. - rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*}/datasets" - }; - } - - // Deletes a dataset by resource name. - rpc DeleteDataset(DeleteDatasetRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/datasets/*}" - }; - } - - // Imports data into dataset based on source locations defined in request. - // It can be called multiple times for the same dataset. Each dataset can - // only have one long running operation running on it. For example, no - // labeling task (also long running operation) can be started while - // importing is still ongoing. Vice versa. - rpc ImportData(ImportDataRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/datasets/*}:importData" - body: "*" - }; - } - - // Exports data and annotations from dataset. - rpc ExportData(ExportDataRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/datasets/*}:exportData" - body: "*" - }; - } - - // Gets a data item in a dataset by resource name. This API can be - // called after data are imported into dataset. - rpc GetDataItem(GetDataItemRequest) returns (DataItem) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/datasets/*/dataItems/*}" - }; - } - - // Lists data items in a dataset. This API can be called after data - // are imported into dataset. Pagination is supported. - rpc ListDataItems(ListDataItemsRequest) returns (ListDataItemsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/datasets/*}/dataItems" - }; - } - - // Gets an annotated dataset by resource name. - rpc GetAnnotatedDataset(GetAnnotatedDatasetRequest) returns (AnnotatedDataset) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}" - }; - } - - // Lists annotated datasets for a dataset. Pagination is supported. - rpc ListAnnotatedDatasets(ListAnnotatedDatasetsRequest) returns (ListAnnotatedDatasetsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/datasets/*}/annotatedDatasets" - }; - } - - // Deletes an annotated dataset by resource name. - rpc DeleteAnnotatedDataset(DeleteAnnotatedDatasetRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*}" - }; - } - - // Starts a labeling task for image. The type of image labeling task is - // configured by feature in the request. - rpc LabelImage(LabelImageRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/datasets/*}/image:label" - body: "*" - }; - } - - // Starts a labeling task for video. The type of video labeling task is - // configured by feature in the request. - rpc LabelVideo(LabelVideoRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/datasets/*}/video:label" - body: "*" - }; - } - - // Starts a labeling task for text. The type of text labeling task is - // configured by feature in the request. - rpc LabelText(LabelTextRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/datasets/*}/text:label" - body: "*" - }; - } - - // Starts a labeling task for audio. The type of audio labeling task is - // configured by feature in the request. - rpc LabelAudio(LabelAudioRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/datasets/*}/audio:label" - body: "*" - }; - } - - // Gets an example by resource name, including both data and annotation. - rpc GetExample(GetExampleRequest) returns (Example) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/datasets/*/annotatedDatasets/*/examples/*}" - }; - } - - // Lists examples in an annotated dataset. Pagination is supported. - rpc ListExamples(ListExamplesRequest) returns (ListExamplesResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/datasets/*/annotatedDatasets/*}/examples" - }; - } - - // Creates an annotation spec set by providing a set of labels. - rpc CreateAnnotationSpecSet(CreateAnnotationSpecSetRequest) returns (AnnotationSpecSet) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*}/annotationSpecSets" - body: "*" - }; - } - - // Gets an annotation spec set by resource name. - rpc GetAnnotationSpecSet(GetAnnotationSpecSetRequest) returns (AnnotationSpecSet) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/annotationSpecSets/*}" - }; - } - - // Lists annotation spec sets for a project. Pagination is supported. - rpc ListAnnotationSpecSets(ListAnnotationSpecSetsRequest) returns (ListAnnotationSpecSetsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*}/annotationSpecSets" - }; - } - - // Deletes an annotation spec set by resource name. - rpc DeleteAnnotationSpecSet(DeleteAnnotationSpecSetRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/annotationSpecSets/*}" - }; - } - - // Creates an instruction for how data should be labeled. - rpc CreateInstruction(CreateInstructionRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*}/instructions" - body: "*" - }; - } - - // Gets an instruction by resource name. - rpc GetInstruction(GetInstructionRequest) returns (Instruction) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/instructions/*}" - }; - } - - // Lists instructions for a project. Pagination is supported. - rpc ListInstructions(ListInstructionsRequest) returns (ListInstructionsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*}/instructions" - }; - } - - // Deletes an instruction object by resource name. - rpc DeleteInstruction(DeleteInstructionRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/instructions/*}" - }; - } -} - -// Request message for CreateDataset. -message CreateDatasetRequest { - // Required. Dataset resource parent, format: - // projects/{project_id} - string parent = 1; - - // Required. The dataset to be created. - Dataset dataset = 2; -} - -// Request message for GetDataSet. -message GetDatasetRequest { - // Required. Dataset resource name, format: - // projects/{project_id}/datasets/{dataset_id} - string name = 1; -} - -// Request message for ListDataset. -message ListDatasetsRequest { - // Required. Dataset resource parent, format: - // projects/{project_id} - string parent = 1; - - // Optional. Filter on dataset is not supported at this moment. - string filter = 2; - - // Optional. Requested page size. Server may return fewer results than - // requested. Default value is 100. - int32 page_size = 3; - - // Optional. A token identifying a page of results for the server to return. - // Typically obtained by - // [ListDatasetsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListDatasetsResponse.next_page_token] of the previous - // [DataLabelingService.ListDatasets] call. - // Returns the first page if empty. - string page_token = 4; -} - -// Results of listing datasets within a project. -message ListDatasetsResponse { - // The list of datasets to return. - repeated Dataset datasets = 1; - - // A token to retrieve next page of results. - string next_page_token = 2; -} - -// Request message for DeleteDataset. -message DeleteDatasetRequest { - // Required. Dataset resource name, format: - // projects/{project_id}/datasets/{dataset_id} - string name = 1; -} - -// Request message for ImportData API. -message ImportDataRequest { - // Required. Dataset resource name, format: - // projects/{project_id}/datasets/{dataset_id} - string name = 1; - - // Required. Specify the input source of the data. - InputConfig input_config = 2; -} - -// Request message for ExportData API. -message ExportDataRequest { - // Required. Dataset resource name, format: - // projects/{project_id}/datasets/{dataset_id} - string name = 1; - - // Required. Annotated dataset resource name. DataItem in - // Dataset and their annotations in specified annotated dataset will be - // exported. It's in format of - // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ - // {annotated_dataset_id} - string annotated_dataset = 2; - - // Optional. Filter is not supported at this moment. - string filter = 3; - - // Required. Specify the output destination. - OutputConfig output_config = 4; -} - -// Request message for GetDataItem. -message GetDataItemRequest { - // Required. The name of the data item to get, format: - // projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} - string name = 1; -} - -// Request message for ListDataItems. -message ListDataItemsRequest { - // Required. Name of the dataset to list data items, format: - // projects/{project_id}/datasets/{dataset_id} - string parent = 1; - - // Optional. Filter is not supported at this moment. - string filter = 2; - - // Optional. Requested page size. Server may return fewer results than - // requested. Default value is 100. - int32 page_size = 3; - - // Optional. A token identifying a page of results for the server to return. - // Typically obtained by - // [ListDataItemsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListDataItemsResponse.next_page_token] of the previous - // [DataLabelingService.ListDataItems] call. - // Return first page if empty. - string page_token = 4; -} - -// Results of listing data items in a dataset. -message ListDataItemsResponse { - // The list of data items to return. - repeated DataItem data_items = 1; - - // A token to retrieve next page of results. - string next_page_token = 2; -} - -// Request message for GetAnnotatedDataset. -message GetAnnotatedDatasetRequest { - // Required. Name of the annotated dataset to get, format: - // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ - // {annotated_dataset_id} - string name = 1; -} - -// Request message for ListAnnotatedDatasets. -message ListAnnotatedDatasetsRequest { - // Required. Name of the dataset to list annotated datasets, format: - // projects/{project_id}/datasets/{dataset_id} - string parent = 1; - - // Optional. Filter is not supported at this moment. - string filter = 2; - - // Optional. Requested page size. Server may return fewer results than - // requested. Default value is 100. - int32 page_size = 3; - - // Optional. A token identifying a page of results for the server to return. - // Typically obtained by - // [ListAnnotatedDatasetsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListAnnotatedDatasetsResponse.next_page_token] of the previous - // [DataLabelingService.ListAnnotatedDatasets] call. - // Return first page if empty. - string page_token = 4; -} - -// Request message for DeleteAnnotatedDataset. -message DeleteAnnotatedDatasetRequest { - // Required. Name of the annotated dataset to delete, format: - // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ - // {annotated_dataset_id} - string name = 1; -} - -// Results of listing annotated datasets for a dataset. -message ListAnnotatedDatasetsResponse { - // The list of annotated datasets to return. - repeated AnnotatedDataset annotated_datasets = 1; - - // A token to retrieve next page of results. - string next_page_token = 2; -} - -// Request message for starting an image labeling task. -message LabelImageRequest { - // Image labeling task feature. - enum Feature { - FEATURE_UNSPECIFIED = 0; - - // Label whole image with one or more of labels. - CLASSIFICATION = 1; - - // Label image with bounding boxes for labels. - BOUNDING_BOX = 2; - - // Label oriented bounding box. The box does not have to be parallel to - // horizontal line. - ORIENTED_BOUNDING_BOX = 6; - - // Label images with bounding poly. A bounding poly is a plane figure that - // is bounded by a finite chain of straight line segments closing in a loop. - BOUNDING_POLY = 3; - - // Label images with polyline. Polyline is formed by connected line segments - // which are not in closed form. - POLYLINE = 4; - - // Label images with segmentation. Segmentation is different from bounding - // poly since it is more fine-grained, pixel level annotation. - SEGMENTATION = 5; - } - - // Required. Config for labeling tasks. The type of request config must - // match the selected feature. - oneof request_config { - // Configuration for image classification task. - // One of image_classification_config, bounding_poly_config, - // polyline_config and segmentation_config is required. - ImageClassificationConfig image_classification_config = 4; - - // Configuration for bounding box and bounding poly task. - // One of image_classification_config, bounding_poly_config, - // polyline_config and segmentation_config is required. - BoundingPolyConfig bounding_poly_config = 5; - - // Configuration for polyline task. - // One of image_classification_config, bounding_poly_config, - // polyline_config and segmentation_config is required. - PolylineConfig polyline_config = 6; - - // Configuration for segmentation task. - // One of image_classification_config, bounding_poly_config, - // polyline_config and segmentation_config is required. - SegmentationConfig segmentation_config = 7; - } - - // Required. Name of the dataset to request labeling task, format: - // projects/{project_id}/datasets/{dataset_id} - string parent = 1; - - // Required. Basic human annotation config. - HumanAnnotationConfig basic_config = 2; - - // Required. The type of image labeling task. - Feature feature = 3; -} - -// Request message for LabelVideo. -message LabelVideoRequest { - // Video labeling task feature. - enum Feature { - FEATURE_UNSPECIFIED = 0; - - // Label whole video or video segment with one or more labels. - CLASSIFICATION = 1; - - // Label objects with bounding box on image frames extracted from the video. - OBJECT_DETECTION = 2; - - // Label and track objects in video. - OBJECT_TRACKING = 3; - - // Label the range of video for the specified events. - EVENT = 4; - } - - // Required. Config for labeling tasks. The type of request config must - // match the selected feature. - oneof request_config { - // Configuration for video classification task. - // One of video_classification_config, object_detection_config, - // object_tracking_config and event_config is required. - VideoClassificationConfig video_classification_config = 4; - - // Configuration for video object detection task. - // One of video_classification_config, object_detection_config, - // object_tracking_config and event_config is required. - ObjectDetectionConfig object_detection_config = 5; - - // Configuration for video object tracking task. - // One of video_classification_config, object_detection_config, - // object_tracking_config and event_config is required. - ObjectTrackingConfig object_tracking_config = 6; - - // Configuration for video event task. - // One of video_classification_config, object_detection_config, - // object_tracking_config and event_config is required. - EventConfig event_config = 7; - } - - // Required. Name of the dataset to request labeling task, format: - // projects/{project_id}/datasets/{dataset_id} - string parent = 1; - - // Required. Basic human annotation config. - HumanAnnotationConfig basic_config = 2; - - // Required. The type of video labeling task. - Feature feature = 3; -} - -// Request message for LabelText. -message LabelTextRequest { - // Text labeling task feature. - enum Feature { - FEATURE_UNSPECIFIED = 0; - - // Label text content to one of more labels. - TEXT_CLASSIFICATION = 1; - - // Label entities and their span in text. - TEXT_ENTITY_EXTRACTION = 2; - } - - // Required. Config for labeling tasks. The type of request config must - // match the selected feature. - oneof request_config { - // Configuration for text classification task. - // One of text_classification_config and text_entity_extraction_config - // is required. - TextClassificationConfig text_classification_config = 4; - - // Configuration for entity extraction task. - // One of text_classification_config and text_entity_extraction_config - // is required. - TextEntityExtractionConfig text_entity_extraction_config = 5; - } - - // Required. Name of the data set to request labeling task, format: - // projects/{project_id}/datasets/{dataset_id} - string parent = 1; - - // Required. Basic human annotation config. - HumanAnnotationConfig basic_config = 2; - - // Required. The type of text labeling task. - Feature feature = 6; -} - -// Request message for LabelAudio. -message LabelAudioRequest { - // Audio labeling task feature. - enum Feature { - FEATURE_UNSPECIFIED = 0; - - // Transcribe the audios into text. - AUDIO_TRANSCRIPTION = 1; - } - - // Required. Name of the dataset to request labeling task, format: - // projects/{project_id}/datasets/{dataset_id} - string parent = 1; - - // Required. Basic human annotation config. - HumanAnnotationConfig basic_config = 2; - - // Required. The type of audio labeling task. - Feature feature = 3; -} - -// Request message for GetExample -message GetExampleRequest { - // Required. Name of example, format: - // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ - // {annotated_dataset_id}/examples/{example_id} - string name = 1; - - // Optional. An expression for filtering Examples. Filter by - // annotation_spec.display_name is supported. Format - // "annotation_spec.display_name = {display_name}" - string filter = 2; -} - -// Request message for ListExamples. -message ListExamplesRequest { - // Required. Example resource parent. - string parent = 1; - - // Optional. An expression for filtering Examples. For annotated datasets that - // have annotation spec set, filter by - // annotation_spec.display_name is supported. Format - // "annotation_spec.display_name = {display_name}" - string filter = 2; - - // Optional. Requested page size. Server may return fewer results than - // requested. Default value is 100. - int32 page_size = 3; - - // Optional. A token identifying a page of results for the server to return. - // Typically obtained by - // [ListExamplesResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListExamplesResponse.next_page_token] of the previous - // [DataLabelingService.ListExamples] call. - // Return first page if empty. - string page_token = 4; -} - -// Results of listing Examples in and annotated dataset. -message ListExamplesResponse { - // The list of examples to return. - repeated Example examples = 1; - - // A token to retrieve next page of results. - string next_page_token = 2; -} - -// Request message for CreateAnnotationSpecSet. -message CreateAnnotationSpecSetRequest { - // Required. AnnotationSpecSet resource parent, format: - // projects/{project_id} - string parent = 1; - - // Required. Annotation spec set to create. Annotation specs must be included. - // Only one annotation spec will be accepted for annotation specs with same - // display_name. - AnnotationSpecSet annotation_spec_set = 2; -} - -// Request message for GetAnnotationSpecSet. -message GetAnnotationSpecSetRequest { - // Required. AnnotationSpecSet resource name, format: - // projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} - string name = 1; -} - -// Request message for ListAnnotationSpecSets. -message ListAnnotationSpecSetsRequest { - // Required. Parent of AnnotationSpecSet resource, format: - // projects/{project_id} - string parent = 1; - - // Optional. Filter is not supported at this moment. - string filter = 2; - - // Optional. Requested page size. Server may return fewer results than - // requested. Default value is 100. - int32 page_size = 3; - - // Optional. A token identifying a page of results for the server to return. - // Typically obtained by - // [ListAnnotationSpecSetsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListAnnotationSpecSetsResponse.next_page_token] of the previous - // [DataLabelingService.ListAnnotationSpecSets] call. - // Return first page if empty. - string page_token = 4; -} - -// Results of listing annotation spec set under a project. -message ListAnnotationSpecSetsResponse { - // The list of annotation spec sets. - repeated AnnotationSpecSet annotation_spec_sets = 1; - - // A token to retrieve next page of results. - string next_page_token = 2; -} - -// Request message for DeleteAnnotationSpecSet. -message DeleteAnnotationSpecSetRequest { - // Required. AnnotationSpec resource name, format: - // `projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}`. - string name = 1; -} - -// Request message for CreateInstruction. -message CreateInstructionRequest { - // Required. Instruction resource parent, format: - // projects/{project_id} - string parent = 1; - - // Required. Instruction of how to perform the labeling task. - Instruction instruction = 2; -} - -// Request message for GetInstruction. -message GetInstructionRequest { - // Required. Instruction resource name, format: - // projects/{project_id}/instructions/{instruction_id} - string name = 1; -} - -// Request message for DeleteInstruction. -message DeleteInstructionRequest { - // Required. Instruction resource name, format: - // projects/{project_id}/instructions/{instruction_id} - string name = 1; -} - -// Request message for ListInstructions. -message ListInstructionsRequest { - // Required. Instruction resource parent, format: - // projects/{project_id} - string parent = 1; - - // Optional. Filter is not supported at this moment. - string filter = 2; - - // Optional. Requested page size. Server may return fewer results than - // requested. Default value is 100. - int32 page_size = 3; - - // Optional. A token identifying a page of results for the server to return. - // Typically obtained by - // [ListInstructionsResponse.next_page_token][google.cloud.datalabeling.v1beta1.ListInstructionsResponse.next_page_token] of the previous - // [DataLabelingService.ListInstructions] call. - // Return first page if empty. - string page_token = 4; -} - -// Results of listing instructions under a project. -message ListInstructionsResponse { - // The list of Instructions to return. - repeated Instruction instructions = 1; - - // A token to retrieve next page of results. - string next_page_token = 2; -} diff --git a/datalabeling/protos/dataset.proto b/datalabeling/protos/dataset.proto deleted file mode 100644 index 952daf38d626..000000000000 --- a/datalabeling/protos/dataset.proto +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright 2018 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datalabeling.v1beta1; - -import "google/cloud/datalabeling/v1beta1/annotation.proto"; -import "google/cloud/datalabeling/v1beta1/human_annotation_config.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datalabeling.v1beta1"; - - -enum DataType { - DATA_TYPE_UNSPECIFIED = 0; - - IMAGE = 1; - - VIDEO = 2; - - TEXT = 4; - - AUDIO = 5; -} - -// Dataset is the resource to hold your data. You can request multiple labeling -// tasks for a dataset while each one will generate an AnnotatedDataset. -message Dataset { - // Output only. - // Dataset resource name, format is: - // projects/{project_id}/datasets/{dataset_id} - string name = 1; - - // Required. The display name of the dataset. Maximum of 64 characters. - string display_name = 2; - - // Optional. User-provided description of the annotation specification set. - // The description can be up to 10000 characters long. - string description = 3; - - // Output only. Time the dataset is created. - google.protobuf.Timestamp create_time = 4; - - // Output only. This is populated with the original input configs - // where ImportData is called. It is available only after the clients - // import data to this dataset. - repeated InputConfig input_configs = 5; -} - -// The configuration of input data, including data type, location, etc. -message InputConfig { - // Required. Where the data is from. - oneof source { - GcsSource gcs_source = 2; - } - - // Required. Data type must be specifed when user tries to import data. - DataType data_type = 1; -} - -// Source of the GCS file to be imported. Only gcs path is allowed in -// input_uri. -message GcsSource { - // Required. The input uri of source file. - string input_uri = 1; - - // Required. The format of the gcs source. Only "text/csv" is supported. - string mime_type = 2; -} - -// The configuration of output data. -message OutputConfig { - // Required. Location to output data to. - oneof destination { - // Output to a GCS file. Should be used for labeling output other than Audio - // transcription. - GcsDestination gcs_destination = 1; - - // Output to a GCS folder. Should be used for Audio transcription - // labeling output. - GcsFolderDestination gcs_folder_destination = 2; - } -} - -// Export destination of the data.Only gcs path is allowed in -// output_uri. -message GcsDestination { - // Required. The output uri of destination file. - string output_uri = 1; - - // Required. The format of the gcs destination. Only "text/csv" and - // "application/json" - // are supported. - string mime_type = 2; -} - -// Export folder destination of the data. -message GcsFolderDestination { - // Required. GCS folder to export data to. - string output_folder_uri = 1; -} - -// DataItem is a piece of data, without annotation. For example, an image. -message DataItem { - // Output only. - oneof payload { - // The image payload, a container of the image bytes/uri. - ImagePayload image_payload = 2; - - // The text payload, a container of text content. - TextPayload text_payload = 3; - - // The video payload, a container of the video uri. - VideoPayload video_payload = 4; - - // The audio payload, a container of the audio uri. - AudioPayload audio_payload = 5; - } - - // Output only. Name of the data item, in format of: - // projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} - string name = 1; -} - -// AnnotatedDataset is a set holding annotations for data in a Dataset. Each -// labeling task will generate an AnnotatedDataset under the Dataset that the -// task is requested for. -message AnnotatedDataset { - // Output only. - // AnnotatedDataset resource name in format of: - // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ - // {annotated_dataset_id} - string name = 1; - - // Output only. The display name of the AnnotatedDataset. It is specified in - // HumanAnnotationConfig when user starts a labeling task. Maximum of 64 - // characters. - string display_name = 2; - - // Output only. The description of the AnnotatedDataset. It is specified in - // HumanAnnotationConfig when user starts a labeling task. Maximum of 10000 - // characters. - string description = 9; - - // Output only. Source of the annotation. - AnnotationSource annotation_source = 3; - - // Output only. Type of the annotation. It is specified when starting labeling - // task. - AnnotationType annotation_type = 8; - - // Output only. Number of examples in the annotated dataset. - int64 example_count = 4; - - // Output only. Number of examples that have annotation in the annotated - // dataset. - int64 completed_example_count = 5; - - // Output only. Per label statistics. - LabelStats label_stats = 6; - - // Output only. Time the AnnotatedDataset was created. - google.protobuf.Timestamp create_time = 7; - - // Output only. Additional information about AnnotatedDataset. - AnnotatedDatasetMetadata metadata = 10; -} - -// Metadata on AnnotatedDataset. -message AnnotatedDatasetMetadata { - // HumanAnnotationConfig used when requesting the human labeling task for this - // AnnotatedDataset. - HumanAnnotationConfig human_annotation_config = 1; - - // Specific request configuration used when requesting the labeling task. - oneof annotation_request_config { - // Configuration for image classification task. - ImageClassificationConfig image_classification_config = 2; - // Configuration for image bounding box and bounding poly task. - BoundingPolyConfig bounding_poly_config = 3; - // Configuration for image polyline task. - PolylineConfig polyline_config = 4; - // Configuration for image segmentation task. - SegmentationConfig segmentation_config = 5; - // Configuration for video classification task. - VideoClassificationConfig video_classification_config = 6; - // Configuration for video object detection task. - ObjectDetectionConfig object_detection_config = 7; - // Configuration for video object tracking task. - ObjectTrackingConfig object_tracking_config = 8; - // Configuration for video event labeling task. - EventConfig event_config = 9; - // Configuration for text classification task. - TextClassificationConfig text_classification_config = 10; - // Configuration for text entity extraction task. - TextEntityExtractionConfig text_entity_extraction_config = 11; - } -} - -// Statistics about annotation specs. -message LabelStats { - // Map of each annotation spec's example count. Key is the annotation spec - // name and value is the number of examples for that annotation spec. - map example_count = 1; -} - -// An Example is a piece of data and its annotation. For example, an image with -// label "house". -message Example { - // Output only. The data part of Example. - oneof payload { - // The image payload, a container of the image bytes/uri. - ImagePayload image_payload = 2; - - // The text payload, a container of the text content. - TextPayload text_payload = 6; - - // The video payload, a container of the video uri. - VideoPayload video_payload = 7; - - // The audio payload, a container of the audio uri. - AudioPayload audio_payload = 8; - } - - // Output only. Name of the example, in format of: - // projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ - // {annotated_dataset_id}/examples/{example_id} - string name = 1; - - // Output only. Annotations for the piece of data in Example. - // One piece of data can have multiple annotations. - repeated Annotation annotations = 5; -} - -// Container of information about an image. -message ImagePayload { - // Image format. - string mime_type = 1; - - // A byte string of a full image. - bytes image_thumbnail = 2; - - // Image uri from the user bucket. - string image_uri = 3; -} - -// Container of information about a piece of text. -message TextPayload { - // Text content. - string text_content = 1; -} - -// Container of information of a video thumbnail. -message VideoThumbnail { - // A byte string of the video frame. - bytes thumbnail = 1; - - // Time offset relative to the beginning of the video, corresponding to the - // video frame where the thumbnail has been extracted from. - google.protobuf.Duration time_offset = 2; -} - -// Container of information of a video. -message VideoPayload { - // Video format. - string mime_type = 1; - - // Video uri from the user bucket. - string video_uri = 2; - - // The list of video thumbnails. - repeated VideoThumbnail video_thumbnails = 3; - - // FPS of the video. - float frame_rate = 4; -} - -// Container of information of an audio. -message AudioPayload { - // Audio uri in user bucket. - string audio_uri = 1; - - // Sample rate in Hertz of the audio data sent in all - // `RecognitionAudio` messages. This field is optional for `FLAC` and `WAV` - // audio files and required for all other audio formats. For details, - // see [AudioEncoding][google.cloud.datalabeling.v1beta1.AudioPayload.AudioEncoding]. - int32 sample_rate_hertz = 3; -} diff --git a/datalabeling/protos/human_annotation_config.proto b/datalabeling/protos/human_annotation_config.proto deleted file mode 100644 index 96672aedaf53..000000000000 --- a/datalabeling/protos/human_annotation_config.proto +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright 2018 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datalabeling.v1beta1; - -import "google/protobuf/duration.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datalabeling.v1beta1"; - - -enum StringAggregationType { - STRING_AGGREGATION_TYPE_UNSPECIFIED = 0; - - // Majority vote to aggregate answers. - MAJORITY_VOTE = 1; - - // Unanimous answers will be adopted. - UNANIMOUS_VOTE = 2; - - // Preserve all answers by crowd compute. - NO_AGGREGATION = 3; -} - -// Configuration for how human labeling task should be done. -message HumanAnnotationConfig { - // Required except for LabelAudio case. Instruction resource name. - string instruction = 1; - - // Required. A human-readable name for AnnotatedDataset defined by - // users. Maximum of 64 characters - // . - string annotated_dataset_display_name = 2; - - // Optional. A human-readable description for AnnotatedDataset. - // The description can be up to 10000 characters long. - string annotated_dataset_description = 3; - - // Optional. A human-readable label used to logically group labeling tasks. - // This string must match the regular expression `[a-zA-Z\\d_-]{0,128}`. - string label_group = 4; - - // Optional. The Language of this question, as a - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). - // Default value is en-US. - // Only need to set this when task is language related. For example, French - // text classification or Chinese audio transcription. - string language_code = 5; - - // Optional. Replication of questions. Each question will be sent to up to - // this number of contributors to label. Aggregated answers will be returned. - // Default is set to 1. - // For image related labeling, valid values are 1, 3, 5. - int32 replica_count = 6; - - // Optional. Maximum duration for contributors to answer a question. Default - // is 1800 seconds. - google.protobuf.Duration question_duration = 7; - - // Optional. If you want your own labeling contributors to manage and work on - // this labeling request, you can set these contributors here. We will give - // them access to the question types in crowdcompute. Note that these - // emails must be registered in crowdcompute worker UI: - // https://crowd-compute.appspot.com/ - repeated string contributor_emails = 9; -} - -// Config for image classification human labeling task. -message ImageClassificationConfig { - // Required. Annotation spec set resource name. - string annotation_spec_set = 1; - - // Optional. If allow_multi_label is true, contributors are able to choose - // multiple labels for one image. - bool allow_multi_label = 2; - - // Optional. The type of how to aggregate answers. - StringAggregationType answer_aggregation_type = 3; -} - -// Config for image bounding poly (and bounding box) human labeling task. -message BoundingPolyConfig { - // Required. Annotation spec set resource name. - string annotation_spec_set = 1; - - // Optional. Instruction message showed on contributors UI. - string instruction_message = 2; -} - -// Config for image polyline human labeling task. -message PolylineConfig { - // Required. Annotation spec set resource name. - string annotation_spec_set = 1; - - // Optional. Instruction message showed on contributors UI. - string instruction_message = 2; -} - -// Config for image segmentation -message SegmentationConfig { - // Required. Annotation spec set resource name. format: - // projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} - string annotation_spec_set = 1; - - // Instruction message showed on labelers UI. - string instruction_message = 2; -} - -// Config for video classification human labeling task. -// Currently two types of video classification are supported: -// 1. Assign labels on the entire video. -// 2. Split the video into multiple video clips based on camera shot, and -// assign labels on each video clip. -message VideoClassificationConfig { - // Annotation spec set with the setting of allowing multi labels or not. - message AnnotationSpecSetConfig { - // Required. Annotation spec set resource name. - string annotation_spec_set = 1; - - // Optional. If allow_multi_label is true, contributors are able to - // choose multiple labels from one annotation spec set. - bool allow_multi_label = 2; - } - - // Required. The list of annotation spec set configs. - // Since watching a video clip takes much longer time than an image, we - // support label with multiple AnnotationSpecSet at the same time. Labels - // in each AnnotationSpecSet will be shown in a group to contributors. - // Contributors can select one or more (depending on whether to allow multi - // label) from each group. - repeated AnnotationSpecSetConfig annotation_spec_set_configs = 1; - - // Optional. Option to apply shot detection on the video. - bool apply_shot_detection = 2; -} - -// Config for video object detection human labeling task. -// Object detection will be conducted on the images extracted from the video, -// and those objects will be labeled with bounding boxes. -// User need to specify the number of images to be extracted per second as the -// extraction frame rate. -message ObjectDetectionConfig { - // Required. Annotation spec set resource name. - string annotation_spec_set = 1; - - // Optional. Instruction message showed on labelers UI. - string instruction_message = 2; - - // Required. Number of frames per second to be extracted from the video. - double extraction_frame_rate = 3; -} - -// Config for video object tracking human labeling task. -message ObjectTrackingConfig { - // Required. Annotation spec set resource name. - string annotation_spec_set = 1; -} - -// Config for video event human labeling task. -message EventConfig { - // Required. The list of annotation spec set resource name. Similar to video - // classification, we support selecting event from multiple AnnotationSpecSet - // at the same time. - repeated string annotation_spec_sets = 1; -} - -// Config for text classification human labeling task. -message TextClassificationConfig { - // Optional. If allow_multi_label is true, contributors are able to choose - // multiple labels for one text segment. - bool allow_multi_label = 1; - - // Required. Annotation spec set resource name. - string annotation_spec_set = 2; - - // Optional. Configs for sentiment selection. - SentimentConfig sentiment_config = 3; -} - -// Config for setting up sentiments. -message SentimentConfig { - // If set to true, contributors will have the option to select sentiment of - // the label they selected, to mark it as negative or positive label. Default - // is false. - bool enable_label_sentiment_selection = 1; -} - -// Config for text entity extraction human labeling task. -message TextEntityExtractionConfig { - // Required. Annotation spec set resource name. - string annotation_spec_set = 1; -} diff --git a/datalabeling/protos/instruction.proto b/datalabeling/protos/instruction.proto deleted file mode 100644 index d1a1e751c9a3..000000000000 --- a/datalabeling/protos/instruction.proto +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2018 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datalabeling.v1beta1; - -import "google/cloud/datalabeling/v1beta1/dataset.proto"; -import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datalabeling.v1beta1"; - - -// Instruction of how to perform the labeling task for human operators. -// Currently two types of instruction are supported - CSV file and PDF. -// One of the two types instruction must be provided. -// CSV file is only supported for image classification task. Instructions for -// other task should be provided as PDF. -// For image classification, CSV and PDF can be provided at the same time. -message Instruction { - // Output only. Instruction resource name, format: - // projects/{project_id}/instructions/{instruction_id} - string name = 1; - - // Required. The display name of the instruction. Maximum of 64 characters. - string display_name = 2; - - // Optional. User-provided description of the instruction. - // The description can be up to 10000 characters long. - string description = 3; - - // Output only. Creation time of instruction. - google.protobuf.Timestamp create_time = 4; - - // Output only. Last update time of instruction. - google.protobuf.Timestamp update_time = 5; - - // Required. The data type of this instruction. - DataType data_type = 6; - - // One of CSV and PDF instruction is required. - // Instruction from a csv file, such as for classification task. - // Csv file should have exact two columns, in the format of: - // The first column is labeled data, such as image reference, text. - // The second column is comma separated labels associated with data. - CsvInstruction csv_instruction = 7; - - // One of CSV and PDF instruction is required. - // Instruction from a PDF doc. The PDF doc should be in GCS bucket. - PdfInstruction pdf_instruction = 9; -} - -// Instruction from a CSV file. -message CsvInstruction { - // CSV file for the instruction. Only gcs path is allowed. - string gcs_file_uri = 1; -} - -// Instruction from a PDF file. -message PdfInstruction { - // PDF file for the instruction. Only gcs path is allowed. - string gcs_file_uri = 1; -} diff --git a/datalabeling/protos/operations.proto b/datalabeling/protos/operations.proto deleted file mode 100644 index 71815e5310e3..000000000000 --- a/datalabeling/protos/operations.proto +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright 2018 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.datalabeling.v1beta1; - -import "google/cloud/datalabeling/v1beta1/dataset.proto"; -import "google/cloud/datalabeling/v1beta1/human_annotation_config.proto"; -import "google/cloud/datalabeling/v1beta1/instruction.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datalabeling.v1beta1"; - -// Response used for ImportData longrunning operation. -message ImportDataOperationResponse { - // Ouptut only. The name of imported dataset. - string dataset = 1; - - // Output only. Total number of examples requested to import - int32 total_count = 2; - - // Output only. Number of examples imported successfully. - int32 import_count = 3; -} - -// Response used for ExportDataset longrunning operation. -message ExportDataOperationResponse { - // Ouptut only. The name of dataset. - // "projects/*/datasets/*/Datasets/*" - string dataset = 1; - - // Output only. Total number of examples requested to export - int32 total_count = 2; - - // Output only. Number of examples exported successfully. - int32 export_count = 3; - - // Output only. Statistic infos of labels in the exported dataset. - LabelStats label_stats = 4; - - // Output only. output_config in the ExportData request. - OutputConfig output_config = 5; -} - -// Metadata of an ImportData operation. -message ImportDataOperationMetadata { - // Ouptut only. The name of imported dataset. - // "projects/*/datasets/*" - string dataset = 1; - - // Output only. Partial failures encountered. - // E.g. single files that couldn't be read. - // Status details field will contain standard GCP error details. - repeated google.rpc.Status partial_failures = 2; -} - -// Metadata of an ExportData operation. -message ExportDataOperationMetadata { - // Output only. The name of dataset to be exported. - // "projects/*/datasets/*/Datasets/*" - string dataset = 1; - - // Output only. Partial failures encountered. - // E.g. single files that couldn't be read. - // Status details field will contain standard GCP error details. - repeated google.rpc.Status partial_failures = 2; -} - -// Metadata of a labeling operation, such as LabelImage or LabelVideo. -// Next tag: 16 -message LabelOperationMetadata { - // Output only. Progress of label operation. Range: [0, 100]. - // Currently not supported. - int32 progress_percent = 1; - - // Output only. Partial failures encountered. - // E.g. single files that couldn't be read. - // Status details field will contain standard GCP error details. - repeated google.rpc.Status partial_failures = 2; - - // Ouptut only. Details of specific label operation. - oneof details { - LabelImageClassificationOperationMetadata image_classification_details = 3; - LabelImageBoundingBoxOperationMetadata image_bounding_box_details = 4; - LabelImageBoundingPolyOperationMetadata image_bounding_poly_details = 11; - LabelImageOrientedBoundingBoxOperationMetadata - image_oriented_bounding_box_details = 14; - LabelImagePolylineOperationMetadata image_polyline_details = 12; - LabelImageSegmentationOperationMetadata image_segmentation_details = 15; - LabelVideoClassificationOperationMetadata video_classification_details = 5; - LabelVideoObjectDetectionOperationMetadata video_object_detection_details = - 6; - LabelVideoObjectTrackingOperationMetadata video_object_tracking_details = 7; - LabelVideoEventOperationMetadata video_event_details = 8; - LabelTextClassificationOperationMetadata text_classification_details = 9; - LabelAudioTranscriptionOperationMetadata audio_transcription_details = 10; - LabelTextEntityExtractionOperationMetadata text_entity_extraction_details = - 13; - } -} - -// Metadata of a LabelImageClassification operation. -message LabelImageClassificationOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Details of a LabelImageBoundingBox operation metadata. -message LabelImageBoundingBoxOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Details of a LabelImageOrientedBoundingBox operation metadata. -message LabelImageOrientedBoundingBoxOperationMetadata { - // Basic human annotation config. - HumanAnnotationConfig basic_config = 1; -} - -// Details of LabelImageBoundingPoly operation metadata. -message LabelImageBoundingPolyOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Details of LabelImagePolyline operation metadata. -message LabelImagePolylineOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Details of a LabelImageSegmentation operation metadata. -message LabelImageSegmentationOperationMetadata { - // Basic human annotation config. - HumanAnnotationConfig basic_config = 1; -} - -// Details of a LabelVideoClassification operation metadata. -message LabelVideoClassificationOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Details of a LabelVideoObjectDetection operation metadata. -message LabelVideoObjectDetectionOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Details of a LabelVideoObjectTracking operation metadata. -message LabelVideoObjectTrackingOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Details of a LabelVideoEvent operation metadata. -message LabelVideoEventOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Details of a LabelTextClassification operation metadata. -message LabelTextClassificationOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -message LabelAudioTranscriptionOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Details of a LabelTextEntityExtraction operation metadata. -message LabelTextEntityExtractionOperationMetadata { - // Basic human annotation config used in labeling request. - HumanAnnotationConfig basic_config = 1; -} - -// Metadata of a CreateInstruction operation. -message CreateInstructionMetadata { - // Output only. The name of the created Instruction. - // projects/{project_id}/instructions/{instruction_id} - string instruction = 1; - - // Output only. Partial failures encountered. - // E.g. single files that couldn't be read. - // Status details field will contain standard GCP error details. - repeated google.rpc.Status partial_failures = 2; -} diff --git a/datalabeling/setup.cfg b/datalabeling/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/datalabeling/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/datalabeling/setup.py b/datalabeling/setup.py deleted file mode 100644 index 0cc796762ebf..000000000000 --- a/datalabeling/setup.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import io -import os - -import setuptools - -name = "google-cloud-datalabeling" -description = "Data Labeling API client library" -version = "0.3.0" -release_status = "Development Status :: 4 - Beta" -dependencies = [ - "google-api-core[grpc] >= 1.14.0, < 2.0.0dev", - 'enum34; python_version < "3.4"', -] - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/GoogleCloudPlatform/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - include_package_data=True, - zip_safe=False, -) diff --git a/datalabeling/synth.metadata b/datalabeling/synth.metadata deleted file mode 100644 index 53ef4f05d374..000000000000 --- a/datalabeling/synth.metadata +++ /dev/null @@ -1,255 +0,0 @@ -{ - "updateTime": "2020-01-30T13:20:10.692850Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c1246a29e22b0f98e800a536b5b0da2d933a55f2", - "internalRef": "292310790", - "log": "c1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\n" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "datalabeling", - "apiVersion": "v1beta1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/datalabeling/artman_datalabeling_v1beta1.yaml" - } - } - ], - "newFiles": [ - { - "path": ".coveragerc" - }, - { - "path": ".flake8" - }, - { - "path": ".gitignore" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "LICENSE" - }, - { - "path": "MANIFEST.in" - }, - { - "path": "README.rst" - }, - { - "path": "docs/README.rst" - }, - { - "path": "docs/_static/custom.css" - }, - { - "path": "docs/_templates/layout.html" - }, - { - "path": "docs/changelog.md" - }, - { - "path": "docs/conf.py" - }, - { - "path": "docs/gapic/v1beta1/api.rst" - }, - { - "path": "docs/gapic/v1beta1/types.rst" - }, - { - "path": "docs/index.rst" - }, - { - "path": "google/__init__.py" - }, - { - "path": "google/cloud/__init__.py" - }, - { - "path": "google/cloud/datalabeling.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/__init__.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/gapic/__init__.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/gapic/data_labeling_service_client_config.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/gapic/enums.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/gapic/transports/data_labeling_service_grpc_transport.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/__init__.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/annotation.proto" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/annotation_pb2.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/annotation_pb2_grpc.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/annotation_spec_set_pb2.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/annotation_spec_set_pb2_grpc.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/data_labeling_service.proto" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/data_labeling_service_pb2.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/data_labeling_service_pb2_grpc.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/data_payloads.proto" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/data_payloads_pb2.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/data_payloads_pb2_grpc.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/dataset.proto" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/dataset_pb2.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/dataset_pb2_grpc.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/evaluation.proto" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/evaluation_job.proto" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/evaluation_job_pb2.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/evaluation_job_pb2_grpc.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/evaluation_pb2.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/evaluation_pb2_grpc.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/human_annotation_config.proto" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/human_annotation_config_pb2.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/human_annotation_config_pb2_grpc.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/instruction.proto" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/instruction_pb2.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/instruction_pb2_grpc.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/operations.proto" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/operations_pb2.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/proto/operations_pb2_grpc.py" - }, - { - "path": "google/cloud/datalabeling_v1beta1/types.py" - }, - { - "path": "noxfile.py" - }, - { - "path": "protos/annotation.proto" - }, - { - "path": "protos/annotation_spec_set.proto" - }, - { - "path": "protos/data_labeling_service.proto" - }, - { - "path": "protos/dataset.proto" - }, - { - "path": "protos/human_annotation_config.proto" - }, - { - "path": "protos/instruction.proto" - }, - { - "path": "protos/operations.proto" - }, - { - "path": "setup.cfg" - }, - { - "path": "setup.py" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "tests/unit/gapic/v1beta1/test_data_labeling_service_client_v1beta1.py" - } - ] -} \ No newline at end of file diff --git a/datalabeling/synth.py b/datalabeling/synth.py deleted file mode 100644 index af1823fd6e4f..000000000000 --- a/datalabeling/synth.py +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -from synthtool import gcp - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() - -version = 'v1beta1' - -library = gapic.py_library( - 'datalabeling', - version, - config_path='/google/cloud/datalabeling/' - 'artman_datalabeling_v1beta1.yaml', - artman_output_name='datalabeling-v1beta1', - include_protos=True, -) - -s.move( - library, - excludes=[ - 'docs/conf.py', - 'docs/index.rst', - 'google/cloud/datalabeling_v1beta1/__init__.py', - 'README.rst', - 'nox*.py', - 'setup.py', - 'setup.cfg', - ], -) - -# Fixup issues in generated code -s.replace( - "./**/gapic/**/*client.py", - r"operations_pb2.ImportDataOperationResponse", - "proto_operations_pb2.ImportDataOperationResponse", -) - -s.replace( - "./**/gapic/**/*client.py", - r"operations_pb2.ImportDataOperationMetadata", - "proto_operations_pb2.ImportDataOperationMetadata", -) - -s.replace( - "./tests/unit/gapic/**/test*_client*.py", - r"operations_pb2.Operation\(", - "longrunning_operations_pb2.Operation(", -) - -# Fix docstrings with no summary line -s.replace( - "google/cloud/**/proto/*_pb2.py", - '''__doc__ = """Attributes:''', - '''__doc__ = """ - Attributes:''', -) - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = common.py_library(unit_cov_level=80, cov_level=80) -s.move(templated_files) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/datalabeling/tests/unit/gapic/v1beta1/test_data_labeling_service_client_v1beta1.py b/datalabeling/tests/unit/gapic/v1beta1/test_data_labeling_service_client_v1beta1.py deleted file mode 100644 index 48ffdc63c4a6..000000000000 --- a/datalabeling/tests/unit/gapic/v1beta1/test_data_labeling_service_client_v1beta1.py +++ /dev/null @@ -1,1712 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import datalabeling_v1beta1 -from google.cloud.datalabeling_v1beta1 import enums -from google.cloud.datalabeling_v1beta1.proto import annotation_spec_set_pb2 -from google.cloud.datalabeling_v1beta1.proto import data_labeling_service_pb2 -from google.cloud.datalabeling_v1beta1.proto import dataset_pb2 -from google.cloud.datalabeling_v1beta1.proto import evaluation_job_pb2 -from google.cloud.datalabeling_v1beta1.proto import evaluation_pb2 -from google.cloud.datalabeling_v1beta1.proto import human_annotation_config_pb2 -from google.cloud.datalabeling_v1beta1.proto import instruction_pb2 -from google.cloud.datalabeling_v1beta1.proto import ( - operations_pb2 as proto_operations_pb2, -) -from google.longrunning import operations_pb2 as longrunning_operations_pb2 -from google.protobuf import empty_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestDataLabelingServiceClient(object): - def test_create_dataset(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - data_item_count = 2014260376 - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - "data_item_count": data_item_count, - } - expected_response = dataset_pb2.Dataset(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - dataset = {} - - response = client.create_dataset(parent, dataset) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.CreateDatasetRequest( - parent=parent, dataset=dataset - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_dataset_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - parent = client.project_path("[PROJECT]") - dataset = {} - - with pytest.raises(CustomException): - client.create_dataset(parent, dataset) - - def test_get_dataset(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - description = "description-1724546052" - data_item_count = 2014260376 - expected_response = { - "name": name_2, - "display_name": display_name, - "description": description, - "data_item_count": data_item_count, - } - expected_response = dataset_pb2.Dataset(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[DATASET]") - - response = client.get_dataset(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.GetDatasetRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_dataset_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - name = client.dataset_path("[PROJECT]", "[DATASET]") - - with pytest.raises(CustomException): - client.get_dataset(name) - - def test_list_datasets(self): - # Setup Expected Response - next_page_token = "" - datasets_element = {} - datasets = [datasets_element] - expected_response = {"next_page_token": next_page_token, "datasets": datasets} - expected_response = data_labeling_service_pb2.ListDatasetsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - - paged_list_response = client.list_datasets(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.datasets[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.ListDatasetsRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_datasets_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - parent = client.project_path("[PROJECT]") - - paged_list_response = client.list_datasets(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_delete_dataset(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[DATASET]") - - client.delete_dataset(name) - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.DeleteDatasetRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_dataset_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - name = client.dataset_path("[PROJECT]", "[DATASET]") - - with pytest.raises(CustomException): - client.delete_dataset(name) - - def test_import_data(self): - # Setup Expected Response - dataset = "dataset1443214456" - total_count = 407761836 - import_count = 1721296907 - expected_response = { - "dataset": dataset, - "total_count": total_count, - "import_count": import_count, - } - expected_response = proto_operations_pb2.ImportDataOperationResponse( - **expected_response - ) - operation = longrunning_operations_pb2.Operation( - name="operations/test_import_data", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[DATASET]") - input_config = {} - - response = client.import_data(name, input_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.ImportDataRequest( - name=name, input_config=input_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_import_data_exception(self): - # Setup Response - error = status_pb2.Status() - operation = longrunning_operations_pb2.Operation( - name="operations/test_import_data_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[DATASET]") - input_config = {} - - response = client.import_data(name, input_config) - exception = response.exception() - assert exception.errors[0] == error - - def test_export_data(self): - # Setup Expected Response - dataset = "dataset1443214456" - total_count = 407761836 - export_count = 529256252 - expected_response = { - "dataset": dataset, - "total_count": total_count, - "export_count": export_count, - } - expected_response = proto_operations_pb2.ExportDataOperationResponse( - **expected_response - ) - operation = longrunning_operations_pb2.Operation( - name="operations/test_export_data", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[DATASET]") - annotated_dataset = client.annotated_dataset_path( - "[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]" - ) - output_config = {} - - response = client.export_data(name, annotated_dataset, output_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.ExportDataRequest( - name=name, annotated_dataset=annotated_dataset, output_config=output_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_export_data_exception(self): - # Setup Response - error = status_pb2.Status() - operation = longrunning_operations_pb2.Operation( - name="operations/test_export_data_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - name = client.dataset_path("[PROJECT]", "[DATASET]") - annotated_dataset = client.annotated_dataset_path( - "[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]" - ) - output_config = {} - - response = client.export_data(name, annotated_dataset, output_config) - exception = response.exception() - assert exception.errors[0] == error - - def test_get_data_item(self): - # Setup Expected Response - name_2 = "name2-1052831874" - expected_response = {"name": name_2} - expected_response = dataset_pb2.DataItem(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - name = client.data_item_path("[PROJECT]", "[DATASET]", "[DATA_ITEM]") - - response = client.get_data_item(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.GetDataItemRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_data_item_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - name = client.data_item_path("[PROJECT]", "[DATASET]", "[DATA_ITEM]") - - with pytest.raises(CustomException): - client.get_data_item(name) - - def test_list_data_items(self): - # Setup Expected Response - next_page_token = "" - data_items_element = {} - data_items = [data_items_element] - expected_response = { - "next_page_token": next_page_token, - "data_items": data_items, - } - expected_response = data_labeling_service_pb2.ListDataItemsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.dataset_path("[PROJECT]", "[DATASET]") - - paged_list_response = client.list_data_items(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.data_items[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.ListDataItemsRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_data_items_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - parent = client.dataset_path("[PROJECT]", "[DATASET]") - - paged_list_response = client.list_data_items(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_annotated_dataset(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - description = "description-1724546052" - example_count = 1517063674 - completed_example_count = 612567290 - expected_response = { - "name": name_2, - "display_name": display_name, - "description": description, - "example_count": example_count, - "completed_example_count": completed_example_count, - } - expected_response = dataset_pb2.AnnotatedDataset(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - name = client.annotated_dataset_path( - "[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]" - ) - - response = client.get_annotated_dataset(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.GetAnnotatedDatasetRequest( - name=name - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_annotated_dataset_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - name = client.annotated_dataset_path( - "[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]" - ) - - with pytest.raises(CustomException): - client.get_annotated_dataset(name) - - def test_list_annotated_datasets(self): - # Setup Expected Response - next_page_token = "" - annotated_datasets_element = {} - annotated_datasets = [annotated_datasets_element] - expected_response = { - "next_page_token": next_page_token, - "annotated_datasets": annotated_datasets, - } - expected_response = data_labeling_service_pb2.ListAnnotatedDatasetsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.dataset_path("[PROJECT]", "[DATASET]") - - paged_list_response = client.list_annotated_datasets(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.annotated_datasets[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.ListAnnotatedDatasetsRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_annotated_datasets_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - parent = client.dataset_path("[PROJECT]", "[DATASET]") - - paged_list_response = client.list_annotated_datasets(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_delete_annotated_dataset(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - name = client.annotated_dataset_path( - "[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]" - ) - - client.delete_annotated_dataset(name) - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.DeleteAnnotatedDatasetRequest( - name=name - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_annotated_dataset_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - name = client.annotated_dataset_path( - "[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]" - ) - - with pytest.raises(CustomException): - client.delete_annotated_dataset(name) - - def test_label_image(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - example_count = 1517063674 - completed_example_count = 612567290 - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - "example_count": example_count, - "completed_example_count": completed_example_count, - } - expected_response = dataset_pb2.AnnotatedDataset(**expected_response) - operation = longrunning_operations_pb2.Operation( - name="operations/test_label_image", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.dataset_path("[PROJECT]", "[DATASET]") - basic_config = {} - feature = enums.LabelImageRequest.Feature.FEATURE_UNSPECIFIED - - response = client.label_image(parent, basic_config, feature) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.LabelImageRequest( - parent=parent, basic_config=basic_config, feature=feature - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_label_image_exception(self): - # Setup Response - error = status_pb2.Status() - operation = longrunning_operations_pb2.Operation( - name="operations/test_label_image_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.dataset_path("[PROJECT]", "[DATASET]") - basic_config = {} - feature = enums.LabelImageRequest.Feature.FEATURE_UNSPECIFIED - - response = client.label_image(parent, basic_config, feature) - exception = response.exception() - assert exception.errors[0] == error - - def test_label_video(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - example_count = 1517063674 - completed_example_count = 612567290 - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - "example_count": example_count, - "completed_example_count": completed_example_count, - } - expected_response = dataset_pb2.AnnotatedDataset(**expected_response) - operation = longrunning_operations_pb2.Operation( - name="operations/test_label_video", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.dataset_path("[PROJECT]", "[DATASET]") - basic_config = {} - feature = enums.LabelVideoRequest.Feature.FEATURE_UNSPECIFIED - - response = client.label_video(parent, basic_config, feature) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.LabelVideoRequest( - parent=parent, basic_config=basic_config, feature=feature - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_label_video_exception(self): - # Setup Response - error = status_pb2.Status() - operation = longrunning_operations_pb2.Operation( - name="operations/test_label_video_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.dataset_path("[PROJECT]", "[DATASET]") - basic_config = {} - feature = enums.LabelVideoRequest.Feature.FEATURE_UNSPECIFIED - - response = client.label_video(parent, basic_config, feature) - exception = response.exception() - assert exception.errors[0] == error - - def test_label_text(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - example_count = 1517063674 - completed_example_count = 612567290 - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - "example_count": example_count, - "completed_example_count": completed_example_count, - } - expected_response = dataset_pb2.AnnotatedDataset(**expected_response) - operation = longrunning_operations_pb2.Operation( - name="operations/test_label_text", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.dataset_path("[PROJECT]", "[DATASET]") - basic_config = {} - feature = enums.LabelTextRequest.Feature.FEATURE_UNSPECIFIED - - response = client.label_text(parent, basic_config, feature) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.LabelTextRequest( - parent=parent, basic_config=basic_config, feature=feature - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_label_text_exception(self): - # Setup Response - error = status_pb2.Status() - operation = longrunning_operations_pb2.Operation( - name="operations/test_label_text_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.dataset_path("[PROJECT]", "[DATASET]") - basic_config = {} - feature = enums.LabelTextRequest.Feature.FEATURE_UNSPECIFIED - - response = client.label_text(parent, basic_config, feature) - exception = response.exception() - assert exception.errors[0] == error - - def test_get_example(self): - # Setup Expected Response - name_2 = "name2-1052831874" - expected_response = {"name": name_2} - expected_response = dataset_pb2.Example(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - name = client.example_path( - "[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]" - ) - - response = client.get_example(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.GetExampleRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_example_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - name = client.example_path( - "[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]" - ) - - with pytest.raises(CustomException): - client.get_example(name) - - def test_list_examples(self): - # Setup Expected Response - next_page_token = "" - examples_element = {} - examples = [examples_element] - expected_response = {"next_page_token": next_page_token, "examples": examples} - expected_response = data_labeling_service_pb2.ListExamplesResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.annotated_dataset_path( - "[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]" - ) - - paged_list_response = client.list_examples(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.examples[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.ListExamplesRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_examples_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - parent = client.annotated_dataset_path( - "[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]" - ) - - paged_list_response = client.list_examples(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_create_annotation_spec_set(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - } - expected_response = annotation_spec_set_pb2.AnnotationSpecSet( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - annotation_spec_set = {} - - response = client.create_annotation_spec_set(parent, annotation_spec_set) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.CreateAnnotationSpecSetRequest( - parent=parent, annotation_spec_set=annotation_spec_set - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_annotation_spec_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - parent = client.project_path("[PROJECT]") - annotation_spec_set = {} - - with pytest.raises(CustomException): - client.create_annotation_spec_set(parent, annotation_spec_set) - - def test_get_annotation_spec_set(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name_2, - "display_name": display_name, - "description": description, - } - expected_response = annotation_spec_set_pb2.AnnotationSpecSet( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - name = client.annotation_spec_set_path("[PROJECT]", "[ANNOTATION_SPEC_SET]") - - response = client.get_annotation_spec_set(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.GetAnnotationSpecSetRequest( - name=name - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_annotation_spec_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - name = client.annotation_spec_set_path("[PROJECT]", "[ANNOTATION_SPEC_SET]") - - with pytest.raises(CustomException): - client.get_annotation_spec_set(name) - - def test_list_annotation_spec_sets(self): - # Setup Expected Response - next_page_token = "" - annotation_spec_sets_element = {} - annotation_spec_sets = [annotation_spec_sets_element] - expected_response = { - "next_page_token": next_page_token, - "annotation_spec_sets": annotation_spec_sets, - } - expected_response = data_labeling_service_pb2.ListAnnotationSpecSetsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - - paged_list_response = client.list_annotation_spec_sets(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.annotation_spec_sets[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.ListAnnotationSpecSetsRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_annotation_spec_sets_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - parent = client.project_path("[PROJECT]") - - paged_list_response = client.list_annotation_spec_sets(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_delete_annotation_spec_set(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - name = client.annotation_spec_set_path("[PROJECT]", "[ANNOTATION_SPEC_SET]") - - client.delete_annotation_spec_set(name) - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.DeleteAnnotationSpecSetRequest( - name=name - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_annotation_spec_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - name = client.annotation_spec_set_path("[PROJECT]", "[ANNOTATION_SPEC_SET]") - - with pytest.raises(CustomException): - client.delete_annotation_spec_set(name) - - def test_create_instruction(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - } - expected_response = instruction_pb2.Instruction(**expected_response) - operation = longrunning_operations_pb2.Operation( - name="operations/test_create_instruction", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - instruction = {} - - response = client.create_instruction(parent, instruction) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.CreateInstructionRequest( - parent=parent, instruction=instruction - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_instruction_exception(self): - # Setup Response - error = status_pb2.Status() - operation = longrunning_operations_pb2.Operation( - name="operations/test_create_instruction_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - instruction = {} - - response = client.create_instruction(parent, instruction) - exception = response.exception() - assert exception.errors[0] == error - - def test_get_instruction(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name_2, - "display_name": display_name, - "description": description, - } - expected_response = instruction_pb2.Instruction(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - name = client.instruction_path("[PROJECT]", "[INSTRUCTION]") - - response = client.get_instruction(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.GetInstructionRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_instruction_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - name = client.instruction_path("[PROJECT]", "[INSTRUCTION]") - - with pytest.raises(CustomException): - client.get_instruction(name) - - def test_list_instructions(self): - # Setup Expected Response - next_page_token = "" - instructions_element = {} - instructions = [instructions_element] - expected_response = { - "next_page_token": next_page_token, - "instructions": instructions, - } - expected_response = data_labeling_service_pb2.ListInstructionsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - - paged_list_response = client.list_instructions(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.instructions[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.ListInstructionsRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_instructions_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - parent = client.project_path("[PROJECT]") - - paged_list_response = client.list_instructions(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_delete_instruction(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - name = client.instruction_path("[PROJECT]", "[INSTRUCTION]") - - client.delete_instruction(name) - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.DeleteInstructionRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_instruction_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - name = client.instruction_path("[PROJECT]", "[INSTRUCTION]") - - with pytest.raises(CustomException): - client.delete_instruction(name) - - def test_get_evaluation(self): - # Setup Expected Response - name_2 = "name2-1052831874" - evaluated_item_count = 358077111 - expected_response = { - "name": name_2, - "evaluated_item_count": evaluated_item_count, - } - expected_response = evaluation_pb2.Evaluation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - name = client.evaluation_path("[PROJECT]", "[DATASET]", "[EVALUATION]") - - response = client.get_evaluation(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.GetEvaluationRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_evaluation_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - name = client.evaluation_path("[PROJECT]", "[DATASET]", "[EVALUATION]") - - with pytest.raises(CustomException): - client.get_evaluation(name) - - def test_search_evaluations(self): - # Setup Expected Response - next_page_token = "" - evaluations_element = {} - evaluations = [evaluations_element] - expected_response = { - "next_page_token": next_page_token, - "evaluations": evaluations, - } - expected_response = data_labeling_service_pb2.SearchEvaluationsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.evaluation_path("[PROJECT]", "[DATASET]", "[EVALUATION]") - - paged_list_response = client.search_evaluations(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.evaluations[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.SearchEvaluationsRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_search_evaluations_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - parent = client.evaluation_path("[PROJECT]", "[DATASET]", "[EVALUATION]") - - paged_list_response = client.search_evaluations(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_search_example_comparisons(self): - # Setup Expected Response - next_page_token = "" - example_comparisons_element = {} - example_comparisons = [example_comparisons_element] - expected_response = { - "next_page_token": next_page_token, - "example_comparisons": example_comparisons, - } - expected_response = data_labeling_service_pb2.SearchExampleComparisonsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.evaluation_path("[PROJECT]", "[DATASET]", "[EVALUATION]") - - paged_list_response = client.search_example_comparisons(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.example_comparisons[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.SearchExampleComparisonsRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_search_example_comparisons_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - parent = client.evaluation_path("[PROJECT]", "[DATASET]", "[EVALUATION]") - - paged_list_response = client.search_example_comparisons(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_create_evaluation_job(self): - # Setup Expected Response - name = "name3373707" - description = "description-1724546052" - schedule = "schedule-697920873" - model_version = "modelVersion-1669102142" - annotation_spec_set = "annotationSpecSet1881405678" - label_missing_ground_truth = False - expected_response = { - "name": name, - "description": description, - "schedule": schedule, - "model_version": model_version, - "annotation_spec_set": annotation_spec_set, - "label_missing_ground_truth": label_missing_ground_truth, - } - expected_response = evaluation_job_pb2.EvaluationJob(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - job = {} - - response = client.create_evaluation_job(parent, job) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.CreateEvaluationJobRequest( - parent=parent, job=job - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_evaluation_job_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - parent = client.project_path("[PROJECT]") - job = {} - - with pytest.raises(CustomException): - client.create_evaluation_job(parent, job) - - def test_update_evaluation_job(self): - # Setup Expected Response - name = "name3373707" - description = "description-1724546052" - schedule = "schedule-697920873" - model_version = "modelVersion-1669102142" - annotation_spec_set = "annotationSpecSet1881405678" - label_missing_ground_truth = False - expected_response = { - "name": name, - "description": description, - "schedule": schedule, - "model_version": model_version, - "annotation_spec_set": annotation_spec_set, - "label_missing_ground_truth": label_missing_ground_truth, - } - expected_response = evaluation_job_pb2.EvaluationJob(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - evaluation_job = {} - - response = client.update_evaluation_job(evaluation_job) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.UpdateEvaluationJobRequest( - evaluation_job=evaluation_job - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_evaluation_job_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - evaluation_job = {} - - with pytest.raises(CustomException): - client.update_evaluation_job(evaluation_job) - - def test_get_evaluation_job(self): - # Setup Expected Response - name_2 = "name2-1052831874" - description = "description-1724546052" - schedule = "schedule-697920873" - model_version = "modelVersion-1669102142" - annotation_spec_set = "annotationSpecSet1881405678" - label_missing_ground_truth = False - expected_response = { - "name": name_2, - "description": description, - "schedule": schedule, - "model_version": model_version, - "annotation_spec_set": annotation_spec_set, - "label_missing_ground_truth": label_missing_ground_truth, - } - expected_response = evaluation_job_pb2.EvaluationJob(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - name = client.evaluation_job_path("[PROJECT]", "[EVALUATION_JOB]") - - response = client.get_evaluation_job(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.GetEvaluationJobRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_evaluation_job_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - name = client.evaluation_job_path("[PROJECT]", "[EVALUATION_JOB]") - - with pytest.raises(CustomException): - client.get_evaluation_job(name) - - def test_pause_evaluation_job(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - name = client.evaluation_job_path("[PROJECT]", "[EVALUATION_JOB]") - - client.pause_evaluation_job(name) - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.PauseEvaluationJobRequest( - name=name - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_pause_evaluation_job_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - name = client.evaluation_job_path("[PROJECT]", "[EVALUATION_JOB]") - - with pytest.raises(CustomException): - client.pause_evaluation_job(name) - - def test_resume_evaluation_job(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - name = client.evaluation_job_path("[PROJECT]", "[EVALUATION_JOB]") - - client.resume_evaluation_job(name) - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.ResumeEvaluationJobRequest( - name=name - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_resume_evaluation_job_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - name = client.evaluation_job_path("[PROJECT]", "[EVALUATION_JOB]") - - with pytest.raises(CustomException): - client.resume_evaluation_job(name) - - def test_delete_evaluation_job(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - name = client.evaluation_job_path("[PROJECT]", "[EVALUATION_JOB]") - - client.delete_evaluation_job(name) - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.DeleteEvaluationJobRequest( - name=name - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_evaluation_job_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - name = client.evaluation_job_path("[PROJECT]", "[EVALUATION_JOB]") - - with pytest.raises(CustomException): - client.delete_evaluation_job(name) - - def test_list_evaluation_jobs(self): - # Setup Expected Response - next_page_token = "" - evaluation_jobs_element = {} - evaluation_jobs = [evaluation_jobs_element] - expected_response = { - "next_page_token": next_page_token, - "evaluation_jobs": evaluation_jobs, - } - expected_response = data_labeling_service_pb2.ListEvaluationJobsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - - paged_list_response = client.list_evaluation_jobs(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.evaluation_jobs[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = data_labeling_service_pb2.ListEvaluationJobsRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_evaluation_jobs_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = datalabeling_v1beta1.DataLabelingServiceClient() - - # Setup request - parent = client.project_path("[PROJECT]") - - paged_list_response = client.list_evaluation_jobs(parent) - with pytest.raises(CustomException): - list(paged_list_response) diff --git a/dlp/.coveragerc b/dlp/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/dlp/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/dlp/.flake8 b/dlp/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/dlp/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/dlp/.repo-metadata.json b/dlp/.repo-metadata.json deleted file mode 100644 index 7aa7a207aade..000000000000 --- a/dlp/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "dlp", - "name_pretty": "Cloud Data Loss Prevention", - "product_documentation": "https://cloud.google.com/dlp/docs/", - "client_documentation": "https://googleapis.dev/python/dlp/latest", - "issue_tracker": "", - "release_level": "alpha", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-dlp", - "api_id": "dlp.googleapis.com", - "requires_billing": true -} \ No newline at end of file diff --git a/dlp/CHANGELOG.md b/dlp/CHANGELOG.md deleted file mode 100644 index e3fdecb8ed5e..000000000000 --- a/dlp/CHANGELOG.md +++ /dev/null @@ -1,199 +0,0 @@ -# Changelog - -[PyPI History][1] - -[1]: https://pypi.org/project/google-cloud-dlp/#history - -## 0.13.0 - -12-06-2019 14:29 PST - - -### Implementation Changes -- Remove send/recv msg size limit (via synth). ([#8953](https://github.com/googleapis/google-cloud-python/pull/8953)) - -### New Features -- Add `location_id` in preparation for regionalization; deprecate resource name helper functions (via synth). ([#9856](https://github.com/googleapis/google-cloud-python/pull/9856)) - -### Documentation -- Add python 2 sunset banner to documentation. ([#9036](https://github.com/googleapis/google-cloud-python/pull/9036)) -- Change requests intersphinx ref (via synth). ([#9403](https://github.com/googleapis/google-cloud-python/pull/9403)) -- Fix intersphinx reference to requests. ([#9294](https://github.com/googleapis/google-cloud-python/pull/9294)) -- Remove CI for gh-pages, use googleapis.dev for api_core refs. ([#9085](https://github.com/googleapis/google-cloud-python/pull/9085)) -- Remove compatability badges from READMEs. ([#9035](https://github.com/googleapis/google-cloud-python/pull/9035)) -- Update intersphinx mapping for requests. ([#8805](https://github.com/googleapis/google-cloud-python/pull/8805)) - -### Internal / Testing Changes -- Normalize VPCSC configuration in systests. ([#9608](https://github.com/googleapis/google-cloud-python/pull/9608)) -- Ensure env is always set; fix typo in `test_deidentify_content`. ([#9479](https://github.com/googleapis/google-cloud-python/pull/9479)) -- Exclude 'noxfile.py' from synth. ([#9284](https://github.com/googleapis/google-cloud-python/pull/9284)) -- Ensure `GOOGLE_CLOUD_TESTS_IN_VPCSC` is down cast for env variables. ([#9274](https://github.com/googleapis/google-cloud-python/pull/9274)) -- Add VPCSC tests. ([#9249](https://github.com/googleapis/google-cloud-python/pull/9249)) - -## 0.12.1 - -07-24-2019 16:16 PDT - -### Dependencies -- Bump minimum version for google-api-core to 1.14.0. ([#8709](https://github.com/googleapis/google-cloud-python/pull/8709)) - -### Documentation -- Fix docs navigation issues. ([#8723](https://github.com/googleapis/google-cloud-python/pull/8723)) -- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705)) -- Add compatibility check badges to READMEs. ([#8288](https://github.com/googleapis/google-cloud-python/pull/8288)) - -## 0.12.0 - -07-09-2019 13:20 PDT - -### New Features -- Add support for publishing findings to GCS; deprecate 'DetectionRule' message (via synth). ([#8610](https://github.com/googleapis/google-cloud-python/pull/8610)) -- Add 'client_options' support, update list method docstrings (via synth). ([#8507](https://github.com/googleapis/google-cloud-python/pull/8507)) -- Allow kwargs to be passed to create_channel; expose support for AVRO files (via synth). ([#8443](https://github.com/googleapis/google-cloud-python/pull/8443)) - -### Internal / Testing Changes -- Pin black version (via synth). ([#8581](https://github.com/googleapis/google-cloud-python/pull/8581)) -- Add docs job to publish to googleapis.dev. ([#8464](https://github.com/googleapis/google-cloud-python/pull/8464)) -- Update docstrings, format protos, update noxfile (via synth). ([#8239](https://github.com/googleapis/google-cloud-python/pull/8239)) -- Fix coverage in 'types.py' (via synth). ([#8153](https://github.com/googleapis/google-cloud-python/pull/8153)) -- Blacken noxfile.py, setup.py (via synth). ([#8121](https://github.com/googleapis/google-cloud-python/pull/8121)) -- Add empty lines (via synth). ([#8056](https://github.com/googleapis/google-cloud-python/pull/8056)) -- Add nox session `docs`, reorder methods (via synth). ([#7769](https://github.com/googleapis/google-cloud-python/pull/7769)) - -## 0.11.0 - -04-15-2019 15:05 PDT - - -### Implementation Changes -- Remove classifier for Python 3.4 for end-of-life. ([#7535](https://github.com/googleapis/google-cloud-python/pull/7535)) -- Remove unused message exports. ([#7267](https://github.com/googleapis/google-cloud-python/pull/7267)) -- Protoc-generated serialization update. ([#7081](https://github.com/googleapis/google-cloud-python/pull/7081)) - -### New Features -- Add support for filtering job triggers; add CryptoDeterministicConfig; update docs/conf.py. (via synth). ([#7390](https://github.com/googleapis/google-cloud-python/pull/7390)) - -### Documentation -- Updated client library documentation URLs. ([#7307](https://github.com/googleapis/google-cloud-python/pull/7307)) -- Update copyright headers -- Pick up stub docstring fix in GAPIC generator. ([#6969](https://github.com/googleapis/google-cloud-python/pull/6969)) - -### Internal / Testing Changes -- Copy in proto files. ([#7227](https://github.com/googleapis/google-cloud-python/pull/7227)) -- Add protos as an artifact to library ([#7205](https://github.com/googleapis/google-cloud-python/pull/7205)) - -## 0.10.0 - -12-17-2018 18:07 PST - - -### Implementation Changes -- Import `iam.policy` from `google.api_core`. ([#6741](https://github.com/googleapis/google-cloud-python/pull/6741)) -- Pick up enum fixes in the GAPIC generator. ([#6611](https://github.com/googleapis/google-cloud-python/pull/6611)) -- Pick up fixes in GAPIC generator. ([#6495](https://github.com/googleapis/google-cloud-python/pull/6495)) -- Fix `client_info` bug, update docstrings via synth. ([#6440](https://github.com/googleapis/google-cloud-python/pull/6440)) -- Assorted synth fixups / cleanups ([#6400](https://github.com/googleapis/google-cloud-python/pull/6400)) - -### New Features -- Add `BigQueryOptions.excluded_fields`. ([#6312](https://github.com/googleapis/google-cloud-python/pull/6312)) - -### Dependencies -- Bump minimum `api_core` version for all GAPIC libs to 1.4.1. ([#6391](https://github.com/googleapis/google-cloud-python/pull/6391)) - -### Documentation -- Document Python 2 deprecation ([#6910](https://github.com/googleapis/google-cloud-python/pull/6910)) -- Pick up docstring fix via synth. ([#6874](https://github.com/googleapis/google-cloud-python/pull/6874)) - -### Internal / Testing Changes -- Update noxfile. -- Blacken all gen'd libs ([#6792](https://github.com/googleapis/google-cloud-python/pull/6792)) -- Omit local deps ([#6701](https://github.com/googleapis/google-cloud-python/pull/6701)) -- Run black at end of synth.py ([#6698](https://github.com/googleapis/google-cloud-python/pull/6698)) -- Run Black on Generated libraries ([#6666](https://github.com/googleapis/google-cloud-python/pull/6666)) -- Add templates for flake8, coveragerc, noxfile, and black. ([#6642](https://github.com/googleapis/google-cloud-python/pull/6642)) -- Add synth metadata. ([#6565](https://github.com/googleapis/google-cloud-python/pull/6565)) - -## 0.9.0 - -10-18-2018 10:44 PDT - -### New Features - -- Added `stored_info_type` methods to v2. ([#6221](https://github.com/googleapis/google-cloud-python/pull/6221)) - -### Documentation - -- Docs: normalize use of support level badges ([#6159](https://github.com/googleapis/google-cloud-python/pull/6159)) -- Add / fix badges for PyPI / versions. ([#6158](https://github.com/googleapis/google-cloud-python/pull/6158)) - -### Internal / Testing Changes - -- Use new Nox ([#6175](https://github.com/googleapis/google-cloud-python/pull/6175)) -- Avoid replacing/scribbling on 'setup.py' during synth. ([#6125](https://github.com/googleapis/google-cloud-python/pull/6125)) - -## 0.8.0 - -### New Features -- Add support for exclude findings. ([#6091](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6091)) -- Add support for stored info type support. ([#5950](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5950)) - -### Documentation -- Fix docs issue in DLP generation. ([#5668](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5668), [#5815](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5815)) -- Docs: Replace links to '/stable/' with '/latest/'. ([#5901](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5901)) - -## 0.7.0 - -### New Features -- Add StoredInfoTypes (#5809) - -## 0.6.0 - -### New Features -- Regenerate DLP v2 endpoint (redact image, delta presence) (#5666) - -### Internal / Testing Changes -- Avoid overwriting '__module__' of messages from shared modules. (#5364) -- Add Test runs for Python 3.7 and remove 3.4 (#5295) -- Modify system tests to use prerelease versions of grpcio (#5304) - -## 0.5.0 - -### New Features -- Add PublishSummaryToCscc (#5246) -- Add configurable row limit (#5246) -- Add EntityID added to risk stats (#5246) -- Add dictionaries via GCS (#5246) - -## 0.4.0 - -### Implementation Changes - -- Remove DLP client version V2Beta1 (#5155) - -## 0.3.0 - -### Implementation changes - -- The library has been regenerated to pick up changes from the API's proto definition. (#5131) - -## 0.2.0 - -### Interface additions - -- Add DLP v2 (#5059) - -## 0.1.1 - -### Dependencies - -- Update dependency range for api-core to include v1.0.0 releases (#4944) - -### Testing and internal changes - -- Normalize all setup.py files (#4909) - -## 0.1.0 - -Initial release of the DLP (Data Loss Prevention) client library. (#4879) - - diff --git a/dlp/LICENSE b/dlp/LICENSE deleted file mode 100644 index a8ee855de2aa..000000000000 --- a/dlp/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/dlp/MANIFEST.in b/dlp/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/dlp/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/dlp/README.rst b/dlp/README.rst deleted file mode 100644 index 4c33c0cdeba3..000000000000 --- a/dlp/README.rst +++ /dev/null @@ -1,111 +0,0 @@ -Python Client for Cloud Data Loss Prevention (DLP) API -====================================================== - -|alpha| |pypi| |versions| - -`Cloud Data Loss Prevention (DLP) API`_: Provides methods for detection, risk analysis, and de-identification of -privacy-sensitive fragments in text, images, and Google Cloud Platform -storage repositories. - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. |alpha| image:: https://img.shields.io/badge/support-alpha-orange.svg - :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#alpha-support -.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-dlp.svg - :target: https://pypi.org/project/google-cloud-dlp/ -.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-dlp.svg - :target: https://pypi.org/project/google-cloud-dlp/ -.. _Cloud Data Loss Prevention (DLP) API: https://cloud.google.com/dlp -.. _Client Library Documentation: https://googleapis.dev/python/dlp/latest -.. _Product Documentation: https://cloud.google.com/dlp - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the Cloud Data Loss Prevention (DLP) API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Cloud Data Loss Prevention (DLP) API.: https://cloud.google.com/dlp -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Supported Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.5 - -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7. Python 2.7 support will be removed on January 1, 2020. - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-dlp - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-dlp - -Preview -~~~~~~~ - -DlpServiceClient -^^^^^^^^^^^^^^^^ - -.. code:: py - - from google.cloud import dlp_v2 - - client = dlp_v2.DlpServiceClient() - - name = 'EMAIL_ADDRESS' - info_types_element = {'name': name} - info_types = [info_types_element] - inspect_config = {'info_types': info_types} - type_ = 'text/plain' - value = 'My email is example@example.com.' - items_element = {'type': type_, 'value': value} - items = [items_element] - - response = client.inspect_content(inspect_config, items) - -Next Steps -~~~~~~~~~~ - -- Read the `Client Library Documentation`_ for Cloud Data Loss Prevention - (DLP) API to see other available methods on the client. -- Read the `Product documentation`_ to - learn more about the product and see How-to Guides. diff --git a/dlp/docs/README.rst b/dlp/docs/README.rst deleted file mode 120000 index 44473becd35c..000000000000 --- a/dlp/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../../dlp/README.rst \ No newline at end of file diff --git a/dlp/docs/_static/custom.css b/dlp/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/dlp/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/dlp/docs/_templates/layout.html b/dlp/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/dlp/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/dlp/docs/changelog.md b/dlp/docs/changelog.md deleted file mode 120000 index f4979b74fd50..000000000000 --- a/dlp/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../../dlp/CHANGELOG.md \ No newline at end of file diff --git a/dlp/docs/conf.py b/dlp/docs/conf.py deleted file mode 100644 index 557ce004755d..000000000000 --- a/dlp/docs/conf.py +++ /dev/null @@ -1,357 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-dlp documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-dlp" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-dlp-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-dlp.tex", - u"google-cloud-dlp Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, "google-cloud-dlp", u"google-cloud-dlp Documentation", [author], 1) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-dlp", - u"google-cloud-dlp Documentation", - author, - "google-cloud-dlp", - "GAPIC library for the {metadata.shortName} v2 service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/master/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/dlp/docs/gapic/v2/api.rst b/dlp/docs/gapic/v2/api.rst deleted file mode 100644 index 2e6e3f989229..000000000000 --- a/dlp/docs/gapic/v2/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud Data Loss Prevention (DLP) API -=============================================== - -.. automodule:: google.cloud.dlp_v2 - :members: - :inherited-members: \ No newline at end of file diff --git a/dlp/docs/gapic/v2/types.rst b/dlp/docs/gapic/v2/types.rst deleted file mode 100644 index 3c8e8e79b180..000000000000 --- a/dlp/docs/gapic/v2/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud Data Loss Prevention (DLP) API Client -===================================================== - -.. automodule:: google.cloud.dlp_v2.types - :members: \ No newline at end of file diff --git a/dlp/docs/index.rst b/dlp/docs/index.rst deleted file mode 100644 index ac9eaec1ba32..000000000000 --- a/dlp/docs/index.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. include:: README.rst - -Api Reference -------------- -.. toctree:: - :maxdepth: 2 - - gapic/v2/api - gapic/v2/types - changelog - -Changelog ---------- - -For a list of all ``google-cloud-dlp`` releases: - -.. toctree:: - :maxdepth: 2 - - changelog diff --git a/dlp/google/__init__.py b/dlp/google/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/dlp/google/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/dlp/google/cloud/__init__.py b/dlp/google/cloud/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/dlp/google/cloud/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/dlp/google/cloud/dlp.py b/dlp/google/cloud/dlp.py deleted file mode 100644 index 8e70272c672e..000000000000 --- a/dlp/google/cloud/dlp.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import - -from google.cloud.dlp_v2 import DlpServiceClient -from google.cloud.dlp_v2 import enums -from google.cloud.dlp_v2 import types - - -__all__ = ("enums", "types", "DlpServiceClient") diff --git a/dlp/google/cloud/dlp_v2/__init__.py b/dlp/google/cloud/dlp_v2/__init__.py deleted file mode 100644 index 48ef10a6201d..000000000000 --- a/dlp/google/cloud/dlp_v2/__init__.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.dlp_v2 import types -from google.cloud.dlp_v2.gapic import dlp_service_client -from google.cloud.dlp_v2.gapic import enums - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class DlpServiceClient(dlp_service_client.DlpServiceClient): - __doc__ = dlp_service_client.DlpServiceClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "DlpServiceClient") diff --git a/dlp/google/cloud/dlp_v2/gapic/__init__.py b/dlp/google/cloud/dlp_v2/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/dlp/google/cloud/dlp_v2/gapic/dlp_service_client.py b/dlp/google/cloud/dlp_v2/gapic/dlp_service_client.py deleted file mode 100644 index 8e54b9e1ec26..000000000000 --- a/dlp/google/cloud/dlp_v2/gapic/dlp_service_client.py +++ /dev/null @@ -1,3095 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.privacy.dlp.v2 DlpService API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.page_iterator -import google.api_core.path_template -import google.api_core.protobuf_helpers -import grpc - -from google.cloud.dlp_v2.gapic import dlp_service_client_config -from google.cloud.dlp_v2.gapic import enums -from google.cloud.dlp_v2.gapic.transports import dlp_service_grpc_transport -from google.cloud.dlp_v2.proto import dlp_pb2 -from google.cloud.dlp_v2.proto import dlp_pb2_grpc -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-dlp").version - - -class DlpServiceClient(object): - """ - The Cloud Data Loss Prevention (DLP) API is a service that allows clients - to detect the presence of Personally Identifiable Information (PII) and other - privacy-sensitive data in user-supplied, unstructured data streams, like text - blocks or images. - The service also includes methods for sensitive data redaction and - scheduling of data scans on Google Cloud Platform based data sets. - - To learn more about concepts and find how-to guides see - https://cloud.google.com/dlp/docs/. - """ - - SERVICE_ADDRESS = "dlp.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.privacy.dlp.v2.DlpService" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - DlpServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def dlp_job_path(cls, project, dlp_job): - """Return a fully-qualified dlp_job string.""" - return google.api_core.path_template.expand( - "projects/{project}/dlpJobs/{dlp_job}", project=project, dlp_job=dlp_job - ) - - @classmethod - def organization_path(cls, organization): - """Return a fully-qualified organization string.""" - return google.api_core.path_template.expand( - "organizations/{organization}", organization=organization - ) - - @classmethod - def organization_deidentify_template_path(cls, organization, deidentify_template): - """Return a fully-qualified organization_deidentify_template string.""" - return google.api_core.path_template.expand( - "organizations/{organization}/deidentifyTemplates/{deidentify_template}", - organization=organization, - deidentify_template=deidentify_template, - ) - - @classmethod - def organization_inspect_template_path(cls, organization, inspect_template): - """Return a fully-qualified organization_inspect_template string.""" - return google.api_core.path_template.expand( - "organizations/{organization}/inspectTemplates/{inspect_template}", - organization=organization, - inspect_template=inspect_template, - ) - - @classmethod - def organization_stored_info_type_path(cls, organization, stored_info_type): - """Return a fully-qualified organization_stored_info_type string.""" - return google.api_core.path_template.expand( - "organizations/{organization}/storedInfoTypes/{stored_info_type}", - organization=organization, - stored_info_type=stored_info_type, - ) - - @classmethod - def project_path(cls, project): - """Return a fully-qualified project string.""" - return google.api_core.path_template.expand( - "projects/{project}", project=project - ) - - @classmethod - def project_deidentify_template_path(cls, project, deidentify_template): - """Return a fully-qualified project_deidentify_template string.""" - return google.api_core.path_template.expand( - "projects/{project}/deidentifyTemplates/{deidentify_template}", - project=project, - deidentify_template=deidentify_template, - ) - - @classmethod - def project_inspect_template_path(cls, project, inspect_template): - """Return a fully-qualified project_inspect_template string.""" - return google.api_core.path_template.expand( - "projects/{project}/inspectTemplates/{inspect_template}", - project=project, - inspect_template=inspect_template, - ) - - @classmethod - def project_job_trigger_path(cls, project, job_trigger): - """Return a fully-qualified project_job_trigger string.""" - return google.api_core.path_template.expand( - "projects/{project}/jobTriggers/{job_trigger}", - project=project, - job_trigger=job_trigger, - ) - - @classmethod - def project_stored_info_type_path(cls, project, stored_info_type): - """Return a fully-qualified project_stored_info_type string.""" - return google.api_core.path_template.expand( - "projects/{project}/storedInfoTypes/{stored_info_type}", - project=project, - stored_info_type=stored_info_type, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.DlpServiceGrpcTransport, - Callable[[~.Credentials, type], ~.DlpServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = dlp_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=dlp_service_grpc_transport.DlpServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = dlp_service_grpc_transport.DlpServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def inspect_content( - self, - parent, - inspect_config=None, - item=None, - inspect_template_name=None, - location_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Finds potentially sensitive info in content. - This method has limits on input size, processing time, and output size. - - When no InfoTypes or CustomInfoTypes are specified in this request, the - system will automatically choose what detectors to run. By default this may - be all types, but may change over time as detectors are updated. - - For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images - and https://cloud.google.com/dlp/docs/inspecting-text, - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> response = client.inspect_content(parent) - - Args: - parent (str): The parent resource name, for example projects/my-project-id. - inspect_config (Union[dict, ~google.cloud.dlp_v2.types.InspectConfig]): Configuration for the inspector. What specified here will override the - template referenced by the inspect\_template\_name argument. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.InspectConfig` - item (Union[dict, ~google.cloud.dlp_v2.types.ContentItem]): The item to inspect. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.ContentItem` - inspect_template_name (str): Template to use. Any configuration directly specified in inspect\_config - will override those set in the template. Singular fields that are set in - this request will replace their corresponding fields in the template. - Repeated fields are appended. Singular sub-messages and groups are - recursively merged. - location_id (str): The geographic location to process content inspection. Reserved for future - extensions. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.dlp_v2.types.InspectContentResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "inspect_content" not in self._inner_api_calls: - self._inner_api_calls[ - "inspect_content" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.inspect_content, - default_retry=self._method_configs["InspectContent"].retry, - default_timeout=self._method_configs["InspectContent"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.InspectContentRequest( - parent=parent, - inspect_config=inspect_config, - item=item, - inspect_template_name=inspect_template_name, - location_id=location_id, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["inspect_content"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def redact_image( - self, - parent, - location_id=None, - inspect_config=None, - image_redaction_configs=None, - include_findings=None, - byte_item=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Redacts potentially sensitive info from an image. - This method has limits on input size, processing time, and output size. - See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images to - learn more. - - When no InfoTypes or CustomInfoTypes are specified in this request, the - system will automatically choose what detectors to run. By default this may - be all types, but may change over time as detectors are updated. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> response = client.redact_image(parent) - - Args: - parent (str): The parent resource name, for example projects/my-project-id. - location_id (str): The geographic location to process the request. Reserved for future - extensions. - inspect_config (Union[dict, ~google.cloud.dlp_v2.types.InspectConfig]): Configuration for the inspector. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.InspectConfig` - image_redaction_configs (list[Union[dict, ~google.cloud.dlp_v2.types.ImageRedactionConfig]]): The configuration for specifying what content to redact from images. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.ImageRedactionConfig` - include_findings (bool): Whether the response should include findings along with the redacted - image. - byte_item (Union[dict, ~google.cloud.dlp_v2.types.ByteContentItem]): The content must be PNG, JPEG, SVG or BMP. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.ByteContentItem` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.dlp_v2.types.RedactImageResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "redact_image" not in self._inner_api_calls: - self._inner_api_calls[ - "redact_image" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.redact_image, - default_retry=self._method_configs["RedactImage"].retry, - default_timeout=self._method_configs["RedactImage"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.RedactImageRequest( - parent=parent, - location_id=location_id, - inspect_config=inspect_config, - image_redaction_configs=image_redaction_configs, - include_findings=include_findings, - byte_item=byte_item, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["redact_image"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def deidentify_content( - self, - parent, - deidentify_config=None, - inspect_config=None, - item=None, - inspect_template_name=None, - deidentify_template_name=None, - location_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - De-identifies potentially sensitive info from a ContentItem. - This method has limits on input size and output size. - See https://cloud.google.com/dlp/docs/deidentify-sensitive-data to - learn more. - - When no InfoTypes or CustomInfoTypes are specified in this request, the - system will automatically choose what detectors to run. By default this may - be all types, but may change over time as detectors are updated. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> response = client.deidentify_content(parent) - - Args: - parent (str): The parent resource name, for example projects/my-project-id. - deidentify_config (Union[dict, ~google.cloud.dlp_v2.types.DeidentifyConfig]): Configuration for the de-identification of the content item. Items - specified here will override the template referenced by the - deidentify\_template\_name argument. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.DeidentifyConfig` - inspect_config (Union[dict, ~google.cloud.dlp_v2.types.InspectConfig]): Configuration for the inspector. Items specified here will override the - template referenced by the inspect\_template\_name argument. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.InspectConfig` - item (Union[dict, ~google.cloud.dlp_v2.types.ContentItem]): The item to de-identify. Will be treated as text. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.ContentItem` - inspect_template_name (str): Template to use. Any configuration directly specified in inspect\_config - will override those set in the template. Singular fields that are set in - this request will replace their corresponding fields in the template. - Repeated fields are appended. Singular sub-messages and groups are - recursively merged. - deidentify_template_name (str): Template to use. Any configuration directly specified in - deidentify\_config will override those set in the template. Singular - fields that are set in this request will replace their corresponding - fields in the template. Repeated fields are appended. Singular - sub-messages and groups are recursively merged. - location_id (str): The geographic location to process de-identification. Reserved for future - extensions. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.dlp_v2.types.DeidentifyContentResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "deidentify_content" not in self._inner_api_calls: - self._inner_api_calls[ - "deidentify_content" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.deidentify_content, - default_retry=self._method_configs["DeidentifyContent"].retry, - default_timeout=self._method_configs["DeidentifyContent"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.DeidentifyContentRequest( - parent=parent, - deidentify_config=deidentify_config, - inspect_config=inspect_config, - item=item, - inspect_template_name=inspect_template_name, - deidentify_template_name=deidentify_template_name, - location_id=location_id, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["deidentify_content"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def reidentify_content( - self, - parent, - reidentify_config=None, - inspect_config=None, - item=None, - inspect_template_name=None, - reidentify_template_name=None, - location_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Re-identifies content that has been de-identified. See - https://cloud.google.com/dlp/docs/pseudonymization#re-identification\_in\_free\_text\_code\_example - to learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> response = client.reidentify_content(parent) - - Args: - parent (str): Required. The parent resource name. - reidentify_config (Union[dict, ~google.cloud.dlp_v2.types.DeidentifyConfig]): Configuration for the re-identification of the content item. This field - shares the same proto message type that is used for de-identification, - however its usage here is for the reversal of the previous - de-identification. Re-identification is performed by examining the - transformations used to de-identify the items and executing the reverse. - This requires that only reversible transformations be provided here. The - reversible transformations are: - - - ``CryptoDeterministicConfig`` - - ``CryptoReplaceFfxFpeConfig`` - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.DeidentifyConfig` - inspect_config (Union[dict, ~google.cloud.dlp_v2.types.InspectConfig]): Configuration for the inspector. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.InspectConfig` - item (Union[dict, ~google.cloud.dlp_v2.types.ContentItem]): The item to re-identify. Will be treated as text. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.ContentItem` - inspect_template_name (str): Template to use. Any configuration directly specified in - ``inspect_config`` will override those set in the template. Singular - fields that are set in this request will replace their corresponding - fields in the template. Repeated fields are appended. Singular - sub-messages and groups are recursively merged. - reidentify_template_name (str): Template to use. References an instance of ``DeidentifyTemplate``. Any - configuration directly specified in ``reidentify_config`` or - ``inspect_config`` will override those set in the template. Singular - fields that are set in this request will replace their corresponding - fields in the template. Repeated fields are appended. Singular - sub-messages and groups are recursively merged. - location_id (str): The geographic location to process content reidentification. Reserved for - future extensions. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.dlp_v2.types.ReidentifyContentResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "reidentify_content" not in self._inner_api_calls: - self._inner_api_calls[ - "reidentify_content" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.reidentify_content, - default_retry=self._method_configs["ReidentifyContent"].retry, - default_timeout=self._method_configs["ReidentifyContent"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.ReidentifyContentRequest( - parent=parent, - reidentify_config=reidentify_config, - inspect_config=inspect_config, - item=item, - inspect_template_name=inspect_template_name, - reidentify_template_name=reidentify_template_name, - location_id=location_id, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["reidentify_content"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_info_types( - self, - language_code=None, - filter_=None, - location_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Returns a list of the sensitive information types that the DLP API - supports. See https://cloud.google.com/dlp/docs/infotypes-reference to - learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> response = client.list_info_types() - - Args: - language_code (str): BCP-47 language code for localized infoType friendly - names. If omitted, or if localized strings are not available, - en-US strings will be returned. - filter_ (str): filter to only return infoTypes supported by certain parts of the API. - Defaults to supported\_by=INSPECT. - location_id (str): The geographic location to list info types. Reserved for future - extensions. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.dlp_v2.types.ListInfoTypesResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_info_types" not in self._inner_api_calls: - self._inner_api_calls[ - "list_info_types" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_info_types, - default_retry=self._method_configs["ListInfoTypes"].retry, - default_timeout=self._method_configs["ListInfoTypes"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.ListInfoTypesRequest( - language_code=language_code, filter=filter_, location_id=location_id - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("location_id", location_id)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["list_info_types"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_inspect_template( - self, - parent, - inspect_template=None, - template_id=None, - location_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates an InspectTemplate for re-using frequently used configuration - for inspecting content, images, and storage. - See https://cloud.google.com/dlp/docs/creating-templates to learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> parent = client.organization_path('[ORGANIZATION]') - >>> - >>> response = client.create_inspect_template(parent) - - Args: - parent (str): Required. The parent resource name, for example projects/my-project-id or - organizations/my-org-id. - inspect_template (Union[dict, ~google.cloud.dlp_v2.types.InspectTemplate]): Required. The InspectTemplate to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.InspectTemplate` - template_id (str): The template id can contain uppercase and lowercase letters, numbers, - and hyphens; that is, it must match the regular expression: - ``[a-zA-Z\\d-_]+``. The maximum length is 100 characters. Can be empty - to allow the system to generate one. - location_id (str): The geographic location to store the inspection template. Reserved for - future extensions. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.dlp_v2.types.InspectTemplate` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_inspect_template" not in self._inner_api_calls: - self._inner_api_calls[ - "create_inspect_template" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_inspect_template, - default_retry=self._method_configs["CreateInspectTemplate"].retry, - default_timeout=self._method_configs["CreateInspectTemplate"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.CreateInspectTemplateRequest( - parent=parent, - inspect_template=inspect_template, - template_id=template_id, - location_id=location_id, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_inspect_template"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_inspect_template( - self, - name, - inspect_template=None, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates the InspectTemplate. - See https://cloud.google.com/dlp/docs/creating-templates to learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> name = client.organization_inspect_template_path('[ORGANIZATION]', '[INSPECT_TEMPLATE]') - >>> - >>> response = client.update_inspect_template(name) - - Args: - name (str): Required. Resource name of organization and inspectTemplate to be - updated, for example - ``organizations/433245324/inspectTemplates/432452342`` or - projects/project-id/inspectTemplates/432452342. - inspect_template (Union[dict, ~google.cloud.dlp_v2.types.InspectTemplate]): New InspectTemplate value. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.InspectTemplate` - update_mask (Union[dict, ~google.cloud.dlp_v2.types.FieldMask]): Mask to control which fields get updated. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.dlp_v2.types.InspectTemplate` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_inspect_template" not in self._inner_api_calls: - self._inner_api_calls[ - "update_inspect_template" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_inspect_template, - default_retry=self._method_configs["UpdateInspectTemplate"].retry, - default_timeout=self._method_configs["UpdateInspectTemplate"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.UpdateInspectTemplateRequest( - name=name, inspect_template=inspect_template, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_inspect_template"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_inspect_template( - self, - name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets an InspectTemplate. - See https://cloud.google.com/dlp/docs/creating-templates to learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> response = client.get_inspect_template() - - Args: - name (str): Required. Resource name of the organization and inspectTemplate to be - read, for example ``organizations/433245324/inspectTemplates/432452342`` - or projects/project-id/inspectTemplates/432452342. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.dlp_v2.types.InspectTemplate` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_inspect_template" not in self._inner_api_calls: - self._inner_api_calls[ - "get_inspect_template" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_inspect_template, - default_retry=self._method_configs["GetInspectTemplate"].retry, - default_timeout=self._method_configs["GetInspectTemplate"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.GetInspectTemplateRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_inspect_template"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_inspect_templates( - self, - parent, - page_size=None, - order_by=None, - location_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists InspectTemplates. - See https://cloud.google.com/dlp/docs/creating-templates to learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> parent = client.organization_path('[ORGANIZATION]') - >>> - >>> # Iterate over all results - >>> for element in client.list_inspect_templates(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_inspect_templates(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The parent resource name, for example projects/my-project-id or - organizations/my-org-id. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - order_by (str): Comma separated list of fields to order by, followed by ``asc`` or - ``desc`` postfix. This list is case-insensitive, default sorting order - is ascending, redundant space characters are insignificant. - - Example: ``name asc,update_time, create_time desc`` - - Supported fields are: - - - ``create_time``: corresponds to time the template was created. - - ``update_time``: corresponds to time the template was last updated. - - ``name``: corresponds to template's name. - - ``display_name``: corresponds to template's display name. - location_id (str): The geographic location where inspection templates will be retrieved - from. Use ``-`` for all locations. Reserved for future extensions. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.dlp_v2.types.InspectTemplate` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_inspect_templates" not in self._inner_api_calls: - self._inner_api_calls[ - "list_inspect_templates" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_inspect_templates, - default_retry=self._method_configs["ListInspectTemplates"].retry, - default_timeout=self._method_configs["ListInspectTemplates"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.ListInspectTemplatesRequest( - parent=parent, - page_size=page_size, - order_by=order_by, - location_id=location_id, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_inspect_templates"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="inspect_templates", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def delete_inspect_template( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes an InspectTemplate. - See https://cloud.google.com/dlp/docs/creating-templates to learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> name = client.organization_inspect_template_path('[ORGANIZATION]', '[INSPECT_TEMPLATE]') - >>> - >>> client.delete_inspect_template(name) - - Args: - name (str): Required. Resource name of the organization and inspectTemplate to be - deleted, for example - ``organizations/433245324/inspectTemplates/432452342`` or - projects/project-id/inspectTemplates/432452342. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_inspect_template" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_inspect_template" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_inspect_template, - default_retry=self._method_configs["DeleteInspectTemplate"].retry, - default_timeout=self._method_configs["DeleteInspectTemplate"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.DeleteInspectTemplateRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_inspect_template"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_deidentify_template( - self, - parent, - deidentify_template=None, - template_id=None, - location_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a DeidentifyTemplate for re-using frequently used configuration - for de-identifying content, images, and storage. - See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> parent = client.organization_path('[ORGANIZATION]') - >>> - >>> response = client.create_deidentify_template(parent) - - Args: - parent (str): Required. The parent resource name, for example projects/my-project-id or - organizations/my-org-id. - deidentify_template (Union[dict, ~google.cloud.dlp_v2.types.DeidentifyTemplate]): Required. The DeidentifyTemplate to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.DeidentifyTemplate` - template_id (str): The template id can contain uppercase and lowercase letters, numbers, - and hyphens; that is, it must match the regular expression: - ``[a-zA-Z\\d-_]+``. The maximum length is 100 characters. Can be empty - to allow the system to generate one. - location_id (str): The geographic location to store the deidentification template. Reserved - for future extensions. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.dlp_v2.types.DeidentifyTemplate` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_deidentify_template" not in self._inner_api_calls: - self._inner_api_calls[ - "create_deidentify_template" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_deidentify_template, - default_retry=self._method_configs["CreateDeidentifyTemplate"].retry, - default_timeout=self._method_configs[ - "CreateDeidentifyTemplate" - ].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.CreateDeidentifyTemplateRequest( - parent=parent, - deidentify_template=deidentify_template, - template_id=template_id, - location_id=location_id, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_deidentify_template"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_deidentify_template( - self, - name, - deidentify_template=None, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates the DeidentifyTemplate. - See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> name = client.organization_deidentify_template_path('[ORGANIZATION]', '[DEIDENTIFY_TEMPLATE]') - >>> - >>> response = client.update_deidentify_template(name) - - Args: - name (str): Required. Resource name of organization and deidentify template to be - updated, for example - ``organizations/433245324/deidentifyTemplates/432452342`` or - projects/project-id/deidentifyTemplates/432452342. - deidentify_template (Union[dict, ~google.cloud.dlp_v2.types.DeidentifyTemplate]): New DeidentifyTemplate value. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.DeidentifyTemplate` - update_mask (Union[dict, ~google.cloud.dlp_v2.types.FieldMask]): Mask to control which fields get updated. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.dlp_v2.types.DeidentifyTemplate` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_deidentify_template" not in self._inner_api_calls: - self._inner_api_calls[ - "update_deidentify_template" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_deidentify_template, - default_retry=self._method_configs["UpdateDeidentifyTemplate"].retry, - default_timeout=self._method_configs[ - "UpdateDeidentifyTemplate" - ].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.UpdateDeidentifyTemplateRequest( - name=name, deidentify_template=deidentify_template, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_deidentify_template"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_deidentify_template( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a DeidentifyTemplate. - See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> name = client.organization_deidentify_template_path('[ORGANIZATION]', '[DEIDENTIFY_TEMPLATE]') - >>> - >>> response = client.get_deidentify_template(name) - - Args: - name (str): Required. Resource name of the organization and deidentify template to - be read, for example - ``organizations/433245324/deidentifyTemplates/432452342`` or - projects/project-id/deidentifyTemplates/432452342. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.dlp_v2.types.DeidentifyTemplate` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_deidentify_template" not in self._inner_api_calls: - self._inner_api_calls[ - "get_deidentify_template" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_deidentify_template, - default_retry=self._method_configs["GetDeidentifyTemplate"].retry, - default_timeout=self._method_configs["GetDeidentifyTemplate"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.GetDeidentifyTemplateRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_deidentify_template"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_deidentify_templates( - self, - parent, - page_size=None, - order_by=None, - location_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists DeidentifyTemplates. - See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> parent = client.organization_path('[ORGANIZATION]') - >>> - >>> # Iterate over all results - >>> for element in client.list_deidentify_templates(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_deidentify_templates(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The parent resource name, for example projects/my-project-id or - organizations/my-org-id. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - order_by (str): Comma separated list of fields to order by, followed by ``asc`` or - ``desc`` postfix. This list is case-insensitive, default sorting order - is ascending, redundant space characters are insignificant. - - Example: ``name asc,update_time, create_time desc`` - - Supported fields are: - - - ``create_time``: corresponds to time the template was created. - - ``update_time``: corresponds to time the template was last updated. - - ``name``: corresponds to template's name. - - ``display_name``: corresponds to template's display name. - location_id (str): The geographic location where deidentifications templates will be - retrieved from. Use ``-`` for all locations. Reserved for future - extensions. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.dlp_v2.types.DeidentifyTemplate` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_deidentify_templates" not in self._inner_api_calls: - self._inner_api_calls[ - "list_deidentify_templates" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_deidentify_templates, - default_retry=self._method_configs["ListDeidentifyTemplates"].retry, - default_timeout=self._method_configs["ListDeidentifyTemplates"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.ListDeidentifyTemplatesRequest( - parent=parent, - page_size=page_size, - order_by=order_by, - location_id=location_id, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_deidentify_templates"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="deidentify_templates", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def delete_deidentify_template( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a DeidentifyTemplate. - See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> name = client.organization_deidentify_template_path('[ORGANIZATION]', '[DEIDENTIFY_TEMPLATE]') - >>> - >>> client.delete_deidentify_template(name) - - Args: - name (str): Required. Resource name of the organization and deidentify template to - be deleted, for example - ``organizations/433245324/deidentifyTemplates/432452342`` or - projects/project-id/deidentifyTemplates/432452342. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_deidentify_template" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_deidentify_template" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_deidentify_template, - default_retry=self._method_configs["DeleteDeidentifyTemplate"].retry, - default_timeout=self._method_configs[ - "DeleteDeidentifyTemplate" - ].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.DeleteDeidentifyTemplateRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_deidentify_template"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_dlp_job( - self, - parent, - inspect_job=None, - risk_job=None, - job_id=None, - location_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a new job to inspect storage or calculate risk metrics. - See https://cloud.google.com/dlp/docs/inspecting-storage and - https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. - - When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the - system will automatically choose what detectors to run. By default this may - be all types, but may change over time as detectors are updated. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> response = client.create_dlp_job(parent) - - Args: - parent (str): Required. The parent resource name, for example projects/my-project-id. - inspect_job (Union[dict, ~google.cloud.dlp_v2.types.InspectJobConfig]): Set to control what and how to inspect. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.InspectJobConfig` - risk_job (Union[dict, ~google.cloud.dlp_v2.types.RiskAnalysisJobConfig]): Set to choose what metric to calculate. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.RiskAnalysisJobConfig` - job_id (str): The job id can contain uppercase and lowercase letters, numbers, and - hyphens; that is, it must match the regular expression: - ``[a-zA-Z\\d-_]+``. The maximum length is 100 characters. Can be empty - to allow the system to generate one. - location_id (str): The geographic location to store and process the job. Reserved for - future extensions. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.dlp_v2.types.DlpJob` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_dlp_job" not in self._inner_api_calls: - self._inner_api_calls[ - "create_dlp_job" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_dlp_job, - default_retry=self._method_configs["CreateDlpJob"].retry, - default_timeout=self._method_configs["CreateDlpJob"].timeout, - client_info=self._client_info, - ) - - # Sanity check: We have some fields which are mutually exclusive; - # raise ValueError if more than one is sent. - google.api_core.protobuf_helpers.check_oneof( - inspect_job=inspect_job, risk_job=risk_job - ) - - request = dlp_pb2.CreateDlpJobRequest( - parent=parent, - inspect_job=inspect_job, - risk_job=risk_job, - job_id=job_id, - location_id=location_id, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_dlp_job"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_dlp_jobs( - self, - parent, - filter_=None, - page_size=None, - type_=None, - order_by=None, - location_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists DlpJobs that match the specified filter in the request. - See https://cloud.google.com/dlp/docs/inspecting-storage and - https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> # Iterate over all results - >>> for element in client.list_dlp_jobs(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_dlp_jobs(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The parent resource name, for example projects/my-project-id. - filter_ (str): Allows filtering. - - Supported syntax: - - - Filter expressions are made up of one or more restrictions. - - Restrictions can be combined by ``AND`` or ``OR`` logical operators. - A sequence of restrictions implicitly uses ``AND``. - - A restriction has the form of ``{field} {operator} {value}``. - - Supported fields/values for inspect jobs: - - - ``state`` - PENDING\|RUNNING\|CANCELED\|FINISHED\|FAILED - - ``inspected_storage`` - DATASTORE\|CLOUD\_STORAGE\|BIGQUERY - - ``trigger_name`` - The resource name of the trigger that created - job. - - 'end\_time\` - Corresponds to time the job finished. - - 'start\_time\` - Corresponds to time the job finished. - - - Supported fields for risk analysis jobs: - - - ``state`` - RUNNING\|CANCELED\|FINISHED\|FAILED - - 'end\_time\` - Corresponds to time the job finished. - - 'start\_time\` - Corresponds to time the job finished. - - - The operator must be ``=`` or ``!=``. - - Examples: - - - inspected\_storage = cloud\_storage AND state = done - - inspected\_storage = cloud\_storage OR inspected\_storage = bigquery - - inspected\_storage = cloud\_storage AND (state = done OR state = - canceled) - - end\_time > "2017-12-12T00:00:00+00:00" - - The length of this field should be no more than 500 characters. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - type_ (~google.cloud.dlp_v2.types.DlpJobType): The type of job. Defaults to ``DlpJobType.INSPECT`` - order_by (str): Comma separated list of fields to order by, followed by ``asc`` or - ``desc`` postfix. This list is case-insensitive, default sorting order - is ascending, redundant space characters are insignificant. - - Example: ``name asc, end_time asc, create_time desc`` - - Supported fields are: - - - ``create_time``: corresponds to time the job was created. - - ``end_time``: corresponds to time the job ended. - - ``name``: corresponds to job's name. - - ``state``: corresponds to ``state`` - location_id (str): The geographic location where jobs will be retrieved from. Use ``-`` for - all locations. Reserved for future extensions. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.dlp_v2.types.DlpJob` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_dlp_jobs" not in self._inner_api_calls: - self._inner_api_calls[ - "list_dlp_jobs" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_dlp_jobs, - default_retry=self._method_configs["ListDlpJobs"].retry, - default_timeout=self._method_configs["ListDlpJobs"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.ListDlpJobsRequest( - parent=parent, - filter=filter_, - page_size=page_size, - type=type_, - order_by=order_by, - location_id=location_id, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_dlp_jobs"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="jobs", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_dlp_job( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets the latest state of a long-running DlpJob. - See https://cloud.google.com/dlp/docs/inspecting-storage and - https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> name = client.dlp_job_path('[PROJECT]', '[DLP_JOB]') - >>> - >>> response = client.get_dlp_job(name) - - Args: - name (str): Required. The name of the DlpJob resource. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.dlp_v2.types.DlpJob` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_dlp_job" not in self._inner_api_calls: - self._inner_api_calls[ - "get_dlp_job" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_dlp_job, - default_retry=self._method_configs["GetDlpJob"].retry, - default_timeout=self._method_configs["GetDlpJob"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.GetDlpJobRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_dlp_job"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_dlp_job( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a long-running DlpJob. This method indicates that the client is - no longer interested in the DlpJob result. The job will be cancelled if - possible. - See https://cloud.google.com/dlp/docs/inspecting-storage and - https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> name = client.dlp_job_path('[PROJECT]', '[DLP_JOB]') - >>> - >>> client.delete_dlp_job(name) - - Args: - name (str): Required. The name of the DlpJob resource to be deleted. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_dlp_job" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_dlp_job" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_dlp_job, - default_retry=self._method_configs["DeleteDlpJob"].retry, - default_timeout=self._method_configs["DeleteDlpJob"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.DeleteDlpJobRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_dlp_job"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def cancel_dlp_job( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Starts asynchronous cancellation on a long-running DlpJob. The server - makes a best effort to cancel the DlpJob, but success is not - guaranteed. - See https://cloud.google.com/dlp/docs/inspecting-storage and - https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> name = client.dlp_job_path('[PROJECT]', '[DLP_JOB]') - >>> - >>> client.cancel_dlp_job(name) - - Args: - name (str): Required. The name of the DlpJob resource to be cancelled. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "cancel_dlp_job" not in self._inner_api_calls: - self._inner_api_calls[ - "cancel_dlp_job" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.cancel_dlp_job, - default_retry=self._method_configs["CancelDlpJob"].retry, - default_timeout=self._method_configs["CancelDlpJob"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.CancelDlpJobRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["cancel_dlp_job"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_job_triggers( - self, - parent, - page_size=None, - order_by=None, - filter_=None, - location_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists job triggers. - See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> # Iterate over all results - >>> for element in client.list_job_triggers(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_job_triggers(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The parent resource name, for example - ``projects/my-project-id``. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - order_by (str): Comma separated list of triggeredJob fields to order by, followed by - ``asc`` or ``desc`` postfix. This list is case-insensitive, default - sorting order is ascending, redundant space characters are - insignificant. - - Example: ``name asc,update_time, create_time desc`` - - Supported fields are: - - - ``create_time``: corresponds to time the JobTrigger was created. - - ``update_time``: corresponds to time the JobTrigger was last updated. - - ``last_run_time``: corresponds to the last time the JobTrigger ran. - - ``name``: corresponds to JobTrigger's name. - - ``display_name``: corresponds to JobTrigger's display name. - - ``status``: corresponds to JobTrigger's status. - filter_ (str): Allows filtering. - - Supported syntax: - - - Filter expressions are made up of one or more restrictions. - - Restrictions can be combined by ``AND`` or ``OR`` logical operators. - A sequence of restrictions implicitly uses ``AND``. - - A restriction has the form of ``{field} {operator} {value}``. - - Supported fields/values for inspect jobs: - - - ``status`` - HEALTHY\|PAUSED\|CANCELLED - - ``inspected_storage`` - DATASTORE\|CLOUD\_STORAGE\|BIGQUERY - - 'last\_run\_time\` - RFC 3339 formatted timestamp, surrounded by - quotation marks. Nanoseconds are ignored. - - 'error\_count' - Number of errors that have occurred while - running. - - - The operator must be ``=`` or ``!=`` for status and - inspected\_storage. - - Examples: - - - inspected\_storage = cloud\_storage AND status = HEALTHY - - inspected\_storage = cloud\_storage OR inspected\_storage = bigquery - - inspected\_storage = cloud\_storage AND (state = PAUSED OR state = - HEALTHY) - - last\_run\_time > "2017-12-12T00:00:00+00:00" - - The length of this field should be no more than 500 characters. - location_id (str): The geographic location where job triggers will be retrieved from. Use - ``-`` for all locations. Reserved for future extensions. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.dlp_v2.types.JobTrigger` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_job_triggers" not in self._inner_api_calls: - self._inner_api_calls[ - "list_job_triggers" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_job_triggers, - default_retry=self._method_configs["ListJobTriggers"].retry, - default_timeout=self._method_configs["ListJobTriggers"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.ListJobTriggersRequest( - parent=parent, - page_size=page_size, - order_by=order_by, - filter=filter_, - location_id=location_id, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_job_triggers"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="job_triggers", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_job_trigger( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a job trigger. - See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> name = client.project_job_trigger_path('[PROJECT]', '[JOB_TRIGGER]') - >>> - >>> response = client.get_job_trigger(name) - - Args: - name (str): Required. Resource name of the project and the triggeredJob, for example - ``projects/dlp-test-project/jobTriggers/53234423``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.dlp_v2.types.JobTrigger` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_job_trigger" not in self._inner_api_calls: - self._inner_api_calls[ - "get_job_trigger" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_job_trigger, - default_retry=self._method_configs["GetJobTrigger"].retry, - default_timeout=self._method_configs["GetJobTrigger"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.GetJobTriggerRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_job_trigger"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_job_trigger( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a job trigger. - See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> # TODO: Initialize `name`: - >>> name = '' - >>> - >>> client.delete_job_trigger(name) - - Args: - name (str): Required. Resource name of the project and the triggeredJob, for example - ``projects/dlp-test-project/jobTriggers/53234423``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_job_trigger" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_job_trigger" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_job_trigger, - default_retry=self._method_configs["DeleteJobTrigger"].retry, - default_timeout=self._method_configs["DeleteJobTrigger"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.DeleteJobTriggerRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_job_trigger"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_job_trigger( - self, - name, - job_trigger=None, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates a job trigger. - See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> name = client.project_job_trigger_path('[PROJECT]', '[JOB_TRIGGER]') - >>> - >>> response = client.update_job_trigger(name) - - Args: - name (str): Required. Resource name of the project and the triggeredJob, for example - ``projects/dlp-test-project/jobTriggers/53234423``. - job_trigger (Union[dict, ~google.cloud.dlp_v2.types.JobTrigger]): New JobTrigger value. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.JobTrigger` - update_mask (Union[dict, ~google.cloud.dlp_v2.types.FieldMask]): Mask to control which fields get updated. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.dlp_v2.types.JobTrigger` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_job_trigger" not in self._inner_api_calls: - self._inner_api_calls[ - "update_job_trigger" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_job_trigger, - default_retry=self._method_configs["UpdateJobTrigger"].retry, - default_timeout=self._method_configs["UpdateJobTrigger"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.UpdateJobTriggerRequest( - name=name, job_trigger=job_trigger, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_job_trigger"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_job_trigger( - self, - parent, - job_trigger=None, - trigger_id=None, - location_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a job trigger to run DLP actions such as scanning storage for - sensitive information on a set schedule. - See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> response = client.create_job_trigger(parent) - - Args: - parent (str): Required. The parent resource name, for example projects/my-project-id. - job_trigger (Union[dict, ~google.cloud.dlp_v2.types.JobTrigger]): Required. The JobTrigger to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.JobTrigger` - trigger_id (str): The trigger id can contain uppercase and lowercase letters, numbers, and - hyphens; that is, it must match the regular expression: - ``[a-zA-Z\\d-_]+``. The maximum length is 100 characters. Can be empty - to allow the system to generate one. - location_id (str): The geographic location to store the job trigger. Reserved for - future extensions. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.dlp_v2.types.JobTrigger` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_job_trigger" not in self._inner_api_calls: - self._inner_api_calls[ - "create_job_trigger" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_job_trigger, - default_retry=self._method_configs["CreateJobTrigger"].retry, - default_timeout=self._method_configs["CreateJobTrigger"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.CreateJobTriggerRequest( - parent=parent, - job_trigger=job_trigger, - trigger_id=trigger_id, - location_id=location_id, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_job_trigger"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_stored_info_type( - self, - parent, - config=None, - stored_info_type_id=None, - location_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a pre-built stored infoType to be used for inspection. - See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> parent = client.organization_path('[ORGANIZATION]') - >>> - >>> response = client.create_stored_info_type(parent) - - Args: - parent (str): Required. The parent resource name, for example projects/my-project-id or - organizations/my-org-id. - config (Union[dict, ~google.cloud.dlp_v2.types.StoredInfoTypeConfig]): Required. Configuration of the storedInfoType to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.StoredInfoTypeConfig` - stored_info_type_id (str): The storedInfoType ID can contain uppercase and lowercase letters, - numbers, and hyphens; that is, it must match the regular expression: - ``[a-zA-Z\\d-_]+``. The maximum length is 100 characters. Can be empty - to allow the system to generate one. - location_id (str): The geographic location to store the stored infoType. Reserved for - future extensions. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.dlp_v2.types.StoredInfoType` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_stored_info_type" not in self._inner_api_calls: - self._inner_api_calls[ - "create_stored_info_type" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_stored_info_type, - default_retry=self._method_configs["CreateStoredInfoType"].retry, - default_timeout=self._method_configs["CreateStoredInfoType"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.CreateStoredInfoTypeRequest( - parent=parent, - config=config, - stored_info_type_id=stored_info_type_id, - location_id=location_id, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_stored_info_type"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_stored_info_type( - self, - name, - config=None, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates the stored infoType by creating a new version. The existing version - will continue to be used until the new version is ready. - See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> name = client.organization_stored_info_type_path('[ORGANIZATION]', '[STORED_INFO_TYPE]') - >>> - >>> response = client.update_stored_info_type(name) - - Args: - name (str): Required. Resource name of organization and storedInfoType to be - updated, for example - ``organizations/433245324/storedInfoTypes/432452342`` or - projects/project-id/storedInfoTypes/432452342. - config (Union[dict, ~google.cloud.dlp_v2.types.StoredInfoTypeConfig]): Updated configuration for the storedInfoType. If not provided, a new - version of the storedInfoType will be created with the existing - configuration. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.StoredInfoTypeConfig` - update_mask (Union[dict, ~google.cloud.dlp_v2.types.FieldMask]): Mask to control which fields get updated. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.dlp_v2.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.dlp_v2.types.StoredInfoType` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_stored_info_type" not in self._inner_api_calls: - self._inner_api_calls[ - "update_stored_info_type" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_stored_info_type, - default_retry=self._method_configs["UpdateStoredInfoType"].retry, - default_timeout=self._method_configs["UpdateStoredInfoType"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.UpdateStoredInfoTypeRequest( - name=name, config=config, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_stored_info_type"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_stored_info_type( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a stored infoType. - See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> name = client.organization_stored_info_type_path('[ORGANIZATION]', '[STORED_INFO_TYPE]') - >>> - >>> response = client.get_stored_info_type(name) - - Args: - name (str): Required. Resource name of the organization and storedInfoType to be - read, for example ``organizations/433245324/storedInfoTypes/432452342`` - or projects/project-id/storedInfoTypes/432452342. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.dlp_v2.types.StoredInfoType` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_stored_info_type" not in self._inner_api_calls: - self._inner_api_calls[ - "get_stored_info_type" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_stored_info_type, - default_retry=self._method_configs["GetStoredInfoType"].retry, - default_timeout=self._method_configs["GetStoredInfoType"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.GetStoredInfoTypeRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_stored_info_type"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_stored_info_types( - self, - parent, - page_size=None, - order_by=None, - location_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists stored infoTypes. - See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> parent = client.organization_path('[ORGANIZATION]') - >>> - >>> # Iterate over all results - >>> for element in client.list_stored_info_types(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_stored_info_types(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The parent resource name, for example projects/my-project-id or - organizations/my-org-id. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - order_by (str): Comma separated list of fields to order by, followed by ``asc`` or - ``desc`` postfix. This list is case-insensitive, default sorting order - is ascending, redundant space characters are insignificant. - - Example: ``name asc, display_name, create_time desc`` - - Supported fields are: - - - ``create_time``: corresponds to time the most recent version of the - resource was created. - - ``state``: corresponds to the state of the resource. - - ``name``: corresponds to resource name. - - ``display_name``: corresponds to info type's display name. - location_id (str): The geographic location where stored infoTypes will be retrieved from. - Use ``-`` for all locations. Reserved for future extensions. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.dlp_v2.types.StoredInfoType` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_stored_info_types" not in self._inner_api_calls: - self._inner_api_calls[ - "list_stored_info_types" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_stored_info_types, - default_retry=self._method_configs["ListStoredInfoTypes"].retry, - default_timeout=self._method_configs["ListStoredInfoTypes"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.ListStoredInfoTypesRequest( - parent=parent, - page_size=page_size, - order_by=order_by, - location_id=location_id, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_stored_info_types"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="stored_info_types", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def delete_stored_info_type( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a stored infoType. - See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - learn more. - - Example: - >>> from google.cloud import dlp_v2 - >>> - >>> client = dlp_v2.DlpServiceClient() - >>> - >>> name = client.organization_stored_info_type_path('[ORGANIZATION]', '[STORED_INFO_TYPE]') - >>> - >>> client.delete_stored_info_type(name) - - Args: - name (str): Required. Resource name of the organization and storedInfoType to be - deleted, for example - ``organizations/433245324/storedInfoTypes/432452342`` or - projects/project-id/storedInfoTypes/432452342. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_stored_info_type" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_stored_info_type" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_stored_info_type, - default_retry=self._method_configs["DeleteStoredInfoType"].retry, - default_timeout=self._method_configs["DeleteStoredInfoType"].timeout, - client_info=self._client_info, - ) - - request = dlp_pb2.DeleteStoredInfoTypeRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_stored_info_type"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/dlp/google/cloud/dlp_v2/gapic/dlp_service_client_config.py b/dlp/google/cloud/dlp_v2/gapic/dlp_service_client_config.py deleted file mode 100644 index c0034706ad9d..000000000000 --- a/dlp/google/cloud/dlp_v2/gapic/dlp_service_client_config.py +++ /dev/null @@ -1,173 +0,0 @@ -config = { - "interfaces": { - "google.privacy.dlp.v2.DlpService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "InspectContent": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "RedactImage": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeidentifyContent": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ReidentifyContent": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListInfoTypes": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateInspectTemplate": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateInspectTemplate": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetInspectTemplate": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListInspectTemplates": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteInspectTemplate": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateDeidentifyTemplate": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateDeidentifyTemplate": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetDeidentifyTemplate": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListDeidentifyTemplates": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteDeidentifyTemplate": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateDlpJob": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListDlpJobs": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetDlpJob": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteDlpJob": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CancelDlpJob": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListJobTriggers": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetJobTrigger": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteJobTrigger": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateJobTrigger": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "CreateJobTrigger": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "CreateStoredInfoType": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateStoredInfoType": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetStoredInfoType": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListStoredInfoTypes": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteStoredInfoType": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/dlp/google/cloud/dlp_v2/gapic/enums.py b/dlp/google/cloud/dlp_v2/gapic/enums.py deleted file mode 100644 index 78af7f466746..000000000000 --- a/dlp/google/cloud/dlp_v2/gapic/enums.py +++ /dev/null @@ -1,456 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class ContentOption(enum.IntEnum): - """ - Options describing which parts of the provided content should be scanned. - - Attributes: - CONTENT_UNSPECIFIED (int): Includes entire content of a file or a data stream. - CONTENT_TEXT (int): Text content within the data, excluding any metadata. - CONTENT_IMAGE (int): Images found in the data. - """ - - CONTENT_UNSPECIFIED = 0 - CONTENT_TEXT = 1 - CONTENT_IMAGE = 2 - - -class DayOfWeek(enum.IntEnum): - """ - Represents a day of week. - - Attributes: - DAY_OF_WEEK_UNSPECIFIED (int): The unspecified day-of-week. - MONDAY (int): The day-of-week of Monday. - TUESDAY (int): The day-of-week of Tuesday. - WEDNESDAY (int): The day-of-week of Wednesday. - THURSDAY (int): The day-of-week of Thursday. - FRIDAY (int): The day-of-week of Friday. - SATURDAY (int): The day-of-week of Saturday. - SUNDAY (int): The day-of-week of Sunday. - """ - - DAY_OF_WEEK_UNSPECIFIED = 0 - MONDAY = 1 - TUESDAY = 2 - WEDNESDAY = 3 - THURSDAY = 4 - FRIDAY = 5 - SATURDAY = 6 - SUNDAY = 7 - - -class DlpJobType(enum.IntEnum): - """ - An enum to represent the various types of DLP jobs. - - Attributes: - DLP_JOB_TYPE_UNSPECIFIED (int): Unused - INSPECT_JOB (int): The job inspected Google Cloud for sensitive data. - RISK_ANALYSIS_JOB (int): The job executed a Risk Analysis computation. - """ - - DLP_JOB_TYPE_UNSPECIFIED = 0 - INSPECT_JOB = 1 - RISK_ANALYSIS_JOB = 2 - - -class FileType(enum.IntEnum): - """ - Definitions of file type groups to scan. - - Attributes: - FILE_TYPE_UNSPECIFIED (int): Includes all files. - BINARY_FILE (int): Includes all file extensions not covered by text file types. - TEXT_FILE (int): Included file extensions: - asc, brf, c, cc, cpp, csv, cxx, c++, cs, css, dart, eml, go, h, hh, hpp, - hxx, h++, hs, html, htm, shtml, shtm, xhtml, lhs, ini, java, js, json, - ocaml, md, mkd, markdown, m, ml, mli, pl, pm, php, phtml, pht, py, pyw, - rb, rbw, rs, rc, scala, sh, sql, tex, txt, text, tsv, vcard, vcs, wml, - xml, xsl, xsd, yml, yaml. - IMAGE (int): Included file extensions: bmp, gif, jpg, jpeg, jpe, png. - bytes\_limit\_per\_file has no effect on image files. - AVRO (int): Included file extensions: - avro - """ - - FILE_TYPE_UNSPECIFIED = 0 - BINARY_FILE = 1 - TEXT_FILE = 2 - IMAGE = 3 - AVRO = 7 - - -class InfoTypeSupportedBy(enum.IntEnum): - """ - Parts of the APIs which use certain infoTypes. - - Attributes: - ENUM_TYPE_UNSPECIFIED (int): Unused. - INSPECT (int): Supported by the inspect operations. - RISK_ANALYSIS (int): Supported by the risk analysis operations. - """ - - ENUM_TYPE_UNSPECIFIED = 0 - INSPECT = 1 - RISK_ANALYSIS = 2 - - -class Likelihood(enum.IntEnum): - """ - Categorization of results based on how likely they are to represent a match, - based on the number of elements they contain which imply a match. - - Attributes: - LIKELIHOOD_UNSPECIFIED (int): Default value; same as POSSIBLE. - VERY_UNLIKELY (int): Few matching elements. - UNLIKELY (int) - POSSIBLE (int): Some matching elements. - LIKELY (int) - VERY_LIKELY (int): Many matching elements. - """ - - LIKELIHOOD_UNSPECIFIED = 0 - VERY_UNLIKELY = 1 - UNLIKELY = 2 - POSSIBLE = 3 - LIKELY = 4 - VERY_LIKELY = 5 - - -class MatchingType(enum.IntEnum): - """ - Type of the match which can be applied to different ways of matching, like - Dictionary, regular expression and intersecting with findings of another - info type. - - Attributes: - MATCHING_TYPE_UNSPECIFIED (int): Invalid. - MATCHING_TYPE_FULL_MATCH (int): Full match. - - - Dictionary: join of Dictionary results matched complete finding quote - - Regex: all regex matches fill a finding quote start to end - - Exclude info type: completely inside affecting info types findings - MATCHING_TYPE_PARTIAL_MATCH (int): Partial match. - - - Dictionary: at least one of the tokens in the finding matches - - Regex: substring of the finding matches - - Exclude info type: intersects with affecting info types findings - MATCHING_TYPE_INVERSE_MATCH (int): Inverse match. - - - Dictionary: no tokens in the finding match the dictionary - - Regex: finding doesn't match the regex - - Exclude info type: no intersection with affecting info types findings - """ - - MATCHING_TYPE_UNSPECIFIED = 0 - MATCHING_TYPE_FULL_MATCH = 1 - MATCHING_TYPE_PARTIAL_MATCH = 2 - MATCHING_TYPE_INVERSE_MATCH = 3 - - -class RelationalOperator(enum.IntEnum): - """ - Operators available for comparing the value of fields. - - Attributes: - RELATIONAL_OPERATOR_UNSPECIFIED (int): Unused - EQUAL_TO (int): Equal. Attempts to match even with incompatible types. - NOT_EQUAL_TO (int): Not equal to. Attempts to match even with incompatible types. - GREATER_THAN (int): Greater than. - LESS_THAN (int): Less than. - GREATER_THAN_OR_EQUALS (int): Greater than or equals. - LESS_THAN_OR_EQUALS (int): Less than or equals. - EXISTS (int): Exists - """ - - RELATIONAL_OPERATOR_UNSPECIFIED = 0 - EQUAL_TO = 1 - NOT_EQUAL_TO = 2 - GREATER_THAN = 3 - LESS_THAN = 4 - GREATER_THAN_OR_EQUALS = 5 - LESS_THAN_OR_EQUALS = 6 - EXISTS = 7 - - -class StoredInfoTypeState(enum.IntEnum): - """ - State of a StoredInfoType version. - - Attributes: - STORED_INFO_TYPE_STATE_UNSPECIFIED (int): Unused - PENDING (int): StoredInfoType version is being created. - READY (int): StoredInfoType version is ready for use. - FAILED (int): StoredInfoType creation failed. All relevant error messages are returned - in the ``StoredInfoTypeVersion`` message. - INVALID (int): StoredInfoType is no longer valid because artifacts stored in - user-controlled storage were modified. To fix an invalid StoredInfoType, - use the ``UpdateStoredInfoType`` method to create a new version. - """ - - STORED_INFO_TYPE_STATE_UNSPECIFIED = 0 - PENDING = 1 - READY = 2 - FAILED = 3 - INVALID = 4 - - -class BigQueryOptions(object): - class SampleMethod(enum.IntEnum): - """ - How to sample rows if not all rows are scanned. Meaningful only when - used in conjunction with either rows\_limit or rows\_limit\_percent. If - not specified, scanning would start from the top. - - Attributes: - SAMPLE_METHOD_UNSPECIFIED (int) - TOP (int): Scan from the top (default). - RANDOM_START (int): Randomly pick the row to start scanning. The scanned rows are contiguous. - """ - - SAMPLE_METHOD_UNSPECIFIED = 0 - TOP = 1 - RANDOM_START = 2 - - -class ByteContentItem(object): - class BytesType(enum.IntEnum): - """ - The type of data being sent to in data. - - Attributes: - BYTES_TYPE_UNSPECIFIED (int): Unused - IMAGE (int): Any image type. - IMAGE_JPEG (int): jpeg - IMAGE_BMP (int): bmp - IMAGE_PNG (int): png - IMAGE_SVG (int): svg - TEXT_UTF8 (int): plain text - AVRO (int): avro - """ - - BYTES_TYPE_UNSPECIFIED = 0 - IMAGE = 6 - IMAGE_JPEG = 1 - IMAGE_BMP = 2 - IMAGE_PNG = 3 - IMAGE_SVG = 4 - TEXT_UTF8 = 5 - AVRO = 11 - - -class CharsToIgnore(object): - class CommonCharsToIgnore(enum.IntEnum): - """ - Convenience enum for indication common characters to not transform. - - Attributes: - COMMON_CHARS_TO_IGNORE_UNSPECIFIED (int): Unused. - NUMERIC (int): 0-9 - ALPHA_UPPER_CASE (int): A-Z - ALPHA_LOWER_CASE (int): a-z - PUNCTUATION (int): US Punctuation, one of !"#$%&'()\*+,-./:;<=>?@[]^\_\`{\|}~ - WHITESPACE (int): Whitespace character - """ - - COMMON_CHARS_TO_IGNORE_UNSPECIFIED = 0 - NUMERIC = 1 - ALPHA_UPPER_CASE = 2 - ALPHA_LOWER_CASE = 3 - PUNCTUATION = 4 - WHITESPACE = 5 - - -class CloudStorageOptions(object): - class SampleMethod(enum.IntEnum): - """ - How to sample bytes if not all bytes are scanned. Meaningful only when - used in conjunction with bytes\_limit\_per\_file. If not specified, - scanning would start from the top. - - Attributes: - SAMPLE_METHOD_UNSPECIFIED (int) - TOP (int): Scan from the top (default). - RANDOM_START (int): For each file larger than bytes\_limit\_per\_file, randomly pick the - offset to start scanning. The scanned bytes are contiguous. - """ - - SAMPLE_METHOD_UNSPECIFIED = 0 - TOP = 1 - RANDOM_START = 2 - - -class CryptoReplaceFfxFpeConfig(object): - class FfxCommonNativeAlphabet(enum.IntEnum): - """ - These are commonly used subsets of the alphabet that the FFX mode - natively supports. In the algorithm, the alphabet is selected using - the "radix". Therefore each corresponds to particular radix. - - Attributes: - FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED (int): Unused. - NUMERIC (int): [0-9] (radix of 10) - HEXADECIMAL (int): [0-9A-F] (radix of 16) - UPPER_CASE_ALPHA_NUMERIC (int): [0-9A-Z] (radix of 36) - ALPHA_NUMERIC (int): [0-9A-Za-z] (radix of 62) - """ - - FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED = 0 - NUMERIC = 1 - HEXADECIMAL = 2 - UPPER_CASE_ALPHA_NUMERIC = 3 - ALPHA_NUMERIC = 4 - - -class CustomInfoType(object): - class ExclusionType(enum.IntEnum): - """ - Attributes: - EXCLUSION_TYPE_UNSPECIFIED (int): A finding of this custom info type will not be excluded from results. - EXCLUSION_TYPE_EXCLUDE (int): A finding of this custom info type will be excluded from final results, - but can still affect rule execution. - """ - - EXCLUSION_TYPE_UNSPECIFIED = 0 - EXCLUSION_TYPE_EXCLUDE = 1 - - -class DlpJob(object): - class JobState(enum.IntEnum): - """ - Possible states of a job. - - Attributes: - JOB_STATE_UNSPECIFIED (int): Unused. - PENDING (int): The job has not yet started. - RUNNING (int): The job is currently running. - DONE (int): The job is no longer running. - CANCELED (int): The job was canceled before it could complete. - FAILED (int): The job had an error and did not complete. - """ - - JOB_STATE_UNSPECIFIED = 0 - PENDING = 1 - RUNNING = 2 - DONE = 3 - CANCELED = 4 - FAILED = 5 - - -class JobTrigger(object): - class Status(enum.IntEnum): - """ - Whether the trigger is currently active. If PAUSED or CANCELLED, no jobs - will be created with this configuration. The service may automatically - pause triggers experiencing frequent errors. To restart a job, set the - status to HEALTHY after correcting user errors. - - Attributes: - STATUS_UNSPECIFIED (int): Unused. - HEALTHY (int): Trigger is healthy. - PAUSED (int): Trigger is temporarily paused. - CANCELLED (int): Trigger is cancelled and can not be resumed. - """ - - STATUS_UNSPECIFIED = 0 - HEALTHY = 1 - PAUSED = 2 - CANCELLED = 3 - - -class OutputStorageConfig(object): - class OutputSchema(enum.IntEnum): - """ - Predefined schemas for storing findings. - - Attributes: - OUTPUT_SCHEMA_UNSPECIFIED (int): Unused. - BASIC_COLUMNS (int): Basic schema including only ``info_type``, ``quote``, ``certainty``, and - ``timestamp``. - GCS_COLUMNS (int): Schema tailored to findings from scanning Google Cloud Storage. - DATASTORE_COLUMNS (int): Schema tailored to findings from scanning Google Datastore. - BIG_QUERY_COLUMNS (int): Schema tailored to findings from scanning Google BigQuery. - ALL_COLUMNS (int): Schema containing all columns. - """ - - OUTPUT_SCHEMA_UNSPECIFIED = 0 - BASIC_COLUMNS = 1 - GCS_COLUMNS = 2 - DATASTORE_COLUMNS = 3 - BIG_QUERY_COLUMNS = 4 - ALL_COLUMNS = 5 - - -class RecordCondition(object): - class Expressions(object): - class LogicalOperator(enum.IntEnum): - """ - Logical operators for conditional checks. - - Attributes: - LOGICAL_OPERATOR_UNSPECIFIED (int): Unused - AND (int): Conditional AND - """ - - LOGICAL_OPERATOR_UNSPECIFIED = 0 - AND = 1 - - -class TimePartConfig(object): - class TimePart(enum.IntEnum): - """ - Components that make up time. - - Attributes: - TIME_PART_UNSPECIFIED (int): Unused - YEAR (int): [0-9999] - MONTH (int): [1-12] - DAY_OF_MONTH (int): [1-31] - DAY_OF_WEEK (int): [1-7] - WEEK_OF_YEAR (int): [1-53] - HOUR_OF_DAY (int): [0-23] - """ - - TIME_PART_UNSPECIFIED = 0 - YEAR = 1 - MONTH = 2 - DAY_OF_MONTH = 3 - DAY_OF_WEEK = 4 - WEEK_OF_YEAR = 5 - HOUR_OF_DAY = 6 - - -class TransformationSummary(object): - class TransformationResultCode(enum.IntEnum): - """ - Possible outcomes of transformations. - - Attributes: - TRANSFORMATION_RESULT_CODE_UNSPECIFIED (int): Unused - SUCCESS (int): Transformation completed without an error. - ERROR (int): Transformation had an error. - """ - - TRANSFORMATION_RESULT_CODE_UNSPECIFIED = 0 - SUCCESS = 1 - ERROR = 2 diff --git a/dlp/google/cloud/dlp_v2/gapic/transports/__init__.py b/dlp/google/cloud/dlp_v2/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/dlp/google/cloud/dlp_v2/gapic/transports/dlp_service_grpc_transport.py b/dlp/google/cloud/dlp_v2/gapic/transports/dlp_service_grpc_transport.py deleted file mode 100644 index c32a3f44b4be..000000000000 --- a/dlp/google/cloud/dlp_v2/gapic/transports/dlp_service_grpc_transport.py +++ /dev/null @@ -1,574 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers - -from google.cloud.dlp_v2.proto import dlp_pb2_grpc - - -class DlpServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.privacy.dlp.v2 DlpService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="dlp.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = {"dlp_service_stub": dlp_pb2_grpc.DlpServiceStub(channel)} - - @classmethod - def create_channel( - cls, address="dlp.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def inspect_content(self): - """Return the gRPC stub for :meth:`DlpServiceClient.inspect_content`. - - Finds potentially sensitive info in content. - This method has limits on input size, processing time, and output size. - - When no InfoTypes or CustomInfoTypes are specified in this request, the - system will automatically choose what detectors to run. By default this may - be all types, but may change over time as detectors are updated. - - For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images - and https://cloud.google.com/dlp/docs/inspecting-text, - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].InspectContent - - @property - def redact_image(self): - """Return the gRPC stub for :meth:`DlpServiceClient.redact_image`. - - Redacts potentially sensitive info from an image. - This method has limits on input size, processing time, and output size. - See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images to - learn more. - - When no InfoTypes or CustomInfoTypes are specified in this request, the - system will automatically choose what detectors to run. By default this may - be all types, but may change over time as detectors are updated. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].RedactImage - - @property - def deidentify_content(self): - """Return the gRPC stub for :meth:`DlpServiceClient.deidentify_content`. - - De-identifies potentially sensitive info from a ContentItem. - This method has limits on input size and output size. - See https://cloud.google.com/dlp/docs/deidentify-sensitive-data to - learn more. - - When no InfoTypes or CustomInfoTypes are specified in this request, the - system will automatically choose what detectors to run. By default this may - be all types, but may change over time as detectors are updated. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].DeidentifyContent - - @property - def reidentify_content(self): - """Return the gRPC stub for :meth:`DlpServiceClient.reidentify_content`. - - Re-identifies content that has been de-identified. See - https://cloud.google.com/dlp/docs/pseudonymization#re-identification\_in\_free\_text\_code\_example - to learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].ReidentifyContent - - @property - def list_info_types(self): - """Return the gRPC stub for :meth:`DlpServiceClient.list_info_types`. - - Returns a list of the sensitive information types that the DLP API - supports. See https://cloud.google.com/dlp/docs/infotypes-reference to - learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].ListInfoTypes - - @property - def create_inspect_template(self): - """Return the gRPC stub for :meth:`DlpServiceClient.create_inspect_template`. - - Creates an InspectTemplate for re-using frequently used configuration - for inspecting content, images, and storage. - See https://cloud.google.com/dlp/docs/creating-templates to learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].CreateInspectTemplate - - @property - def update_inspect_template(self): - """Return the gRPC stub for :meth:`DlpServiceClient.update_inspect_template`. - - Updates the InspectTemplate. - See https://cloud.google.com/dlp/docs/creating-templates to learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].UpdateInspectTemplate - - @property - def get_inspect_template(self): - """Return the gRPC stub for :meth:`DlpServiceClient.get_inspect_template`. - - Gets an InspectTemplate. - See https://cloud.google.com/dlp/docs/creating-templates to learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].GetInspectTemplate - - @property - def list_inspect_templates(self): - """Return the gRPC stub for :meth:`DlpServiceClient.list_inspect_templates`. - - Lists InspectTemplates. - See https://cloud.google.com/dlp/docs/creating-templates to learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].ListInspectTemplates - - @property - def delete_inspect_template(self): - """Return the gRPC stub for :meth:`DlpServiceClient.delete_inspect_template`. - - Deletes an InspectTemplate. - See https://cloud.google.com/dlp/docs/creating-templates to learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].DeleteInspectTemplate - - @property - def create_deidentify_template(self): - """Return the gRPC stub for :meth:`DlpServiceClient.create_deidentify_template`. - - Creates a DeidentifyTemplate for re-using frequently used configuration - for de-identifying content, images, and storage. - See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].CreateDeidentifyTemplate - - @property - def update_deidentify_template(self): - """Return the gRPC stub for :meth:`DlpServiceClient.update_deidentify_template`. - - Updates the DeidentifyTemplate. - See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].UpdateDeidentifyTemplate - - @property - def get_deidentify_template(self): - """Return the gRPC stub for :meth:`DlpServiceClient.get_deidentify_template`. - - Gets a DeidentifyTemplate. - See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].GetDeidentifyTemplate - - @property - def list_deidentify_templates(self): - """Return the gRPC stub for :meth:`DlpServiceClient.list_deidentify_templates`. - - Lists DeidentifyTemplates. - See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].ListDeidentifyTemplates - - @property - def delete_deidentify_template(self): - """Return the gRPC stub for :meth:`DlpServiceClient.delete_deidentify_template`. - - Deletes a DeidentifyTemplate. - See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].DeleteDeidentifyTemplate - - @property - def create_dlp_job(self): - """Return the gRPC stub for :meth:`DlpServiceClient.create_dlp_job`. - - Creates a new job to inspect storage or calculate risk metrics. - See https://cloud.google.com/dlp/docs/inspecting-storage and - https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. - - When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the - system will automatically choose what detectors to run. By default this may - be all types, but may change over time as detectors are updated. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].CreateDlpJob - - @property - def list_dlp_jobs(self): - """Return the gRPC stub for :meth:`DlpServiceClient.list_dlp_jobs`. - - Lists DlpJobs that match the specified filter in the request. - See https://cloud.google.com/dlp/docs/inspecting-storage and - https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].ListDlpJobs - - @property - def get_dlp_job(self): - """Return the gRPC stub for :meth:`DlpServiceClient.get_dlp_job`. - - Gets the latest state of a long-running DlpJob. - See https://cloud.google.com/dlp/docs/inspecting-storage and - https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].GetDlpJob - - @property - def delete_dlp_job(self): - """Return the gRPC stub for :meth:`DlpServiceClient.delete_dlp_job`. - - Deletes a long-running DlpJob. This method indicates that the client is - no longer interested in the DlpJob result. The job will be cancelled if - possible. - See https://cloud.google.com/dlp/docs/inspecting-storage and - https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].DeleteDlpJob - - @property - def cancel_dlp_job(self): - """Return the gRPC stub for :meth:`DlpServiceClient.cancel_dlp_job`. - - Starts asynchronous cancellation on a long-running DlpJob. The server - makes a best effort to cancel the DlpJob, but success is not - guaranteed. - See https://cloud.google.com/dlp/docs/inspecting-storage and - https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].CancelDlpJob - - @property - def list_job_triggers(self): - """Return the gRPC stub for :meth:`DlpServiceClient.list_job_triggers`. - - Lists job triggers. - See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].ListJobTriggers - - @property - def get_job_trigger(self): - """Return the gRPC stub for :meth:`DlpServiceClient.get_job_trigger`. - - Gets a job trigger. - See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].GetJobTrigger - - @property - def delete_job_trigger(self): - """Return the gRPC stub for :meth:`DlpServiceClient.delete_job_trigger`. - - Deletes a job trigger. - See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].DeleteJobTrigger - - @property - def update_job_trigger(self): - """Return the gRPC stub for :meth:`DlpServiceClient.update_job_trigger`. - - Updates a job trigger. - See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].UpdateJobTrigger - - @property - def create_job_trigger(self): - """Return the gRPC stub for :meth:`DlpServiceClient.create_job_trigger`. - - Creates a job trigger to run DLP actions such as scanning storage for - sensitive information on a set schedule. - See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].CreateJobTrigger - - @property - def create_stored_info_type(self): - """Return the gRPC stub for :meth:`DlpServiceClient.create_stored_info_type`. - - Creates a pre-built stored infoType to be used for inspection. - See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].CreateStoredInfoType - - @property - def update_stored_info_type(self): - """Return the gRPC stub for :meth:`DlpServiceClient.update_stored_info_type`. - - Updates the stored infoType by creating a new version. The existing version - will continue to be used until the new version is ready. - See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].UpdateStoredInfoType - - @property - def get_stored_info_type(self): - """Return the gRPC stub for :meth:`DlpServiceClient.get_stored_info_type`. - - Gets a stored infoType. - See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].GetStoredInfoType - - @property - def list_stored_info_types(self): - """Return the gRPC stub for :meth:`DlpServiceClient.list_stored_info_types`. - - Lists stored infoTypes. - See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].ListStoredInfoTypes - - @property - def delete_stored_info_type(self): - """Return the gRPC stub for :meth:`DlpServiceClient.delete_stored_info_type`. - - Deletes a stored infoType. - See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - learn more. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["dlp_service_stub"].DeleteStoredInfoType diff --git a/dlp/google/cloud/dlp_v2/proto/__init__.py b/dlp/google/cloud/dlp_v2/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/dlp/google/cloud/dlp_v2/proto/dlp.proto b/dlp/google/cloud/dlp_v2/proto/dlp.proto deleted file mode 100644 index 0dc4119b8adf..000000000000 --- a/dlp/google/cloud/dlp_v2/proto/dlp.proto +++ /dev/null @@ -1,3775 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.privacy.dlp.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/privacy/dlp/v2/storage.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; -import "google/type/date.proto"; -import "google/type/dayofweek.proto"; -import "google/type/timeofday.proto"; - -option csharp_namespace = "Google.Cloud.Dlp.V2"; -option go_package = "google.golang.org/genproto/googleapis/privacy/dlp/v2;dlp"; -option java_multiple_files = true; -option java_outer_classname = "DlpProto"; -option java_package = "com.google.privacy.dlp.v2"; -option php_namespace = "Google\\Cloud\\Dlp\\V2"; - -// The Cloud Data Loss Prevention (DLP) API is a service that allows clients -// to detect the presence of Personally Identifiable Information (PII) and other -// privacy-sensitive data in user-supplied, unstructured data streams, like text -// blocks or images. -// The service also includes methods for sensitive data redaction and -// scheduling of data scans on Google Cloud Platform based data sets. -// -// To learn more about concepts and find how-to guides see -// https://cloud.google.com/dlp/docs/. -service DlpService { - option (google.api.default_host) = "dlp.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Finds potentially sensitive info in content. - // This method has limits on input size, processing time, and output size. - // - // When no InfoTypes or CustomInfoTypes are specified in this request, the - // system will automatically choose what detectors to run. By default this may - // be all types, but may change over time as detectors are updated. - // - // For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images - // and https://cloud.google.com/dlp/docs/inspecting-text, - rpc InspectContent(InspectContentRequest) returns (InspectContentResponse) { - option (google.api.http) = { - post: "/v2/{parent=projects/*}/content:inspect" - body: "*" - additional_bindings { - post: "/v2/{parent=projects/*}/locations/{location_id}/content:inspect" - body: "*" - } - }; - } - - // Redacts potentially sensitive info from an image. - // This method has limits on input size, processing time, and output size. - // See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images to - // learn more. - // - // When no InfoTypes or CustomInfoTypes are specified in this request, the - // system will automatically choose what detectors to run. By default this may - // be all types, but may change over time as detectors are updated. - rpc RedactImage(RedactImageRequest) returns (RedactImageResponse) { - option (google.api.http) = { - post: "/v2/{parent=projects/*}/image:redact" - body: "*" - additional_bindings { - post: "/v2/{parent=projects/*}/locations/{location_id}/image:redact" - body: "*" - } - }; - } - - // De-identifies potentially sensitive info from a ContentItem. - // This method has limits on input size and output size. - // See https://cloud.google.com/dlp/docs/deidentify-sensitive-data to - // learn more. - // - // When no InfoTypes or CustomInfoTypes are specified in this request, the - // system will automatically choose what detectors to run. By default this may - // be all types, but may change over time as detectors are updated. - rpc DeidentifyContent(DeidentifyContentRequest) returns (DeidentifyContentResponse) { - option (google.api.http) = { - post: "/v2/{parent=projects/*}/content:deidentify" - body: "*" - additional_bindings { - post: "/v2/{parent=projects/*}/locations/{location_id}/content:deidentify" - body: "*" - } - }; - } - - // Re-identifies content that has been de-identified. - // See - // https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example - // to learn more. - rpc ReidentifyContent(ReidentifyContentRequest) returns (ReidentifyContentResponse) { - option (google.api.http) = { - post: "/v2/{parent=projects/*}/content:reidentify" - body: "*" - additional_bindings { - post: "/v2/{parent=projects/*}/locations/{location_id}/content:reidentify" - body: "*" - } - }; - } - - // Returns a list of the sensitive information types that the DLP API - // supports. See https://cloud.google.com/dlp/docs/infotypes-reference to - // learn more. - rpc ListInfoTypes(ListInfoTypesRequest) returns (ListInfoTypesResponse) { - option (google.api.http) = { - get: "/v2/infoTypes" - additional_bindings { - get: "/v2/locations/{location_id}/infoTypes" - } - }; - option (google.api.method_signature) = "location_id"; - } - - // Creates an InspectTemplate for re-using frequently used configuration - // for inspecting content, images, and storage. - // See https://cloud.google.com/dlp/docs/creating-templates to learn more. - rpc CreateInspectTemplate(CreateInspectTemplateRequest) returns (InspectTemplate) { - option (google.api.http) = { - post: "/v2/{parent=organizations/*}/inspectTemplates" - body: "*" - additional_bindings { - post: "/v2/{parent=organizations/*}/locations/{location_id}/inspectTemplates" - body: "*" - } - additional_bindings { - post: "/v2/{parent=projects/*}/inspectTemplates" - body: "*" - } - additional_bindings { - post: "/v2/{parent=projects/*}/locations/{location_id}/inspectTemplates" - body: "*" - } - }; - option (google.api.method_signature) = "parent,inspect_template"; - option (google.api.method_signature) = "parent,inspect_template,location_id"; - } - - // Updates the InspectTemplate. - // See https://cloud.google.com/dlp/docs/creating-templates to learn more. - rpc UpdateInspectTemplate(UpdateInspectTemplateRequest) returns (InspectTemplate) { - option (google.api.http) = { - patch: "/v2/{name=organizations/*/inspectTemplates/*}" - body: "*" - additional_bindings { - patch: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}" - body: "*" - } - additional_bindings { - patch: "/v2/{name=projects/*/inspectTemplates/*}" - body: "*" - } - additional_bindings { - patch: "/v2/{name=projects/*/locations/*/inspectTemplates/*}" - body: "*" - } - }; - option (google.api.method_signature) = "name,inspect_template,update_mask"; - } - - // Gets an InspectTemplate. - // See https://cloud.google.com/dlp/docs/creating-templates to learn more. - rpc GetInspectTemplate(GetInspectTemplateRequest) returns (InspectTemplate) { - option (google.api.http) = { - get: "/v2/{name=organizations/*/inspectTemplates/*}" - additional_bindings { - get: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}" - } - additional_bindings { - get: "/v2/{name=projects/*/inspectTemplates/*}" - } - additional_bindings { - get: "/v2/{name=projects/*/locations/*/inspectTemplates/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists InspectTemplates. - // See https://cloud.google.com/dlp/docs/creating-templates to learn more. - rpc ListInspectTemplates(ListInspectTemplatesRequest) returns (ListInspectTemplatesResponse) { - option (google.api.http) = { - get: "/v2/{parent=organizations/*}/inspectTemplates" - additional_bindings { - get: "/v2/{parent=organizations/*}/locations/{location_id}/inspectTemplates" - } - additional_bindings { - get: "/v2/{parent=projects/*}/inspectTemplates" - } - additional_bindings { - get: "/v2/{parent=projects/*}/locations/{location_id}/inspectTemplates" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes an InspectTemplate. - // See https://cloud.google.com/dlp/docs/creating-templates to learn more. - rpc DeleteInspectTemplate(DeleteInspectTemplateRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=organizations/*/inspectTemplates/*}" - additional_bindings { - delete: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}" - } - additional_bindings { - delete: "/v2/{name=projects/*/inspectTemplates/*}" - } - additional_bindings { - delete: "/v2/{name=projects/*/locations/*/inspectTemplates/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Creates a DeidentifyTemplate for re-using frequently used configuration - // for de-identifying content, images, and storage. - // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - // more. - rpc CreateDeidentifyTemplate(CreateDeidentifyTemplateRequest) returns (DeidentifyTemplate) { - option (google.api.http) = { - post: "/v2/{parent=organizations/*}/deidentifyTemplates" - body: "*" - additional_bindings { - post: "/v2/{parent=organizations/*}/locations/{location_id}/deidentifyTemplates" - body: "*" - } - additional_bindings { - post: "/v2/{parent=projects/*}/deidentifyTemplates" - body: "*" - } - additional_bindings { - post: "/v2/{parent=projects/*}/locations/{location_id}/deidentifyTemplates" - body: "*" - } - }; - option (google.api.method_signature) = "parent,deidentify_template"; - option (google.api.method_signature) = "parent,deidentify_template,location_id"; - } - - // Updates the DeidentifyTemplate. - // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - // more. - rpc UpdateDeidentifyTemplate(UpdateDeidentifyTemplateRequest) returns (DeidentifyTemplate) { - option (google.api.http) = { - patch: "/v2/{name=organizations/*/deidentifyTemplates/*}" - body: "*" - additional_bindings { - patch: "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}" - body: "*" - } - additional_bindings { - patch: "/v2/{name=projects/*/deidentifyTemplates/*}" - body: "*" - } - additional_bindings { - patch: "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}" - body: "*" - } - }; - option (google.api.method_signature) = "name,deidentify_template,update_mask"; - } - - // Gets a DeidentifyTemplate. - // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - // more. - rpc GetDeidentifyTemplate(GetDeidentifyTemplateRequest) returns (DeidentifyTemplate) { - option (google.api.http) = { - get: "/v2/{name=organizations/*/deidentifyTemplates/*}" - additional_bindings { - get: "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}" - } - additional_bindings { - get: "/v2/{name=projects/*/deidentifyTemplates/*}" - } - additional_bindings { - get: "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists DeidentifyTemplates. - // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - // more. - rpc ListDeidentifyTemplates(ListDeidentifyTemplatesRequest) returns (ListDeidentifyTemplatesResponse) { - option (google.api.http) = { - get: "/v2/{parent=organizations/*}/deidentifyTemplates" - additional_bindings { - get: "/v2/{parent=organizations/*}/locations/{location_id}/deidentifyTemplates" - } - additional_bindings { - get: "/v2/{parent=projects/*}/deidentifyTemplates" - } - additional_bindings { - get: "/v2/{parent=projects/*}/locations/{location_id}/deidentifyTemplates" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a DeidentifyTemplate. - // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn - // more. - rpc DeleteDeidentifyTemplate(DeleteDeidentifyTemplateRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=organizations/*/deidentifyTemplates/*}" - additional_bindings { - delete: "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}" - } - additional_bindings { - delete: "/v2/{name=projects/*/deidentifyTemplates/*}" - } - additional_bindings { - delete: "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Creates a job trigger to run DLP actions such as scanning storage for - // sensitive information on a set schedule. - // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - rpc CreateJobTrigger(CreateJobTriggerRequest) returns (JobTrigger) { - option (google.api.http) = { - post: "/v2/{parent=projects/*}/jobTriggers" - body: "*" - additional_bindings { - post: "/v2/{parent=projects/*}/locations/{location_id}/jobTriggers" - body: "*" - } - }; - option (google.api.method_signature) = "parent,job_trigger"; - option (google.api.method_signature) = "parent,job_trigger,location_id"; - } - - // Updates a job trigger. - // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - rpc UpdateJobTrigger(UpdateJobTriggerRequest) returns (JobTrigger) { - option (google.api.http) = { - patch: "/v2/{name=projects/*/jobTriggers/*}" - body: "*" - additional_bindings { - patch: "/v2/{name=projects/*/locations/*/jobTriggers/*}" - body: "*" - } - }; - option (google.api.method_signature) = "name,job_trigger,update_mask"; - } - - // Gets a job trigger. - // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - rpc GetJobTrigger(GetJobTriggerRequest) returns (JobTrigger) { - option (google.api.http) = { - get: "/v2/{name=projects/*/jobTriggers/*}" - additional_bindings { - get: "/v2/{name=projects/*/locations/*/jobTriggers/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists job triggers. - // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - rpc ListJobTriggers(ListJobTriggersRequest) returns (ListJobTriggersResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*}/jobTriggers" - additional_bindings { - get: "/v2/{parent=projects/*}/locations/{location_id}/jobTriggers" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a job trigger. - // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more. - rpc DeleteJobTrigger(DeleteJobTriggerRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/jobTriggers/*}" - additional_bindings { - delete: "/v2/{name=projects/*/locations/*/jobTriggers/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Activate a job trigger. Causes the immediate execute of a trigger - // instead of waiting on the trigger event to occur. - rpc ActivateJobTrigger(ActivateJobTriggerRequest) returns (DlpJob) { - option (google.api.http) = { - post: "/v2/{name=projects/*/jobTriggers/*}:activate" - body: "*" - additional_bindings { - post: "/v2/{name=projects/*/locations/*/jobTriggers/*}:activate" - body: "*" - } - }; - } - - // Creates a new job to inspect storage or calculate risk metrics. - // See https://cloud.google.com/dlp/docs/inspecting-storage and - // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. - // - // When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the - // system will automatically choose what detectors to run. By default this may - // be all types, but may change over time as detectors are updated. - rpc CreateDlpJob(CreateDlpJobRequest) returns (DlpJob) { - option (google.api.http) = { - post: "/v2/{parent=projects/*}/dlpJobs" - body: "*" - additional_bindings { - post: "/v2/{parent=projects/*}/locations/{location_id}/dlpJobs" - body: "*" - } - }; - option (google.api.method_signature) = "parent,inspect_job"; - option (google.api.method_signature) = "parent,inspect_job,location_id"; - option (google.api.method_signature) = "parent,risk_job"; - option (google.api.method_signature) = "parent,risk_job,location_id"; - } - - // Lists DlpJobs that match the specified filter in the request. - // See https://cloud.google.com/dlp/docs/inspecting-storage and - // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. - rpc ListDlpJobs(ListDlpJobsRequest) returns (ListDlpJobsResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*}/dlpJobs" - additional_bindings { - get: "/v2/{parent=projects/*}/locations/{location_id}/dlpJobs" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Gets the latest state of a long-running DlpJob. - // See https://cloud.google.com/dlp/docs/inspecting-storage and - // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. - rpc GetDlpJob(GetDlpJobRequest) returns (DlpJob) { - option (google.api.http) = { - get: "/v2/{name=projects/*/dlpJobs/*}" - additional_bindings { - get: "/v2/{name=projects/*/locations/*/dlpJobs/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Deletes a long-running DlpJob. This method indicates that the client is - // no longer interested in the DlpJob result. The job will be cancelled if - // possible. - // See https://cloud.google.com/dlp/docs/inspecting-storage and - // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. - rpc DeleteDlpJob(DeleteDlpJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/dlpJobs/*}" - additional_bindings { - delete: "/v2/{name=projects/*/locations/*/dlpJobs/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Starts asynchronous cancellation on a long-running DlpJob. The server - // makes a best effort to cancel the DlpJob, but success is not - // guaranteed. - // See https://cloud.google.com/dlp/docs/inspecting-storage and - // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. - rpc CancelDlpJob(CancelDlpJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v2/{name=projects/*/dlpJobs/*}:cancel" - body: "*" - additional_bindings { - post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:cancel" - body: "*" - } - }; - } - - // Creates a pre-built stored infoType to be used for inspection. - // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - // learn more. - rpc CreateStoredInfoType(CreateStoredInfoTypeRequest) returns (StoredInfoType) { - option (google.api.http) = { - post: "/v2/{parent=organizations/*}/storedInfoTypes" - body: "*" - additional_bindings { - post: "/v2/{parent=organizations/*}/locations/{location_id}/storedInfoTypes" - body: "*" - } - additional_bindings { - post: "/v2/{parent=projects/*}/storedInfoTypes" - body: "*" - } - additional_bindings { - post: "/v2/{parent=projects/*}/locations/{location_id}/storedInfoTypes" - body: "*" - } - }; - option (google.api.method_signature) = "parent,config"; - option (google.api.method_signature) = "parent,config,location_id"; - } - - // Updates the stored infoType by creating a new version. The existing version - // will continue to be used until the new version is ready. - // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - // learn more. - rpc UpdateStoredInfoType(UpdateStoredInfoTypeRequest) returns (StoredInfoType) { - option (google.api.http) = { - patch: "/v2/{name=organizations/*/storedInfoTypes/*}" - body: "*" - additional_bindings { - patch: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}" - body: "*" - } - additional_bindings { - patch: "/v2/{name=projects/*/storedInfoTypes/*}" - body: "*" - } - additional_bindings { - patch: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}" - body: "*" - } - }; - option (google.api.method_signature) = "name,config,update_mask"; - } - - // Gets a stored infoType. - // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - // learn more. - rpc GetStoredInfoType(GetStoredInfoTypeRequest) returns (StoredInfoType) { - option (google.api.http) = { - get: "/v2/{name=organizations/*/storedInfoTypes/*}" - additional_bindings { - get: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}" - } - additional_bindings { - get: "/v2/{name=projects/*/storedInfoTypes/*}" - } - additional_bindings { - get: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists stored infoTypes. - // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - // learn more. - rpc ListStoredInfoTypes(ListStoredInfoTypesRequest) returns (ListStoredInfoTypesResponse) { - option (google.api.http) = { - get: "/v2/{parent=organizations/*}/storedInfoTypes" - additional_bindings { - get: "/v2/{parent=organizations/*}/locations/{location_id}/storedInfoTypes" - } - additional_bindings { - get: "/v2/{parent=projects/*}/storedInfoTypes" - } - additional_bindings { - get: "/v2/{parent=projects/*}/locations/{location_id}/storedInfoTypes" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a stored infoType. - // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to - // learn more. - rpc DeleteStoredInfoType(DeleteStoredInfoTypeRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=organizations/*/storedInfoTypes/*}" - additional_bindings { - delete: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}" - } - additional_bindings { - delete: "/v2/{name=projects/*/storedInfoTypes/*}" - } - additional_bindings { - delete: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}" - } - }; - option (google.api.method_signature) = "name"; - } -} - -// List of exclude infoTypes. -message ExcludeInfoTypes { - // InfoType list in ExclusionRule rule drops a finding when it overlaps or - // contained within with a finding of an infoType from this list. For - // example, for `InspectionRuleSet.info_types` containing "PHONE_NUMBER"` and - // `exclusion_rule` containing `exclude_info_types.info_types` with - // "EMAIL_ADDRESS" the phone number findings are dropped if they overlap - // with EMAIL_ADDRESS finding. - // That leads to "555-222-2222@example.org" to generate only a single - // finding, namely email address. - repeated InfoType info_types = 1; -} - -// The rule that specifies conditions when findings of infoTypes specified in -// `InspectionRuleSet` are removed from results. -message ExclusionRule { - // Exclusion rule types. - oneof type { - // Dictionary which defines the rule. - CustomInfoType.Dictionary dictionary = 1; - - // Regular expression which defines the rule. - CustomInfoType.Regex regex = 2; - - // Set of infoTypes for which findings would affect this rule. - ExcludeInfoTypes exclude_info_types = 3; - } - - // How the rule is applied, see MatchingType documentation for details. - MatchingType matching_type = 4; -} - -// A single inspection rule to be applied to infoTypes, specified in -// `InspectionRuleSet`. -message InspectionRule { - // Inspection rule types. - oneof type { - // Hotword-based detection rule. - CustomInfoType.DetectionRule.HotwordRule hotword_rule = 1; - - // Exclusion rule. - ExclusionRule exclusion_rule = 2; - } -} - -// Rule set for modifying a set of infoTypes to alter behavior under certain -// circumstances, depending on the specific details of the rules within the set. -message InspectionRuleSet { - // List of infoTypes this rule set is applied to. - repeated InfoType info_types = 1; - - // Set of rules to be applied to infoTypes. The rules are applied in order. - repeated InspectionRule rules = 2; -} - -// Configuration description of the scanning process. -// When used with redactContent only info_types and min_likelihood are currently -// used. -message InspectConfig { - // Configuration to control the number of findings returned. - message FindingLimits { - // Max findings configuration per infoType, per content item or long - // running DlpJob. - message InfoTypeLimit { - // Type of information the findings limit applies to. Only one limit per - // info_type should be provided. If InfoTypeLimit does not have an - // info_type, the DLP API applies the limit against all info_types that - // are found but not specified in another InfoTypeLimit. - InfoType info_type = 1; - - // Max findings limit for the given infoType. - int32 max_findings = 2; - } - - // Max number of findings that will be returned for each item scanned. - // When set within `InspectDataSourceRequest`, - // the maximum returned is 2000 regardless if this is set higher. - // When set within `InspectContentRequest`, this field is ignored. - int32 max_findings_per_item = 1; - - // Max number of findings that will be returned per request/job. - // When set within `InspectContentRequest`, the maximum returned is 2000 - // regardless if this is set higher. - int32 max_findings_per_request = 2; - - // Configuration of findings limit given for specified infoTypes. - repeated InfoTypeLimit max_findings_per_info_type = 3; - } - - // Restricts what info_types to look for. The values must correspond to - // InfoType values returned by ListInfoTypes or listed at - // https://cloud.google.com/dlp/docs/infotypes-reference. - // - // When no InfoTypes or CustomInfoTypes are specified in a request, the - // system may automatically choose what detectors to run. By default this may - // be all types, but may change over time as detectors are updated. - // - // If you need precise control and predictability as to what detectors are - // run you should specify specific InfoTypes listed in the reference, - // otherwise a default list will be used, which may change over time. - repeated InfoType info_types = 1; - - // Only returns findings equal or above this threshold. The default is - // POSSIBLE. - // See https://cloud.google.com/dlp/docs/likelihood to learn more. - Likelihood min_likelihood = 2; - - // Configuration to control the number of findings returned. - FindingLimits limits = 3; - - // When true, a contextual quote from the data that triggered a finding is - // included in the response; see Finding.quote. - bool include_quote = 4; - - // When true, excludes type information of the findings. - bool exclude_info_types = 5; - - // CustomInfoTypes provided by the user. See - // https://cloud.google.com/dlp/docs/creating-custom-infotypes to learn more. - repeated CustomInfoType custom_info_types = 6; - - // List of options defining data content to scan. - // If empty, text, images, and other content will be included. - repeated ContentOption content_options = 8; - - // Set of rules to apply to the findings for this InspectConfig. - // Exclusion rules, contained in the set are executed in the end, other - // rules are executed in the order they are specified for each info type. - repeated InspectionRuleSet rule_set = 10; -} - -// Container for bytes to inspect or redact. -message ByteContentItem { - // The type of data being sent to in data. - enum BytesType { - // Unused - BYTES_TYPE_UNSPECIFIED = 0; - - // Any image type. - IMAGE = 6; - - // jpeg - IMAGE_JPEG = 1; - - // bmp - IMAGE_BMP = 2; - - // png - IMAGE_PNG = 3; - - // svg - IMAGE_SVG = 4; - - // plain text - TEXT_UTF8 = 5; - - // avro - AVRO = 11; - } - - // The type of data stored in the bytes string. Default will be TEXT_UTF8. - BytesType type = 1; - - // Content data to inspect or redact. - bytes data = 2; -} - -// Container structure for the content to inspect. -message ContentItem { - // Data of the item either in the byte array or UTF-8 string form, or table. - oneof data_item { - // String data to inspect or redact. - string value = 3; - - // Structured content for inspection. See - // https://cloud.google.com/dlp/docs/inspecting-text#inspecting_a_table to - // learn more. - Table table = 4; - - // Content data to inspect or redact. Replaces `type` and `data`. - ByteContentItem byte_item = 5; - } -} - -// Structured content to inspect. Up to 50,000 `Value`s per request allowed. -// See https://cloud.google.com/dlp/docs/inspecting-text#inspecting_a_table to -// learn more. -message Table { - // Values of the row. - message Row { - // Individual cells. - repeated Value values = 1; - } - - // Headers of the table. - repeated FieldId headers = 1; - - // Rows of the table. - repeated Row rows = 2; -} - -// All the findings for a single scanned item. -message InspectResult { - // List of findings for an item. - repeated Finding findings = 1; - - // If true, then this item might have more findings than were returned, - // and the findings returned are an arbitrary subset of all findings. - // The findings list might be truncated because the input items were too - // large, or because the server reached the maximum amount of resources - // allowed for a single API call. For best results, divide the input into - // smaller batches. - bool findings_truncated = 2; -} - -// Represents a piece of potentially sensitive content. -message Finding { - // The content that was found. Even if the content is not textual, it - // may be converted to a textual representation here. - // Provided if `include_quote` is true and the finding is - // less than or equal to 4096 bytes long. If the finding exceeds 4096 bytes - // in length, the quote may be omitted. - string quote = 1; - - // The type of content that might have been found. - // Provided if `excluded_types` is false. - InfoType info_type = 2; - - // Confidence of how likely it is that the `info_type` is correct. - Likelihood likelihood = 3; - - // Where the content was found. - Location location = 4; - - // Timestamp when finding was detected. - google.protobuf.Timestamp create_time = 6; - - // Contains data parsed from quotes. Only populated if include_quote was set - // to true and a supported infoType was requested. Currently supported - // infoTypes: DATE, DATE_OF_BIRTH and TIME. - QuoteInfo quote_info = 7; -} - -// Specifies the location of the finding. -message Location { - // Zero-based byte offsets delimiting the finding. - // These are relative to the finding's containing element. - // Note that when the content is not textual, this references - // the UTF-8 encoded textual representation of the content. - // Omitted if content is an image. - Range byte_range = 1; - - // Unicode character offsets delimiting the finding. - // These are relative to the finding's containing element. - // Provided when the content is text. - Range codepoint_range = 2; - - // List of nested objects pointing to the precise location of the finding - // within the file or record. - repeated ContentLocation content_locations = 7; -} - -// Findings container location data. -message ContentLocation { - // Name of the container where the finding is located. - // The top level name is the source file name or table name. Names of some - // common storage containers are formatted as follows: - // - // * BigQuery tables: `{project_id}:{dataset_id}.{table_id}` - // * Cloud Storage files: `gs://{bucket}/{path}` - // * Datastore namespace: {namespace} - // - // Nested names could be absent if the embedded object has no string - // identifier (for an example an image contained within a document). - string container_name = 1; - - // Type of the container within the file with location of the finding. - oneof location { - // Location within a row or record of a database table. - RecordLocation record_location = 2; - - // Location within an image's pixels. - ImageLocation image_location = 3; - - // Location data for document files. - DocumentLocation document_location = 5; - } - - // Findings container modification timestamp, if applicable. - // For Google Cloud Storage contains last file modification timestamp. - // For BigQuery table contains last_modified_time property. - // For Datastore - not populated. - google.protobuf.Timestamp container_timestamp = 6; - - // Findings container version, if available - // ("generation" for Google Cloud Storage). - string container_version = 7; -} - -// Location of a finding within a document. -message DocumentLocation { - // Offset of the line, from the beginning of the file, where the finding - // is located. - int64 file_offset = 1; -} - -// Location of a finding within a row or record. -message RecordLocation { - // Key of the finding. - RecordKey record_key = 1; - - // Field id of the field containing the finding. - FieldId field_id = 2; - - // Location within a `ContentItem.Table`. - TableLocation table_location = 3; -} - -// Location of a finding within a table. -message TableLocation { - // The zero-based index of the row where the finding is located. - int64 row_index = 1; -} - -// Generic half-open interval [start, end) -message Range { - // Index of the first character of the range (inclusive). - int64 start = 1; - - // Index of the last character of the range (exclusive). - int64 end = 2; -} - -// Location of the finding within an image. -message ImageLocation { - // Bounding boxes locating the pixels within the image containing the finding. - repeated BoundingBox bounding_boxes = 1; -} - -// Bounding box encompassing detected text within an image. -message BoundingBox { - // Top coordinate of the bounding box. (0,0) is upper left. - int32 top = 1; - - // Left coordinate of the bounding box. (0,0) is upper left. - int32 left = 2; - - // Width of the bounding box in pixels. - int32 width = 3; - - // Height of the bounding box in pixels. - int32 height = 4; -} - -// Request to search for potentially sensitive info in an image and redact it -// by covering it with a colored rectangle. -message RedactImageRequest { - // Configuration for determining how redaction of images should occur. - message ImageRedactionConfig { - // Type of information to redact from images. - oneof target { - // Only one per info_type should be provided per request. If not - // specified, and redact_all_text is false, the DLP API will redact all - // text that it matches against all info_types that are found, but not - // specified in another ImageRedactionConfig. - InfoType info_type = 1; - - // If true, all text found in the image, regardless whether it matches an - // info_type, is redacted. Only one should be provided. - bool redact_all_text = 2; - } - - // The color to use when redacting content from an image. If not specified, - // the default is black. - Color redaction_color = 3; - } - - // The parent resource name, for example projects/my-project-id. - string parent = 1 [(google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - }]; - - // The geographic location to process the request. Reserved for future - // extensions. - string location_id = 8; - - // Configuration for the inspector. - InspectConfig inspect_config = 2; - - // The configuration for specifying what content to redact from images. - repeated ImageRedactionConfig image_redaction_configs = 5; - - // Whether the response should include findings along with the redacted - // image. - bool include_findings = 6; - - // The content must be PNG, JPEG, SVG or BMP. - ByteContentItem byte_item = 7; -} - -// Represents a color in the RGB color space. -message Color { - // The amount of red in the color as a value in the interval [0, 1]. - float red = 1; - - // The amount of green in the color as a value in the interval [0, 1]. - float green = 2; - - // The amount of blue in the color as a value in the interval [0, 1]. - float blue = 3; -} - -// Results of redacting an image. -message RedactImageResponse { - // The redacted image. The type will be the same as the original image. - bytes redacted_image = 1; - - // If an image was being inspected and the InspectConfig's include_quote was - // set to true, then this field will include all text, if any, that was found - // in the image. - string extracted_text = 2; - - // The findings. Populated when include_findings in the request is true. - InspectResult inspect_result = 3; -} - -// Request to de-identify a list of items. -message DeidentifyContentRequest { - // The parent resource name, for example projects/my-project-id. - string parent = 1 [(google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - }]; - - // Configuration for the de-identification of the content item. - // Items specified here will override the template referenced by the - // deidentify_template_name argument. - DeidentifyConfig deidentify_config = 2; - - // Configuration for the inspector. - // Items specified here will override the template referenced by the - // inspect_template_name argument. - InspectConfig inspect_config = 3; - - // The item to de-identify. Will be treated as text. - ContentItem item = 4; - - // Template to use. Any configuration directly specified in - // inspect_config will override those set in the template. Singular fields - // that are set in this request will replace their corresponding fields in the - // template. Repeated fields are appended. Singular sub-messages and groups - // are recursively merged. - string inspect_template_name = 5; - - // Template to use. Any configuration directly specified in - // deidentify_config will override those set in the template. Singular fields - // that are set in this request will replace their corresponding fields in the - // template. Repeated fields are appended. Singular sub-messages and groups - // are recursively merged. - string deidentify_template_name = 6; - - // The geographic location to process de-identification. Reserved for future - // extensions. - string location_id = 7; -} - -// Results of de-identifying a ContentItem. -message DeidentifyContentResponse { - // The de-identified item. - ContentItem item = 1; - - // An overview of the changes that were made on the `item`. - TransformationOverview overview = 2; -} - -// Request to re-identify an item. -message ReidentifyContentRequest { - // Required. The parent resource name. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Configuration for the re-identification of the content item. - // This field shares the same proto message type that is used for - // de-identification, however its usage here is for the reversal of the - // previous de-identification. Re-identification is performed by examining - // the transformations used to de-identify the items and executing the - // reverse. This requires that only reversible transformations - // be provided here. The reversible transformations are: - // - // - `CryptoDeterministicConfig` - // - `CryptoReplaceFfxFpeConfig` - DeidentifyConfig reidentify_config = 2; - - // Configuration for the inspector. - InspectConfig inspect_config = 3; - - // The item to re-identify. Will be treated as text. - ContentItem item = 4; - - // Template to use. Any configuration directly specified in - // `inspect_config` will override those set in the template. Singular fields - // that are set in this request will replace their corresponding fields in the - // template. Repeated fields are appended. Singular sub-messages and groups - // are recursively merged. - string inspect_template_name = 5; - - // Template to use. References an instance of `DeidentifyTemplate`. - // Any configuration directly specified in `reidentify_config` or - // `inspect_config` will override those set in the template. Singular fields - // that are set in this request will replace their corresponding fields in the - // template. Repeated fields are appended. Singular sub-messages and groups - // are recursively merged. - string reidentify_template_name = 6; - - // The geographic location to process content reidentification. Reserved for - // future extensions. - string location_id = 7; -} - -// Results of re-identifying a item. -message ReidentifyContentResponse { - // The re-identified item. - ContentItem item = 1; - - // An overview of the changes that were made to the `item`. - TransformationOverview overview = 2; -} - -// Request to search for potentially sensitive info in a ContentItem. -message InspectContentRequest { - // The parent resource name, for example projects/my-project-id. - string parent = 1 [(google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - }]; - - // Configuration for the inspector. What specified here will override - // the template referenced by the inspect_template_name argument. - InspectConfig inspect_config = 2; - - // The item to inspect. - ContentItem item = 3; - - // Template to use. Any configuration directly specified in - // inspect_config will override those set in the template. Singular fields - // that are set in this request will replace their corresponding fields in the - // template. Repeated fields are appended. Singular sub-messages and groups - // are recursively merged. - string inspect_template_name = 4; - - // The geographic location to process content inspection. Reserved for future - // extensions. - string location_id = 5; -} - -// Results of inspecting an item. -message InspectContentResponse { - // The findings. - InspectResult result = 1; -} - -// Cloud repository for storing output. -message OutputStorageConfig { - // Predefined schemas for storing findings. - enum OutputSchema { - // Unused. - OUTPUT_SCHEMA_UNSPECIFIED = 0; - - // Basic schema including only `info_type`, `quote`, `certainty`, and - // `timestamp`. - BASIC_COLUMNS = 1; - - // Schema tailored to findings from scanning Google Cloud Storage. - GCS_COLUMNS = 2; - - // Schema tailored to findings from scanning Google Datastore. - DATASTORE_COLUMNS = 3; - - // Schema tailored to findings from scanning Google BigQuery. - BIG_QUERY_COLUMNS = 4; - - // Schema containing all columns. - ALL_COLUMNS = 5; - } - - // Output storage types. - oneof type { - // Store findings in an existing table or a new table in an existing - // dataset. If table_id is not set a new one will be generated - // for you with the following format: - // dlp_googleapis_yyyy_mm_dd_[dlp_job_id]. Pacific timezone will be used for - // generating the date details. - // - // For Inspect, each column in an existing output table must have the same - // name, type, and mode of a field in the `Finding` object. - // - // For Risk, an existing output table should be the output of a previous - // Risk analysis job run on the same source table, with the same privacy - // metric and quasi-identifiers. Risk jobs that analyze the same table but - // compute a different privacy metric, or use different sets of - // quasi-identifiers, cannot store their results in the same table. - BigQueryTable table = 1; - } - - // Schema used for writing the findings for Inspect jobs. This field is only - // used for Inspect and must be unspecified for Risk jobs. Columns are derived - // from the `Finding` object. If appending to an existing table, any columns - // from the predefined schema that are missing will be added. No columns in - // the existing table will be deleted. - // - // If unspecified, then all available columns will be used for a new table or - // an (existing) table with no schema, and no changes will be made to an - // existing table that has a schema. - OutputSchema output_schema = 3; -} - -// Statistics regarding a specific InfoType. -message InfoTypeStats { - // The type of finding this stat is for. - InfoType info_type = 1; - - // Number of findings for this infoType. - int64 count = 2; -} - -// The results of an inspect DataSource job. -message InspectDataSourceDetails { - // Snapshot of the inspection configuration. - message RequestedOptions { - // If run with an InspectTemplate, a snapshot of its state at the time of - // this run. - InspectTemplate snapshot_inspect_template = 1; - - // Inspect config. - InspectJobConfig job_config = 3; - } - - // All result fields mentioned below are updated while the job is processing. - message Result { - // Total size in bytes that were processed. - int64 processed_bytes = 1; - - // Estimate of the number of bytes to process. - int64 total_estimated_bytes = 2; - - // Statistics of how many instances of each info type were found during - // inspect job. - repeated InfoTypeStats info_type_stats = 3; - } - - // The configuration used for this job. - RequestedOptions requested_options = 2; - - // A summary of the outcome of this inspect job. - Result result = 3; -} - -// InfoType description. -message InfoTypeDescription { - // Internal name of the infoType. - string name = 1; - - // Human readable form of the infoType name. - string display_name = 2; - - // Which parts of the API supports this InfoType. - repeated InfoTypeSupportedBy supported_by = 3; - - // Description of the infotype. Translated when language is provided in the - // request. - string description = 4; -} - -// Request for the list of infoTypes. -message ListInfoTypesRequest { - // BCP-47 language code for localized infoType friendly - // names. If omitted, or if localized strings are not available, - // en-US strings will be returned. - string language_code = 1; - - // filter to only return infoTypes supported by certain parts of the - // API. Defaults to supported_by=INSPECT. - string filter = 2; - - // The geographic location to list info types. Reserved for future - // extensions. - string location_id = 3; -} - -// Response to the ListInfoTypes request. -message ListInfoTypesResponse { - // Set of sensitive infoTypes. - repeated InfoTypeDescription info_types = 1; -} - -// Configuration for a risk analysis job. See -// https://cloud.google.com/dlp/docs/concepts-risk-analysis to learn more. -message RiskAnalysisJobConfig { - // Privacy metric to compute. - PrivacyMetric privacy_metric = 1; - - // Input dataset to compute metrics over. - BigQueryTable source_table = 2; - - // Actions to execute at the completion of the job. Are executed in the order - // provided. - repeated Action actions = 3; -} - -// A column with a semantic tag attached. -message QuasiId { - // Required. Identifies the column. - FieldId field = 1 [(google.api.field_behavior) = REQUIRED]; - - // Semantic tag that identifies what a column contains, to determine which - // statistical model to use to estimate the reidentifiability of each - // value. [required] - oneof tag { - // A column can be tagged with a InfoType to use the relevant public - // dataset as a statistical model of population, if available. We - // currently support US ZIP codes, region codes, ages and genders. - // To programmatically obtain the list of supported InfoTypes, use - // ListInfoTypes with the supported_by=RISK_ANALYSIS filter. - InfoType info_type = 2; - - // A column can be tagged with a custom tag. In this case, the user must - // indicate an auxiliary table that contains statistical information on - // the possible values of this column (below). - string custom_tag = 3; - - // If no semantic tag is indicated, we infer the statistical model from - // the distribution of values in the input data - google.protobuf.Empty inferred = 4; - } -} - -// An auxiliary table containing statistical information on the relative -// frequency of different quasi-identifiers values. It has one or several -// quasi-identifiers columns, and one column that indicates the relative -// frequency of each quasi-identifier tuple. -// If a tuple is present in the data but not in the auxiliary table, the -// corresponding relative frequency is assumed to be zero (and thus, the -// tuple is highly reidentifiable). -message StatisticalTable { - // A quasi-identifier column has a custom_tag, used to know which column - // in the data corresponds to which column in the statistical model. - message QuasiIdentifierField { - // Identifies the column. - FieldId field = 1; - - // A column can be tagged with a custom tag. In this case, the user must - // indicate an auxiliary table that contains statistical information on - // the possible values of this column (below). - string custom_tag = 2; - } - - // Required. Auxiliary table location. - BigQueryTable table = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. Quasi-identifier columns. - repeated QuasiIdentifierField quasi_ids = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The relative frequency column must contain a floating-point number - // between 0 and 1 (inclusive). Null values are assumed to be zero. - FieldId relative_frequency = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Privacy metric to compute for reidentification risk analysis. -message PrivacyMetric { - // Compute numerical stats over an individual column, including - // min, max, and quantiles. - message NumericalStatsConfig { - // Field to compute numerical stats on. Supported types are - // integer, float, date, datetime, timestamp, time. - FieldId field = 1; - } - - // Compute numerical stats over an individual column, including - // number of distinct values and value count distribution. - message CategoricalStatsConfig { - // Field to compute categorical stats on. All column types are - // supported except for arrays and structs. However, it may be more - // informative to use NumericalStats when the field type is supported, - // depending on the data. - FieldId field = 1; - } - - // k-anonymity metric, used for analysis of reidentification risk. - message KAnonymityConfig { - // Set of fields to compute k-anonymity over. When multiple fields are - // specified, they are considered a single composite key. Structs and - // repeated data types are not supported; however, nested fields are - // supported so long as they are not structs themselves or nested within - // a repeated field. - repeated FieldId quasi_ids = 1; - - // Message indicating that multiple rows might be associated to a - // single individual. If the same entity_id is associated to multiple - // quasi-identifier tuples over distinct rows, we consider the entire - // collection of tuples as the composite quasi-identifier. This collection - // is a multiset: the order in which the different tuples appear in the - // dataset is ignored, but their frequency is taken into account. - // - // Important note: a maximum of 1000 rows can be associated to a single - // entity ID. If more rows are associated with the same entity ID, some - // might be ignored. - EntityId entity_id = 2; - } - - // l-diversity metric, used for analysis of reidentification risk. - message LDiversityConfig { - // Set of quasi-identifiers indicating how equivalence classes are - // defined for the l-diversity computation. When multiple fields are - // specified, they are considered a single composite key. - repeated FieldId quasi_ids = 1; - - // Sensitive field for computing the l-value. - FieldId sensitive_attribute = 2; - } - - // Reidentifiability metric. This corresponds to a risk model similar to what - // is called "journalist risk" in the literature, except the attack dataset is - // statistically modeled instead of being perfectly known. This can be done - // using publicly available data (like the US Census), or using a custom - // statistical model (indicated as one or several BigQuery tables), or by - // extrapolating from the distribution of values in the input dataset. - message KMapEstimationConfig { - // A column with a semantic tag attached. - message TaggedField { - // Required. Identifies the column. - FieldId field = 1 [(google.api.field_behavior) = REQUIRED]; - - // Semantic tag that identifies what a column contains, to determine which - // statistical model to use to estimate the reidentifiability of each - // value. [required] - oneof tag { - // A column can be tagged with a InfoType to use the relevant public - // dataset as a statistical model of population, if available. We - // currently support US ZIP codes, region codes, ages and genders. - // To programmatically obtain the list of supported InfoTypes, use - // ListInfoTypes with the supported_by=RISK_ANALYSIS filter. - InfoType info_type = 2; - - // A column can be tagged with a custom tag. In this case, the user must - // indicate an auxiliary table that contains statistical information on - // the possible values of this column (below). - string custom_tag = 3; - - // If no semantic tag is indicated, we infer the statistical model from - // the distribution of values in the input data - google.protobuf.Empty inferred = 4; - } - } - - // An auxiliary table contains statistical information on the relative - // frequency of different quasi-identifiers values. It has one or several - // quasi-identifiers columns, and one column that indicates the relative - // frequency of each quasi-identifier tuple. - // If a tuple is present in the data but not in the auxiliary table, the - // corresponding relative frequency is assumed to be zero (and thus, the - // tuple is highly reidentifiable). - message AuxiliaryTable { - // A quasi-identifier column has a custom_tag, used to know which column - // in the data corresponds to which column in the statistical model. - message QuasiIdField { - // Identifies the column. - FieldId field = 1; - - // A auxiliary field. - string custom_tag = 2; - } - - // Required. Auxiliary table location. - BigQueryTable table = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. Quasi-identifier columns. - repeated QuasiIdField quasi_ids = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The relative frequency column must contain a floating-point number - // between 0 and 1 (inclusive). Null values are assumed to be zero. - FieldId relative_frequency = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Required. Fields considered to be quasi-identifiers. No two columns can have the - // same tag. - repeated TaggedField quasi_ids = 1 [(google.api.field_behavior) = REQUIRED]; - - // ISO 3166-1 alpha-2 region code to use in the statistical modeling. - // Set if no column is tagged with a region-specific InfoType (like - // US_ZIP_5) or a region code. - string region_code = 2; - - // Several auxiliary tables can be used in the analysis. Each custom_tag - // used to tag a quasi-identifiers column must appear in exactly one column - // of one auxiliary table. - repeated AuxiliaryTable auxiliary_tables = 3; - } - - // δ-presence metric, used to estimate how likely it is for an attacker to - // figure out that one given individual appears in a de-identified dataset. - // Similarly to the k-map metric, we cannot compute δ-presence exactly without - // knowing the attack dataset, so we use a statistical model instead. - message DeltaPresenceEstimationConfig { - // Required. Fields considered to be quasi-identifiers. No two fields can have the - // same tag. - repeated QuasiId quasi_ids = 1 [(google.api.field_behavior) = REQUIRED]; - - // ISO 3166-1 alpha-2 region code to use in the statistical modeling. - // Set if no column is tagged with a region-specific InfoType (like - // US_ZIP_5) or a region code. - string region_code = 2; - - // Several auxiliary tables can be used in the analysis. Each custom_tag - // used to tag a quasi-identifiers field must appear in exactly one - // field of one auxiliary table. - repeated StatisticalTable auxiliary_tables = 3; - } - - // Types of analysis. - oneof type { - // Numerical stats - NumericalStatsConfig numerical_stats_config = 1; - - // Categorical stats - CategoricalStatsConfig categorical_stats_config = 2; - - // K-anonymity - KAnonymityConfig k_anonymity_config = 3; - - // l-diversity - LDiversityConfig l_diversity_config = 4; - - // k-map - KMapEstimationConfig k_map_estimation_config = 5; - - // delta-presence - DeltaPresenceEstimationConfig delta_presence_estimation_config = 6; - } -} - -// Result of a risk analysis operation request. -message AnalyzeDataSourceRiskDetails { - // Result of the numerical stats computation. - message NumericalStatsResult { - // Minimum value appearing in the column. - Value min_value = 1; - - // Maximum value appearing in the column. - Value max_value = 2; - - // List of 99 values that partition the set of field values into 100 equal - // sized buckets. - repeated Value quantile_values = 4; - } - - // Result of the categorical stats computation. - message CategoricalStatsResult { - // Histogram of value frequencies in the column. - message CategoricalStatsHistogramBucket { - // Lower bound on the value frequency of the values in this bucket. - int64 value_frequency_lower_bound = 1; - - // Upper bound on the value frequency of the values in this bucket. - int64 value_frequency_upper_bound = 2; - - // Total number of values in this bucket. - int64 bucket_size = 3; - - // Sample of value frequencies in this bucket. The total number of - // values returned per bucket is capped at 20. - repeated ValueFrequency bucket_values = 4; - - // Total number of distinct values in this bucket. - int64 bucket_value_count = 5; - } - - // Histogram of value frequencies in the column. - repeated CategoricalStatsHistogramBucket value_frequency_histogram_buckets = 5; - } - - // Result of the k-anonymity computation. - message KAnonymityResult { - // The set of columns' values that share the same ldiversity value - message KAnonymityEquivalenceClass { - // Set of values defining the equivalence class. One value per - // quasi-identifier column in the original KAnonymity metric message. - // The order is always the same as the original request. - repeated Value quasi_ids_values = 1; - - // Size of the equivalence class, for example number of rows with the - // above set of values. - int64 equivalence_class_size = 2; - } - - // Histogram of k-anonymity equivalence classes. - message KAnonymityHistogramBucket { - // Lower bound on the size of the equivalence classes in this bucket. - int64 equivalence_class_size_lower_bound = 1; - - // Upper bound on the size of the equivalence classes in this bucket. - int64 equivalence_class_size_upper_bound = 2; - - // Total number of equivalence classes in this bucket. - int64 bucket_size = 3; - - // Sample of equivalence classes in this bucket. The total number of - // classes returned per bucket is capped at 20. - repeated KAnonymityEquivalenceClass bucket_values = 4; - - // Total number of distinct equivalence classes in this bucket. - int64 bucket_value_count = 5; - } - - // Histogram of k-anonymity equivalence classes. - repeated KAnonymityHistogramBucket equivalence_class_histogram_buckets = 5; - } - - // Result of the l-diversity computation. - message LDiversityResult { - // The set of columns' values that share the same ldiversity value. - message LDiversityEquivalenceClass { - // Quasi-identifier values defining the k-anonymity equivalence - // class. The order is always the same as the original request. - repeated Value quasi_ids_values = 1; - - // Size of the k-anonymity equivalence class. - int64 equivalence_class_size = 2; - - // Number of distinct sensitive values in this equivalence class. - int64 num_distinct_sensitive_values = 3; - - // Estimated frequencies of top sensitive values. - repeated ValueFrequency top_sensitive_values = 4; - } - - // Histogram of l-diversity equivalence class sensitive value frequencies. - message LDiversityHistogramBucket { - // Lower bound on the sensitive value frequencies of the equivalence - // classes in this bucket. - int64 sensitive_value_frequency_lower_bound = 1; - - // Upper bound on the sensitive value frequencies of the equivalence - // classes in this bucket. - int64 sensitive_value_frequency_upper_bound = 2; - - // Total number of equivalence classes in this bucket. - int64 bucket_size = 3; - - // Sample of equivalence classes in this bucket. The total number of - // classes returned per bucket is capped at 20. - repeated LDiversityEquivalenceClass bucket_values = 4; - - // Total number of distinct equivalence classes in this bucket. - int64 bucket_value_count = 5; - } - - // Histogram of l-diversity equivalence class sensitive value frequencies. - repeated LDiversityHistogramBucket sensitive_value_frequency_histogram_buckets = 5; - } - - // Result of the reidentifiability analysis. Note that these results are an - // estimation, not exact values. - message KMapEstimationResult { - // A tuple of values for the quasi-identifier columns. - message KMapEstimationQuasiIdValues { - // The quasi-identifier values. - repeated Value quasi_ids_values = 1; - - // The estimated anonymity for these quasi-identifier values. - int64 estimated_anonymity = 2; - } - - // A KMapEstimationHistogramBucket message with the following values: - // min_anonymity: 3 - // max_anonymity: 5 - // frequency: 42 - // means that there are 42 records whose quasi-identifier values correspond - // to 3, 4 or 5 people in the overlying population. An important particular - // case is when min_anonymity = max_anonymity = 1: the frequency field then - // corresponds to the number of uniquely identifiable records. - message KMapEstimationHistogramBucket { - // Always positive. - int64 min_anonymity = 1; - - // Always greater than or equal to min_anonymity. - int64 max_anonymity = 2; - - // Number of records within these anonymity bounds. - int64 bucket_size = 5; - - // Sample of quasi-identifier tuple values in this bucket. The total - // number of classes returned per bucket is capped at 20. - repeated KMapEstimationQuasiIdValues bucket_values = 6; - - // Total number of distinct quasi-identifier tuple values in this bucket. - int64 bucket_value_count = 7; - } - - // The intervals [min_anonymity, max_anonymity] do not overlap. If a value - // doesn't correspond to any such interval, the associated frequency is - // zero. For example, the following records: - // {min_anonymity: 1, max_anonymity: 1, frequency: 17} - // {min_anonymity: 2, max_anonymity: 3, frequency: 42} - // {min_anonymity: 5, max_anonymity: 10, frequency: 99} - // mean that there are no record with an estimated anonymity of 4, 5, or - // larger than 10. - repeated KMapEstimationHistogramBucket k_map_estimation_histogram = 1; - } - - // Result of the δ-presence computation. Note that these results are an - // estimation, not exact values. - message DeltaPresenceEstimationResult { - // A tuple of values for the quasi-identifier columns. - message DeltaPresenceEstimationQuasiIdValues { - // The quasi-identifier values. - repeated Value quasi_ids_values = 1; - - // The estimated probability that a given individual sharing these - // quasi-identifier values is in the dataset. This value, typically called - // δ, is the ratio between the number of records in the dataset with these - // quasi-identifier values, and the total number of individuals (inside - // *and* outside the dataset) with these quasi-identifier values. - // For example, if there are 15 individuals in the dataset who share the - // same quasi-identifier values, and an estimated 100 people in the entire - // population with these values, then δ is 0.15. - double estimated_probability = 2; - } - - // A DeltaPresenceEstimationHistogramBucket message with the following - // values: - // min_probability: 0.1 - // max_probability: 0.2 - // frequency: 42 - // means that there are 42 records for which δ is in [0.1, 0.2). An - // important particular case is when min_probability = max_probability = 1: - // then, every individual who shares this quasi-identifier combination is in - // the dataset. - message DeltaPresenceEstimationHistogramBucket { - // Between 0 and 1. - double min_probability = 1; - - // Always greater than or equal to min_probability. - double max_probability = 2; - - // Number of records within these probability bounds. - int64 bucket_size = 5; - - // Sample of quasi-identifier tuple values in this bucket. The total - // number of classes returned per bucket is capped at 20. - repeated DeltaPresenceEstimationQuasiIdValues bucket_values = 6; - - // Total number of distinct quasi-identifier tuple values in this bucket. - int64 bucket_value_count = 7; - } - - // The intervals [min_probability, max_probability) do not overlap. If a - // value doesn't correspond to any such interval, the associated frequency - // is zero. For example, the following records: - // {min_probability: 0, max_probability: 0.1, frequency: 17} - // {min_probability: 0.2, max_probability: 0.3, frequency: 42} - // {min_probability: 0.3, max_probability: 0.4, frequency: 99} - // mean that there are no record with an estimated probability in [0.1, 0.2) - // nor larger or equal to 0.4. - repeated DeltaPresenceEstimationHistogramBucket delta_presence_estimation_histogram = 1; - } - - // Privacy metric to compute. - PrivacyMetric requested_privacy_metric = 1; - - // Input dataset to compute metrics over. - BigQueryTable requested_source_table = 2; - - // Values associated with this metric. - oneof result { - // Numerical stats result - NumericalStatsResult numerical_stats_result = 3; - - // Categorical stats result - CategoricalStatsResult categorical_stats_result = 4; - - // K-anonymity result - KAnonymityResult k_anonymity_result = 5; - - // L-divesity result - LDiversityResult l_diversity_result = 6; - - // K-map result - KMapEstimationResult k_map_estimation_result = 7; - - // Delta-presence result - DeltaPresenceEstimationResult delta_presence_estimation_result = 9; - } -} - -// A value of a field, including its frequency. -message ValueFrequency { - // A value contained in the field in question. - Value value = 1; - - // How many times the value is contained in the field. - int64 count = 2; -} - -// Set of primitive values supported by the system. -// Note that for the purposes of inspection or transformation, the number -// of bytes considered to comprise a 'Value' is based on its representation -// as a UTF-8 encoded string. For example, if 'integer_value' is set to -// 123456789, the number of bytes would be counted as 9, even though an -// int64 only holds up to 8 bytes of data. -message Value { - // Value types - oneof type { - // integer - int64 integer_value = 1; - - // float - double float_value = 2; - - // string - string string_value = 3; - - // boolean - bool boolean_value = 4; - - // timestamp - google.protobuf.Timestamp timestamp_value = 5; - - // time of day - google.type.TimeOfDay time_value = 6; - - // date - google.type.Date date_value = 7; - - // day of week - google.type.DayOfWeek day_of_week_value = 8; - } -} - -// Message for infoType-dependent details parsed from quote. -message QuoteInfo { - // Object representation of the quote. - oneof parsed_quote { - // The date time indicated by the quote. - DateTime date_time = 2; - } -} - -// Message for a date time object. -// e.g. 2018-01-01, 5th August. -message DateTime { - // Time zone of the date time object. - message TimeZone { - // Set only if the offset can be determined. Positive for time ahead of UTC. - // E.g. For "UTC-9", this value is -540. - int32 offset_minutes = 1; - } - - // One or more of the following must be set. - // Must be a valid date or time value. - google.type.Date date = 1; - - // Day of week - google.type.DayOfWeek day_of_week = 2; - - // Time of day - google.type.TimeOfDay time = 3; - - // Time zone - TimeZone time_zone = 4; -} - -// The configuration that controls how the data will change. -message DeidentifyConfig { - oneof transformation { - // Treat the dataset as free-form text and apply the same free text - // transformation everywhere. - InfoTypeTransformations info_type_transformations = 1; - - // Treat the dataset as structured. Transformations can be applied to - // specific locations within structured datasets, such as transforming - // a column within a table. - RecordTransformations record_transformations = 2; - } -} - -// A rule for transforming a value. -message PrimitiveTransformation { - oneof transformation { - // Replace - ReplaceValueConfig replace_config = 1; - - // Redact - RedactConfig redact_config = 2; - - // Mask - CharacterMaskConfig character_mask_config = 3; - - // Ffx-Fpe - CryptoReplaceFfxFpeConfig crypto_replace_ffx_fpe_config = 4; - - // Fixed size bucketing - FixedSizeBucketingConfig fixed_size_bucketing_config = 5; - - // Bucketing - BucketingConfig bucketing_config = 6; - - // Replace with infotype - ReplaceWithInfoTypeConfig replace_with_info_type_config = 7; - - // Time extraction - TimePartConfig time_part_config = 8; - - // Crypto - CryptoHashConfig crypto_hash_config = 9; - - // Date Shift - DateShiftConfig date_shift_config = 11; - - // Deterministic Crypto - CryptoDeterministicConfig crypto_deterministic_config = 12; - } -} - -// For use with `Date`, `Timestamp`, and `TimeOfDay`, extract or preserve a -// portion of the value. -message TimePartConfig { - // Components that make up time. - enum TimePart { - // Unused - TIME_PART_UNSPECIFIED = 0; - - // [0-9999] - YEAR = 1; - - // [1-12] - MONTH = 2; - - // [1-31] - DAY_OF_MONTH = 3; - - // [1-7] - DAY_OF_WEEK = 4; - - // [1-53] - WEEK_OF_YEAR = 5; - - // [0-23] - HOUR_OF_DAY = 6; - } - - // The part of the time to keep. - TimePart part_to_extract = 1; -} - -// Pseudonymization method that generates surrogates via cryptographic hashing. -// Uses SHA-256. -// The key size must be either 32 or 64 bytes. -// Outputs a base64 encoded representation of the hashed output -// (for example, L7k0BHmF1ha5U3NfGykjro4xWi1MPVQPjhMAZbSV9mM=). -// Currently, only string and integer values can be hashed. -// See https://cloud.google.com/dlp/docs/pseudonymization to learn more. -message CryptoHashConfig { - // The key used by the hash function. - CryptoKey crypto_key = 1; -} - -// Pseudonymization method that generates deterministic encryption for the given -// input. Outputs a base64 encoded representation of the encrypted output. -// Uses AES-SIV based on the RFC https://tools.ietf.org/html/rfc5297. -message CryptoDeterministicConfig { - // The key used by the encryption function. - CryptoKey crypto_key = 1; - - // The custom info type to annotate the surrogate with. - // This annotation will be applied to the surrogate by prefixing it with - // the name of the custom info type followed by the number of - // characters comprising the surrogate. The following scheme defines the - // format: {info type name}({surrogate character count}):{surrogate} - // - // For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and - // the surrogate is 'abc', the full replacement value - // will be: 'MY_TOKEN_INFO_TYPE(3):abc' - // - // This annotation identifies the surrogate when inspecting content using the - // custom info type 'Surrogate'. This facilitates reversal of the - // surrogate when it occurs in free text. - // - // Note: For record transformations where the entire cell in a table is being - // transformed, surrogates are not mandatory. Surrogates are used to denote - // the location of the token and are necessary for re-identification in free - // form text. - // - // In order for inspection to work properly, the name of this info type must - // not occur naturally anywhere in your data; otherwise, inspection may either - // - // - reverse a surrogate that does not correspond to an actual identifier - // - be unable to parse the surrogate and result in an error - // - // Therefore, choose your custom info type name carefully after considering - // what your data looks like. One way to select a name that has a high chance - // of yielding reliable detection is to include one or more unicode characters - // that are highly improbable to exist in your data. - // For example, assuming your data is entered from a regular ASCII keyboard, - // the symbol with the hex code point 29DD might be used like so: - // ⧝MY_TOKEN_TYPE. - InfoType surrogate_info_type = 2; - - // A context may be used for higher security and maintaining - // referential integrity such that the same identifier in two different - // contexts will be given a distinct surrogate. The context is appended to - // plaintext value being encrypted. On decryption the provided context is - // validated against the value used during encryption. If a context was - // provided during encryption, same context must be provided during decryption - // as well. - // - // If the context is not set, plaintext would be used as is for encryption. - // If the context is set but: - // - // 1. there is no record present when transforming a given value or - // 2. the field is not present when transforming a given value, - // - // plaintext would be used as is for encryption. - // - // Note that case (1) is expected when an `InfoTypeTransformation` is - // applied to both structured and non-structured `ContentItem`s. - FieldId context = 3; -} - -// Replace each input value with a given `Value`. -message ReplaceValueConfig { - // Value to replace it with. - Value new_value = 1; -} - -// Replace each matching finding with the name of the info_type. -message ReplaceWithInfoTypeConfig { - -} - -// Redact a given value. For example, if used with an `InfoTypeTransformation` -// transforming PHONE_NUMBER, and input 'My phone number is 206-555-0123', the -// output would be 'My phone number is '. -message RedactConfig { - -} - -// Characters to skip when doing deidentification of a value. These will be left -// alone and skipped. -message CharsToIgnore { - // Convenience enum for indication common characters to not transform. - enum CommonCharsToIgnore { - // Unused. - COMMON_CHARS_TO_IGNORE_UNSPECIFIED = 0; - - // 0-9 - NUMERIC = 1; - - // A-Z - ALPHA_UPPER_CASE = 2; - - // a-z - ALPHA_LOWER_CASE = 3; - - // US Punctuation, one of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ - PUNCTUATION = 4; - - // Whitespace character, one of [ \t\n\x0B\f\r] - WHITESPACE = 5; - } - - oneof characters { - // Characters to not transform when masking. - string characters_to_skip = 1; - - // Common characters to not transform when masking. Useful to avoid removing - // punctuation. - CommonCharsToIgnore common_characters_to_ignore = 2; - } -} - -// Partially mask a string by replacing a given number of characters with a -// fixed character. Masking can start from the beginning or end of the string. -// This can be used on data of any type (numbers, longs, and so on) and when -// de-identifying structured data we'll attempt to preserve the original data's -// type. (This allows you to take a long like 123 and modify it to a string like -// **3. -message CharacterMaskConfig { - // Character to use to mask the sensitive values—for example, `*` for an - // alphabetic string such as a name, or `0` for a numeric string such as ZIP - // code or credit card number. This string must have a length of 1. If not - // supplied, this value defaults to `*` for strings, and `0` for digits. - string masking_character = 1; - - // Number of characters to mask. If not set, all matching chars will be - // masked. Skipped characters do not count towards this tally. - int32 number_to_mask = 2; - - // Mask characters in reverse order. For example, if `masking_character` is - // `0`, `number_to_mask` is `14`, and `reverse_order` is `false`, then the - // input string `1234-5678-9012-3456` is masked as `00000000000000-3456`. - // If `masking_character` is `*`, `number_to_mask` is `3`, and `reverse_order` - // is `true`, then the string `12345` is masked as `12***`. - bool reverse_order = 3; - - // When masking a string, items in this list will be skipped when replacing - // characters. For example, if the input string is `555-555-5555` and you - // instruct Cloud DLP to skip `-` and mask 5 characters with `*`, Cloud DLP - // returns `***-**5-5555`. - repeated CharsToIgnore characters_to_ignore = 4; -} - -// Buckets values based on fixed size ranges. The -// Bucketing transformation can provide all of this functionality, -// but requires more configuration. This message is provided as a convenience to -// the user for simple bucketing strategies. -// -// The transformed value will be a hyphenated string of -// {lower_bound}-{upper_bound}, i.e if lower_bound = 10 and upper_bound = 20 -// all values that are within this bucket will be replaced with "10-20". -// -// This can be used on data of type: double, long. -// -// If the bound Value type differs from the type of data -// being transformed, we will first attempt converting the type of the data to -// be transformed to match the type of the bound before comparing. -// -// See https://cloud.google.com/dlp/docs/concepts-bucketing to learn more. -message FixedSizeBucketingConfig { - // Required. Lower bound value of buckets. All values less than `lower_bound` are - // grouped together into a single bucket; for example if `lower_bound` = 10, - // then all values less than 10 are replaced with the value “-10”. - Value lower_bound = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Upper bound value of buckets. All values greater than upper_bound are - // grouped together into a single bucket; for example if `upper_bound` = 89, - // then all values greater than 89 are replaced with the value “89+”. - Value upper_bound = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Size of each bucket (except for minimum and maximum buckets). So if - // `lower_bound` = 10, `upper_bound` = 89, and `bucket_size` = 10, then the - // following buckets would be used: -10, 10-20, 20-30, 30-40, 40-50, 50-60, - // 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works. - double bucket_size = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Generalization function that buckets values based on ranges. The ranges and -// replacement values are dynamically provided by the user for custom behavior, -// such as 1-30 -> LOW 31-65 -> MEDIUM 66-100 -> HIGH -// This can be used on -// data of type: number, long, string, timestamp. -// If the bound `Value` type differs from the type of data being transformed, we -// will first attempt converting the type of the data to be transformed to match -// the type of the bound before comparing. -// See https://cloud.google.com/dlp/docs/concepts-bucketing to learn more. -message BucketingConfig { - // Bucket is represented as a range, along with replacement values. - message Bucket { - // Lower bound of the range, inclusive. Type should be the same as max if - // used. - Value min = 1; - - // Upper bound of the range, exclusive; type must match min. - Value max = 2; - - // Replacement value for this bucket. If not provided - // the default behavior will be to hyphenate the min-max range. - Value replacement_value = 3; - } - - // Set of buckets. Ranges must be non-overlapping. - repeated Bucket buckets = 1; -} - -// Replaces an identifier with a surrogate using Format Preserving Encryption -// (FPE) with the FFX mode of operation; however when used in the -// `ReidentifyContent` API method, it serves the opposite function by reversing -// the surrogate back into the original identifier. The identifier must be -// encoded as ASCII. For a given crypto key and context, the same identifier -// will be replaced with the same surrogate. Identifiers must be at least two -// characters long. In the case that the identifier is the empty string, it will -// be skipped. See https://cloud.google.com/dlp/docs/pseudonymization to learn -// more. -// -// Note: We recommend using CryptoDeterministicConfig for all use cases which -// do not require preserving the input alphabet space and size, plus warrant -// referential integrity. -message CryptoReplaceFfxFpeConfig { - // These are commonly used subsets of the alphabet that the FFX mode - // natively supports. In the algorithm, the alphabet is selected using - // the "radix". Therefore each corresponds to particular radix. - enum FfxCommonNativeAlphabet { - // Unused. - FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED = 0; - - // [0-9] (radix of 10) - NUMERIC = 1; - - // [0-9A-F] (radix of 16) - HEXADECIMAL = 2; - - // [0-9A-Z] (radix of 36) - UPPER_CASE_ALPHA_NUMERIC = 3; - - // [0-9A-Za-z] (radix of 62) - ALPHA_NUMERIC = 4; - } - - // Required. The key used by the encryption algorithm. - CryptoKey crypto_key = 1 [(google.api.field_behavior) = REQUIRED]; - - // The 'tweak', a context may be used for higher security since the same - // identifier in two different contexts won't be given the same surrogate. If - // the context is not set, a default tweak will be used. - // - // If the context is set but: - // - // 1. there is no record present when transforming a given value or - // 1. the field is not present when transforming a given value, - // - // a default tweak will be used. - // - // Note that case (1) is expected when an `InfoTypeTransformation` is - // applied to both structured and non-structured `ContentItem`s. - // Currently, the referenced field may be of value type integer or string. - // - // The tweak is constructed as a sequence of bytes in big endian byte order - // such that: - // - // - a 64 bit integer is encoded followed by a single byte of value 1 - // - a string is encoded in UTF-8 format followed by a single byte of value 2 - FieldId context = 2; - - // Choose an alphabet which the data being transformed will be made up of. - oneof alphabet { - // Common alphabets. - FfxCommonNativeAlphabet common_alphabet = 4; - - // This is supported by mapping these to the alphanumeric characters - // that the FFX mode natively supports. This happens before/after - // encryption/decryption. - // Each character listed must appear only once. - // Number of characters must be in the range [2, 95]. - // This must be encoded as ASCII. - // The order of characters does not matter. - string custom_alphabet = 5; - - // The native way to select the alphabet. Must be in the range [2, 95]. - int32 radix = 6; - } - - // The custom infoType to annotate the surrogate with. - // This annotation will be applied to the surrogate by prefixing it with - // the name of the custom infoType followed by the number of - // characters comprising the surrogate. The following scheme defines the - // format: info_type_name(surrogate_character_count):surrogate - // - // For example, if the name of custom infoType is 'MY_TOKEN_INFO_TYPE' and - // the surrogate is 'abc', the full replacement value - // will be: 'MY_TOKEN_INFO_TYPE(3):abc' - // - // This annotation identifies the surrogate when inspecting content using the - // custom infoType - // [`SurrogateType`](/dlp/docs/reference/rest/v2/InspectConfig#surrogatetype). - // This facilitates reversal of the surrogate when it occurs in free text. - // - // In order for inspection to work properly, the name of this infoType must - // not occur naturally anywhere in your data; otherwise, inspection may - // find a surrogate that does not correspond to an actual identifier. - // Therefore, choose your custom infoType name carefully after considering - // what your data looks like. One way to select a name that has a high chance - // of yielding reliable detection is to include one or more unicode characters - // that are highly improbable to exist in your data. - // For example, assuming your data is entered from a regular ASCII keyboard, - // the symbol with the hex code point 29DD might be used like so: - // ⧝MY_TOKEN_TYPE - InfoType surrogate_info_type = 8; -} - -// This is a data encryption key (DEK) (as opposed to -// a key encryption key (KEK) stored by KMS). -// When using KMS to wrap/unwrap DEKs, be sure to set an appropriate -// IAM policy on the KMS CryptoKey (KEK) to ensure an attacker cannot -// unwrap the data crypto key. -message CryptoKey { - // Sources of crypto keys. - oneof source { - // Transient crypto key - TransientCryptoKey transient = 1; - - // Unwrapped crypto key - UnwrappedCryptoKey unwrapped = 2; - - // Kms wrapped key - KmsWrappedCryptoKey kms_wrapped = 3; - } -} - -// Use this to have a random data crypto key generated. -// It will be discarded after the request finishes. -message TransientCryptoKey { - // Required. Name of the key. - // This is an arbitrary string used to differentiate different keys. - // A unique key is generated per name: two separate `TransientCryptoKey` - // protos share the same generated key if their names are the same. - // When the data crypto key is generated, this name is not used in any way - // (repeating the api call will result in a different key being generated). - string name = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Using raw keys is prone to security risks due to accidentally -// leaking the key. Choose another type of key if possible. -message UnwrappedCryptoKey { - // Required. A 128/192/256 bit key. - bytes key = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Include to use an existing data crypto key wrapped by KMS. -// The wrapped key must be a 128/192/256 bit key. -// Authorization requires the following IAM permissions when sending a request -// to perform a crypto transformation using a kms-wrapped crypto key: -// dlp.kms.encrypt -message KmsWrappedCryptoKey { - // Required. The wrapped data crypto key. - bytes wrapped_key = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource name of the KMS CryptoKey to use for unwrapping. - string crypto_key_name = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Shifts dates by random number of days, with option to be consistent for the -// same context. See https://cloud.google.com/dlp/docs/concepts-date-shifting -// to learn more. -message DateShiftConfig { - // Required. Range of shift in days. Actual shift will be selected at random within this - // range (inclusive ends). Negative means shift to earlier in time. Must not - // be more than 365250 days (1000 years) each direction. - // - // For example, 3 means shift date to at most 3 days into the future. - int32 upper_bound_days = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. For example, -5 means shift date to at most 5 days back in the past. - int32 lower_bound_days = 2 [(google.api.field_behavior) = REQUIRED]; - - // Points to the field that contains the context, for example, an entity id. - // If set, must also set cryptoKey. If set, shift will be consistent for the - // given context. - FieldId context = 3; - - // Method for calculating shift that takes context into consideration. If - // set, must also set context. Can only be applied to table items. - oneof method { - // Causes the shift to be computed based on this key and the context. This - // results in the same shift for the same context and crypto_key. If - // set, must also set context. Can only be applied to table items. - CryptoKey crypto_key = 4; - } -} - -// A type of transformation that will scan unstructured text and -// apply various `PrimitiveTransformation`s to each finding, where the -// transformation is applied to only values that were identified as a specific -// info_type. -message InfoTypeTransformations { - // A transformation to apply to text that is identified as a specific - // info_type. - message InfoTypeTransformation { - // InfoTypes to apply the transformation to. An empty list will cause - // this transformation to apply to all findings that correspond to - // infoTypes that were requested in `InspectConfig`. - repeated InfoType info_types = 1; - - // Required. Primitive transformation to apply to the infoType. - PrimitiveTransformation primitive_transformation = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Required. Transformation for each infoType. Cannot specify more than one - // for a given infoType. - repeated InfoTypeTransformation transformations = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The transformation to apply to the field. -message FieldTransformation { - // Required. Input field(s) to apply the transformation to. - repeated FieldId fields = 1 [(google.api.field_behavior) = REQUIRED]; - - // Only apply the transformation if the condition evaluates to true for the - // given `RecordCondition`. The conditions are allowed to reference fields - // that are not used in the actual transformation. - // - // Example Use Cases: - // - // - Apply a different bucket transformation to an age column if the zip code - // column for the same record is within a specific range. - // - Redact a field if the date of birth field is greater than 85. - RecordCondition condition = 3; - - // Transformation to apply. [required] - oneof transformation { - // Apply the transformation to the entire field. - PrimitiveTransformation primitive_transformation = 4; - - // Treat the contents of the field as free text, and selectively - // transform content that matches an `InfoType`. - InfoTypeTransformations info_type_transformations = 5; - } -} - -// A type of transformation that is applied over structured data such as a -// table. -message RecordTransformations { - // Transform the record by applying various field transformations. - repeated FieldTransformation field_transformations = 1; - - // Configuration defining which records get suppressed entirely. Records that - // match any suppression rule are omitted from the output. - repeated RecordSuppression record_suppressions = 2; -} - -// Configuration to suppress records whose suppression conditions evaluate to -// true. -message RecordSuppression { - // A condition that when it evaluates to true will result in the record being - // evaluated to be suppressed from the transformed content. - RecordCondition condition = 1; -} - -// A condition for determining whether a transformation should be applied to -// a field. -message RecordCondition { - // The field type of `value` and `field` do not need to match to be - // considered equal, but not all comparisons are possible. - // EQUAL_TO and NOT_EQUAL_TO attempt to compare even with incompatible types, - // but all other comparisons are invalid with incompatible types. - // A `value` of type: - // - // - `string` can be compared against all other types - // - `boolean` can only be compared against other booleans - // - `integer` can be compared against doubles or a string if the string value - // can be parsed as an integer. - // - `double` can be compared against integers or a string if the string can - // be parsed as a double. - // - `Timestamp` can be compared against strings in RFC 3339 date string - // format. - // - `TimeOfDay` can be compared against timestamps and strings in the format - // of 'HH:mm:ss'. - // - // If we fail to compare do to type mismatch, a warning will be given and - // the condition will evaluate to false. - message Condition { - // Required. Field within the record this condition is evaluated against. - FieldId field = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Operator used to compare the field or infoType to the value. - RelationalOperator operator = 3 [(google.api.field_behavior) = REQUIRED]; - - // Value to compare against. [Mandatory, except for `EXISTS` tests.] - Value value = 4; - } - - // A collection of conditions. - message Conditions { - // A collection of conditions. - repeated Condition conditions = 1; - } - - // An expression, consisting or an operator and conditions. - message Expressions { - // Logical operators for conditional checks. - enum LogicalOperator { - // Unused - LOGICAL_OPERATOR_UNSPECIFIED = 0; - - // Conditional AND - AND = 1; - } - - // The operator to apply to the result of conditions. Default and currently - // only supported value is `AND`. - LogicalOperator logical_operator = 1; - - // Expression types. - oneof type { - // Conditions to apply to the expression. - Conditions conditions = 3; - } - } - - // An expression. - Expressions expressions = 3; -} - -// Overview of the modifications that occurred. -message TransformationOverview { - // Total size in bytes that were transformed in some way. - int64 transformed_bytes = 2; - - // Transformations applied to the dataset. - repeated TransformationSummary transformation_summaries = 3; -} - -// Summary of a single transformation. -// Only one of 'transformation', 'field_transformation', or 'record_suppress' -// will be set. -message TransformationSummary { - // A collection that informs the user the number of times a particular - // `TransformationResultCode` and error details occurred. - message SummaryResult { - // Number of transformations counted by this result. - int64 count = 1; - - // Outcome of the transformation. - TransformationResultCode code = 2; - - // A place for warnings or errors to show up if a transformation didn't - // work as expected. - string details = 3; - } - - // Possible outcomes of transformations. - enum TransformationResultCode { - // Unused - TRANSFORMATION_RESULT_CODE_UNSPECIFIED = 0; - - // Transformation completed without an error. - SUCCESS = 1; - - // Transformation had an error. - ERROR = 2; - } - - // Set if the transformation was limited to a specific InfoType. - InfoType info_type = 1; - - // Set if the transformation was limited to a specific FieldId. - FieldId field = 2; - - // The specific transformation these stats apply to. - PrimitiveTransformation transformation = 3; - - // The field transformation that was applied. - // If multiple field transformations are requested for a single field, - // this list will contain all of them; otherwise, only one is supplied. - repeated FieldTransformation field_transformations = 5; - - // The specific suppression option these stats apply to. - RecordSuppression record_suppress = 6; - - // Collection of all transformations that took place or had an error. - repeated SummaryResult results = 4; - - // Total size in bytes that were transformed in some way. - int64 transformed_bytes = 7; -} - -// Schedule for triggeredJobs. -message Schedule { - oneof option { - // With this option a job is started a regular periodic basis. For - // example: every day (86400 seconds). - // - // A scheduled start time will be skipped if the previous - // execution has not ended when its scheduled time occurs. - // - // This value must be set to a time duration greater than or equal - // to 1 day and can be no longer than 60 days. - google.protobuf.Duration recurrence_period_duration = 1; - } -} - -// The inspectTemplate contains a configuration (set of types of sensitive data -// to be detected) to be used anywhere you otherwise would normally specify -// InspectConfig. See https://cloud.google.com/dlp/docs/concepts-templates -// to learn more. -message InspectTemplate { - option (google.api.resource) = { - type: "dlp.googleapis.com/InspectTemplate" - pattern: "organizations/{organization}/inspectTemplates/{inspect_template}" - pattern: "projects/{project}/inspectTemplates/{inspect_template}" - }; - - // Output only. The template name. - // - // The template will have one of the following formats: - // `projects/PROJECT_ID/inspectTemplates/TEMPLATE_ID` OR - // `organizations/ORGANIZATION_ID/inspectTemplates/TEMPLATE_ID`; - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Display name (max 256 chars). - string display_name = 2; - - // Short description (max 256 chars). - string description = 3; - - // Output only. The creation timestamp of an inspectTemplate. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last update timestamp of an inspectTemplate. - google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The core content of the template. Configuration of the scanning process. - InspectConfig inspect_config = 6; -} - -// DeidentifyTemplates contains instructions on how to de-identify content. -// See https://cloud.google.com/dlp/docs/concepts-templates to learn more. -message DeidentifyTemplate { - option (google.api.resource) = { - type: "dlp.googleapis.com/DeidentifyTemplate" - pattern: "organizations/{organization}/deidentifyTemplates/{deidentify_template}" - pattern: "projects/{project}/deidentifyTemplates/{deidentify_template}" - }; - - // Output only. The template name. - // - // The template will have one of the following formats: - // `projects/PROJECT_ID/deidentifyTemplates/TEMPLATE_ID` OR - // `organizations/ORGANIZATION_ID/deidentifyTemplates/TEMPLATE_ID` - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Display name (max 256 chars). - string display_name = 2; - - // Short description (max 256 chars). - string description = 3; - - // Output only. The creation timestamp of an inspectTemplate. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last update timestamp of an inspectTemplate. - google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // ///////////// // The core content of the template // /////////////// - DeidentifyConfig deidentify_config = 6; -} - -// Details information about an error encountered during job execution or -// the results of an unsuccessful activation of the JobTrigger. -message Error { - // Detailed error codes and messages. - google.rpc.Status details = 1; - - // The times the error occurred. - repeated google.protobuf.Timestamp timestamps = 2; -} - -// Contains a configuration to make dlp api calls on a repeating basis. -// See https://cloud.google.com/dlp/docs/concepts-job-triggers to learn more. -message JobTrigger { - option (google.api.resource) = { - type: "dlp.googleapis.com/JobTrigger" - pattern: "projects/{project}/jobTriggers/{job_trigger}" - }; - - // What event needs to occur for a new job to be started. - message Trigger { - oneof trigger { - // Create a job on a repeating basis based on the elapse of time. - Schedule schedule = 1; - } - } - - // Whether the trigger is currently active. If PAUSED or CANCELLED, no jobs - // will be created with this configuration. The service may automatically - // pause triggers experiencing frequent errors. To restart a job, set the - // status to HEALTHY after correcting user errors. - enum Status { - // Unused. - STATUS_UNSPECIFIED = 0; - - // Trigger is healthy. - HEALTHY = 1; - - // Trigger is temporarily paused. - PAUSED = 2; - - // Trigger is cancelled and can not be resumed. - CANCELLED = 3; - } - - // Unique resource name for the triggeredJob, assigned by the service when the - // triggeredJob is created, for example - // `projects/dlp-test-project/jobTriggers/53234423`. - string name = 1; - - // Display name (max 100 chars) - string display_name = 2; - - // User provided description (max 256 chars) - string description = 3; - - // The configuration details for the specific type of job to run. - oneof job { - // For inspect jobs, a snapshot of the configuration. - InspectJobConfig inspect_job = 4; - } - - // A list of triggers which will be OR'ed together. Only one in the list - // needs to trigger for a job to be started. The list may contain only - // a single Schedule trigger and must have at least one object. - repeated Trigger triggers = 5; - - // Output only. A stream of errors encountered when the trigger was activated. Repeated - // errors may result in the JobTrigger automatically being paused. - // Will return the last 100 errors. Whenever the JobTrigger is modified - // this list will be cleared. - repeated Error errors = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The creation timestamp of a triggeredJob. - google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last update timestamp of a triggeredJob. - google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The timestamp of the last time this trigger executed. - google.protobuf.Timestamp last_run_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. A status for this trigger. - Status status = 10 [(google.api.field_behavior) = REQUIRED]; -} - -// A task to execute on the completion of a job. -// See https://cloud.google.com/dlp/docs/concepts-actions to learn more. -message Action { - // If set, the detailed findings will be persisted to the specified - // OutputStorageConfig. Only a single instance of this action can be - // specified. - // Compatible with: Inspect, Risk - message SaveFindings { - // Location to store findings outside of DLP. - OutputStorageConfig output_config = 1; - } - - // Publish a message into given Pub/Sub topic when DlpJob has completed. The - // message contains a single field, `DlpJobName`, which is equal to the - // finished job's - // [`DlpJob.name`](/dlp/docs/reference/rest/v2/projects.dlpJobs#DlpJob). - // Compatible with: Inspect, Risk - message PublishToPubSub { - // Cloud Pub/Sub topic to send notifications to. The topic must have given - // publishing access rights to the DLP API service account executing - // the long running DlpJob sending the notifications. - // Format is projects/{project}/topics/{topic}. - string topic = 1; - } - - // Publish the result summary of a DlpJob to the Cloud Security - // Command Center (CSCC Alpha). - // This action is only available for projects which are parts of - // an organization and whitelisted for the alpha Cloud Security Command - // Center. - // The action will publish count of finding instances and their info types. - // The summary of findings will be persisted in CSCC and are governed by CSCC - // service-specific policy, see https://cloud.google.com/terms/service-terms - // Only a single instance of this action can be specified. - // Compatible with: Inspect - message PublishSummaryToCscc { - - } - - // Publish findings of a DlpJob to Cloud Data Catalog. Labels summarizing the - // results of the DlpJob will be applied to the entry for the resource scanned - // in Cloud Data Catalog. Any labels previously written by another DlpJob will - // be deleted. InfoType naming patterns are strictly enforced when using this - // feature. Note that the findings will be persisted in Cloud Data Catalog - // storage and are governed by Data Catalog service-specific policy, see - // https://cloud.google.com/terms/service-terms - // Only a single instance of this action can be specified and only allowed if - // all resources being scanned are BigQuery tables. - // Compatible with: Inspect - message PublishFindingsToCloudDataCatalog { - - } - - // Enable email notification to project owners and editors on jobs's - // completion/failure. - message JobNotificationEmails { - - } - - // Enable Stackdriver metric dlp.googleapis.com/finding_count. This - // will publish a metric to stack driver on each infotype requested and - // how many findings were found for it. CustomDetectors will be bucketed - // as 'Custom' under the Stackdriver label 'info_type'. - message PublishToStackdriver { - - } - - oneof action { - // Save resulting findings in a provided location. - SaveFindings save_findings = 1; - - // Publish a notification to a pubsub topic. - PublishToPubSub pub_sub = 2; - - // Publish summary to Cloud Security Command Center (Alpha). - PublishSummaryToCscc publish_summary_to_cscc = 3; - - // Publish findings to Cloud Datahub. - PublishFindingsToCloudDataCatalog publish_findings_to_cloud_data_catalog = 5; - - // Enable email notification for project owners and editors on job's - // completion/failure. - JobNotificationEmails job_notification_emails = 8; - - // Enable Stackdriver metric dlp.googleapis.com/finding_count. - PublishToStackdriver publish_to_stackdriver = 9; - } -} - -// Request message for CreateInspectTemplate. -message CreateInspectTemplateRequest { - // Required. The parent resource name, for example projects/my-project-id or - // organizations/my-org-id. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dlp.googleapis.com/InspectTemplate" - } - ]; - - // Required. The InspectTemplate to create. - InspectTemplate inspect_template = 2 [(google.api.field_behavior) = REQUIRED]; - - // The template id can contain uppercase and lowercase letters, - // numbers, and hyphens; that is, it must match the regular - // expression: `[a-zA-Z\\d-_]+`. The maximum length is 100 - // characters. Can be empty to allow the system to generate one. - string template_id = 3; - - // The geographic location to store the inspection template. Reserved for - // future extensions. - string location_id = 4; -} - -// Request message for UpdateInspectTemplate. -message UpdateInspectTemplateRequest { - // Required. Resource name of organization and inspectTemplate to be updated, for - // example `organizations/433245324/inspectTemplates/432452342` or - // projects/project-id/inspectTemplates/432452342. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/InspectTemplate" - } - ]; - - // New InspectTemplate value. - InspectTemplate inspect_template = 2; - - // Mask to control which fields get updated. - google.protobuf.FieldMask update_mask = 3; -} - -// Request message for GetInspectTemplate. -message GetInspectTemplateRequest { - // Required. Resource name of the organization and inspectTemplate to be read, for - // example `organizations/433245324/inspectTemplates/432452342` or - // projects/project-id/inspectTemplates/432452342. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/InspectTemplate" - } - ]; -} - -// Request message for ListInspectTemplates. -message ListInspectTemplatesRequest { - // Required. The parent resource name, for example projects/my-project-id or - // organizations/my-org-id. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dlp.googleapis.com/InspectTemplate" - } - ]; - - // Page token to continue retrieval. Comes from previous call - // to `ListInspectTemplates`. - string page_token = 2; - - // Size of the page, can be limited by server. If zero server returns - // a page of max size 100. - int32 page_size = 3; - - // Comma separated list of fields to order by, - // followed by `asc` or `desc` postfix. This list is case-insensitive, - // default sorting order is ascending, redundant space characters are - // insignificant. - // - // Example: `name asc,update_time, create_time desc` - // - // Supported fields are: - // - // - `create_time`: corresponds to time the template was created. - // - `update_time`: corresponds to time the template was last updated. - // - `name`: corresponds to template's name. - // - `display_name`: corresponds to template's display name. - string order_by = 4; - - // The geographic location where inspection templates will be retrieved from. - // Use `-` for all locations. Reserved for future extensions. - string location_id = 5; -} - -// Response message for ListInspectTemplates. -message ListInspectTemplatesResponse { - // List of inspectTemplates, up to page_size in ListInspectTemplatesRequest. - repeated InspectTemplate inspect_templates = 1; - - // If the next page is available then the next page token to be used - // in following ListInspectTemplates request. - string next_page_token = 2; -} - -// Request message for DeleteInspectTemplate. -message DeleteInspectTemplateRequest { - // Required. Resource name of the organization and inspectTemplate to be deleted, for - // example `organizations/433245324/inspectTemplates/432452342` or - // projects/project-id/inspectTemplates/432452342. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/InspectTemplate" - } - ]; -} - -// Request message for CreateJobTrigger. -message CreateJobTriggerRequest { - // Required. The parent resource name, for example projects/my-project-id. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. The JobTrigger to create. - JobTrigger job_trigger = 2 [(google.api.field_behavior) = REQUIRED]; - - // The trigger id can contain uppercase and lowercase letters, - // numbers, and hyphens; that is, it must match the regular - // expression: `[a-zA-Z\\d-_]+`. The maximum length is 100 - // characters. Can be empty to allow the system to generate one. - string trigger_id = 3; - - // The geographic location to store the job trigger. Reserved for - // future extensions. - string location_id = 4; -} - -// Request message for ActivateJobTrigger. -message ActivateJobTriggerRequest { - // Required. Resource name of the trigger to activate, for example - // `projects/dlp-test-project/jobTriggers/53234423`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/JobTrigger" - } - ]; -} - -// Request message for UpdateJobTrigger. -message UpdateJobTriggerRequest { - // Required. Resource name of the project and the triggeredJob, for example - // `projects/dlp-test-project/jobTriggers/53234423`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/JobTrigger" - } - ]; - - // New JobTrigger value. - JobTrigger job_trigger = 2; - - // Mask to control which fields get updated. - google.protobuf.FieldMask update_mask = 3; -} - -// Request message for GetJobTrigger. -message GetJobTriggerRequest { - // Required. Resource name of the project and the triggeredJob, for example - // `projects/dlp-test-project/jobTriggers/53234423`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/JobTrigger" - } - ]; -} - -// Request message for CreateDlpJobRequest. Used to initiate long running -// jobs such as calculating risk metrics or inspecting Google Cloud -// Storage. -message CreateDlpJobRequest { - // Required. The parent resource name, for example projects/my-project-id. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // The configuration details for the specific type of job to run. - oneof job { - // Set to control what and how to inspect. - InspectJobConfig inspect_job = 2; - - // Set to choose what metric to calculate. - RiskAnalysisJobConfig risk_job = 3; - } - - // The job id can contain uppercase and lowercase letters, - // numbers, and hyphens; that is, it must match the regular - // expression: `[a-zA-Z\\d-_]+`. The maximum length is 100 - // characters. Can be empty to allow the system to generate one. - string job_id = 4; - - // The geographic location to store and process the job. Reserved for - // future extensions. - string location_id = 5; -} - -// Request message for ListJobTriggers. -message ListJobTriggersRequest { - // Required. The parent resource name, for example `projects/my-project-id`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Page token to continue retrieval. Comes from previous call - // to ListJobTriggers. `order_by` field must not - // change for subsequent calls. - string page_token = 2; - - // Size of the page, can be limited by a server. - int32 page_size = 3; - - // Comma separated list of triggeredJob fields to order by, - // followed by `asc` or `desc` postfix. This list is case-insensitive, - // default sorting order is ascending, redundant space characters are - // insignificant. - // - // Example: `name asc,update_time, create_time desc` - // - // Supported fields are: - // - // - `create_time`: corresponds to time the JobTrigger was created. - // - `update_time`: corresponds to time the JobTrigger was last updated. - // - `last_run_time`: corresponds to the last time the JobTrigger ran. - // - `name`: corresponds to JobTrigger's name. - // - `display_name`: corresponds to JobTrigger's display name. - // - `status`: corresponds to JobTrigger's status. - string order_by = 4; - - // Allows filtering. - // - // Supported syntax: - // - // * Filter expressions are made up of one or more restrictions. - // * Restrictions can be combined by `AND` or `OR` logical operators. A - // sequence of restrictions implicitly uses `AND`. - // * A restriction has the form of `{field} {operator} {value}`. - // * Supported fields/values for inspect jobs: - // - `status` - HEALTHY|PAUSED|CANCELLED - // - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY - // - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by - // quotation marks. Nanoseconds are ignored. - // - 'error_count' - Number of errors that have occurred while running. - // * The operator must be `=` or `!=` for status and inspected_storage. - // - // Examples: - // - // * inspected_storage = cloud_storage AND status = HEALTHY - // * inspected_storage = cloud_storage OR inspected_storage = bigquery - // * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY) - // * last_run_time > \"2017-12-12T00:00:00+00:00\" - // - // The length of this field should be no more than 500 characters. - string filter = 5; - - // The geographic location where job triggers will be retrieved from. - // Use `-` for all locations. Reserved for future extensions. - string location_id = 7; -} - -// Response message for ListJobTriggers. -message ListJobTriggersResponse { - // List of triggeredJobs, up to page_size in ListJobTriggersRequest. - repeated JobTrigger job_triggers = 1; - - // If the next page is available then the next page token to be used - // in following ListJobTriggers request. - string next_page_token = 2; -} - -// Request message for DeleteJobTrigger. -message DeleteJobTriggerRequest { - // Required. Resource name of the project and the triggeredJob, for example - // `projects/dlp-test-project/jobTriggers/53234423`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/JobTrigger" - } - ]; -} - -// Controls what and how to inspect for findings. -message InspectJobConfig { - // The data to scan. - StorageConfig storage_config = 1; - - // How and what to scan for. - InspectConfig inspect_config = 2; - - // If provided, will be used as the default for all values in InspectConfig. - // `inspect_config` will be merged into the values persisted as part of the - // template. - string inspect_template_name = 3; - - // Actions to execute at the completion of the job. - repeated Action actions = 4; -} - -// Combines all of the information about a DLP job. -message DlpJob { - option (google.api.resource) = { - type: "dlp.googleapis.com/DlpJob" - pattern: "projects/{project}/dlpJobs/{dlp_job}" - }; - - // Possible states of a job. - enum JobState { - // Unused. - JOB_STATE_UNSPECIFIED = 0; - - // The job has not yet started. - PENDING = 1; - - // The job is currently running. - RUNNING = 2; - - // The job is no longer running. - DONE = 3; - - // The job was canceled before it could complete. - CANCELED = 4; - - // The job had an error and did not complete. - FAILED = 5; - } - - // The server-assigned name. - string name = 1; - - // The type of job. - DlpJobType type = 2; - - // State of a job. - JobState state = 3; - - oneof details { - // Results from analyzing risk of a data source. - AnalyzeDataSourceRiskDetails risk_details = 4; - - // Results from inspecting a data source. - InspectDataSourceDetails inspect_details = 5; - } - - // Time when the job was created. - google.protobuf.Timestamp create_time = 6; - - // Time when the job started. - google.protobuf.Timestamp start_time = 7; - - // Time when the job finished. - google.protobuf.Timestamp end_time = 8; - - // If created by a job trigger, the resource name of the trigger that - // instantiated the job. - string job_trigger_name = 10; - - // A stream of errors encountered running the job. - repeated Error errors = 11; -} - -// The request message for [DlpJobs.GetDlpJob][]. -message GetDlpJobRequest { - // Required. The name of the DlpJob resource. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/DlpJob" - } - ]; -} - -// The request message for listing DLP jobs. -message ListDlpJobsRequest { - // Required. The parent resource name, for example projects/my-project-id. - string parent = 4 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Allows filtering. - // - // Supported syntax: - // - // * Filter expressions are made up of one or more restrictions. - // * Restrictions can be combined by `AND` or `OR` logical operators. A - // sequence of restrictions implicitly uses `AND`. - // * A restriction has the form of `{field} {operator} {value}`. - // * Supported fields/values for inspect jobs: - // - `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED - // - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY - // - `trigger_name` - The resource name of the trigger that created job. - // - 'end_time` - Corresponds to time the job finished. - // - 'start_time` - Corresponds to time the job finished. - // * Supported fields for risk analysis jobs: - // - `state` - RUNNING|CANCELED|FINISHED|FAILED - // - 'end_time` - Corresponds to time the job finished. - // - 'start_time` - Corresponds to time the job finished. - // * The operator must be `=` or `!=`. - // - // Examples: - // - // * inspected_storage = cloud_storage AND state = done - // * inspected_storage = cloud_storage OR inspected_storage = bigquery - // * inspected_storage = cloud_storage AND (state = done OR state = canceled) - // * end_time > \"2017-12-12T00:00:00+00:00\" - // - // The length of this field should be no more than 500 characters. - string filter = 1; - - // The standard list page size. - int32 page_size = 2; - - // The standard list page token. - string page_token = 3; - - // The type of job. Defaults to `DlpJobType.INSPECT` - DlpJobType type = 5; - - // Comma separated list of fields to order by, - // followed by `asc` or `desc` postfix. This list is case-insensitive, - // default sorting order is ascending, redundant space characters are - // insignificant. - // - // Example: `name asc, end_time asc, create_time desc` - // - // Supported fields are: - // - // - `create_time`: corresponds to time the job was created. - // - `end_time`: corresponds to time the job ended. - // - `name`: corresponds to job's name. - // - `state`: corresponds to `state` - string order_by = 6; - - // The geographic location where jobs will be retrieved from. - // Use `-` for all locations. Reserved for future extensions. - string location_id = 7; -} - -// The response message for listing DLP jobs. -message ListDlpJobsResponse { - // A list of DlpJobs that matches the specified filter in the request. - repeated DlpJob jobs = 1; - - // The standard List next-page token. - string next_page_token = 2; -} - -// The request message for canceling a DLP job. -message CancelDlpJobRequest { - // Required. The name of the DlpJob resource to be cancelled. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/DlpJob" - } - ]; -} - -// The request message for deleting a DLP job. -message DeleteDlpJobRequest { - // Required. The name of the DlpJob resource to be deleted. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/DlpJob" - } - ]; -} - -// Request message for CreateDeidentifyTemplate. -message CreateDeidentifyTemplateRequest { - // Required. The parent resource name, for example projects/my-project-id or - // organizations/my-org-id. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dlp.googleapis.com/DeidentifyTemplate" - } - ]; - - // Required. The DeidentifyTemplate to create. - DeidentifyTemplate deidentify_template = 2 [(google.api.field_behavior) = REQUIRED]; - - // The template id can contain uppercase and lowercase letters, - // numbers, and hyphens; that is, it must match the regular - // expression: `[a-zA-Z\\d-_]+`. The maximum length is 100 - // characters. Can be empty to allow the system to generate one. - string template_id = 3; - - // The geographic location to store the deidentification template. Reserved - // for future extensions. - string location_id = 4; -} - -// Request message for UpdateDeidentifyTemplate. -message UpdateDeidentifyTemplateRequest { - // Required. Resource name of organization and deidentify template to be updated, for - // example `organizations/433245324/deidentifyTemplates/432452342` or - // projects/project-id/deidentifyTemplates/432452342. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/DeidentifyTemplate" - } - ]; - - // New DeidentifyTemplate value. - DeidentifyTemplate deidentify_template = 2; - - // Mask to control which fields get updated. - google.protobuf.FieldMask update_mask = 3; -} - -// Request message for GetDeidentifyTemplate. -message GetDeidentifyTemplateRequest { - // Required. Resource name of the organization and deidentify template to be read, for - // example `organizations/433245324/deidentifyTemplates/432452342` or - // projects/project-id/deidentifyTemplates/432452342. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/DeidentifyTemplate" - } - ]; -} - -// Request message for ListDeidentifyTemplates. -message ListDeidentifyTemplatesRequest { - // Required. The parent resource name, for example projects/my-project-id or - // organizations/my-org-id. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dlp.googleapis.com/DeidentifyTemplate" - } - ]; - - // Page token to continue retrieval. Comes from previous call - // to `ListDeidentifyTemplates`. - string page_token = 2; - - // Size of the page, can be limited by server. If zero server returns - // a page of max size 100. - int32 page_size = 3; - - // Comma separated list of fields to order by, - // followed by `asc` or `desc` postfix. This list is case-insensitive, - // default sorting order is ascending, redundant space characters are - // insignificant. - // - // Example: `name asc,update_time, create_time desc` - // - // Supported fields are: - // - // - `create_time`: corresponds to time the template was created. - // - `update_time`: corresponds to time the template was last updated. - // - `name`: corresponds to template's name. - // - `display_name`: corresponds to template's display name. - string order_by = 4; - - // The geographic location where deidentifications templates will be retrieved - // from. Use `-` for all locations. Reserved for future extensions. - string location_id = 5; -} - -// Response message for ListDeidentifyTemplates. -message ListDeidentifyTemplatesResponse { - // List of deidentify templates, up to page_size in - // ListDeidentifyTemplatesRequest. - repeated DeidentifyTemplate deidentify_templates = 1; - - // If the next page is available then the next page token to be used - // in following ListDeidentifyTemplates request. - string next_page_token = 2; -} - -// Request message for DeleteDeidentifyTemplate. -message DeleteDeidentifyTemplateRequest { - // Required. Resource name of the organization and deidentify template to be deleted, - // for example `organizations/433245324/deidentifyTemplates/432452342` or - // projects/project-id/deidentifyTemplates/432452342. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/DeidentifyTemplate" - } - ]; -} - -// Configuration for a custom dictionary created from a data source of any size -// up to the maximum size defined in the -// [limits](https://cloud.google.com/dlp/limits) page. The artifacts of -// dictionary creation are stored in the specified Google Cloud Storage -// location. Consider using `CustomInfoType.Dictionary` for smaller dictionaries -// that satisfy the size requirements. -message LargeCustomDictionaryConfig { - // Location to store dictionary artifacts in Google Cloud Storage. These files - // will only be accessible by project owners and the DLP API. If any of these - // artifacts are modified, the dictionary is considered invalid and can no - // longer be used. - CloudStoragePath output_path = 1; - - oneof source { - // Set of files containing newline-delimited lists of dictionary phrases. - CloudStorageFileSet cloud_storage_file_set = 2; - - // Field in a BigQuery table where each cell represents a dictionary phrase. - BigQueryField big_query_field = 3; - } -} - -// Summary statistics of a custom dictionary. -message LargeCustomDictionaryStats { - // Approximate number of distinct phrases in the dictionary. - int64 approx_num_phrases = 1; -} - -// Configuration for stored infoTypes. All fields and subfield are provided -// by the user. For more information, see -// https://cloud.google.com/dlp/docs/creating-custom-infotypes. -message StoredInfoTypeConfig { - // Display name of the StoredInfoType (max 256 characters). - string display_name = 1; - - // Description of the StoredInfoType (max 256 characters). - string description = 2; - - // Stored infotype types. - oneof type { - // StoredInfoType where findings are defined by a dictionary of phrases. - LargeCustomDictionaryConfig large_custom_dictionary = 3; - } -} - -// Statistics for a StoredInfoType. -message StoredInfoTypeStats { - // Stat types - oneof type { - // StoredInfoType where findings are defined by a dictionary of phrases. - LargeCustomDictionaryStats large_custom_dictionary = 1; - } -} - -// Version of a StoredInfoType, including the configuration used to build it, -// create timestamp, and current state. -message StoredInfoTypeVersion { - // StoredInfoType configuration. - StoredInfoTypeConfig config = 1; - - // Create timestamp of the version. Read-only, determined by the system - // when the version is created. - google.protobuf.Timestamp create_time = 2; - - // Stored info type version state. Read-only, updated by the system - // during dictionary creation. - StoredInfoTypeState state = 3; - - // Errors that occurred when creating this storedInfoType version, or - // anomalies detected in the storedInfoType data that render it unusable. Only - // the five most recent errors will be displayed, with the most recent error - // appearing first. - // - // For example, some of the data for stored custom dictionaries is put in - // the user's Google Cloud Storage bucket, and if this data is modified or - // deleted by the user or another system, the dictionary becomes invalid. - // - // If any errors occur, fix the problem indicated by the error message and - // use the UpdateStoredInfoType API method to create another version of the - // storedInfoType to continue using it, reusing the same `config` if it was - // not the source of the error. - repeated Error errors = 4; - - // Statistics about this storedInfoType version. - StoredInfoTypeStats stats = 5; -} - -// StoredInfoType resource message that contains information about the current -// version and any pending updates. -message StoredInfoType { - option (google.api.resource) = { - type: "dlp.googleapis.com/StoredInfoType" - pattern: "organizations/{organization}/storedInfoTypes/{stored_info_type}" - pattern: "projects/{project}/storedInfoTypes/{stored_info_type}" - }; - - // Resource name. - string name = 1; - - // Current version of the stored info type. - StoredInfoTypeVersion current_version = 2; - - // Pending versions of the stored info type. Empty if no versions are - // pending. - repeated StoredInfoTypeVersion pending_versions = 3; -} - -// Request message for CreateStoredInfoType. -message CreateStoredInfoTypeRequest { - // Required. The parent resource name, for example projects/my-project-id or - // organizations/my-org-id. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dlp.googleapis.com/StoredInfoType" - } - ]; - - // Required. Configuration of the storedInfoType to create. - StoredInfoTypeConfig config = 2 [(google.api.field_behavior) = REQUIRED]; - - // The storedInfoType ID can contain uppercase and lowercase letters, - // numbers, and hyphens; that is, it must match the regular - // expression: `[a-zA-Z\\d-_]+`. The maximum length is 100 - // characters. Can be empty to allow the system to generate one. - string stored_info_type_id = 3; - - // The geographic location to store the stored infoType. Reserved for - // future extensions. - string location_id = 4; -} - -// Request message for UpdateStoredInfoType. -message UpdateStoredInfoTypeRequest { - // Required. Resource name of organization and storedInfoType to be updated, for - // example `organizations/433245324/storedInfoTypes/432452342` or - // projects/project-id/storedInfoTypes/432452342. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/StoredInfoType" - } - ]; - - // Updated configuration for the storedInfoType. If not provided, a new - // version of the storedInfoType will be created with the existing - // configuration. - StoredInfoTypeConfig config = 2; - - // Mask to control which fields get updated. - google.protobuf.FieldMask update_mask = 3; -} - -// Request message for GetStoredInfoType. -message GetStoredInfoTypeRequest { - // Required. Resource name of the organization and storedInfoType to be read, for - // example `organizations/433245324/storedInfoTypes/432452342` or - // projects/project-id/storedInfoTypes/432452342. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/StoredInfoType" - } - ]; -} - -// Request message for ListStoredInfoTypes. -message ListStoredInfoTypesRequest { - // Required. The parent resource name, for example projects/my-project-id or - // organizations/my-org-id. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dlp.googleapis.com/StoredInfoType" - } - ]; - - // Page token to continue retrieval. Comes from previous call - // to `ListStoredInfoTypes`. - string page_token = 2; - - // Size of the page, can be limited by server. If zero server returns - // a page of max size 100. - int32 page_size = 3; - - // Comma separated list of fields to order by, - // followed by `asc` or `desc` postfix. This list is case-insensitive, - // default sorting order is ascending, redundant space characters are - // insignificant. - // - // Example: `name asc, display_name, create_time desc` - // - // Supported fields are: - // - // - `create_time`: corresponds to time the most recent version of the - // resource was created. - // - `state`: corresponds to the state of the resource. - // - `name`: corresponds to resource name. - // - `display_name`: corresponds to info type's display name. - string order_by = 4; - - // The geographic location where stored infoTypes will be retrieved from. - // Use `-` for all locations. Reserved for future extensions. - string location_id = 5; -} - -// Response message for ListStoredInfoTypes. -message ListStoredInfoTypesResponse { - // List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest. - repeated StoredInfoType stored_info_types = 1; - - // If the next page is available then the next page token to be used - // in following ListStoredInfoTypes request. - string next_page_token = 2; -} - -// Request message for DeleteStoredInfoType. -message DeleteStoredInfoTypeRequest { - // Required. Resource name of the organization and storedInfoType to be deleted, for - // example `organizations/433245324/storedInfoTypes/432452342` or - // projects/project-id/storedInfoTypes/432452342. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dlp.googleapis.com/StoredInfoType" - } - ]; -} - -// Operators available for comparing the value of fields. -enum RelationalOperator { - // Unused - RELATIONAL_OPERATOR_UNSPECIFIED = 0; - - // Equal. Attempts to match even with incompatible types. - EQUAL_TO = 1; - - // Not equal to. Attempts to match even with incompatible types. - NOT_EQUAL_TO = 2; - - // Greater than. - GREATER_THAN = 3; - - // Less than. - LESS_THAN = 4; - - // Greater than or equals. - GREATER_THAN_OR_EQUALS = 5; - - // Less than or equals. - LESS_THAN_OR_EQUALS = 6; - - // Exists - EXISTS = 7; -} - -// Type of the match which can be applied to different ways of matching, like -// Dictionary, regular expression and intersecting with findings of another -// info type. -enum MatchingType { - // Invalid. - MATCHING_TYPE_UNSPECIFIED = 0; - - // Full match. - // - // - Dictionary: join of Dictionary results matched complete finding quote - // - Regex: all regex matches fill a finding quote start to end - // - Exclude info type: completely inside affecting info types findings - MATCHING_TYPE_FULL_MATCH = 1; - - // Partial match. - // - // - Dictionary: at least one of the tokens in the finding matches - // - Regex: substring of the finding matches - // - Exclude info type: intersects with affecting info types findings - MATCHING_TYPE_PARTIAL_MATCH = 2; - - // Inverse match. - // - // - Dictionary: no tokens in the finding match the dictionary - // - Regex: finding doesn't match the regex - // - Exclude info type: no intersection with affecting info types findings - MATCHING_TYPE_INVERSE_MATCH = 3; -} - -// Options describing which parts of the provided content should be scanned. -enum ContentOption { - // Includes entire content of a file or a data stream. - CONTENT_UNSPECIFIED = 0; - - // Text content within the data, excluding any metadata. - CONTENT_TEXT = 1; - - // Images found in the data. - CONTENT_IMAGE = 2; -} - -// Parts of the APIs which use certain infoTypes. -enum InfoTypeSupportedBy { - // Unused. - ENUM_TYPE_UNSPECIFIED = 0; - - // Supported by the inspect operations. - INSPECT = 1; - - // Supported by the risk analysis operations. - RISK_ANALYSIS = 2; -} - -// An enum to represent the various types of DLP jobs. -enum DlpJobType { - // Unused - DLP_JOB_TYPE_UNSPECIFIED = 0; - - // The job inspected Google Cloud for sensitive data. - INSPECT_JOB = 1; - - // The job executed a Risk Analysis computation. - RISK_ANALYSIS_JOB = 2; -} - -// State of a StoredInfoType version. -enum StoredInfoTypeState { - // Unused - STORED_INFO_TYPE_STATE_UNSPECIFIED = 0; - - // StoredInfoType version is being created. - PENDING = 1; - - // StoredInfoType version is ready for use. - READY = 2; - - // StoredInfoType creation failed. All relevant error messages are returned in - // the `StoredInfoTypeVersion` message. - FAILED = 3; - - // StoredInfoType is no longer valid because artifacts stored in - // user-controlled storage were modified. To fix an invalid StoredInfoType, - // use the `UpdateStoredInfoType` method to create a new version. - INVALID = 4; -} diff --git a/dlp/google/cloud/dlp_v2/proto/dlp_pb2.py b/dlp/google/cloud/dlp_v2/proto/dlp_pb2.py deleted file mode 100644 index 0bdd6f8e96c4..000000000000 --- a/dlp/google/cloud/dlp_v2/proto/dlp_pb2.py +++ /dev/null @@ -1,18420 +0,0 @@ -# -*- coding: utf-8 -*- -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/privacy/dlp_v2/proto/dlp.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.dlp_v2.proto import ( - storage_pb2 as google_dot_cloud_dot_privacy_dot_dlp__v2_dot_proto_dot_storage__pb2, -) -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 -from google.type import date_pb2 as google_dot_type_dot_date__pb2 -from google.type import dayofweek_pb2 as google_dot_type_dot_dayofweek__pb2 -from google.type import timeofday_pb2 as google_dot_type_dot_timeofday__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/privacy/dlp_v2/proto/dlp.proto", - package="google.privacy.dlp.v2", - syntax="proto3", - serialized_options=_b( - "\n\031com.google.privacy.dlp.v2B\010DlpProtoP\001Z8google.golang.org/genproto/googleapis/privacy/dlp/v2;dlp\252\002\023Google.Cloud.Dlp.V2\312\002\023Google\\Cloud\\Dlp\\V2" - ), - serialized_pb=_b( - '\n+google/cloud/privacy/dlp_v2/proto/dlp.proto\x12\x15google.privacy.dlp.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a/google/cloud/privacy/dlp_v2/proto/storage.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x16google/type/date.proto\x1a\x1bgoogle/type/dayofweek.proto\x1a\x1bgoogle/type/timeofday.proto"G\n\x10\x45xcludeInfoTypes\x12\x33\n\ninfo_types\x18\x01 \x03(\x0b\x32\x1f.google.privacy.dlp.v2.InfoType"\xa0\x02\n\rExclusionRule\x12\x46\n\ndictionary\x18\x01 \x01(\x0b\x32\x30.google.privacy.dlp.v2.CustomInfoType.DictionaryH\x00\x12<\n\x05regex\x18\x02 \x01(\x0b\x32+.google.privacy.dlp.v2.CustomInfoType.RegexH\x00\x12\x45\n\x12\x65xclude_info_types\x18\x03 \x01(\x0b\x32\'.google.privacy.dlp.v2.ExcludeInfoTypesH\x00\x12:\n\rmatching_type\x18\x04 \x01(\x0e\x32#.google.privacy.dlp.v2.MatchingTypeB\x06\n\x04type"\xb1\x01\n\x0eInspectionRule\x12W\n\x0chotword_rule\x18\x01 \x01(\x0b\x32?.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRuleH\x00\x12>\n\x0e\x65xclusion_rule\x18\x02 \x01(\x0b\x32$.google.privacy.dlp.v2.ExclusionRuleH\x00\x42\x06\n\x04type"~\n\x11InspectionRuleSet\x12\x33\n\ninfo_types\x18\x01 \x03(\x0b\x32\x1f.google.privacy.dlp.v2.InfoType\x12\x34\n\x05rules\x18\x02 \x03(\x0b\x32%.google.privacy.dlp.v2.InspectionRule"\xc7\x05\n\rInspectConfig\x12\x33\n\ninfo_types\x18\x01 \x03(\x0b\x32\x1f.google.privacy.dlp.v2.InfoType\x12\x39\n\x0emin_likelihood\x18\x02 \x01(\x0e\x32!.google.privacy.dlp.v2.Likelihood\x12\x42\n\x06limits\x18\x03 \x01(\x0b\x32\x32.google.privacy.dlp.v2.InspectConfig.FindingLimits\x12\x15\n\rinclude_quote\x18\x04 \x01(\x08\x12\x1a\n\x12\x65xclude_info_types\x18\x05 \x01(\x08\x12@\n\x11\x63ustom_info_types\x18\x06 \x03(\x0b\x32%.google.privacy.dlp.v2.CustomInfoType\x12=\n\x0f\x63ontent_options\x18\x08 \x03(\x0e\x32$.google.privacy.dlp.v2.ContentOption\x12:\n\x08rule_set\x18\n \x03(\x0b\x32(.google.privacy.dlp.v2.InspectionRuleSet\x1a\x91\x02\n\rFindingLimits\x12\x1d\n\x15max_findings_per_item\x18\x01 \x01(\x05\x12 \n\x18max_findings_per_request\x18\x02 \x01(\x05\x12\x64\n\x1amax_findings_per_info_type\x18\x03 \x03(\x0b\x32@.google.privacy.dlp.v2.InspectConfig.FindingLimits.InfoTypeLimit\x1aY\n\rInfoTypeLimit\x12\x32\n\tinfo_type\x18\x01 \x01(\x0b\x32\x1f.google.privacy.dlp.v2.InfoType\x12\x14\n\x0cmax_findings\x18\x02 \x01(\x05"\xea\x01\n\x0f\x42yteContentItem\x12>\n\x04type\x18\x01 \x01(\x0e\x32\x30.google.privacy.dlp.v2.ByteContentItem.BytesType\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c"\x88\x01\n\tBytesType\x12\x1a\n\x16\x42YTES_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05IMAGE\x10\x06\x12\x0e\n\nIMAGE_JPEG\x10\x01\x12\r\n\tIMAGE_BMP\x10\x02\x12\r\n\tIMAGE_PNG\x10\x03\x12\r\n\tIMAGE_SVG\x10\x04\x12\r\n\tTEXT_UTF8\x10\x05\x12\x08\n\x04\x41VRO\x10\x0b"\x97\x01\n\x0b\x43ontentItem\x12\x0f\n\x05value\x18\x03 \x01(\tH\x00\x12-\n\x05table\x18\x04 \x01(\x0b\x32\x1c.google.privacy.dlp.v2.TableH\x00\x12;\n\tbyte_item\x18\x05 \x01(\x0b\x32&.google.privacy.dlp.v2.ByteContentItemH\x00\x42\x0b\n\tdata_item"\x9d\x01\n\x05Table\x12/\n\x07headers\x18\x01 \x03(\x0b\x32\x1e.google.privacy.dlp.v2.FieldId\x12.\n\x04rows\x18\x02 \x03(\x0b\x32 .google.privacy.dlp.v2.Table.Row\x1a\x33\n\x03Row\x12,\n\x06values\x18\x01 \x03(\x0b\x32\x1c.google.privacy.dlp.v2.Value"]\n\rInspectResult\x12\x30\n\x08\x66indings\x18\x01 \x03(\x0b\x32\x1e.google.privacy.dlp.v2.Finding\x12\x1a\n\x12\x66indings_truncated\x18\x02 \x01(\x08"\x9d\x02\n\x07\x46inding\x12\r\n\x05quote\x18\x01 \x01(\t\x12\x32\n\tinfo_type\x18\x02 \x01(\x0b\x32\x1f.google.privacy.dlp.v2.InfoType\x12\x35\n\nlikelihood\x18\x03 \x01(\x0e\x32!.google.privacy.dlp.v2.Likelihood\x12\x31\n\x08location\x18\x04 \x01(\x0b\x32\x1f.google.privacy.dlp.v2.Location\x12/\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\nquote_info\x18\x07 \x01(\x0b\x32 .google.privacy.dlp.v2.QuoteInfo"\xb6\x01\n\x08Location\x12\x30\n\nbyte_range\x18\x01 \x01(\x0b\x32\x1c.google.privacy.dlp.v2.Range\x12\x35\n\x0f\x63odepoint_range\x18\x02 \x01(\x0b\x32\x1c.google.privacy.dlp.v2.Range\x12\x41\n\x11\x63ontent_locations\x18\x07 \x03(\x0b\x32&.google.privacy.dlp.v2.ContentLocation"\xd1\x02\n\x0f\x43ontentLocation\x12\x16\n\x0e\x63ontainer_name\x18\x01 \x01(\t\x12@\n\x0frecord_location\x18\x02 \x01(\x0b\x32%.google.privacy.dlp.v2.RecordLocationH\x00\x12>\n\x0eimage_location\x18\x03 \x01(\x0b\x32$.google.privacy.dlp.v2.ImageLocationH\x00\x12\x44\n\x11\x64ocument_location\x18\x05 \x01(\x0b\x32\'.google.privacy.dlp.v2.DocumentLocationH\x00\x12\x37\n\x13\x63ontainer_timestamp\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x19\n\x11\x63ontainer_version\x18\x07 \x01(\tB\n\n\x08location"\'\n\x10\x44ocumentLocation\x12\x13\n\x0b\x66ile_offset\x18\x01 \x01(\x03"\xb6\x01\n\x0eRecordLocation\x12\x34\n\nrecord_key\x18\x01 \x01(\x0b\x32 .google.privacy.dlp.v2.RecordKey\x12\x30\n\x08\x66ield_id\x18\x02 \x01(\x0b\x32\x1e.google.privacy.dlp.v2.FieldId\x12<\n\x0etable_location\x18\x03 \x01(\x0b\x32$.google.privacy.dlp.v2.TableLocation""\n\rTableLocation\x12\x11\n\trow_index\x18\x01 \x01(\x03"#\n\x05Range\x12\r\n\x05start\x18\x01 \x01(\x03\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x03"K\n\rImageLocation\x12:\n\x0e\x62ounding_boxes\x18\x01 \x03(\x0b\x32".google.privacy.dlp.v2.BoundingBox"G\n\x0b\x42oundingBox\x12\x0b\n\x03top\x18\x01 \x01(\x05\x12\x0c\n\x04left\x18\x02 \x01(\x05\x12\r\n\x05width\x18\x03 \x01(\x05\x12\x0e\n\x06height\x18\x04 \x01(\x05"\x8a\x04\n\x12RedactImageRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x13\n\x0blocation_id\x18\x08 \x01(\t\x12<\n\x0einspect_config\x18\x02 \x01(\x0b\x32$.google.privacy.dlp.v2.InspectConfig\x12_\n\x17image_redaction_configs\x18\x05 \x03(\x0b\x32>.google.privacy.dlp.v2.RedactImageRequest.ImageRedactionConfig\x12\x18\n\x10include_findings\x18\x06 \x01(\x08\x12\x39\n\tbyte_item\x18\x07 \x01(\x0b\x32&.google.privacy.dlp.v2.ByteContentItem\x1a\xa8\x01\n\x14ImageRedactionConfig\x12\x34\n\tinfo_type\x18\x01 \x01(\x0b\x32\x1f.google.privacy.dlp.v2.InfoTypeH\x00\x12\x19\n\x0fredact_all_text\x18\x02 \x01(\x08H\x00\x12\x35\n\x0fredaction_color\x18\x03 \x01(\x0b\x32\x1c.google.privacy.dlp.v2.ColorB\x08\n\x06target"1\n\x05\x43olor\x12\x0b\n\x03red\x18\x01 \x01(\x02\x12\r\n\x05green\x18\x02 \x01(\x02\x12\x0c\n\x04\x62lue\x18\x03 \x01(\x02"\x83\x01\n\x13RedactImageResponse\x12\x16\n\x0eredacted_image\x18\x01 \x01(\x0c\x12\x16\n\x0e\x65xtracted_text\x18\x02 \x01(\t\x12<\n\x0einspect_result\x18\x03 \x01(\x0b\x32$.google.privacy.dlp.v2.InspectResult"\xe6\x02\n\x18\x44\x65identifyContentRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x42\n\x11\x64\x65identify_config\x18\x02 \x01(\x0b\x32\'.google.privacy.dlp.v2.DeidentifyConfig\x12<\n\x0einspect_config\x18\x03 \x01(\x0b\x32$.google.privacy.dlp.v2.InspectConfig\x12\x30\n\x04item\x18\x04 \x01(\x0b\x32".google.privacy.dlp.v2.ContentItem\x12\x1d\n\x15inspect_template_name\x18\x05 \x01(\t\x12 \n\x18\x64\x65identify_template_name\x18\x06 \x01(\t\x12\x13\n\x0blocation_id\x18\x07 \x01(\t"\x8e\x01\n\x19\x44\x65identifyContentResponse\x12\x30\n\x04item\x18\x01 \x01(\x0b\x32".google.privacy.dlp.v2.ContentItem\x12?\n\x08overview\x18\x02 \x01(\x0b\x32-.google.privacy.dlp.v2.TransformationOverview"\xe9\x02\n\x18ReidentifyContentRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x42\n\x11reidentify_config\x18\x02 \x01(\x0b\x32\'.google.privacy.dlp.v2.DeidentifyConfig\x12<\n\x0einspect_config\x18\x03 \x01(\x0b\x32$.google.privacy.dlp.v2.InspectConfig\x12\x30\n\x04item\x18\x04 \x01(\x0b\x32".google.privacy.dlp.v2.ContentItem\x12\x1d\n\x15inspect_template_name\x18\x05 \x01(\t\x12 \n\x18reidentify_template_name\x18\x06 \x01(\t\x12\x13\n\x0blocation_id\x18\x07 \x01(\t"\x8e\x01\n\x19ReidentifyContentResponse\x12\x30\n\x04item\x18\x01 \x01(\x0b\x32".google.privacy.dlp.v2.ContentItem\x12?\n\x08overview\x18\x02 \x01(\x0b\x32-.google.privacy.dlp.v2.TransformationOverview"\xfd\x01\n\x15InspectContentRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12<\n\x0einspect_config\x18\x02 \x01(\x0b\x32$.google.privacy.dlp.v2.InspectConfig\x12\x30\n\x04item\x18\x03 \x01(\x0b\x32".google.privacy.dlp.v2.ContentItem\x12\x1d\n\x15inspect_template_name\x18\x04 \x01(\t\x12\x13\n\x0blocation_id\x18\x05 \x01(\t"N\n\x16InspectContentResponse\x12\x34\n\x06result\x18\x01 \x01(\x0b\x32$.google.privacy.dlp.v2.InspectResult"\xb7\x02\n\x13OutputStorageConfig\x12\x35\n\x05table\x18\x01 \x01(\x0b\x32$.google.privacy.dlp.v2.BigQueryTableH\x00\x12N\n\routput_schema\x18\x03 \x01(\x0e\x32\x37.google.privacy.dlp.v2.OutputStorageConfig.OutputSchema"\x90\x01\n\x0cOutputSchema\x12\x1d\n\x19OUTPUT_SCHEMA_UNSPECIFIED\x10\x00\x12\x11\n\rBASIC_COLUMNS\x10\x01\x12\x0f\n\x0bGCS_COLUMNS\x10\x02\x12\x15\n\x11\x44\x41TASTORE_COLUMNS\x10\x03\x12\x15\n\x11\x42IG_QUERY_COLUMNS\x10\x04\x12\x0f\n\x0b\x41LL_COLUMNS\x10\x05\x42\x06\n\x04type"R\n\rInfoTypeStats\x12\x32\n\tinfo_type\x18\x01 \x01(\x0b\x32\x1f.google.privacy.dlp.v2.InfoType\x12\r\n\x05\x63ount\x18\x02 \x01(\x03"\xdd\x03\n\x18InspectDataSourceDetails\x12[\n\x11requested_options\x18\x02 \x01(\x0b\x32@.google.privacy.dlp.v2.InspectDataSourceDetails.RequestedOptions\x12\x46\n\x06result\x18\x03 \x01(\x0b\x32\x36.google.privacy.dlp.v2.InspectDataSourceDetails.Result\x1a\x9a\x01\n\x10RequestedOptions\x12I\n\x19snapshot_inspect_template\x18\x01 \x01(\x0b\x32&.google.privacy.dlp.v2.InspectTemplate\x12;\n\njob_config\x18\x03 \x01(\x0b\x32\'.google.privacy.dlp.v2.InspectJobConfig\x1a\x7f\n\x06Result\x12\x17\n\x0fprocessed_bytes\x18\x01 \x01(\x03\x12\x1d\n\x15total_estimated_bytes\x18\x02 \x01(\x03\x12=\n\x0finfo_type_stats\x18\x03 \x03(\x0b\x32$.google.privacy.dlp.v2.InfoTypeStats"\x90\x01\n\x13InfoTypeDescription\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12@\n\x0csupported_by\x18\x03 \x03(\x0e\x32*.google.privacy.dlp.v2.InfoTypeSupportedBy\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t"R\n\x14ListInfoTypesRequest\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x13\n\x0blocation_id\x18\x03 \x01(\t"W\n\x15ListInfoTypesResponse\x12>\n\ninfo_types\x18\x01 \x03(\x0b\x32*.google.privacy.dlp.v2.InfoTypeDescription"\xc1\x01\n\x15RiskAnalysisJobConfig\x12<\n\x0eprivacy_metric\x18\x01 \x01(\x0b\x32$.google.privacy.dlp.v2.PrivacyMetric\x12:\n\x0csource_table\x18\x02 \x01(\x0b\x32$.google.privacy.dlp.v2.BigQueryTable\x12.\n\x07\x61\x63tions\x18\x03 \x03(\x0b\x32\x1d.google.privacy.dlp.v2.Action"\xbc\x01\n\x07QuasiId\x12\x32\n\x05\x66ield\x18\x01 \x01(\x0b\x32\x1e.google.privacy.dlp.v2.FieldIdB\x03\xe0\x41\x02\x12\x34\n\tinfo_type\x18\x02 \x01(\x0b\x32\x1f.google.privacy.dlp.v2.InfoTypeH\x00\x12\x14\n\ncustom_tag\x18\x03 \x01(\tH\x00\x12*\n\x08inferred\x18\x04 \x01(\x0b\x32\x16.google.protobuf.EmptyH\x00\x42\x05\n\x03tag"\xbe\x02\n\x10StatisticalTable\x12\x38\n\x05table\x18\x03 \x01(\x0b\x32$.google.privacy.dlp.v2.BigQueryTableB\x03\xe0\x41\x02\x12T\n\tquasi_ids\x18\x01 \x03(\x0b\x32<.google.privacy.dlp.v2.StatisticalTable.QuasiIdentifierFieldB\x03\xe0\x41\x02\x12?\n\x12relative_frequency\x18\x02 \x01(\x0b\x32\x1e.google.privacy.dlp.v2.FieldIdB\x03\xe0\x41\x02\x1aY\n\x14QuasiIdentifierField\x12-\n\x05\x66ield\x18\x01 \x01(\x0b\x32\x1e.google.privacy.dlp.v2.FieldId\x12\x12\n\ncustom_tag\x18\x02 \x01(\t"\x93\x0f\n\rPrivacyMetric\x12[\n\x16numerical_stats_config\x18\x01 \x01(\x0b\x32\x39.google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfigH\x00\x12_\n\x18\x63\x61tegorical_stats_config\x18\x02 \x01(\x0b\x32;.google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfigH\x00\x12S\n\x12k_anonymity_config\x18\x03 \x01(\x0b\x32\x35.google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfigH\x00\x12S\n\x12l_diversity_config\x18\x04 \x01(\x0b\x32\x35.google.privacy.dlp.v2.PrivacyMetric.LDiversityConfigH\x00\x12\\\n\x17k_map_estimation_config\x18\x05 \x01(\x0b\x32\x39.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfigH\x00\x12n\n delta_presence_estimation_config\x18\x06 \x01(\x0b\x32\x42.google.privacy.dlp.v2.PrivacyMetric.DeltaPresenceEstimationConfigH\x00\x1a\x45\n\x14NumericalStatsConfig\x12-\n\x05\x66ield\x18\x01 \x01(\x0b\x32\x1e.google.privacy.dlp.v2.FieldId\x1aG\n\x16\x43\x61tegoricalStatsConfig\x12-\n\x05\x66ield\x18\x01 \x01(\x0b\x32\x1e.google.privacy.dlp.v2.FieldId\x1ay\n\x10KAnonymityConfig\x12\x31\n\tquasi_ids\x18\x01 \x03(\x0b\x32\x1e.google.privacy.dlp.v2.FieldId\x12\x32\n\tentity_id\x18\x02 \x01(\x0b\x32\x1f.google.privacy.dlp.v2.EntityId\x1a\x82\x01\n\x10LDiversityConfig\x12\x31\n\tquasi_ids\x18\x01 \x03(\x0b\x32\x1e.google.privacy.dlp.v2.FieldId\x12;\n\x13sensitive_attribute\x18\x02 \x01(\x0b\x32\x1e.google.privacy.dlp.v2.FieldId\x1a\x81\x06\n\x14KMapEstimationConfig\x12]\n\tquasi_ids\x18\x01 \x03(\x0b\x32\x45.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.TaggedFieldB\x03\xe0\x41\x02\x12\x13\n\x0bregion_code\x18\x02 \x01(\t\x12\x62\n\x10\x61uxiliary_tables\x18\x03 \x03(\x0b\x32H.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable\x1a\xc0\x01\n\x0bTaggedField\x12\x32\n\x05\x66ield\x18\x01 \x01(\x0b\x32\x1e.google.privacy.dlp.v2.FieldIdB\x03\xe0\x41\x02\x12\x34\n\tinfo_type\x18\x02 \x01(\x0b\x32\x1f.google.privacy.dlp.v2.InfoTypeH\x00\x12\x14\n\ncustom_tag\x18\x03 \x01(\tH\x00\x12*\n\x08inferred\x18\x04 \x01(\x0b\x32\x16.google.protobuf.EmptyH\x00\x42\x05\n\x03tag\x1a\xcd\x02\n\x0e\x41uxiliaryTable\x12\x38\n\x05table\x18\x03 \x01(\x0b\x32$.google.privacy.dlp.v2.BigQueryTableB\x03\xe0\x41\x02\x12m\n\tquasi_ids\x18\x01 \x03(\x0b\x32U.google.privacy.dlp.v2.PrivacyMetric.KMapEstimationConfig.AuxiliaryTable.QuasiIdFieldB\x03\xe0\x41\x02\x12?\n\x12relative_frequency\x18\x02 \x01(\x0b\x32\x1e.google.privacy.dlp.v2.FieldIdB\x03\xe0\x41\x02\x1aQ\n\x0cQuasiIdField\x12-\n\x05\x66ield\x18\x01 \x01(\x0b\x32\x1e.google.privacy.dlp.v2.FieldId\x12\x12\n\ncustom_tag\x18\x02 \x01(\t\x1a\xaf\x01\n\x1d\x44\x65ltaPresenceEstimationConfig\x12\x36\n\tquasi_ids\x18\x01 \x03(\x0b\x32\x1e.google.privacy.dlp.v2.QuasiIdB\x03\xe0\x41\x02\x12\x13\n\x0bregion_code\x18\x02 \x01(\t\x12\x41\n\x10\x61uxiliary_tables\x18\x03 \x03(\x0b\x32\'.google.privacy.dlp.v2.StatisticalTableB\x06\n\x04type"\xf2\x1d\n\x1c\x41nalyzeDataSourceRiskDetails\x12\x46\n\x18requested_privacy_metric\x18\x01 \x01(\x0b\x32$.google.privacy.dlp.v2.PrivacyMetric\x12\x44\n\x16requested_source_table\x18\x02 \x01(\x0b\x32$.google.privacy.dlp.v2.BigQueryTable\x12j\n\x16numerical_stats_result\x18\x03 \x01(\x0b\x32H.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResultH\x00\x12n\n\x18\x63\x61tegorical_stats_result\x18\x04 \x01(\x0b\x32J.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResultH\x00\x12\x62\n\x12k_anonymity_result\x18\x05 \x01(\x0b\x32\x44.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResultH\x00\x12\x62\n\x12l_diversity_result\x18\x06 \x01(\x0b\x32\x44.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResultH\x00\x12k\n\x17k_map_estimation_result\x18\x07 \x01(\x0b\x32H.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResultH\x00\x12}\n delta_presence_estimation_result\x18\t \x01(\x0b\x32Q.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResultH\x00\x1a\xaf\x01\n\x14NumericalStatsResult\x12/\n\tmin_value\x18\x01 \x01(\x0b\x32\x1c.google.privacy.dlp.v2.Value\x12/\n\tmax_value\x18\x02 \x01(\x0b\x32\x1c.google.privacy.dlp.v2.Value\x12\x35\n\x0fquantile_values\x18\x04 \x03(\x0b\x32\x1c.google.privacy.dlp.v2.Value\x1a\x8d\x03\n\x16\x43\x61tegoricalStatsResult\x12\x95\x01\n!value_frequency_histogram_buckets\x18\x05 \x03(\x0b\x32j.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.CategoricalStatsResult.CategoricalStatsHistogramBucket\x1a\xda\x01\n\x1f\x43\x61tegoricalStatsHistogramBucket\x12#\n\x1bvalue_frequency_lower_bound\x18\x01 \x01(\x03\x12#\n\x1bvalue_frequency_upper_bound\x18\x02 \x01(\x03\x12\x13\n\x0b\x62ucket_size\x18\x03 \x01(\x03\x12<\n\rbucket_values\x18\x04 \x03(\x0b\x32%.google.privacy.dlp.v2.ValueFrequency\x12\x1a\n\x12\x62ucket_value_count\x18\x05 \x01(\x03\x1a\xb5\x04\n\x10KAnonymityResult\x12\x8b\x01\n#equivalence_class_histogram_buckets\x18\x05 \x03(\x0b\x32^.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityHistogramBucket\x1at\n\x1aKAnonymityEquivalenceClass\x12\x36\n\x10quasi_ids_values\x18\x01 \x03(\x0b\x32\x1c.google.privacy.dlp.v2.Value\x12\x1e\n\x16\x65quivalence_class_size\x18\x02 \x01(\x03\x1a\x9c\x02\n\x19KAnonymityHistogramBucket\x12*\n"equivalence_class_size_lower_bound\x18\x01 \x01(\x03\x12*\n"equivalence_class_size_upper_bound\x18\x02 \x01(\x03\x12\x13\n\x0b\x62ucket_size\x18\x03 \x01(\x03\x12v\n\rbucket_values\x18\x04 \x03(\x0b\x32_.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult.KAnonymityEquivalenceClass\x12\x1a\n\x12\x62ucket_value_count\x18\x05 \x01(\x03\x1a\xb0\x05\n\x10LDiversityResult\x12\x93\x01\n+sensitive_value_frequency_histogram_buckets\x18\x05 \x03(\x0b\x32^.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityHistogramBucket\x1a\xe0\x01\n\x1aLDiversityEquivalenceClass\x12\x36\n\x10quasi_ids_values\x18\x01 \x03(\x0b\x32\x1c.google.privacy.dlp.v2.Value\x12\x1e\n\x16\x65quivalence_class_size\x18\x02 \x01(\x03\x12%\n\x1dnum_distinct_sensitive_values\x18\x03 \x01(\x03\x12\x43\n\x14top_sensitive_values\x18\x04 \x03(\x0b\x32%.google.privacy.dlp.v2.ValueFrequency\x1a\xa2\x02\n\x19LDiversityHistogramBucket\x12-\n%sensitive_value_frequency_lower_bound\x18\x01 \x01(\x03\x12-\n%sensitive_value_frequency_upper_bound\x18\x02 \x01(\x03\x12\x13\n\x0b\x62ucket_size\x18\x03 \x01(\x03\x12v\n\rbucket_values\x18\x04 \x03(\x0b\x32_.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.LDiversityResult.LDiversityEquivalenceClass\x12\x1a\n\x12\x62ucket_value_count\x18\x05 \x01(\x03\x1a\x95\x04\n\x14KMapEstimationResult\x12\x8a\x01\n\x1ak_map_estimation_histogram\x18\x01 \x03(\x0b\x32\x66.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationHistogramBucket\x1ar\n\x1bKMapEstimationQuasiIdValues\x12\x36\n\x10quasi_ids_values\x18\x01 \x03(\x0b\x32\x1c.google.privacy.dlp.v2.Value\x12\x1b\n\x13\x65stimated_anonymity\x18\x02 \x01(\x03\x1a\xfb\x01\n\x1dKMapEstimationHistogramBucket\x12\x15\n\rmin_anonymity\x18\x01 \x01(\x03\x12\x15\n\rmax_anonymity\x18\x02 \x01(\x03\x12\x13\n\x0b\x62ucket_size\x18\x05 \x01(\x03\x12{\n\rbucket_values\x18\x06 \x03(\x0b\x32\x64.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult.KMapEstimationQuasiIdValues\x12\x1a\n\x12\x62ucket_value_count\x18\x07 \x01(\x03\x1a\xe4\x04\n\x1d\x44\x65ltaPresenceEstimationResult\x12\xa5\x01\n#delta_presence_estimation_histogram\x18\x01 \x03(\x0b\x32x.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationHistogramBucket\x1a}\n$DeltaPresenceEstimationQuasiIdValues\x12\x36\n\x10quasi_ids_values\x18\x01 \x03(\x0b\x32\x1c.google.privacy.dlp.v2.Value\x12\x1d\n\x15\x65stimated_probability\x18\x02 \x01(\x01\x1a\x9b\x02\n&DeltaPresenceEstimationHistogramBucket\x12\x17\n\x0fmin_probability\x18\x01 \x01(\x01\x12\x17\n\x0fmax_probability\x18\x02 \x01(\x01\x12\x13\n\x0b\x62ucket_size\x18\x05 \x01(\x03\x12\x8d\x01\n\rbucket_values\x18\x06 \x03(\x0b\x32v.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult.DeltaPresenceEstimationQuasiIdValues\x12\x1a\n\x12\x62ucket_value_count\x18\x07 \x01(\x03\x42\x08\n\x06result"L\n\x0eValueFrequency\x12+\n\x05value\x18\x01 \x01(\x0b\x32\x1c.google.privacy.dlp.v2.Value\x12\r\n\x05\x63ount\x18\x02 \x01(\x03"\xb3\x02\n\x05Value\x12\x17\n\rinteger_value\x18\x01 \x01(\x03H\x00\x12\x15\n\x0b\x66loat_value\x18\x02 \x01(\x01H\x00\x12\x16\n\x0cstring_value\x18\x03 \x01(\tH\x00\x12\x17\n\rboolean_value\x18\x04 \x01(\x08H\x00\x12\x35\n\x0ftimestamp_value\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12,\n\ntime_value\x18\x06 \x01(\x0b\x32\x16.google.type.TimeOfDayH\x00\x12\'\n\ndate_value\x18\x07 \x01(\x0b\x32\x11.google.type.DateH\x00\x12\x33\n\x11\x64\x61y_of_week_value\x18\x08 \x01(\x0e\x32\x16.google.type.DayOfWeekH\x00\x42\x06\n\x04type"Q\n\tQuoteInfo\x12\x34\n\tdate_time\x18\x02 \x01(\x0b\x32\x1f.google.privacy.dlp.v2.DateTimeH\x00\x42\x0e\n\x0cparsed_quote"\xdf\x01\n\x08\x44\x61teTime\x12\x1f\n\x04\x64\x61te\x18\x01 \x01(\x0b\x32\x11.google.type.Date\x12+\n\x0b\x64\x61y_of_week\x18\x02 \x01(\x0e\x32\x16.google.type.DayOfWeek\x12$\n\x04time\x18\x03 \x01(\x0b\x32\x16.google.type.TimeOfDay\x12;\n\ttime_zone\x18\x04 \x01(\x0b\x32(.google.privacy.dlp.v2.DateTime.TimeZone\x1a"\n\x08TimeZone\x12\x16\n\x0eoffset_minutes\x18\x01 \x01(\x05"\xc9\x01\n\x10\x44\x65identifyConfig\x12S\n\x19info_type_transformations\x18\x01 \x01(\x0b\x32..google.privacy.dlp.v2.InfoTypeTransformationsH\x00\x12N\n\x16record_transformations\x18\x02 \x01(\x0b\x32,.google.privacy.dlp.v2.RecordTransformationsH\x00\x42\x10\n\x0etransformation"\xf5\x06\n\x17PrimitiveTransformation\x12\x43\n\x0ereplace_config\x18\x01 \x01(\x0b\x32).google.privacy.dlp.v2.ReplaceValueConfigH\x00\x12<\n\rredact_config\x18\x02 \x01(\x0b\x32#.google.privacy.dlp.v2.RedactConfigH\x00\x12K\n\x15\x63haracter_mask_config\x18\x03 \x01(\x0b\x32*.google.privacy.dlp.v2.CharacterMaskConfigH\x00\x12Y\n\x1d\x63rypto_replace_ffx_fpe_config\x18\x04 \x01(\x0b\x32\x30.google.privacy.dlp.v2.CryptoReplaceFfxFpeConfigH\x00\x12V\n\x1b\x66ixed_size_bucketing_config\x18\x05 \x01(\x0b\x32/.google.privacy.dlp.v2.FixedSizeBucketingConfigH\x00\x12\x42\n\x10\x62ucketing_config\x18\x06 \x01(\x0b\x32&.google.privacy.dlp.v2.BucketingConfigH\x00\x12Y\n\x1dreplace_with_info_type_config\x18\x07 \x01(\x0b\x32\x30.google.privacy.dlp.v2.ReplaceWithInfoTypeConfigH\x00\x12\x41\n\x10time_part_config\x18\x08 \x01(\x0b\x32%.google.privacy.dlp.v2.TimePartConfigH\x00\x12\x45\n\x12\x63rypto_hash_config\x18\t \x01(\x0b\x32\'.google.privacy.dlp.v2.CryptoHashConfigH\x00\x12\x43\n\x11\x64\x61te_shift_config\x18\x0b \x01(\x0b\x32&.google.privacy.dlp.v2.DateShiftConfigH\x00\x12W\n\x1b\x63rypto_deterministic_config\x18\x0c \x01(\x0b\x32\x30.google.privacy.dlp.v2.CryptoDeterministicConfigH\x00\x42\x10\n\x0etransformation"\xdc\x01\n\x0eTimePartConfig\x12G\n\x0fpart_to_extract\x18\x01 \x01(\x0e\x32..google.privacy.dlp.v2.TimePartConfig.TimePart"\x80\x01\n\x08TimePart\x12\x19\n\x15TIME_PART_UNSPECIFIED\x10\x00\x12\x08\n\x04YEAR\x10\x01\x12\t\n\x05MONTH\x10\x02\x12\x10\n\x0c\x44\x41Y_OF_MONTH\x10\x03\x12\x0f\n\x0b\x44\x41Y_OF_WEEK\x10\x04\x12\x10\n\x0cWEEK_OF_YEAR\x10\x05\x12\x0f\n\x0bHOUR_OF_DAY\x10\x06"H\n\x10\x43ryptoHashConfig\x12\x34\n\ncrypto_key\x18\x01 \x01(\x0b\x32 .google.privacy.dlp.v2.CryptoKey"\xc0\x01\n\x19\x43ryptoDeterministicConfig\x12\x34\n\ncrypto_key\x18\x01 \x01(\x0b\x32 .google.privacy.dlp.v2.CryptoKey\x12<\n\x13surrogate_info_type\x18\x02 \x01(\x0b\x32\x1f.google.privacy.dlp.v2.InfoType\x12/\n\x07\x63ontext\x18\x03 \x01(\x0b\x32\x1e.google.privacy.dlp.v2.FieldId"E\n\x12ReplaceValueConfig\x12/\n\tnew_value\x18\x01 \x01(\x0b\x32\x1c.google.privacy.dlp.v2.Value"\x1b\n\x19ReplaceWithInfoTypeConfig"\x0e\n\x0cRedactConfig"\xb6\x02\n\rCharsToIgnore\x12\x1c\n\x12\x63haracters_to_skip\x18\x01 \x01(\tH\x00\x12_\n\x1b\x63ommon_characters_to_ignore\x18\x02 \x01(\x0e\x32\x38.google.privacy.dlp.v2.CharsToIgnore.CommonCharsToIgnoreH\x00"\x97\x01\n\x13\x43ommonCharsToIgnore\x12&\n"COMMON_CHARS_TO_IGNORE_UNSPECIFIED\x10\x00\x12\x0b\n\x07NUMERIC\x10\x01\x12\x14\n\x10\x41LPHA_UPPER_CASE\x10\x02\x12\x14\n\x10\x41LPHA_LOWER_CASE\x10\x03\x12\x0f\n\x0bPUNCTUATION\x10\x04\x12\x0e\n\nWHITESPACE\x10\x05\x42\x0c\n\ncharacters"\xa3\x01\n\x13\x43haracterMaskConfig\x12\x19\n\x11masking_character\x18\x01 \x01(\t\x12\x16\n\x0enumber_to_mask\x18\x02 \x01(\x05\x12\x15\n\rreverse_order\x18\x03 \x01(\x08\x12\x42\n\x14\x63haracters_to_ignore\x18\x04 \x03(\x0b\x32$.google.privacy.dlp.v2.CharsToIgnore"\xa4\x01\n\x18\x46ixedSizeBucketingConfig\x12\x36\n\x0blower_bound\x18\x01 \x01(\x0b\x32\x1c.google.privacy.dlp.v2.ValueB\x03\xe0\x41\x02\x12\x36\n\x0bupper_bound\x18\x02 \x01(\x0b\x32\x1c.google.privacy.dlp.v2.ValueB\x03\xe0\x41\x02\x12\x18\n\x0b\x62ucket_size\x18\x03 \x01(\x01\x42\x03\xe0\x41\x02"\xeb\x01\n\x0f\x42ucketingConfig\x12>\n\x07\x62uckets\x18\x01 \x03(\x0b\x32-.google.privacy.dlp.v2.BucketingConfig.Bucket\x1a\x97\x01\n\x06\x42ucket\x12)\n\x03min\x18\x01 \x01(\x0b\x32\x1c.google.privacy.dlp.v2.Value\x12)\n\x03max\x18\x02 \x01(\x0b\x32\x1c.google.privacy.dlp.v2.Value\x12\x37\n\x11replacement_value\x18\x03 \x01(\x0b\x32\x1c.google.privacy.dlp.v2.Value"\xf9\x03\n\x19\x43ryptoReplaceFfxFpeConfig\x12\x39\n\ncrypto_key\x18\x01 \x01(\x0b\x32 .google.privacy.dlp.v2.CryptoKeyB\x03\xe0\x41\x02\x12/\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x1e.google.privacy.dlp.v2.FieldId\x12\x63\n\x0f\x63ommon_alphabet\x18\x04 \x01(\x0e\x32H.google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig.FfxCommonNativeAlphabetH\x00\x12\x19\n\x0f\x63ustom_alphabet\x18\x05 \x01(\tH\x00\x12\x0f\n\x05radix\x18\x06 \x01(\x05H\x00\x12<\n\x13surrogate_info_type\x18\x08 \x01(\x0b\x32\x1f.google.privacy.dlp.v2.InfoType"\x94\x01\n\x17\x46\x66xCommonNativeAlphabet\x12*\n&FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED\x10\x00\x12\x0b\n\x07NUMERIC\x10\x01\x12\x0f\n\x0bHEXADECIMAL\x10\x02\x12\x1c\n\x18UPPER_CASE_ALPHA_NUMERIC\x10\x03\x12\x11\n\rALPHA_NUMERIC\x10\x04\x42\n\n\x08\x61lphabet"\xd8\x01\n\tCryptoKey\x12>\n\ttransient\x18\x01 \x01(\x0b\x32).google.privacy.dlp.v2.TransientCryptoKeyH\x00\x12>\n\tunwrapped\x18\x02 \x01(\x0b\x32).google.privacy.dlp.v2.UnwrappedCryptoKeyH\x00\x12\x41\n\x0bkms_wrapped\x18\x03 \x01(\x0b\x32*.google.privacy.dlp.v2.KmsWrappedCryptoKeyH\x00\x42\x08\n\x06source"\'\n\x12TransientCryptoKey\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02"&\n\x12UnwrappedCryptoKey\x12\x10\n\x03key\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x02"M\n\x13KmsWrappedCryptoKey\x12\x18\n\x0bwrapped_key\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x1c\n\x0f\x63rypto_key_name\x18\x02 \x01(\tB\x03\xe0\x41\x02"\xc2\x01\n\x0f\x44\x61teShiftConfig\x12\x1d\n\x10upper_bound_days\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1d\n\x10lower_bound_days\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12/\n\x07\x63ontext\x18\x03 \x01(\x0b\x32\x1e.google.privacy.dlp.v2.FieldId\x12\x36\n\ncrypto_key\x18\x04 \x01(\x0b\x32 .google.privacy.dlp.v2.CryptoKeyH\x00\x42\x08\n\x06method"\xa5\x02\n\x17InfoTypeTransformations\x12\x63\n\x0ftransformations\x18\x01 \x03(\x0b\x32\x45.google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformationB\x03\xe0\x41\x02\x1a\xa4\x01\n\x16InfoTypeTransformation\x12\x33\n\ninfo_types\x18\x01 \x03(\x0b\x32\x1f.google.privacy.dlp.v2.InfoType\x12U\n\x18primitive_transformation\x18\x02 \x01(\x0b\x32..google.privacy.dlp.v2.PrimitiveTransformationB\x03\xe0\x41\x02"\xc0\x02\n\x13\x46ieldTransformation\x12\x33\n\x06\x66ields\x18\x01 \x03(\x0b\x32\x1e.google.privacy.dlp.v2.FieldIdB\x03\xe0\x41\x02\x12\x39\n\tcondition\x18\x03 \x01(\x0b\x32&.google.privacy.dlp.v2.RecordCondition\x12R\n\x18primitive_transformation\x18\x04 \x01(\x0b\x32..google.privacy.dlp.v2.PrimitiveTransformationH\x00\x12S\n\x19info_type_transformations\x18\x05 \x01(\x0b\x32..google.privacy.dlp.v2.InfoTypeTransformationsH\x00\x42\x10\n\x0etransformation"\xa9\x01\n\x15RecordTransformations\x12I\n\x15\x66ield_transformations\x18\x01 \x03(\x0b\x32*.google.privacy.dlp.v2.FieldTransformation\x12\x45\n\x13record_suppressions\x18\x02 \x03(\x0b\x32(.google.privacy.dlp.v2.RecordSuppression"N\n\x11RecordSuppression\x12\x39\n\tcondition\x18\x01 \x01(\x0b\x32&.google.privacy.dlp.v2.RecordCondition"\xdc\x04\n\x0fRecordCondition\x12G\n\x0b\x65xpressions\x18\x03 \x01(\x0b\x32\x32.google.privacy.dlp.v2.RecordCondition.Expressions\x1a\xae\x01\n\tCondition\x12\x32\n\x05\x66ield\x18\x01 \x01(\x0b\x32\x1e.google.privacy.dlp.v2.FieldIdB\x03\xe0\x41\x02\x12@\n\x08operator\x18\x03 \x01(\x0e\x32).google.privacy.dlp.v2.RelationalOperatorB\x03\xe0\x41\x02\x12+\n\x05value\x18\x04 \x01(\x0b\x32\x1c.google.privacy.dlp.v2.Value\x1aR\n\nConditions\x12\x44\n\nconditions\x18\x01 \x03(\x0b\x32\x30.google.privacy.dlp.v2.RecordCondition.Condition\x1a\xfa\x01\n\x0b\x45xpressions\x12\\\n\x10logical_operator\x18\x01 \x01(\x0e\x32\x42.google.privacy.dlp.v2.RecordCondition.Expressions.LogicalOperator\x12G\n\nconditions\x18\x03 \x01(\x0b\x32\x31.google.privacy.dlp.v2.RecordCondition.ConditionsH\x00"<\n\x0fLogicalOperator\x12 \n\x1cLOGICAL_OPERATOR_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41ND\x10\x01\x42\x06\n\x04type"\x83\x01\n\x16TransformationOverview\x12\x19\n\x11transformed_bytes\x18\x02 \x01(\x03\x12N\n\x18transformation_summaries\x18\x03 \x03(\x0b\x32,.google.privacy.dlp.v2.TransformationSummary"\x9f\x05\n\x15TransformationSummary\x12\x32\n\tinfo_type\x18\x01 \x01(\x0b\x32\x1f.google.privacy.dlp.v2.InfoType\x12-\n\x05\x66ield\x18\x02 \x01(\x0b\x32\x1e.google.privacy.dlp.v2.FieldId\x12\x46\n\x0etransformation\x18\x03 \x01(\x0b\x32..google.privacy.dlp.v2.PrimitiveTransformation\x12I\n\x15\x66ield_transformations\x18\x05 \x03(\x0b\x32*.google.privacy.dlp.v2.FieldTransformation\x12\x41\n\x0frecord_suppress\x18\x06 \x01(\x0b\x32(.google.privacy.dlp.v2.RecordSuppression\x12K\n\x07results\x18\x04 \x03(\x0b\x32:.google.privacy.dlp.v2.TransformationSummary.SummaryResult\x12\x19\n\x11transformed_bytes\x18\x07 \x01(\x03\x1a\x84\x01\n\rSummaryResult\x12\r\n\x05\x63ount\x18\x01 \x01(\x03\x12S\n\x04\x63ode\x18\x02 \x01(\x0e\x32\x45.google.privacy.dlp.v2.TransformationSummary.TransformationResultCode\x12\x0f\n\x07\x64\x65tails\x18\x03 \x01(\t"^\n\x18TransformationResultCode\x12*\n&TRANSFORMATION_RESULT_CODE_UNSPECIFIED\x10\x00\x12\x0b\n\x07SUCCESS\x10\x01\x12\t\n\x05\x45RROR\x10\x02"U\n\x08Schedule\x12?\n\x1arecurrence_period_duration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x42\x08\n\x06option"\x9e\x03\n\x0fInspectTemplate\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12<\n\x0einspect_config\x18\x06 \x01(\x0b\x32$.google.privacy.dlp.v2.InspectConfig:\xa2\x01\xea\x41\x9e\x01\n"dlp.googleapis.com/InspectTemplate\x12@organizations/{organization}/inspectTemplates/{inspect_template}\x12\x36projects/{project}/inspectTemplates/{inspect_template}"\xb6\x03\n\x12\x44\x65identifyTemplate\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x42\n\x11\x64\x65identify_config\x18\x06 \x01(\x0b\x32\'.google.privacy.dlp.v2.DeidentifyConfig:\xb1\x01\xea\x41\xad\x01\n%dlp.googleapis.com/DeidentifyTemplate\x12\x46organizations/{organization}/deidentifyTemplates/{deidentify_template}\x12\n\x0binspect_job\x18\x04 \x01(\x0b\x32\'.google.privacy.dlp.v2.InspectJobConfigH\x00\x12;\n\x08triggers\x18\x05 \x03(\x0b\x32).google.privacy.dlp.v2.JobTrigger.Trigger\x12\x31\n\x06\x65rrors\x18\x06 \x03(\x0b\x32\x1c.google.privacy.dlp.v2.ErrorB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rlast_run_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12=\n\x06status\x18\n \x01(\x0e\x32(.google.privacy.dlp.v2.JobTrigger.StatusB\x03\xe0\x41\x02\x1aI\n\x07Trigger\x12\x33\n\x08schedule\x18\x01 \x01(\x0b\x32\x1f.google.privacy.dlp.v2.ScheduleH\x00\x42\t\n\x07trigger"H\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x0b\n\x07HEALTHY\x10\x01\x12\n\n\x06PAUSED\x10\x02\x12\r\n\tCANCELLED\x10\x03:P\xea\x41M\n\x1d\x64lp.googleapis.com/JobTrigger\x12,projects/{project}/jobTriggers/{job_trigger}B\x05\n\x03job"\xf4\x05\n\x06\x41\x63tion\x12\x43\n\rsave_findings\x18\x01 \x01(\x0b\x32*.google.privacy.dlp.v2.Action.SaveFindingsH\x00\x12@\n\x07pub_sub\x18\x02 \x01(\x0b\x32-.google.privacy.dlp.v2.Action.PublishToPubSubH\x00\x12U\n\x17publish_summary_to_cscc\x18\x03 \x01(\x0b\x32\x32.google.privacy.dlp.v2.Action.PublishSummaryToCsccH\x00\x12q\n&publish_findings_to_cloud_data_catalog\x18\x05 \x01(\x0b\x32?.google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalogH\x00\x12V\n\x17job_notification_emails\x18\x08 \x01(\x0b\x32\x33.google.privacy.dlp.v2.Action.JobNotificationEmailsH\x00\x12T\n\x16publish_to_stackdriver\x18\t \x01(\x0b\x32\x32.google.privacy.dlp.v2.Action.PublishToStackdriverH\x00\x1aQ\n\x0cSaveFindings\x12\x41\n\routput_config\x18\x01 \x01(\x0b\x32*.google.privacy.dlp.v2.OutputStorageConfig\x1a \n\x0fPublishToPubSub\x12\r\n\x05topic\x18\x01 \x01(\t\x1a\x16\n\x14PublishSummaryToCscc\x1a#\n!PublishFindingsToCloudDataCatalog\x1a\x17\n\x15JobNotificationEmails\x1a\x16\n\x14PublishToStackdriverB\x08\n\x06\x61\x63tion"\xcb\x01\n\x1c\x43reateInspectTemplateRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12"dlp.googleapis.com/InspectTemplate\x12\x45\n\x10inspect_template\x18\x02 \x01(\x0b\x32&.google.privacy.dlp.v2.InspectTemplateB\x03\xe0\x41\x02\x12\x13\n\x0btemplate_id\x18\x03 \x01(\t\x12\x13\n\x0blocation_id\x18\x04 \x01(\t"\xcb\x01\n\x1cUpdateInspectTemplateRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n"dlp.googleapis.com/InspectTemplate\x12@\n\x10inspect_template\x18\x02 \x01(\x0b\x32&.google.privacy.dlp.v2.InspectTemplate\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"U\n\x19GetInspectTemplateRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n"dlp.googleapis.com/InspectTemplate"\xa7\x01\n\x1bListInspectTemplatesRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12"dlp.googleapis.com/InspectTemplate\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x10\n\x08order_by\x18\x04 \x01(\t\x12\x13\n\x0blocation_id\x18\x05 \x01(\t"z\n\x1cListInspectTemplatesResponse\x12\x41\n\x11inspect_templates\x18\x01 \x03(\x0b\x32&.google.privacy.dlp.v2.InspectTemplate\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"X\n\x1c\x44\x65leteInspectTemplateRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n"dlp.googleapis.com/InspectTemplate"\xc4\x01\n\x17\x43reateJobTriggerRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12;\n\x0bjob_trigger\x18\x02 \x01(\x0b\x32!.google.privacy.dlp.v2.JobTriggerB\x03\xe0\x41\x02\x12\x12\n\ntrigger_id\x18\x03 \x01(\t\x12\x13\n\x0blocation_id\x18\x04 \x01(\t"P\n\x19\x41\x63tivateJobTriggerRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x64lp.googleapis.com/JobTrigger"\xb7\x01\n\x17UpdateJobTriggerRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x64lp.googleapis.com/JobTrigger\x12\x36\n\x0bjob_trigger\x18\x02 \x01(\x0b\x32!.google.privacy.dlp.v2.JobTrigger\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"K\n\x14GetJobTriggerRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x64lp.googleapis.com/JobTrigger"\x88\x02\n\x13\x43reateDlpJobRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12>\n\x0binspect_job\x18\x02 \x01(\x0b\x32\'.google.privacy.dlp.v2.InspectJobConfigH\x00\x12@\n\x08risk_job\x18\x03 \x01(\x0b\x32,.google.privacy.dlp.v2.RiskAnalysisJobConfigH\x00\x12\x0e\n\x06job_id\x18\x04 \x01(\t\x12\x13\n\x0blocation_id\x18\x05 \x01(\tB\x05\n\x03job"\xbb\x01\n\x16ListJobTriggersRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x10\n\x08order_by\x18\x04 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x05 \x01(\t\x12\x13\n\x0blocation_id\x18\x07 \x01(\t"k\n\x17ListJobTriggersResponse\x12\x37\n\x0cjob_triggers\x18\x01 \x03(\x0b\x32!.google.privacy.dlp.v2.JobTrigger\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"N\n\x17\x44\x65leteJobTriggerRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x64lp.googleapis.com/JobTrigger"\xdd\x01\n\x10InspectJobConfig\x12<\n\x0estorage_config\x18\x01 \x01(\x0b\x32$.google.privacy.dlp.v2.StorageConfig\x12<\n\x0einspect_config\x18\x02 \x01(\x0b\x32$.google.privacy.dlp.v2.InspectConfig\x12\x1d\n\x15inspect_template_name\x18\x03 \x01(\t\x12.\n\x07\x61\x63tions\x18\x04 \x03(\x0b\x32\x1d.google.privacy.dlp.v2.Action"\xa4\x05\n\x06\x44lpJob\x12\x0c\n\x04name\x18\x01 \x01(\t\x12/\n\x04type\x18\x02 \x01(\x0e\x32!.google.privacy.dlp.v2.DlpJobType\x12\x35\n\x05state\x18\x03 \x01(\x0e\x32&.google.privacy.dlp.v2.DlpJob.JobState\x12K\n\x0crisk_details\x18\x04 \x01(\x0b\x32\x33.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetailsH\x00\x12J\n\x0finspect_details\x18\x05 \x01(\x0b\x32/.google.privacy.dlp.v2.InspectDataSourceDetailsH\x00\x12/\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nstart_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x18\n\x10job_trigger_name\x18\n \x01(\t\x12,\n\x06\x65rrors\x18\x0b \x03(\x0b\x32\x1c.google.privacy.dlp.v2.Error"c\n\x08JobState\x12\x19\n\x15JOB_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\x12\x0c\n\x08\x43\x41NCELED\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05:D\xea\x41\x41\n\x19\x64lp.googleapis.com/DlpJob\x12$projects/{project}/dlpJobs/{dlp_job}B\t\n\x07\x64\x65tails"C\n\x10GetDlpJobRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x64lp.googleapis.com/DlpJob"\xe8\x01\n\x12ListDlpJobsRequest\x12\x43\n\x06parent\x18\x04 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x0e\n\x06\x66ilter\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12/\n\x04type\x18\x05 \x01(\x0e\x32!.google.privacy.dlp.v2.DlpJobType\x12\x10\n\x08order_by\x18\x06 \x01(\t\x12\x13\n\x0blocation_id\x18\x07 \x01(\t"[\n\x13ListDlpJobsResponse\x12+\n\x04jobs\x18\x01 \x03(\x0b\x32\x1d.google.privacy.dlp.v2.DlpJob\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"F\n\x13\x43\x61ncelDlpJobRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x64lp.googleapis.com/DlpJob"F\n\x13\x44\x65leteDlpJobRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x64lp.googleapis.com/DlpJob"\xd7\x01\n\x1f\x43reateDeidentifyTemplateRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dlp.googleapis.com/DeidentifyTemplate\x12K\n\x13\x64\x65identify_template\x18\x02 \x01(\x0b\x32).google.privacy.dlp.v2.DeidentifyTemplateB\x03\xe0\x41\x02\x12\x13\n\x0btemplate_id\x18\x03 \x01(\t\x12\x13\n\x0blocation_id\x18\x04 \x01(\t"\xd7\x01\n\x1fUpdateDeidentifyTemplateRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dlp.googleapis.com/DeidentifyTemplate\x12\x46\n\x13\x64\x65identify_template\x18\x02 \x01(\x0b\x32).google.privacy.dlp.v2.DeidentifyTemplate\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"[\n\x1cGetDeidentifyTemplateRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dlp.googleapis.com/DeidentifyTemplate"\xad\x01\n\x1eListDeidentifyTemplatesRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dlp.googleapis.com/DeidentifyTemplate\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x10\n\x08order_by\x18\x04 \x01(\t\x12\x13\n\x0blocation_id\x18\x05 \x01(\t"\x83\x01\n\x1fListDeidentifyTemplatesResponse\x12G\n\x14\x64\x65identify_templates\x18\x01 \x03(\x0b\x32).google.privacy.dlp.v2.DeidentifyTemplate\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"^\n\x1f\x44\x65leteDeidentifyTemplateRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dlp.googleapis.com/DeidentifyTemplate"\xf4\x01\n\x1bLargeCustomDictionaryConfig\x12<\n\x0boutput_path\x18\x01 \x01(\x0b\x32\'.google.privacy.dlp.v2.CloudStoragePath\x12L\n\x16\x63loud_storage_file_set\x18\x02 \x01(\x0b\x32*.google.privacy.dlp.v2.CloudStorageFileSetH\x00\x12?\n\x0f\x62ig_query_field\x18\x03 \x01(\x0b\x32$.google.privacy.dlp.v2.BigQueryFieldH\x00\x42\x08\n\x06source"8\n\x1aLargeCustomDictionaryStats\x12\x1a\n\x12\x61pprox_num_phrases\x18\x01 \x01(\x03"\xa0\x01\n\x14StoredInfoTypeConfig\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12U\n\x17large_custom_dictionary\x18\x03 \x01(\x0b\x32\x32.google.privacy.dlp.v2.LargeCustomDictionaryConfigH\x00\x42\x06\n\x04type"s\n\x13StoredInfoTypeStats\x12T\n\x17large_custom_dictionary\x18\x01 \x01(\x0b\x32\x31.google.privacy.dlp.v2.LargeCustomDictionaryStatsH\x00\x42\x06\n\x04type"\xa9\x02\n\x15StoredInfoTypeVersion\x12;\n\x06\x63onfig\x18\x01 \x01(\x0b\x32+.google.privacy.dlp.v2.StoredInfoTypeConfig\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x39\n\x05state\x18\x03 \x01(\x0e\x32*.google.privacy.dlp.v2.StoredInfoTypeState\x12,\n\x06\x65rrors\x18\x04 \x03(\x0b\x32\x1c.google.privacy.dlp.v2.Error\x12\x39\n\x05stats\x18\x05 \x01(\x0b\x32*.google.privacy.dlp.v2.StoredInfoTypeStats"\xcf\x02\n\x0eStoredInfoType\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x45\n\x0f\x63urrent_version\x18\x02 \x01(\x0b\x32,.google.privacy.dlp.v2.StoredInfoTypeVersion\x12\x46\n\x10pending_versions\x18\x03 \x03(\x0b\x32,.google.privacy.dlp.v2.StoredInfoTypeVersion:\x9f\x01\xea\x41\x9b\x01\n!dlp.googleapis.com/StoredInfoType\x12?organizations/{organization}/storedInfoTypes/{stored_info_type}\x12\x35projects/{project}/storedInfoTypes/{stored_info_type}"\xcc\x01\n\x1b\x43reateStoredInfoTypeRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dlp.googleapis.com/StoredInfoType\x12@\n\x06\x63onfig\x18\x02 \x01(\x0b\x32+.google.privacy.dlp.v2.StoredInfoTypeConfigB\x03\xe0\x41\x02\x12\x1b\n\x13stored_info_type_id\x18\x03 \x01(\t\x12\x13\n\x0blocation_id\x18\x04 \x01(\t"\xc4\x01\n\x1bUpdateStoredInfoTypeRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dlp.googleapis.com/StoredInfoType\x12;\n\x06\x63onfig\x18\x02 \x01(\x0b\x32+.google.privacy.dlp.v2.StoredInfoTypeConfig\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"S\n\x18GetStoredInfoTypeRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dlp.googleapis.com/StoredInfoType"\xa5\x01\n\x1aListStoredInfoTypesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dlp.googleapis.com/StoredInfoType\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x10\n\x08order_by\x18\x04 \x01(\t\x12\x13\n\x0blocation_id\x18\x05 \x01(\t"x\n\x1bListStoredInfoTypesResponse\x12@\n\x11stored_info_types\x18\x01 \x03(\x0b\x32%.google.privacy.dlp.v2.StoredInfoType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"V\n\x1b\x44\x65leteStoredInfoTypeRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dlp.googleapis.com/StoredInfoType*\xbb\x01\n\x12RelationalOperator\x12#\n\x1fRELATIONAL_OPERATOR_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x45QUAL_TO\x10\x01\x12\x10\n\x0cNOT_EQUAL_TO\x10\x02\x12\x10\n\x0cGREATER_THAN\x10\x03\x12\r\n\tLESS_THAN\x10\x04\x12\x1a\n\x16GREATER_THAN_OR_EQUALS\x10\x05\x12\x17\n\x13LESS_THAN_OR_EQUALS\x10\x06\x12\n\n\x06\x45XISTS\x10\x07*\x8d\x01\n\x0cMatchingType\x12\x1d\n\x19MATCHING_TYPE_UNSPECIFIED\x10\x00\x12\x1c\n\x18MATCHING_TYPE_FULL_MATCH\x10\x01\x12\x1f\n\x1bMATCHING_TYPE_PARTIAL_MATCH\x10\x02\x12\x1f\n\x1bMATCHING_TYPE_INVERSE_MATCH\x10\x03*M\n\rContentOption\x12\x17\n\x13\x43ONTENT_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x43ONTENT_TEXT\x10\x01\x12\x11\n\rCONTENT_IMAGE\x10\x02*P\n\x13InfoTypeSupportedBy\x12\x19\n\x15\x45NUM_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07INSPECT\x10\x01\x12\x11\n\rRISK_ANALYSIS\x10\x02*R\n\nDlpJobType\x12\x1c\n\x18\x44LP_JOB_TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bINSPECT_JOB\x10\x01\x12\x15\n\x11RISK_ANALYSIS_JOB\x10\x02*n\n\x13StoredInfoTypeState\x12&\n"STORED_INFO_TYPE_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\t\n\x05READY\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0b\n\x07INVALID\x10\x04\x32\xdbH\n\nDlpService\x12\xe7\x01\n\x0eInspectContent\x12,.google.privacy.dlp.v2.InspectContentRequest\x1a-.google.privacy.dlp.v2.InspectContentResponse"x\x82\xd3\xe4\x93\x02r"\'/v2/{parent=projects/*}/content:inspect:\x01*ZD"?/v2/{parent=projects/*}/locations/{location_id}/content:inspect:\x01*\x12\xd8\x01\n\x0bRedactImage\x12).google.privacy.dlp.v2.RedactImageRequest\x1a*.google.privacy.dlp.v2.RedactImageResponse"r\x82\xd3\xe4\x93\x02l"$/v2/{parent=projects/*}/image:redact:\x01*ZA"29/v2/{name=organizations/*/locations/*/inspectTemplates/*}:\x01*Z-2(/v2/{name=projects/*/inspectTemplates/*}:\x01*Z924/v2/{name=projects/*/locations/*/inspectTemplates/*}:\x01*\xda\x41!name,inspect_template,update_mask\x12\xcf\x02\n\x12GetInspectTemplate\x12\x30.google.privacy.dlp.v2.GetInspectTemplateRequest\x1a&.google.privacy.dlp.v2.InspectTemplate"\xde\x01\x82\xd3\xe4\x93\x02\xd0\x01\x12-/v2/{name=organizations/*/inspectTemplates/*}Z;\x12\x39/v2/{name=organizations/*/locations/*/inspectTemplates/*}Z*\x12(/v2/{name=projects/*/inspectTemplates/*}Z6\x12\x34/v2/{name=projects/*/locations/*/inspectTemplates/*}\xda\x41\x04name\x12\xfa\x02\n\x14ListInspectTemplates\x12\x32.google.privacy.dlp.v2.ListInspectTemplatesRequest\x1a\x33.google.privacy.dlp.v2.ListInspectTemplatesResponse"\xf8\x01\x82\xd3\xe4\x93\x02\xe8\x01\x12-/v2/{parent=organizations/*}/inspectTemplatesZG\x12\x45/v2/{parent=organizations/*}/locations/{location_id}/inspectTemplatesZ*\x12(/v2/{parent=projects/*}/inspectTemplatesZB\x12@/v2/{parent=projects/*}/locations/{location_id}/inspectTemplates\xda\x41\x06parent\x12\xc5\x02\n\x15\x44\x65leteInspectTemplate\x12\x33.google.privacy.dlp.v2.DeleteInspectTemplateRequest\x1a\x16.google.protobuf.Empty"\xde\x01\x82\xd3\xe4\x93\x02\xd0\x01*-/v2/{name=organizations/*/inspectTemplates/*}Z;*9/v2/{name=organizations/*/locations/*/inspectTemplates/*}Z**(/v2/{name=projects/*/inspectTemplates/*}Z6*4/v2/{name=projects/*/locations/*/inspectTemplates/*}\xda\x41\x04name\x12\xcd\x03\n\x18\x43reateDeidentifyTemplate\x12\x36.google.privacy.dlp.v2.CreateDeidentifyTemplateRequest\x1a).google.privacy.dlp.v2.DeidentifyTemplate"\xcd\x02\x82\xd3\xe4\x93\x02\x80\x02"0/v2/{parent=organizations/*}/deidentifyTemplates:\x01*ZM"H/v2/{parent=organizations/*}/locations/{location_id}/deidentifyTemplates:\x01*Z0"+/v2/{parent=projects/*}/deidentifyTemplates:\x01*ZH"C/v2/{parent=projects/*}/locations/{location_id}/deidentifyTemplates:\x01*\xda\x41\x1aparent,deidentify_template\xda\x41&parent,deidentify_template,location_id\x12\x96\x03\n\x18UpdateDeidentifyTemplate\x12\x36.google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest\x1a).google.privacy.dlp.v2.DeidentifyTemplate"\x96\x02\x82\xd3\xe4\x93\x02\xe8\x01\x32\x30/v2/{name=organizations/*/deidentifyTemplates/*}:\x01*ZA2\x12* LOW 31-65 -> MEDIUM 66-100 - -> HIGH This can be used on data of type: number, long, string, - timestamp. If the bound ``Value`` type differs from the type of data - being transformed, we will first attempt converting the type of the data - to be transformed to match the type of the bound before comparing. See - https://cloud.google.com/dlp/docs/concepts-bucketing to learn more. - - - Attributes: - buckets: - Set of buckets. Ranges must be non-overlapping. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.BucketingConfig) - ), -) -_sym_db.RegisterMessage(BucketingConfig) -_sym_db.RegisterMessage(BucketingConfig.Bucket) - -CryptoReplaceFfxFpeConfig = _reflection.GeneratedProtocolMessageType( - "CryptoReplaceFfxFpeConfig", - (_message.Message,), - dict( - DESCRIPTOR=_CRYPTOREPLACEFFXFPECONFIG, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Replaces an identifier with a surrogate using Format - Preserving Encryption (FPE) with the FFX mode of operation; however when - used in the ``ReidentifyContent`` API method, it serves the opposite - function by reversing the surrogate back into the original identifier. - The identifier must be encoded as ASCII. For a given crypto key and - context, the same identifier will be replaced with the same surrogate. - Identifiers must be at least two characters long. In the case that the - identifier is the empty string, it will be skipped. See - https://cloud.google.com/dlp/docs/pseudonymization to learn more. - - Note: We recommend using CryptoDeterministicConfig for all use cases - which do not require preserving the input alphabet space and size, plus - warrant referential integrity. - - - Attributes: - crypto_key: - Required. The key used by the encryption algorithm. - context: - The 'tweak', a context may be used for higher security since - the same identifier in two different contexts won't be given - the same surrogate. If the context is not set, a default tweak - will be used. If the context is set but: 1. there is no - record present when transforming a given value or 2. the field - is not present when transforming a given value, a default - tweak will be used. Note that case (1) is expected when an - ``InfoTypeTransformation`` is applied to both structured and - non-structured ``ContentItem``\ s. Currently, the referenced - field may be of value type integer or string. The tweak is - constructed as a sequence of bytes in big endian byte order - such that: - a 64 bit integer is encoded followed by a - single byte of value 1 - a string is encoded in UTF-8 format - followed by a single byte of value 2 - alphabet: - Choose an alphabet which the data being transformed will be - made up of. - common_alphabet: - Common alphabets. - custom_alphabet: - This is supported by mapping these to the alphanumeric - characters that the FFX mode natively supports. This happens - before/after encryption/decryption. Each character listed must - appear only once. Number of characters must be in the range - [2, 95]. This must be encoded as ASCII. The order of - characters does not matter. - radix: - The native way to select the alphabet. Must be in the range - [2, 95]. - surrogate_info_type: - The custom infoType to annotate the surrogate with. This - annotation will be applied to the surrogate by prefixing it - with the name of the custom infoType followed by the number of - characters comprising the surrogate. The following scheme - defines the format: - info\_type\_name(surrogate\_character\_count):surrogate For - example, if the name of custom infoType is - 'MY\_TOKEN\_INFO\_TYPE' and the surrogate is 'abc', the full - replacement value will be: 'MY\_TOKEN\_INFO\_TYPE(3):abc' - This annotation identifies the surrogate when inspecting - content using the custom infoType ```SurrogateType`` - `__. - This facilitates reversal of the surrogate when it occurs in - free text. In order for inspection to work properly, the name - of this infoType must not occur naturally anywhere in your - data; otherwise, inspection may find a surrogate that does not - correspond to an actual identifier. Therefore, choose your - custom infoType name carefully after considering what your - data looks like. One way to select a name that has a high - chance of yielding reliable detection is to include one or - more unicode characters that are highly improbable to exist in - your data. For example, assuming your data is entered from a - regular ASCII keyboard, the symbol with the hex code point - 29DD might be used like so: ⧝MY\_TOKEN\_TYPE - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CryptoReplaceFfxFpeConfig) - ), -) -_sym_db.RegisterMessage(CryptoReplaceFfxFpeConfig) - -CryptoKey = _reflection.GeneratedProtocolMessageType( - "CryptoKey", - (_message.Message,), - dict( - DESCRIPTOR=_CRYPTOKEY, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""This is a data encryption key (DEK) (as opposed to a key - encryption key (KEK) stored by KMS). When using KMS to wrap/unwrap DEKs, - be sure to set an appropriate IAM policy on the KMS CryptoKey (KEK) to - ensure an attacker cannot unwrap the data crypto key. - - - Attributes: - source: - Sources of crypto keys. - transient: - Transient crypto key - unwrapped: - Unwrapped crypto key - kms_wrapped: - Kms wrapped key - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CryptoKey) - ), -) -_sym_db.RegisterMessage(CryptoKey) - -TransientCryptoKey = _reflection.GeneratedProtocolMessageType( - "TransientCryptoKey", - (_message.Message,), - dict( - DESCRIPTOR=_TRANSIENTCRYPTOKEY, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Use this to have a random data crypto key generated. It - will be discarded after the request finishes. - - - Attributes: - name: - Required. Name of the key. This is an arbitrary string used to - differentiate different keys. A unique key is generated per - name: two separate ``TransientCryptoKey`` protos share the - same generated key if their names are the same. When the data - crypto key is generated, this name is not used in any way - (repeating the api call will result in a different key being - generated). - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.TransientCryptoKey) - ), -) -_sym_db.RegisterMessage(TransientCryptoKey) - -UnwrappedCryptoKey = _reflection.GeneratedProtocolMessageType( - "UnwrappedCryptoKey", - (_message.Message,), - dict( - DESCRIPTOR=_UNWRAPPEDCRYPTOKEY, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Using raw keys is prone to security risks due to - accidentally leaking the key. Choose another type of key if possible. - - - Attributes: - key: - Required. A 128/192/256 bit key. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.UnwrappedCryptoKey) - ), -) -_sym_db.RegisterMessage(UnwrappedCryptoKey) - -KmsWrappedCryptoKey = _reflection.GeneratedProtocolMessageType( - "KmsWrappedCryptoKey", - (_message.Message,), - dict( - DESCRIPTOR=_KMSWRAPPEDCRYPTOKEY, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Include to use an existing data crypto key wrapped by KMS. - The wrapped key must be a 128/192/256 bit key. Authorization requires - the following IAM permissions when sending a request to perform a crypto - transformation using a kms-wrapped crypto key: dlp.kms.encrypt - - - Attributes: - wrapped_key: - Required. The wrapped data crypto key. - crypto_key_name: - Required. The resource name of the KMS CryptoKey to use for - unwrapping. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.KmsWrappedCryptoKey) - ), -) -_sym_db.RegisterMessage(KmsWrappedCryptoKey) - -DateShiftConfig = _reflection.GeneratedProtocolMessageType( - "DateShiftConfig", - (_message.Message,), - dict( - DESCRIPTOR=_DATESHIFTCONFIG, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Shifts dates by random number of days, with option to be - consistent for the same context. See - https://cloud.google.com/dlp/docs/concepts-date-shifting to learn more. - - - Attributes: - upper_bound_days: - Required. Range of shift in days. Actual shift will be - selected at random within this range (inclusive ends). - Negative means shift to earlier in time. Must not be more than - 365250 days (1000 years) each direction. For example, 3 means - shift date to at most 3 days into the future. - lower_bound_days: - Required. For example, -5 means shift date to at most 5 days - back in the past. - context: - Points to the field that contains the context, for example, an - entity id. If set, must also set cryptoKey. If set, shift will - be consistent for the given context. - method: - Method for calculating shift that takes context into - consideration. If set, must also set context. Can only be - applied to table items. - crypto_key: - Causes the shift to be computed based on this key and the - context. This results in the same shift for the same context - and crypto\_key. If set, must also set context. Can only be - applied to table items. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.DateShiftConfig) - ), -) -_sym_db.RegisterMessage(DateShiftConfig) - -InfoTypeTransformations = _reflection.GeneratedProtocolMessageType( - "InfoTypeTransformations", - (_message.Message,), - dict( - InfoTypeTransformation=_reflection.GeneratedProtocolMessageType( - "InfoTypeTransformation", - (_message.Message,), - dict( - DESCRIPTOR=_INFOTYPETRANSFORMATIONS_INFOTYPETRANSFORMATION, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""A transformation to apply to text that is identified as a - specific info\_type. - - - Attributes: - info_types: - InfoTypes to apply the transformation to. An empty list will - cause this transformation to apply to all findings that - correspond to infoTypes that were requested in - ``InspectConfig``. - primitive_transformation: - Required. Primitive transformation to apply to the infoType. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.InfoTypeTransformations.InfoTypeTransformation) - ), - ), - DESCRIPTOR=_INFOTYPETRANSFORMATIONS, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""A type of transformation that will scan unstructured text - and apply various ``PrimitiveTransformation``\ s to each finding, where - the transformation is applied to only values that were identified as a - specific info\_type. - - - Attributes: - transformations: - Required. Transformation for each infoType. Cannot specify - more than one for a given infoType. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.InfoTypeTransformations) - ), -) -_sym_db.RegisterMessage(InfoTypeTransformations) -_sym_db.RegisterMessage(InfoTypeTransformations.InfoTypeTransformation) - -FieldTransformation = _reflection.GeneratedProtocolMessageType( - "FieldTransformation", - (_message.Message,), - dict( - DESCRIPTOR=_FIELDTRANSFORMATION, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""The transformation to apply to the field. - - - Attributes: - fields: - Required. Input field(s) to apply the transformation to. - condition: - Only apply the transformation if the condition evaluates to - true for the given ``RecordCondition``. The conditions are - allowed to reference fields that are not used in the actual - transformation. Example Use Cases: - Apply a different - bucket transformation to an age column if the zip code - column for the same record is within a specific range. - - Redact a field if the date of birth field is greater than 85. - transformation: - Transformation to apply. [required] - primitive_transformation: - Apply the transformation to the entire field. - info_type_transformations: - Treat the contents of the field as free text, and selectively - transform content that matches an ``InfoType``. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.FieldTransformation) - ), -) -_sym_db.RegisterMessage(FieldTransformation) - -RecordTransformations = _reflection.GeneratedProtocolMessageType( - "RecordTransformations", - (_message.Message,), - dict( - DESCRIPTOR=_RECORDTRANSFORMATIONS, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""A type of transformation that is applied over structured - data such as a table. - - - Attributes: - field_transformations: - Transform the record by applying various field - transformations. - record_suppressions: - Configuration defining which records get suppressed entirely. - Records that match any suppression rule are omitted from the - output. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.RecordTransformations) - ), -) -_sym_db.RegisterMessage(RecordTransformations) - -RecordSuppression = _reflection.GeneratedProtocolMessageType( - "RecordSuppression", - (_message.Message,), - dict( - DESCRIPTOR=_RECORDSUPPRESSION, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Configuration to suppress records whose suppression - conditions evaluate to true. - - - Attributes: - condition: - A condition that when it evaluates to true will result in the - record being evaluated to be suppressed from the transformed - content. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.RecordSuppression) - ), -) -_sym_db.RegisterMessage(RecordSuppression) - -RecordCondition = _reflection.GeneratedProtocolMessageType( - "RecordCondition", - (_message.Message,), - dict( - Condition=_reflection.GeneratedProtocolMessageType( - "Condition", - (_message.Message,), - dict( - DESCRIPTOR=_RECORDCONDITION_CONDITION, - __module__="google.cloud.dlp_v2.proto.dlp_pb2" - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.RecordCondition.Condition) - ), - ), - Conditions=_reflection.GeneratedProtocolMessageType( - "Conditions", - (_message.Message,), - dict( - DESCRIPTOR=_RECORDCONDITION_CONDITIONS, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""A collection of conditions. - - - Attributes: - conditions: - A collection of conditions. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.RecordCondition.Conditions) - ), - ), - Expressions=_reflection.GeneratedProtocolMessageType( - "Expressions", - (_message.Message,), - dict( - DESCRIPTOR=_RECORDCONDITION_EXPRESSIONS, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""An expression, consisting or an operator and conditions. - - - Attributes: - logical_operator: - The operator to apply to the result of conditions. Default and - currently only supported value is ``AND``. - type: - Expression types. - conditions: - Conditions to apply to the expression. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.RecordCondition.Expressions) - ), - ), - DESCRIPTOR=_RECORDCONDITION, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""The field type of ``value`` and ``field`` do not need to - match to be considered equal, but not all comparisons are possible. - EQUAL\_TO and NOT\_EQUAL\_TO attempt to compare even with incompatible - types, but all other comparisons are invalid with incompatible types. A - ``value`` of type: - - - ``string`` can be compared against all other types - - ``boolean`` can only be compared against other booleans - - ``integer`` can be compared against doubles or a string if the string - value can be parsed as an integer. - - ``double`` can be compared against integers or a string if the string - can be parsed as a double. - - ``Timestamp`` can be compared against strings in RFC 3339 date string - format. - - ``TimeOfDay`` can be compared against timestamps and strings in the - format of 'HH:mm:ss'. - - If we fail to compare do to type mismatch, a warning will be given and - the condition will evaluate to false. - - - Attributes: - field: - Required. Field within the record this condition is evaluated - against. - operator: - Required. Operator used to compare the field or infoType to - the value. - value: - Value to compare against. [Mandatory, except for ``EXISTS`` - tests.] - expressions: - An expression. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.RecordCondition) - ), -) -_sym_db.RegisterMessage(RecordCondition) -_sym_db.RegisterMessage(RecordCondition.Condition) -_sym_db.RegisterMessage(RecordCondition.Conditions) -_sym_db.RegisterMessage(RecordCondition.Expressions) - -TransformationOverview = _reflection.GeneratedProtocolMessageType( - "TransformationOverview", - (_message.Message,), - dict( - DESCRIPTOR=_TRANSFORMATIONOVERVIEW, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Overview of the modifications that occurred. - - - Attributes: - transformed_bytes: - Total size in bytes that were transformed in some way. - transformation_summaries: - Transformations applied to the dataset. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.TransformationOverview) - ), -) -_sym_db.RegisterMessage(TransformationOverview) - -TransformationSummary = _reflection.GeneratedProtocolMessageType( - "TransformationSummary", - (_message.Message,), - dict( - SummaryResult=_reflection.GeneratedProtocolMessageType( - "SummaryResult", - (_message.Message,), - dict( - DESCRIPTOR=_TRANSFORMATIONSUMMARY_SUMMARYRESULT, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""A collection that informs the user the number of times a - particular ``TransformationResultCode`` and error details occurred. - - - Attributes: - count: - Number of transformations counted by this result. - code: - Outcome of the transformation. - details: - A place for warnings or errors to show up if a transformation - didn't work as expected. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.TransformationSummary.SummaryResult) - ), - ), - DESCRIPTOR=_TRANSFORMATIONSUMMARY, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Summary of a single transformation. Only one of - 'transformation', 'field\_transformation', or 'record\_suppress' will be - set. - - - Attributes: - info_type: - Set if the transformation was limited to a specific InfoType. - field: - Set if the transformation was limited to a specific FieldId. - transformation: - The specific transformation these stats apply to. - field_transformations: - The field transformation that was applied. If multiple field - transformations are requested for a single field, this list - will contain all of them; otherwise, only one is supplied. - record_suppress: - The specific suppression option these stats apply to. - results: - Collection of all transformations that took place or had an - error. - transformed_bytes: - Total size in bytes that were transformed in some way. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.TransformationSummary) - ), -) -_sym_db.RegisterMessage(TransformationSummary) -_sym_db.RegisterMessage(TransformationSummary.SummaryResult) - -Schedule = _reflection.GeneratedProtocolMessageType( - "Schedule", - (_message.Message,), - dict( - DESCRIPTOR=_SCHEDULE, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Schedule for triggeredJobs. - - - Attributes: - recurrence_period_duration: - With this option a job is started a regular periodic basis. - For example: every day (86400 seconds). A scheduled start - time will be skipped if the previous execution has not ended - when its scheduled time occurs. This value must be set to a - time duration greater than or equal to 1 day and can be no - longer than 60 days. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.Schedule) - ), -) -_sym_db.RegisterMessage(Schedule) - -InspectTemplate = _reflection.GeneratedProtocolMessageType( - "InspectTemplate", - (_message.Message,), - dict( - DESCRIPTOR=_INSPECTTEMPLATE, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""The inspectTemplate contains a configuration (set of types - of sensitive data to be detected) to be used anywhere you otherwise - would normally specify InspectConfig. See - https://cloud.google.com/dlp/docs/concepts-templates to learn more. - - - Attributes: - name: - Output only. The template name. The template will have one of - the following formats: - ``projects/PROJECT_ID/inspectTemplates/TEMPLATE_ID`` OR ``orga - nizations/ORGANIZATION_ID/inspectTemplates/TEMPLATE_ID``; - display_name: - Display name (max 256 chars). - description: - Short description (max 256 chars). - create_time: - Output only. The creation timestamp of an inspectTemplate. - update_time: - Output only. The last update timestamp of an inspectTemplate. - inspect_config: - The core content of the template. Configuration of the - scanning process. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.InspectTemplate) - ), -) -_sym_db.RegisterMessage(InspectTemplate) - -DeidentifyTemplate = _reflection.GeneratedProtocolMessageType( - "DeidentifyTemplate", - (_message.Message,), - dict( - DESCRIPTOR=_DEIDENTIFYTEMPLATE, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""DeidentifyTemplates contains instructions on how to - de-identify content. See - https://cloud.google.com/dlp/docs/concepts-templates to learn more. - - - Attributes: - name: - Output only. The template name. The template will have one of - the following formats: - ``projects/PROJECT_ID/deidentifyTemplates/TEMPLATE_ID`` OR ``o - rganizations/ORGANIZATION_ID/deidentifyTemplates/TEMPLATE_ID`` - display_name: - Display name (max 256 chars). - description: - Short description (max 256 chars). - create_time: - Output only. The creation timestamp of an inspectTemplate. - update_time: - Output only. The last update timestamp of an inspectTemplate. - deidentify_config: - ///////////// // The core content of the template // /////////////// - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.DeidentifyTemplate) - ), -) -_sym_db.RegisterMessage(DeidentifyTemplate) - -Error = _reflection.GeneratedProtocolMessageType( - "Error", - (_message.Message,), - dict( - DESCRIPTOR=_ERROR, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Details information about an error encountered during job - execution or the results of an unsuccessful activation of the - JobTrigger. - - - Attributes: - details: - Detailed error codes and messages. - timestamps: - The times the error occurred. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.Error) - ), -) -_sym_db.RegisterMessage(Error) - -JobTrigger = _reflection.GeneratedProtocolMessageType( - "JobTrigger", - (_message.Message,), - dict( - Trigger=_reflection.GeneratedProtocolMessageType( - "Trigger", - (_message.Message,), - dict( - DESCRIPTOR=_JOBTRIGGER_TRIGGER, - __module__="google.cloud.dlp_v2.proto.dlp_pb2" - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.JobTrigger.Trigger) - ), - ), - DESCRIPTOR=_JOBTRIGGER, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""What event needs to occur for a new job to be started. - - - Attributes: - schedule: - Create a job on a repeating basis based on the elapse of time. - name: - Unique resource name for the triggeredJob, assigned by the - service when the triggeredJob is created, for example - ``projects/dlp-test-project/jobTriggers/53234423``. - display_name: - Display name (max 100 chars) - description: - User provided description (max 256 chars) - job: - The configuration details for the specific type of job to run. - inspect_job: - For inspect jobs, a snapshot of the configuration. - triggers: - A list of triggers which will be OR'ed together. Only one in - the list needs to trigger for a job to be started. The list - may contain only a single Schedule trigger and must have at - least one object. - errors: - Output only. A stream of errors encountered when the trigger - was activated. Repeated errors may result in the JobTrigger - automatically being paused. Will return the last 100 errors. - Whenever the JobTrigger is modified this list will be cleared. - create_time: - Output only. The creation timestamp of a triggeredJob. - update_time: - Output only. The last update timestamp of a triggeredJob. - last_run_time: - Output only. The timestamp of the last time this trigger - executed. - status: - Required. A status for this trigger. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.JobTrigger) - ), -) -_sym_db.RegisterMessage(JobTrigger) -_sym_db.RegisterMessage(JobTrigger.Trigger) - -Action = _reflection.GeneratedProtocolMessageType( - "Action", - (_message.Message,), - dict( - SaveFindings=_reflection.GeneratedProtocolMessageType( - "SaveFindings", - (_message.Message,), - dict( - DESCRIPTOR=_ACTION_SAVEFINDINGS, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""If set, the detailed findings will be persisted to the - specified OutputStorageConfig. Only a single instance of this action can - be specified. Compatible with: Inspect, Risk - - - Attributes: - output_config: - Location to store findings outside of DLP. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.Action.SaveFindings) - ), - ), - PublishToPubSub=_reflection.GeneratedProtocolMessageType( - "PublishToPubSub", - (_message.Message,), - dict( - DESCRIPTOR=_ACTION_PUBLISHTOPUBSUB, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Publish a message into given Pub/Sub topic when DlpJob has - completed. The message contains a single field, ``DlpJobName``, which is - equal to the finished job's - ```DlpJob.name`` `__. - Compatible with: Inspect, Risk - - - Attributes: - topic: - Cloud Pub/Sub topic to send notifications to. The topic must - have given publishing access rights to the DLP API service - account executing the long running DlpJob sending the - notifications. Format is projects/{project}/topics/{topic}. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.Action.PublishToPubSub) - ), - ), - PublishSummaryToCscc=_reflection.GeneratedProtocolMessageType( - "PublishSummaryToCscc", - (_message.Message,), - dict( - DESCRIPTOR=_ACTION_PUBLISHSUMMARYTOCSCC, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Publish the result summary of a DlpJob to the Cloud - Security Command Center (CSCC Alpha). This action is only available for - projects which are parts of an organization and whitelisted for the - alpha Cloud Security Command Center. The action will publish count of - finding instances and their info types. The summary of findings will be - persisted in CSCC and are governed by CSCC service-specific policy, see - https://cloud.google.com/terms/service-terms Only a single instance of - this action can be specified. Compatible with: Inspect - - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.Action.PublishSummaryToCscc) - ), - ), - PublishFindingsToCloudDataCatalog=_reflection.GeneratedProtocolMessageType( - "PublishFindingsToCloudDataCatalog", - (_message.Message,), - dict( - DESCRIPTOR=_ACTION_PUBLISHFINDINGSTOCLOUDDATACATALOG, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Publish findings of a DlpJob to Cloud Data Catalog. Labels - summarizing the results of the DlpJob will be applied to the entry for - the resource scanned in Cloud Data Catalog. Any labels previously - written by another DlpJob will be deleted. InfoType naming patterns are - strictly enforced when using this feature. Note that the findings will - be persisted in Cloud Data Catalog storage and are governed by Data - Catalog service-specific policy, see - https://cloud.google.com/terms/service-terms Only a single instance of - this action can be specified and only allowed if all resources being - scanned are BigQuery tables. Compatible with: Inspect - - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.Action.PublishFindingsToCloudDataCatalog) - ), - ), - JobNotificationEmails=_reflection.GeneratedProtocolMessageType( - "JobNotificationEmails", - (_message.Message,), - dict( - DESCRIPTOR=_ACTION_JOBNOTIFICATIONEMAILS, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Enable email notification to project owners and editors on - jobs's completion/failure. - - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.Action.JobNotificationEmails) - ), - ), - PublishToStackdriver=_reflection.GeneratedProtocolMessageType( - "PublishToStackdriver", - (_message.Message,), - dict( - DESCRIPTOR=_ACTION_PUBLISHTOSTACKDRIVER, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Enable Stackdriver metric - dlp.googleapis.com/finding\_count. This will publish a metric to stack - driver on each infotype requested and how many findings were found for - it. CustomDetectors will be bucketed as 'Custom' under the Stackdriver - label 'info\_type'. - - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.Action.PublishToStackdriver) - ), - ), - DESCRIPTOR=_ACTION, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""A task to execute on the completion of a job. See - https://cloud.google.com/dlp/docs/concepts-actions to learn more. - - - Attributes: - save_findings: - Save resulting findings in a provided location. - pub_sub: - Publish a notification to a pubsub topic. - publish_summary_to_cscc: - Publish summary to Cloud Security Command Center (Alpha). - publish_findings_to_cloud_data_catalog: - Publish findings to Cloud Datahub. - job_notification_emails: - Enable email notification for project owners and editors on - job's completion/failure. - publish_to_stackdriver: - Enable Stackdriver metric dlp.googleapis.com/finding\_count. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.Action) - ), -) -_sym_db.RegisterMessage(Action) -_sym_db.RegisterMessage(Action.SaveFindings) -_sym_db.RegisterMessage(Action.PublishToPubSub) -_sym_db.RegisterMessage(Action.PublishSummaryToCscc) -_sym_db.RegisterMessage(Action.PublishFindingsToCloudDataCatalog) -_sym_db.RegisterMessage(Action.JobNotificationEmails) -_sym_db.RegisterMessage(Action.PublishToStackdriver) - -CreateInspectTemplateRequest = _reflection.GeneratedProtocolMessageType( - "CreateInspectTemplateRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEINSPECTTEMPLATEREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for CreateInspectTemplate. - - - Attributes: - parent: - Required. The parent resource name, for example projects/my- - project-id or organizations/my-org-id. - inspect_template: - Required. The InspectTemplate to create. - template_id: - The template id can contain uppercase and lowercase letters, - numbers, and hyphens; that is, it must match the regular - expression: ``[a-zA-Z\\d-_]+``. The maximum length is 100 - characters. Can be empty to allow the system to generate one. - location_id: - The geographic location to store the inspection template. - Reserved for future extensions. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CreateInspectTemplateRequest) - ), -) -_sym_db.RegisterMessage(CreateInspectTemplateRequest) - -UpdateInspectTemplateRequest = _reflection.GeneratedProtocolMessageType( - "UpdateInspectTemplateRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEINSPECTTEMPLATEREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for UpdateInspectTemplate. - - - Attributes: - name: - Required. Resource name of organization and inspectTemplate to - be updated, for example - ``organizations/433245324/inspectTemplates/432452342`` or - projects/project-id/inspectTemplates/432452342. - inspect_template: - New InspectTemplate value. - update_mask: - Mask to control which fields get updated. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.UpdateInspectTemplateRequest) - ), -) -_sym_db.RegisterMessage(UpdateInspectTemplateRequest) - -GetInspectTemplateRequest = _reflection.GeneratedProtocolMessageType( - "GetInspectTemplateRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETINSPECTTEMPLATEREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for GetInspectTemplate. - - - Attributes: - name: - Required. Resource name of the organization and - inspectTemplate to be read, for example - ``organizations/433245324/inspectTemplates/432452342`` or - projects/project-id/inspectTemplates/432452342. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.GetInspectTemplateRequest) - ), -) -_sym_db.RegisterMessage(GetInspectTemplateRequest) - -ListInspectTemplatesRequest = _reflection.GeneratedProtocolMessageType( - "ListInspectTemplatesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTINSPECTTEMPLATESREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for ListInspectTemplates. - - - Attributes: - parent: - Required. The parent resource name, for example projects/my- - project-id or organizations/my-org-id. - page_token: - Page token to continue retrieval. Comes from previous call to - ``ListInspectTemplates``. - page_size: - Size of the page, can be limited by server. If zero server - returns a page of max size 100. - order_by: - Comma separated list of fields to order by, followed by - ``asc`` or ``desc`` postfix. This list is case-insensitive, - default sorting order is ascending, redundant space characters - are insignificant. Example: ``name asc,update_time, - create_time desc`` Supported fields are: - ``create_time``: - corresponds to time the template was created. - - ``update_time``: corresponds to time the template was last - updated. - ``name``: corresponds to template's name. - - ``display_name``: corresponds to template's display name. - location_id: - The geographic location where inspection templates will be - retrieved from. Use ``-`` for all locations. Reserved for - future extensions. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.ListInspectTemplatesRequest) - ), -) -_sym_db.RegisterMessage(ListInspectTemplatesRequest) - -ListInspectTemplatesResponse = _reflection.GeneratedProtocolMessageType( - "ListInspectTemplatesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTINSPECTTEMPLATESRESPONSE, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Response message for ListInspectTemplates. - - - Attributes: - inspect_templates: - List of inspectTemplates, up to page\_size in - ListInspectTemplatesRequest. - next_page_token: - If the next page is available then the next page token to be - used in following ListInspectTemplates request. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.ListInspectTemplatesResponse) - ), -) -_sym_db.RegisterMessage(ListInspectTemplatesResponse) - -DeleteInspectTemplateRequest = _reflection.GeneratedProtocolMessageType( - "DeleteInspectTemplateRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEINSPECTTEMPLATEREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for DeleteInspectTemplate. - - - Attributes: - name: - Required. Resource name of the organization and - inspectTemplate to be deleted, for example - ``organizations/433245324/inspectTemplates/432452342`` or - projects/project-id/inspectTemplates/432452342. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.DeleteInspectTemplateRequest) - ), -) -_sym_db.RegisterMessage(DeleteInspectTemplateRequest) - -CreateJobTriggerRequest = _reflection.GeneratedProtocolMessageType( - "CreateJobTriggerRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEJOBTRIGGERREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for CreateJobTrigger. - - - Attributes: - parent: - Required. The parent resource name, for example projects/my- - project-id. - job_trigger: - Required. The JobTrigger to create. - trigger_id: - The trigger id can contain uppercase and lowercase letters, - numbers, and hyphens; that is, it must match the regular - expression: ``[a-zA-Z\\d-_]+``. The maximum length is 100 - characters. Can be empty to allow the system to generate one. - location_id: - The geographic location to store the job trigger. Reserved for - future extensions. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CreateJobTriggerRequest) - ), -) -_sym_db.RegisterMessage(CreateJobTriggerRequest) - -ActivateJobTriggerRequest = _reflection.GeneratedProtocolMessageType( - "ActivateJobTriggerRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ACTIVATEJOBTRIGGERREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for ActivateJobTrigger. - - - Attributes: - name: - Required. Resource name of the trigger to activate, for - example ``projects/dlp-test-project/jobTriggers/53234423``. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.ActivateJobTriggerRequest) - ), -) -_sym_db.RegisterMessage(ActivateJobTriggerRequest) - -UpdateJobTriggerRequest = _reflection.GeneratedProtocolMessageType( - "UpdateJobTriggerRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEJOBTRIGGERREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for UpdateJobTrigger. - - - Attributes: - name: - Required. Resource name of the project and the triggeredJob, - for example ``projects/dlp-test- - project/jobTriggers/53234423``. - job_trigger: - New JobTrigger value. - update_mask: - Mask to control which fields get updated. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.UpdateJobTriggerRequest) - ), -) -_sym_db.RegisterMessage(UpdateJobTriggerRequest) - -GetJobTriggerRequest = _reflection.GeneratedProtocolMessageType( - "GetJobTriggerRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETJOBTRIGGERREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for GetJobTrigger. - - - Attributes: - name: - Required. Resource name of the project and the triggeredJob, - for example ``projects/dlp-test- - project/jobTriggers/53234423``. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.GetJobTriggerRequest) - ), -) -_sym_db.RegisterMessage(GetJobTriggerRequest) - -CreateDlpJobRequest = _reflection.GeneratedProtocolMessageType( - "CreateDlpJobRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEDLPJOBREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for CreateDlpJobRequest. Used to initiate - long running jobs such as calculating risk metrics or inspecting Google - Cloud Storage. - - - Attributes: - parent: - Required. The parent resource name, for example projects/my- - project-id. - job: - The configuration details for the specific type of job to run. - inspect_job: - Set to control what and how to inspect. - risk_job: - Set to choose what metric to calculate. - job_id: - The job id can contain uppercase and lowercase letters, - numbers, and hyphens; that is, it must match the regular - expression: ``[a-zA-Z\\d-_]+``. The maximum length is 100 - characters. Can be empty to allow the system to generate one. - location_id: - The geographic location to store and process the job. Reserved - for future extensions. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CreateDlpJobRequest) - ), -) -_sym_db.RegisterMessage(CreateDlpJobRequest) - -ListJobTriggersRequest = _reflection.GeneratedProtocolMessageType( - "ListJobTriggersRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTJOBTRIGGERSREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for ListJobTriggers. - - - Attributes: - parent: - Required. The parent resource name, for example ``projects/my- - project-id``. - page_token: - Page token to continue retrieval. Comes from previous call to - ListJobTriggers. ``order_by`` field must not change for - subsequent calls. - page_size: - Size of the page, can be limited by a server. - order_by: - Comma separated list of triggeredJob fields to order by, - followed by ``asc`` or ``desc`` postfix. This list is case- - insensitive, default sorting order is ascending, redundant - space characters are insignificant. Example: ``name - asc,update_time, create_time desc`` Supported fields are: - - ``create_time``: corresponds to time the JobTrigger was - created. - ``update_time``: corresponds to time the - JobTrigger was last updated. - ``last_run_time``: corresponds - to the last time the JobTrigger ran. - ``name``: corresponds - to JobTrigger's name. - ``display_name``: corresponds to - JobTrigger's display name. - ``status``: corresponds to - JobTrigger's status. - filter: - Allows filtering. Supported syntax: - Filter expressions - are made up of one or more restrictions. - Restrictions can - be combined by ``AND`` or ``OR`` logical operators. A - sequence of restrictions implicitly uses ``AND``. - A - restriction has the form of ``{field} {operator} {value}``. - - Supported fields/values for inspect jobs: - ``status`` - - HEALTHY\|PAUSED\|CANCELLED - ``inspected_storage`` - - DATASTORE\|CLOUD\_STORAGE\|BIGQUERY - 'last\_run\_time\` - - RFC 3339 formatted timestamp, surrounded by quotation - marks. Nanoseconds are ignored. - 'error\_count' - Number - of errors that have occurred while running. - The - operator must be ``=`` or ``!=`` for status and - inspected\_storage. Examples: - inspected\_storage = - cloud\_storage AND status = HEALTHY - inspected\_storage = - cloud\_storage OR inspected\_storage = bigquery - - inspected\_storage = cloud\_storage AND (state = PAUSED OR - state = HEALTHY) - last\_run\_time > - "2017-12-12T00:00:00+00:00" The length of this field should - be no more than 500 characters. - location_id: - The geographic location where job triggers will be retrieved - from. Use ``-`` for all locations. Reserved for future - extensions. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.ListJobTriggersRequest) - ), -) -_sym_db.RegisterMessage(ListJobTriggersRequest) - -ListJobTriggersResponse = _reflection.GeneratedProtocolMessageType( - "ListJobTriggersResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTJOBTRIGGERSRESPONSE, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Response message for ListJobTriggers. - - - Attributes: - job_triggers: - List of triggeredJobs, up to page\_size in - ListJobTriggersRequest. - next_page_token: - If the next page is available then the next page token to be - used in following ListJobTriggers request. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.ListJobTriggersResponse) - ), -) -_sym_db.RegisterMessage(ListJobTriggersResponse) - -DeleteJobTriggerRequest = _reflection.GeneratedProtocolMessageType( - "DeleteJobTriggerRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEJOBTRIGGERREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for DeleteJobTrigger. - - - Attributes: - name: - Required. Resource name of the project and the triggeredJob, - for example ``projects/dlp-test- - project/jobTriggers/53234423``. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.DeleteJobTriggerRequest) - ), -) -_sym_db.RegisterMessage(DeleteJobTriggerRequest) - -InspectJobConfig = _reflection.GeneratedProtocolMessageType( - "InspectJobConfig", - (_message.Message,), - dict( - DESCRIPTOR=_INSPECTJOBCONFIG, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Controls what and how to inspect for findings. - - - Attributes: - storage_config: \ - The data to scan. - inspect_config: \ - How and what to scan for. - inspect_template_name: \ - If provided, will be used as the default for all values in \ - InspectConfig. ``inspect_config`` will be merged into the \ - values persisted as part of the template. \ - actions: \ - Actions to execute at the completion of the job. \ - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.InspectJobConfig) - ), -) -_sym_db.RegisterMessage(InspectJobConfig) - -DlpJob = _reflection.GeneratedProtocolMessageType( - "DlpJob", - (_message.Message,), - dict( - DESCRIPTOR=_DLPJOB, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Combines all of the information about a DLP job. - - - Attributes: - name: - The server-assigned name. - type: - The type of job. - state: - State of a job. - risk_details: - Results from analyzing risk of a data source. - inspect_details: - Results from inspecting a data source. - create_time: - Time when the job was created. - start_time: - Time when the job started. - end_time: - Time when the job finished. - job_trigger_name: - If created by a job trigger, the resource name of the trigger - that instantiated the job. - errors: - A stream of errors encountered running the job. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.DlpJob) - ), -) -_sym_db.RegisterMessage(DlpJob) - -GetDlpJobRequest = _reflection.GeneratedProtocolMessageType( - "GetDlpJobRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETDLPJOBREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""The request message for [DlpJobs.GetDlpJob][]. - - - Attributes: - name: - Required. The name of the DlpJob resource. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.GetDlpJobRequest) - ), -) -_sym_db.RegisterMessage(GetDlpJobRequest) - -ListDlpJobsRequest = _reflection.GeneratedProtocolMessageType( - "ListDlpJobsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTDLPJOBSREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""The request message for listing DLP jobs. - - - Attributes: - parent: - Required. The parent resource name, for example projects/my- - project-id. - filter: - Allows filtering. Supported syntax: - Filter expressions - are made up of one or more restrictions. - Restrictions can - be combined by ``AND`` or ``OR`` logical operators. A - sequence of restrictions implicitly uses ``AND``. - A - restriction has the form of ``{field} {operator} {value}``. - - Supported fields/values for inspect jobs: - ``state`` - - PENDING\|RUNNING\|CANCELED\|FINISHED\|FAILED - - ``inspected_storage`` - DATASTORE\|CLOUD\_STORAGE\|BIGQUERY - - ``trigger_name`` - The resource name of the trigger that - created job. - 'end\_time\` - Corresponds to time - the job finished. - 'start\_time\` - Corresponds to time - the job finished. - Supported fields for risk analysis jobs: - - ``state`` - RUNNING\|CANCELED\|FINISHED\|FAILED - - 'end\_time\` - Corresponds to time the job finished. - - 'start\_time\` - Corresponds to time the job finished. - The - operator must be ``=`` or ``!=``. Examples: - - inspected\_storage = cloud\_storage AND state = done - - inspected\_storage = cloud\_storage OR inspected\_storage = - bigquery - inspected\_storage = cloud\_storage AND (state = - done OR state = canceled) - end\_time > - "2017-12-12T00:00:00+00:00" The length of this field should - be no more than 500 characters. - page_size: - The standard list page size. - page_token: - The standard list page token. - type: - The type of job. Defaults to ``DlpJobType.INSPECT`` - order_by: - Comma separated list of fields to order by, followed by - ``asc`` or ``desc`` postfix. This list is case-insensitive, - default sorting order is ascending, redundant space characters - are insignificant. Example: ``name asc, end_time asc, - create_time desc`` Supported fields are: - ``create_time``: - corresponds to time the job was created. - ``end_time``: - corresponds to time the job ended. - ``name``: corresponds to - job's name. - ``state``: corresponds to ``state`` - location_id: - The geographic location where jobs will be retrieved from. Use - ``-`` for all locations. Reserved for future extensions. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.ListDlpJobsRequest) - ), -) -_sym_db.RegisterMessage(ListDlpJobsRequest) - -ListDlpJobsResponse = _reflection.GeneratedProtocolMessageType( - "ListDlpJobsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTDLPJOBSRESPONSE, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""The response message for listing DLP jobs. - - - Attributes: - jobs: - A list of DlpJobs that matches the specified filter in the - request. - next_page_token: - The standard List next-page token. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.ListDlpJobsResponse) - ), -) -_sym_db.RegisterMessage(ListDlpJobsResponse) - -CancelDlpJobRequest = _reflection.GeneratedProtocolMessageType( - "CancelDlpJobRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CANCELDLPJOBREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""The request message for canceling a DLP job. - - - Attributes: - name: - Required. The name of the DlpJob resource to be cancelled. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CancelDlpJobRequest) - ), -) -_sym_db.RegisterMessage(CancelDlpJobRequest) - -DeleteDlpJobRequest = _reflection.GeneratedProtocolMessageType( - "DeleteDlpJobRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEDLPJOBREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""The request message for deleting a DLP job. - - - Attributes: - name: - Required. The name of the DlpJob resource to be deleted. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.DeleteDlpJobRequest) - ), -) -_sym_db.RegisterMessage(DeleteDlpJobRequest) - -CreateDeidentifyTemplateRequest = _reflection.GeneratedProtocolMessageType( - "CreateDeidentifyTemplateRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEDEIDENTIFYTEMPLATEREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for CreateDeidentifyTemplate. - - - Attributes: - parent: - Required. The parent resource name, for example projects/my- - project-id or organizations/my-org-id. - deidentify_template: - Required. The DeidentifyTemplate to create. - template_id: - The template id can contain uppercase and lowercase letters, - numbers, and hyphens; that is, it must match the regular - expression: ``[a-zA-Z\\d-_]+``. The maximum length is 100 - characters. Can be empty to allow the system to generate one. - location_id: - The geographic location to store the deidentification - template. Reserved for future extensions. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CreateDeidentifyTemplateRequest) - ), -) -_sym_db.RegisterMessage(CreateDeidentifyTemplateRequest) - -UpdateDeidentifyTemplateRequest = _reflection.GeneratedProtocolMessageType( - "UpdateDeidentifyTemplateRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEDEIDENTIFYTEMPLATEREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for UpdateDeidentifyTemplate. - - - Attributes: - name: - Required. Resource name of organization and deidentify - template to be updated, for example - ``organizations/433245324/deidentifyTemplates/432452342`` or - projects/project-id/deidentifyTemplates/432452342. - deidentify_template: - New DeidentifyTemplate value. - update_mask: - Mask to control which fields get updated. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest) - ), -) -_sym_db.RegisterMessage(UpdateDeidentifyTemplateRequest) - -GetDeidentifyTemplateRequest = _reflection.GeneratedProtocolMessageType( - "GetDeidentifyTemplateRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETDEIDENTIFYTEMPLATEREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for GetDeidentifyTemplate. - - - Attributes: - name: - Required. Resource name of the organization and deidentify - template to be read, for example - ``organizations/433245324/deidentifyTemplates/432452342`` or - projects/project-id/deidentifyTemplates/432452342. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.GetDeidentifyTemplateRequest) - ), -) -_sym_db.RegisterMessage(GetDeidentifyTemplateRequest) - -ListDeidentifyTemplatesRequest = _reflection.GeneratedProtocolMessageType( - "ListDeidentifyTemplatesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTDEIDENTIFYTEMPLATESREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for ListDeidentifyTemplates. - - - Attributes: - parent: - Required. The parent resource name, for example projects/my- - project-id or organizations/my-org-id. - page_token: - Page token to continue retrieval. Comes from previous call to - ``ListDeidentifyTemplates``. - page_size: - Size of the page, can be limited by server. If zero server - returns a page of max size 100. - order_by: - Comma separated list of fields to order by, followed by - ``asc`` or ``desc`` postfix. This list is case-insensitive, - default sorting order is ascending, redundant space characters - are insignificant. Example: ``name asc,update_time, - create_time desc`` Supported fields are: - ``create_time``: - corresponds to time the template was created. - - ``update_time``: corresponds to time the template was last - updated. - ``name``: corresponds to template's name. - - ``display_name``: corresponds to template's display name. - location_id: - The geographic location where deidentifications templates will - be retrieved from. Use ``-`` for all locations. Reserved for - future extensions. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.ListDeidentifyTemplatesRequest) - ), -) -_sym_db.RegisterMessage(ListDeidentifyTemplatesRequest) - -ListDeidentifyTemplatesResponse = _reflection.GeneratedProtocolMessageType( - "ListDeidentifyTemplatesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTDEIDENTIFYTEMPLATESRESPONSE, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Response message for ListDeidentifyTemplates. - - - Attributes: - deidentify_templates: - List of deidentify templates, up to page\_size in - ListDeidentifyTemplatesRequest. - next_page_token: - If the next page is available then the next page token to be - used in following ListDeidentifyTemplates request. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.ListDeidentifyTemplatesResponse) - ), -) -_sym_db.RegisterMessage(ListDeidentifyTemplatesResponse) - -DeleteDeidentifyTemplateRequest = _reflection.GeneratedProtocolMessageType( - "DeleteDeidentifyTemplateRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEDEIDENTIFYTEMPLATEREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for DeleteDeidentifyTemplate. - - - Attributes: - name: - Required. Resource name of the organization and deidentify - template to be deleted, for example - ``organizations/433245324/deidentifyTemplates/432452342`` or - projects/project-id/deidentifyTemplates/432452342. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest) - ), -) -_sym_db.RegisterMessage(DeleteDeidentifyTemplateRequest) - -LargeCustomDictionaryConfig = _reflection.GeneratedProtocolMessageType( - "LargeCustomDictionaryConfig", - (_message.Message,), - dict( - DESCRIPTOR=_LARGECUSTOMDICTIONARYCONFIG, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Configuration for a custom dictionary created from a data - source of any size up to the maximum size defined in the - `limits `__ page. The artifacts of - dictionary creation are stored in the specified Google Cloud Storage - location. Consider using ``CustomInfoType.Dictionary`` for smaller - dictionaries that satisfy the size requirements. - - - Attributes: - output_path: - Location to store dictionary artifacts in Google Cloud - Storage. These files will only be accessible by project owners - and the DLP API. If any of these artifacts are modified, the - dictionary is considered invalid and can no longer be used. - cloud_storage_file_set: - Set of files containing newline-delimited lists of dictionary - phrases. - big_query_field: - Field in a BigQuery table where each cell represents a - dictionary phrase. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.LargeCustomDictionaryConfig) - ), -) -_sym_db.RegisterMessage(LargeCustomDictionaryConfig) - -LargeCustomDictionaryStats = _reflection.GeneratedProtocolMessageType( - "LargeCustomDictionaryStats", - (_message.Message,), - dict( - DESCRIPTOR=_LARGECUSTOMDICTIONARYSTATS, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Summary statistics of a custom dictionary. - - - Attributes: - approx_num_phrases: - Approximate number of distinct phrases in the dictionary. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.LargeCustomDictionaryStats) - ), -) -_sym_db.RegisterMessage(LargeCustomDictionaryStats) - -StoredInfoTypeConfig = _reflection.GeneratedProtocolMessageType( - "StoredInfoTypeConfig", - (_message.Message,), - dict( - DESCRIPTOR=_STOREDINFOTYPECONFIG, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Configuration for stored infoTypes. All fields and - subfield are provided by the user. For more information, see - https://cloud.google.com/dlp/docs/creating-custom-infotypes. - - - Attributes: - display_name: - Display name of the StoredInfoType (max 256 characters). - description: - Description of the StoredInfoType (max 256 characters). - type: - Stored infotype types. - large_custom_dictionary: - StoredInfoType where findings are defined by a dictionary of - phrases. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.StoredInfoTypeConfig) - ), -) -_sym_db.RegisterMessage(StoredInfoTypeConfig) - -StoredInfoTypeStats = _reflection.GeneratedProtocolMessageType( - "StoredInfoTypeStats", - (_message.Message,), - dict( - DESCRIPTOR=_STOREDINFOTYPESTATS, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Statistics for a StoredInfoType. - - - Attributes: - type: - Stat types - large_custom_dictionary: - StoredInfoType where findings are defined by a dictionary of - phrases. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.StoredInfoTypeStats) - ), -) -_sym_db.RegisterMessage(StoredInfoTypeStats) - -StoredInfoTypeVersion = _reflection.GeneratedProtocolMessageType( - "StoredInfoTypeVersion", - (_message.Message,), - dict( - DESCRIPTOR=_STOREDINFOTYPEVERSION, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Version of a StoredInfoType, including the configuration - used to build it, create timestamp, and current state. - - - Attributes: - config: - StoredInfoType configuration. - create_time: - Create timestamp of the version. Read-only, determined by the - system when the version is created. - state: - Stored info type version state. Read-only, updated by the - system during dictionary creation. - errors: - Errors that occurred when creating this storedInfoType - version, or anomalies detected in the storedInfoType data that - render it unusable. Only the five most recent errors will be - displayed, with the most recent error appearing first. For - example, some of the data for stored custom dictionaries is - put in the user's Google Cloud Storage bucket, and if this - data is modified or deleted by the user or another system, the - dictionary becomes invalid. If any errors occur, fix the - problem indicated by the error message and use the - UpdateStoredInfoType API method to create another version of - the storedInfoType to continue using it, reusing the same - ``config`` if it was not the source of the error. - stats: - Statistics about this storedInfoType version. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.StoredInfoTypeVersion) - ), -) -_sym_db.RegisterMessage(StoredInfoTypeVersion) - -StoredInfoType = _reflection.GeneratedProtocolMessageType( - "StoredInfoType", - (_message.Message,), - dict( - DESCRIPTOR=_STOREDINFOTYPE, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""StoredInfoType resource message that contains information - about the current version and any pending updates. - - - Attributes: - name: - Resource name. - current_version: - Current version of the stored info type. - pending_versions: - Pending versions of the stored info type. Empty if no versions - are pending. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.StoredInfoType) - ), -) -_sym_db.RegisterMessage(StoredInfoType) - -CreateStoredInfoTypeRequest = _reflection.GeneratedProtocolMessageType( - "CreateStoredInfoTypeRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATESTOREDINFOTYPEREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for CreateStoredInfoType. - - - Attributes: - parent: - Required. The parent resource name, for example projects/my- - project-id or organizations/my-org-id. - config: - Required. Configuration of the storedInfoType to create. - stored_info_type_id: - The storedInfoType ID can contain uppercase and lowercase - letters, numbers, and hyphens; that is, it must match the - regular expression: ``[a-zA-Z\\d-_]+``. The maximum length is - 100 characters. Can be empty to allow the system to generate - one. - location_id: - The geographic location to store the stored infoType. Reserved - for future extensions. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CreateStoredInfoTypeRequest) - ), -) -_sym_db.RegisterMessage(CreateStoredInfoTypeRequest) - -UpdateStoredInfoTypeRequest = _reflection.GeneratedProtocolMessageType( - "UpdateStoredInfoTypeRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATESTOREDINFOTYPEREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for UpdateStoredInfoType. - - - Attributes: - name: - Required. Resource name of organization and storedInfoType to - be updated, for example - ``organizations/433245324/storedInfoTypes/432452342`` or - projects/project-id/storedInfoTypes/432452342. - config: - Updated configuration for the storedInfoType. If not provided, - a new version of the storedInfoType will be created with the - existing configuration. - update_mask: - Mask to control which fields get updated. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.UpdateStoredInfoTypeRequest) - ), -) -_sym_db.RegisterMessage(UpdateStoredInfoTypeRequest) - -GetStoredInfoTypeRequest = _reflection.GeneratedProtocolMessageType( - "GetStoredInfoTypeRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETSTOREDINFOTYPEREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for GetStoredInfoType. - - - Attributes: - name: - Required. Resource name of the organization and storedInfoType - to be read, for example - ``organizations/433245324/storedInfoTypes/432452342`` or - projects/project-id/storedInfoTypes/432452342. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.GetStoredInfoTypeRequest) - ), -) -_sym_db.RegisterMessage(GetStoredInfoTypeRequest) - -ListStoredInfoTypesRequest = _reflection.GeneratedProtocolMessageType( - "ListStoredInfoTypesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTSTOREDINFOTYPESREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for ListStoredInfoTypes. - - - Attributes: - parent: - Required. The parent resource name, for example projects/my- - project-id or organizations/my-org-id. - page_token: - Page token to continue retrieval. Comes from previous call to - ``ListStoredInfoTypes``. - page_size: - Size of the page, can be limited by server. If zero server - returns a page of max size 100. - order_by: - Comma separated list of fields to order by, followed by - ``asc`` or ``desc`` postfix. This list is case-insensitive, - default sorting order is ascending, redundant space characters - are insignificant. Example: ``name asc, display_name, - create_time desc`` Supported fields are: - ``create_time``: - corresponds to time the most recent version of the resource - was created. - ``state``: corresponds to the state of the - resource. - ``name``: corresponds to resource name. - - ``display_name``: corresponds to info type's display name. - location_id: - The geographic location where stored infoTypes will be - retrieved from. Use ``-`` for all locations. Reserved for - future extensions. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.ListStoredInfoTypesRequest) - ), -) -_sym_db.RegisterMessage(ListStoredInfoTypesRequest) - -ListStoredInfoTypesResponse = _reflection.GeneratedProtocolMessageType( - "ListStoredInfoTypesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTSTOREDINFOTYPESRESPONSE, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Response message for ListStoredInfoTypes. - - - Attributes: - stored_info_types: - List of storedInfoTypes, up to page\_size in - ListStoredInfoTypesRequest. - next_page_token: - If the next page is available then the next page token to be - used in following ListStoredInfoTypes request. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.ListStoredInfoTypesResponse) - ), -) -_sym_db.RegisterMessage(ListStoredInfoTypesResponse) - -DeleteStoredInfoTypeRequest = _reflection.GeneratedProtocolMessageType( - "DeleteStoredInfoTypeRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETESTOREDINFOTYPEREQUEST, - __module__="google.cloud.dlp_v2.proto.dlp_pb2", - __doc__="""Request message for DeleteStoredInfoType. - - - Attributes: - name: - Required. Resource name of the organization and storedInfoType - to be deleted, for example - ``organizations/433245324/storedInfoTypes/432452342`` or - projects/project-id/storedInfoTypes/432452342. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.DeleteStoredInfoTypeRequest) - ), -) -_sym_db.RegisterMessage(DeleteStoredInfoTypeRequest) - - -DESCRIPTOR._options = None -_REDACTIMAGEREQUEST.fields_by_name["parent"]._options = None -_DEIDENTIFYCONTENTREQUEST.fields_by_name["parent"]._options = None -_REIDENTIFYCONTENTREQUEST.fields_by_name["parent"]._options = None -_INSPECTCONTENTREQUEST.fields_by_name["parent"]._options = None -_QUASIID.fields_by_name["field"]._options = None -_STATISTICALTABLE.fields_by_name["table"]._options = None -_STATISTICALTABLE.fields_by_name["quasi_ids"]._options = None -_STATISTICALTABLE.fields_by_name["relative_frequency"]._options = None -_PRIVACYMETRIC_KMAPESTIMATIONCONFIG_TAGGEDFIELD.fields_by_name["field"]._options = None -_PRIVACYMETRIC_KMAPESTIMATIONCONFIG_AUXILIARYTABLE.fields_by_name[ - "table" -]._options = None -_PRIVACYMETRIC_KMAPESTIMATIONCONFIG_AUXILIARYTABLE.fields_by_name[ - "quasi_ids" -]._options = None -_PRIVACYMETRIC_KMAPESTIMATIONCONFIG_AUXILIARYTABLE.fields_by_name[ - "relative_frequency" -]._options = None -_PRIVACYMETRIC_KMAPESTIMATIONCONFIG.fields_by_name["quasi_ids"]._options = None -_PRIVACYMETRIC_DELTAPRESENCEESTIMATIONCONFIG.fields_by_name["quasi_ids"]._options = None -_FIXEDSIZEBUCKETINGCONFIG.fields_by_name["lower_bound"]._options = None -_FIXEDSIZEBUCKETINGCONFIG.fields_by_name["upper_bound"]._options = None -_FIXEDSIZEBUCKETINGCONFIG.fields_by_name["bucket_size"]._options = None -_CRYPTOREPLACEFFXFPECONFIG.fields_by_name["crypto_key"]._options = None -_TRANSIENTCRYPTOKEY.fields_by_name["name"]._options = None -_UNWRAPPEDCRYPTOKEY.fields_by_name["key"]._options = None -_KMSWRAPPEDCRYPTOKEY.fields_by_name["wrapped_key"]._options = None -_KMSWRAPPEDCRYPTOKEY.fields_by_name["crypto_key_name"]._options = None -_DATESHIFTCONFIG.fields_by_name["upper_bound_days"]._options = None -_DATESHIFTCONFIG.fields_by_name["lower_bound_days"]._options = None -_INFOTYPETRANSFORMATIONS_INFOTYPETRANSFORMATION.fields_by_name[ - "primitive_transformation" -]._options = None -_INFOTYPETRANSFORMATIONS.fields_by_name["transformations"]._options = None -_FIELDTRANSFORMATION.fields_by_name["fields"]._options = None -_RECORDCONDITION_CONDITION.fields_by_name["field"]._options = None -_RECORDCONDITION_CONDITION.fields_by_name["operator"]._options = None -_INSPECTTEMPLATE.fields_by_name["name"]._options = None -_INSPECTTEMPLATE.fields_by_name["create_time"]._options = None -_INSPECTTEMPLATE.fields_by_name["update_time"]._options = None -_INSPECTTEMPLATE._options = None -_DEIDENTIFYTEMPLATE.fields_by_name["name"]._options = None -_DEIDENTIFYTEMPLATE.fields_by_name["create_time"]._options = None -_DEIDENTIFYTEMPLATE.fields_by_name["update_time"]._options = None -_DEIDENTIFYTEMPLATE._options = None -_JOBTRIGGER.fields_by_name["errors"]._options = None -_JOBTRIGGER.fields_by_name["create_time"]._options = None -_JOBTRIGGER.fields_by_name["update_time"]._options = None -_JOBTRIGGER.fields_by_name["last_run_time"]._options = None -_JOBTRIGGER.fields_by_name["status"]._options = None -_JOBTRIGGER._options = None -_CREATEINSPECTTEMPLATEREQUEST.fields_by_name["parent"]._options = None -_CREATEINSPECTTEMPLATEREQUEST.fields_by_name["inspect_template"]._options = None -_UPDATEINSPECTTEMPLATEREQUEST.fields_by_name["name"]._options = None -_GETINSPECTTEMPLATEREQUEST.fields_by_name["name"]._options = None -_LISTINSPECTTEMPLATESREQUEST.fields_by_name["parent"]._options = None -_DELETEINSPECTTEMPLATEREQUEST.fields_by_name["name"]._options = None -_CREATEJOBTRIGGERREQUEST.fields_by_name["parent"]._options = None -_CREATEJOBTRIGGERREQUEST.fields_by_name["job_trigger"]._options = None -_ACTIVATEJOBTRIGGERREQUEST.fields_by_name["name"]._options = None -_UPDATEJOBTRIGGERREQUEST.fields_by_name["name"]._options = None -_GETJOBTRIGGERREQUEST.fields_by_name["name"]._options = None -_CREATEDLPJOBREQUEST.fields_by_name["parent"]._options = None -_LISTJOBTRIGGERSREQUEST.fields_by_name["parent"]._options = None -_DELETEJOBTRIGGERREQUEST.fields_by_name["name"]._options = None -_DLPJOB._options = None -_GETDLPJOBREQUEST.fields_by_name["name"]._options = None -_LISTDLPJOBSREQUEST.fields_by_name["parent"]._options = None -_CANCELDLPJOBREQUEST.fields_by_name["name"]._options = None -_DELETEDLPJOBREQUEST.fields_by_name["name"]._options = None -_CREATEDEIDENTIFYTEMPLATEREQUEST.fields_by_name["parent"]._options = None -_CREATEDEIDENTIFYTEMPLATEREQUEST.fields_by_name["deidentify_template"]._options = None -_UPDATEDEIDENTIFYTEMPLATEREQUEST.fields_by_name["name"]._options = None -_GETDEIDENTIFYTEMPLATEREQUEST.fields_by_name["name"]._options = None -_LISTDEIDENTIFYTEMPLATESREQUEST.fields_by_name["parent"]._options = None -_DELETEDEIDENTIFYTEMPLATEREQUEST.fields_by_name["name"]._options = None -_STOREDINFOTYPE._options = None -_CREATESTOREDINFOTYPEREQUEST.fields_by_name["parent"]._options = None -_CREATESTOREDINFOTYPEREQUEST.fields_by_name["config"]._options = None -_UPDATESTOREDINFOTYPEREQUEST.fields_by_name["name"]._options = None -_GETSTOREDINFOTYPEREQUEST.fields_by_name["name"]._options = None -_LISTSTOREDINFOTYPESREQUEST.fields_by_name["parent"]._options = None -_DELETESTOREDINFOTYPEREQUEST.fields_by_name["name"]._options = None - -_DLPSERVICE = _descriptor.ServiceDescriptor( - name="DlpService", - full_name="google.privacy.dlp.v2.DlpService", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\022dlp.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=29899, - serialized_end=39206, - methods=[ - _descriptor.MethodDescriptor( - name="InspectContent", - full_name="google.privacy.dlp.v2.DlpService.InspectContent", - index=0, - containing_service=None, - input_type=_INSPECTCONTENTREQUEST, - output_type=_INSPECTCONTENTRESPONSE, - serialized_options=_b( - '\202\323\344\223\002r"\'/v2/{parent=projects/*}/content:inspect:\001*ZD"?/v2/{parent=projects/*}/locations/{location_id}/content:inspect:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="RedactImage", - full_name="google.privacy.dlp.v2.DlpService.RedactImage", - index=1, - containing_service=None, - input_type=_REDACTIMAGEREQUEST, - output_type=_REDACTIMAGERESPONSE, - serialized_options=_b( - '\202\323\344\223\002l"$/v2/{parent=projects/*}/image:redact:\001*ZA"29/v2/{name=organizations/*/locations/*/inspectTemplates/*}:\001*Z-2(/v2/{name=projects/*/inspectTemplates/*}:\001*Z924/v2/{name=projects/*/locations/*/inspectTemplates/*}:\001*\332A!name,inspect_template,update_mask" - ), - ), - _descriptor.MethodDescriptor( - name="GetInspectTemplate", - full_name="google.privacy.dlp.v2.DlpService.GetInspectTemplate", - index=7, - containing_service=None, - input_type=_GETINSPECTTEMPLATEREQUEST, - output_type=_INSPECTTEMPLATE, - serialized_options=_b( - "\202\323\344\223\002\320\001\022-/v2/{name=organizations/*/inspectTemplates/*}Z;\0229/v2/{name=organizations/*/locations/*/inspectTemplates/*}Z*\022(/v2/{name=projects/*/inspectTemplates/*}Z6\0224/v2/{name=projects/*/locations/*/inspectTemplates/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ListInspectTemplates", - full_name="google.privacy.dlp.v2.DlpService.ListInspectTemplates", - index=8, - containing_service=None, - input_type=_LISTINSPECTTEMPLATESREQUEST, - output_type=_LISTINSPECTTEMPLATESRESPONSE, - serialized_options=_b( - "\202\323\344\223\002\350\001\022-/v2/{parent=organizations/*}/inspectTemplatesZG\022E/v2/{parent=organizations/*}/locations/{location_id}/inspectTemplatesZ*\022(/v2/{parent=projects/*}/inspectTemplatesZB\022@/v2/{parent=projects/*}/locations/{location_id}/inspectTemplates\332A\006parent" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteInspectTemplate", - full_name="google.privacy.dlp.v2.DlpService.DeleteInspectTemplate", - index=9, - containing_service=None, - input_type=_DELETEINSPECTTEMPLATEREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002\320\001*-/v2/{name=organizations/*/inspectTemplates/*}Z;*9/v2/{name=organizations/*/locations/*/inspectTemplates/*}Z**(/v2/{name=projects/*/inspectTemplates/*}Z6*4/v2/{name=projects/*/locations/*/inspectTemplates/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="CreateDeidentifyTemplate", - full_name="google.privacy.dlp.v2.DlpService.CreateDeidentifyTemplate", - index=10, - containing_service=None, - input_type=_CREATEDEIDENTIFYTEMPLATEREQUEST, - output_type=_DEIDENTIFYTEMPLATE, - serialized_options=_b( - '\202\323\344\223\002\200\002"0/v2/{parent=organizations/*}/deidentifyTemplates:\001*ZM"H/v2/{parent=organizations/*}/locations/{location_id}/deidentifyTemplates:\001*Z0"+/v2/{parent=projects/*}/deidentifyTemplates:\001*ZH"C/v2/{parent=projects/*}/locations/{location_id}/deidentifyTemplates:\001*\332A\032parent,deidentify_template\332A&parent,deidentify_template,location_id' - ), - ), - _descriptor.MethodDescriptor( - name="UpdateDeidentifyTemplate", - full_name="google.privacy.dlp.v2.DlpService.UpdateDeidentifyTemplate", - index=11, - containing_service=None, - input_type=_UPDATEDEIDENTIFYTEMPLATEREQUEST, - output_type=_DEIDENTIFYTEMPLATE, - serialized_options=_b( - "\202\323\344\223\002\350\00120/v2/{name=organizations/*/deidentifyTemplates/*}:\001*ZA2\022*/`. Trailing wildcard in the path is allowed. - // - // If the url ends in a trailing slash, the bucket or directory represented - // by the url will be scanned non-recursively (content in sub-directories - // will not be scanned). This means that `gs://mybucket/` is equivalent to - // `gs://mybucket/*`, and `gs://mybucket/directory/` is equivalent to - // `gs://mybucket/directory/*`. - // - // Exactly one of `url` or `regex_file_set` must be set. - string url = 1; - - // The regex-filtered set of files to scan. Exactly one of `url` or - // `regex_file_set` must be set. - CloudStorageRegexFileSet regex_file_set = 2; - } - - // How to sample bytes if not all bytes are scanned. Meaningful only when used - // in conjunction with bytes_limit_per_file. If not specified, scanning would - // start from the top. - enum SampleMethod { - SAMPLE_METHOD_UNSPECIFIED = 0; - - // Scan from the top (default). - TOP = 1; - - // For each file larger than bytes_limit_per_file, randomly pick the offset - // to start scanning. The scanned bytes are contiguous. - RANDOM_START = 2; - } - - // The set of one or more files to scan. - FileSet file_set = 1; - - // Max number of bytes to scan from a file. If a scanned file's size is bigger - // than this value then the rest of the bytes are omitted. Only one - // of bytes_limit_per_file and bytes_limit_per_file_percent can be specified. - int64 bytes_limit_per_file = 4; - - // Max percentage of bytes to scan from a file. The rest are omitted. The - // number of bytes scanned is rounded down. Must be between 0 and 100, - // inclusively. Both 0 and 100 means no limit. Defaults to 0. Only one - // of bytes_limit_per_file and bytes_limit_per_file_percent can be specified. - int32 bytes_limit_per_file_percent = 8; - - // List of file type groups to include in the scan. - // If empty, all files are scanned and available data format processors - // are applied. In addition, the binary content of the selected files - // is always scanned as well. - repeated FileType file_types = 5; - - SampleMethod sample_method = 6; - - // Limits the number of files to scan to this percentage of the input FileSet. - // Number of files scanned is rounded down. Must be between 0 and 100, - // inclusively. Both 0 and 100 means no limit. Defaults to 0. - int32 files_limit_percent = 7; -} - -// Message representing a set of files in Cloud Storage. -message CloudStorageFileSet { - // The url, in the format `gs:///`. Trailing wildcard in the - // path is allowed. - string url = 1; -} - -// Message representing a single file or path in Cloud Storage. -message CloudStoragePath { - // A url representing a file or path (no wildcards) in Cloud Storage. - // Example: gs://[BUCKET_NAME]/dictionary.txt - string path = 1; -} - -// Options defining BigQuery table and row identifiers. -message BigQueryOptions { - // How to sample rows if not all rows are scanned. Meaningful only when used - // in conjunction with either rows_limit or rows_limit_percent. If not - // specified, scanning would start from the top. - enum SampleMethod { - SAMPLE_METHOD_UNSPECIFIED = 0; - - // Scan from the top (default). - TOP = 1; - - // Randomly pick the row to start scanning. The scanned rows are contiguous. - RANDOM_START = 2; - } - - // Complete BigQuery table reference. - BigQueryTable table_reference = 1; - - // References to fields uniquely identifying rows within the table. - // Nested fields in the format, like `person.birthdate.year`, are allowed. - repeated FieldId identifying_fields = 2; - - // Max number of rows to scan. If the table has more rows than this value, the - // rest of the rows are omitted. If not set, or if set to 0, all rows will be - // scanned. Only one of rows_limit and rows_limit_percent can be specified. - // Cannot be used in conjunction with TimespanConfig. - int64 rows_limit = 3; - - // Max percentage of rows to scan. The rest are omitted. The number of rows - // scanned is rounded down. Must be between 0 and 100, inclusively. Both 0 and - // 100 means no limit. Defaults to 0. Only one of rows_limit and - // rows_limit_percent can be specified. Cannot be used in conjunction with - // TimespanConfig. - int32 rows_limit_percent = 6; - - SampleMethod sample_method = 4; - - // References to fields excluded from scanning. This allows you to skip - // inspection of entire columns which you know have no findings. - repeated FieldId excluded_fields = 5; -} - -// Shared message indicating Cloud storage type. -message StorageConfig { - // Configuration of the timespan of the items to include in scanning. - // Currently only supported when inspecting Google Cloud Storage and BigQuery. - message TimespanConfig { - // Exclude files or rows older than this value. - google.protobuf.Timestamp start_time = 1; - - // Exclude files or rows newer than this value. - // If set to zero, no upper time limit is applied. - google.protobuf.Timestamp end_time = 2; - - // Specification of the field containing the timestamp of scanned items. - // Used for data sources like Datastore and BigQuery. - // - // For BigQuery: - // Required to filter out rows based on the given start and - // end times. If not specified and the table was modified between the given - // start and end times, the entire table will be scanned. - // The valid data types of the timestamp field are: `INTEGER`, `DATE`, - // `TIMESTAMP`, or `DATETIME` BigQuery column. - // - // For Datastore. - // Valid data types of the timestamp field are: `TIMESTAMP`. - // Datastore entity will be scanned if the timestamp property does not - // exist or its value is empty or invalid. - FieldId timestamp_field = 3; - - // When the job is started by a JobTrigger we will automatically figure out - // a valid start_time to avoid scanning files that have not been modified - // since the last time the JobTrigger executed. This will be based on the - // time of the execution of the last run of the JobTrigger. - bool enable_auto_population_of_timespan_config = 4; - } - - oneof type { - // Google Cloud Datastore options specification. - DatastoreOptions datastore_options = 2; - - // Google Cloud Storage options specification. - CloudStorageOptions cloud_storage_options = 3; - - // BigQuery options specification. - BigQueryOptions big_query_options = 4; - } - - TimespanConfig timespan_config = 6; -} - -// Definitions of file type groups to scan. -enum FileType { - // Includes all files. - FILE_TYPE_UNSPECIFIED = 0; - - // Includes all file extensions not covered by text file types. - BINARY_FILE = 1; - - // Included file extensions: - // asc, brf, c, cc, cpp, csv, cxx, c++, cs, css, dart, eml, go, h, hh, hpp, - // hxx, h++, hs, html, htm, shtml, shtm, xhtml, lhs, ini, java, js, json, - // ocaml, md, mkd, markdown, m, ml, mli, pl, pm, php, phtml, pht, py, pyw, - // rb, rbw, rs, rc, scala, sh, sql, tex, txt, text, tsv, vcard, vcs, wml, - // xml, xsl, xsd, yml, yaml. - TEXT_FILE = 2; - - // Included file extensions: - // bmp, gif, jpg, jpeg, jpe, png. - // bytes_limit_per_file has no effect on image files. - IMAGE = 3; - - // Included file extensions: - // avro - AVRO = 7; -} - -// Row key for identifying a record in BigQuery table. -message BigQueryKey { - // Complete BigQuery table reference. - BigQueryTable table_reference = 1; - - // Absolute number of the row from the beginning of the table at the time - // of scanning. - int64 row_number = 2; -} - -// Record key for a finding in Cloud Datastore. -message DatastoreKey { - // Datastore entity key. - Key entity_key = 1; -} - -// A unique identifier for a Datastore entity. -// If a key's partition ID or any of its path kinds or names are -// reserved/read-only, the key is reserved/read-only. -// A reserved/read-only key is forbidden in certain documented contexts. -message Key { - // A (kind, ID/name) pair used to construct a key path. - // - // If either name or ID is set, the element is complete. - // If neither is set, the element is incomplete. - message PathElement { - // The kind of the entity. - // A kind matching regex `__.*__` is reserved/read-only. - // A kind must not contain more than 1500 bytes when UTF-8 encoded. - // Cannot be `""`. - string kind = 1; - - // The type of ID. - oneof id_type { - // The auto-allocated ID of the entity. - // Never equal to zero. Values less than zero are discouraged and may not - // be supported in the future. - int64 id = 2; - - // The name of the entity. - // A name matching regex `__.*__` is reserved/read-only. - // A name must not be more than 1500 bytes when UTF-8 encoded. - // Cannot be `""`. - string name = 3; - } - } - - // Entities are partitioned into subsets, currently identified by a project - // ID and namespace ID. - // Queries are scoped to a single partition. - PartitionId partition_id = 1; - - // The entity path. - // An entity path consists of one or more elements composed of a kind and a - // string or numerical identifier, which identify entities. The first - // element identifies a _root entity_, the second element identifies - // a _child_ of the root entity, the third element identifies a child of the - // second entity, and so forth. The entities identified by all prefixes of - // the path are called the element's _ancestors_. - // - // A path can never be empty, and a path can have at most 100 elements. - repeated PathElement path = 2; -} - -// Message for a unique key indicating a record that contains a finding. -message RecordKey { - oneof type { - DatastoreKey datastore_key = 2; - - BigQueryKey big_query_key = 3; - } - - // Values of identifying columns in the given row. Order of values matches - // the order of field identifiers specified in the scanning request. - repeated string id_values = 5; -} - -// Message defining the location of a BigQuery table. A table is uniquely -// identified by its project_id, dataset_id, and table_name. Within a query -// a table is often referenced with a string in the format of: -// `:.` or -// `..`. -message BigQueryTable { - // The Google Cloud Platform project ID of the project containing the table. - // If omitted, project ID is inferred from the API call. - string project_id = 1; - - // Dataset ID of the table. - string dataset_id = 2; - - // Name of the table. - string table_id = 3; -} - -// Message defining a field of a BigQuery table. -message BigQueryField { - // Source table of the field. - BigQueryTable table = 1; - - // Designated field in the BigQuery table. - FieldId field = 2; -} - -// An entity in a dataset is a field or set of fields that correspond to a -// single person. For example, in medical records the `EntityId` might be a -// patient identifier, or for financial records it might be an account -// identifier. This message is used when generalizations or analysis must take -// into account that multiple rows correspond to the same entity. -message EntityId { - // Composite key indicating which field contains the entity identifier. - FieldId field = 1; -} diff --git a/dlp/google/cloud/dlp_v2/proto/storage_pb2.py b/dlp/google/cloud/dlp_v2/proto/storage_pb2.py deleted file mode 100644 index d1b5b167699c..000000000000 --- a/dlp/google/cloud/dlp_v2/proto/storage_pb2.py +++ /dev/null @@ -1,3327 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/privacy/dlp_v2/proto/storage.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/privacy/dlp_v2/proto/storage.proto", - package="google.privacy.dlp.v2", - syntax="proto3", - serialized_options=_b( - "\n\031com.google.privacy.dlp.v2B\nDlpStorageP\001Z8google.golang.org/genproto/googleapis/privacy/dlp/v2;dlp\252\002\023Google.Cloud.Dlp.V2\312\002\023Google\\Cloud\\Dlp\\V2" - ), - serialized_pb=_b( - '\n/google/cloud/privacy/dlp_v2/proto/storage.proto\x12\x15google.privacy.dlp.v2\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\x18\n\x08InfoType\x12\x0c\n\x04name\x18\x01 \x01(\t"K\n\nStoredType\x12\x0c\n\x04name\x18\x01 \x01(\t\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"\xc8\x0b\n\x0e\x43ustomInfoType\x12\x32\n\tinfo_type\x18\x01 \x01(\x0b\x32\x1f.google.privacy.dlp.v2.InfoType\x12\x35\n\nlikelihood\x18\x06 \x01(\x0e\x32!.google.privacy.dlp.v2.Likelihood\x12\x46\n\ndictionary\x18\x02 \x01(\x0b\x32\x30.google.privacy.dlp.v2.CustomInfoType.DictionaryH\x00\x12<\n\x05regex\x18\x03 \x01(\x0b\x32+.google.privacy.dlp.v2.CustomInfoType.RegexH\x00\x12M\n\x0esurrogate_type\x18\x04 \x01(\x0b\x32\x33.google.privacy.dlp.v2.CustomInfoType.SurrogateTypeH\x00\x12\x38\n\x0bstored_type\x18\x05 \x01(\x0b\x32!.google.privacy.dlp.v2.StoredTypeH\x00\x12L\n\x0f\x64\x65tection_rules\x18\x07 \x03(\x0b\x32\x33.google.privacy.dlp.v2.CustomInfoType.DetectionRule\x12K\n\x0e\x65xclusion_type\x18\x08 \x01(\x0e\x32\x33.google.privacy.dlp.v2.CustomInfoType.ExclusionType\x1a\xc8\x01\n\nDictionary\x12N\n\tword_list\x18\x01 \x01(\x0b\x32\x39.google.privacy.dlp.v2.CustomInfoType.Dictionary.WordListH\x00\x12\x45\n\x12\x63loud_storage_path\x18\x03 \x01(\x0b\x32\'.google.privacy.dlp.v2.CloudStoragePathH\x00\x1a\x19\n\x08WordList\x12\r\n\x05words\x18\x01 \x03(\tB\x08\n\x06source\x1a/\n\x05Regex\x12\x0f\n\x07pattern\x18\x01 \x01(\t\x12\x15\n\rgroup_indexes\x18\x02 \x03(\x05\x1a\x0f\n\rSurrogateType\x1a\xbe\x04\n\rDetectionRule\x12W\n\x0chotword_rule\x18\x01 \x01(\x0b\x32?.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRuleH\x00\x1a\x38\n\tProximity\x12\x15\n\rwindow_before\x18\x01 \x01(\x05\x12\x14\n\x0cwindow_after\x18\x02 \x01(\x05\x1a\x82\x01\n\x14LikelihoodAdjustment\x12=\n\x10\x66ixed_likelihood\x18\x01 \x01(\x0e\x32!.google.privacy.dlp.v2.LikelihoodH\x00\x12\x1d\n\x13relative_likelihood\x18\x02 \x01(\x05H\x00\x42\x0c\n\nadjustment\x1a\x8c\x02\n\x0bHotwordRule\x12\x42\n\rhotword_regex\x18\x01 \x01(\x0b\x32+.google.privacy.dlp.v2.CustomInfoType.Regex\x12P\n\tproximity\x18\x02 \x01(\x0b\x32=.google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity\x12g\n\x15likelihood_adjustment\x18\x03 \x01(\x0b\x32H.google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustmentB\x06\n\x04type"K\n\rExclusionType\x12\x1e\n\x1a\x45XCLUSION_TYPE_UNSPECIFIED\x10\x00\x12\x1a\n\x16\x45XCLUSION_TYPE_EXCLUDE\x10\x01\x42\x06\n\x04type"\x17\n\x07\x46ieldId\x12\x0c\n\x04name\x18\x01 \x01(\t"7\n\x0bPartitionId\x12\x12\n\nproject_id\x18\x02 \x01(\t\x12\x14\n\x0cnamespace_id\x18\x04 \x01(\t"\x1e\n\x0eKindExpression\x12\x0c\n\x04name\x18\x01 \x01(\t"\x81\x01\n\x10\x44\x61tastoreOptions\x12\x38\n\x0cpartition_id\x18\x01 \x01(\x0b\x32".google.privacy.dlp.v2.PartitionId\x12\x33\n\x04kind\x18\x02 \x01(\x0b\x32%.google.privacy.dlp.v2.KindExpression"]\n\x18\x43loudStorageRegexFileSet\x12\x13\n\x0b\x62ucket_name\x18\x01 \x01(\t\x12\x15\n\rinclude_regex\x18\x02 \x03(\t\x12\x15\n\rexclude_regex\x18\x03 \x03(\t"\xec\x03\n\x13\x43loudStorageOptions\x12\x44\n\x08\x66ile_set\x18\x01 \x01(\x0b\x32\x32.google.privacy.dlp.v2.CloudStorageOptions.FileSet\x12\x1c\n\x14\x62ytes_limit_per_file\x18\x04 \x01(\x03\x12$\n\x1c\x62ytes_limit_per_file_percent\x18\x08 \x01(\x05\x12\x33\n\nfile_types\x18\x05 \x03(\x0e\x32\x1f.google.privacy.dlp.v2.FileType\x12N\n\rsample_method\x18\x06 \x01(\x0e\x32\x37.google.privacy.dlp.v2.CloudStorageOptions.SampleMethod\x12\x1b\n\x13\x66iles_limit_percent\x18\x07 \x01(\x05\x1a_\n\x07\x46ileSet\x12\x0b\n\x03url\x18\x01 \x01(\t\x12G\n\x0eregex_file_set\x18\x02 \x01(\x0b\x32/.google.privacy.dlp.v2.CloudStorageRegexFileSet"H\n\x0cSampleMethod\x12\x1d\n\x19SAMPLE_METHOD_UNSPECIFIED\x10\x00\x12\x07\n\x03TOP\x10\x01\x12\x10\n\x0cRANDOM_START\x10\x02""\n\x13\x43loudStorageFileSet\x12\x0b\n\x03url\x18\x01 \x01(\t" \n\x10\x43loudStoragePath\x12\x0c\n\x04path\x18\x01 \x01(\t"\x8b\x03\n\x0f\x42igQueryOptions\x12=\n\x0ftable_reference\x18\x01 \x01(\x0b\x32$.google.privacy.dlp.v2.BigQueryTable\x12:\n\x12identifying_fields\x18\x02 \x03(\x0b\x32\x1e.google.privacy.dlp.v2.FieldId\x12\x12\n\nrows_limit\x18\x03 \x01(\x03\x12\x1a\n\x12rows_limit_percent\x18\x06 \x01(\x05\x12J\n\rsample_method\x18\x04 \x01(\x0e\x32\x33.google.privacy.dlp.v2.BigQueryOptions.SampleMethod\x12\x37\n\x0f\x65xcluded_fields\x18\x05 \x03(\x0b\x32\x1e.google.privacy.dlp.v2.FieldId"H\n\x0cSampleMethod\x12\x1d\n\x19SAMPLE_METHOD_UNSPECIFIED\x10\x00\x12\x07\n\x03TOP\x10\x01\x12\x10\n\x0cRANDOM_START\x10\x02"\x9a\x04\n\rStorageConfig\x12\x44\n\x11\x64\x61tastore_options\x18\x02 \x01(\x0b\x32\'.google.privacy.dlp.v2.DatastoreOptionsH\x00\x12K\n\x15\x63loud_storage_options\x18\x03 \x01(\x0b\x32*.google.privacy.dlp.v2.CloudStorageOptionsH\x00\x12\x43\n\x11\x62ig_query_options\x18\x04 \x01(\x0b\x32&.google.privacy.dlp.v2.BigQueryOptionsH\x00\x12L\n\x0ftimespan_config\x18\x06 \x01(\x0b\x32\x33.google.privacy.dlp.v2.StorageConfig.TimespanConfig\x1a\xda\x01\n\x0eTimespanConfig\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x37\n\x0ftimestamp_field\x18\x03 \x01(\x0b\x32\x1e.google.privacy.dlp.v2.FieldId\x12\x31\n)enable_auto_population_of_timespan_config\x18\x04 \x01(\x08\x42\x06\n\x04type"`\n\x0b\x42igQueryKey\x12=\n\x0ftable_reference\x18\x01 \x01(\x0b\x32$.google.privacy.dlp.v2.BigQueryTable\x12\x12\n\nrow_number\x18\x02 \x01(\x03">\n\x0c\x44\x61tastoreKey\x12.\n\nentity_key\x18\x01 \x01(\x0b\x32\x1a.google.privacy.dlp.v2.Key"\xbb\x01\n\x03Key\x12\x38\n\x0cpartition_id\x18\x01 \x01(\x0b\x32".google.privacy.dlp.v2.PartitionId\x12\x34\n\x04path\x18\x02 \x03(\x0b\x32&.google.privacy.dlp.v2.Key.PathElement\x1a\x44\n\x0bPathElement\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\x0c\n\x02id\x18\x02 \x01(\x03H\x00\x12\x0e\n\x04name\x18\x03 \x01(\tH\x00\x42\t\n\x07id_type"\xa1\x01\n\tRecordKey\x12<\n\rdatastore_key\x18\x02 \x01(\x0b\x32#.google.privacy.dlp.v2.DatastoreKeyH\x00\x12;\n\rbig_query_key\x18\x03 \x01(\x0b\x32".google.privacy.dlp.v2.BigQueryKeyH\x00\x12\x11\n\tid_values\x18\x05 \x03(\tB\x06\n\x04type"I\n\rBigQueryTable\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x12\n\ndataset_id\x18\x02 \x01(\t\x12\x10\n\x08table_id\x18\x03 \x01(\t"s\n\rBigQueryField\x12\x33\n\x05table\x18\x01 \x01(\x0b\x32$.google.privacy.dlp.v2.BigQueryTable\x12-\n\x05\x66ield\x18\x02 \x01(\x0b\x32\x1e.google.privacy.dlp.v2.FieldId"9\n\x08\x45ntityId\x12-\n\x05\x66ield\x18\x01 \x01(\x0b\x32\x1e.google.privacy.dlp.v2.FieldId*t\n\nLikelihood\x12\x1a\n\x16LIKELIHOOD_UNSPECIFIED\x10\x00\x12\x11\n\rVERY_UNLIKELY\x10\x01\x12\x0c\n\x08UNLIKELY\x10\x02\x12\x0c\n\x08POSSIBLE\x10\x03\x12\n\n\x06LIKELY\x10\x04\x12\x0f\n\x0bVERY_LIKELY\x10\x05*Z\n\x08\x46ileType\x12\x19\n\x15\x46ILE_TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x42INARY_FILE\x10\x01\x12\r\n\tTEXT_FILE\x10\x02\x12\t\n\x05IMAGE\x10\x03\x12\x08\n\x04\x41VRO\x10\x07\x42\x8f\x01\n\x19\x63om.google.privacy.dlp.v2B\nDlpStorageP\x01Z8google.golang.org/genproto/googleapis/privacy/dlp/v2;dlp\xaa\x02\x13Google.Cloud.Dlp.V2\xca\x02\x13Google\\Cloud\\Dlp\\V2b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - -_LIKELIHOOD = _descriptor.EnumDescriptor( - name="Likelihood", - full_name="google.privacy.dlp.v2.Likelihood", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="LIKELIHOOD_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="VERY_UNLIKELY", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UNLIKELY", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="POSSIBLE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LIKELY", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VERY_LIKELY", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4332, - serialized_end=4448, -) -_sym_db.RegisterEnumDescriptor(_LIKELIHOOD) - -Likelihood = enum_type_wrapper.EnumTypeWrapper(_LIKELIHOOD) -_FILETYPE = _descriptor.EnumDescriptor( - name="FileType", - full_name="google.privacy.dlp.v2.FileType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="FILE_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="BINARY_FILE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TEXT_FILE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="IMAGE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="AVRO", index=4, number=7, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4450, - serialized_end=4540, -) -_sym_db.RegisterEnumDescriptor(_FILETYPE) - -FileType = enum_type_wrapper.EnumTypeWrapper(_FILETYPE) -LIKELIHOOD_UNSPECIFIED = 0 -VERY_UNLIKELY = 1 -UNLIKELY = 2 -POSSIBLE = 3 -LIKELY = 4 -VERY_LIKELY = 5 -FILE_TYPE_UNSPECIFIED = 0 -BINARY_FILE = 1 -TEXT_FILE = 2 -IMAGE = 3 -AVRO = 7 - - -_CUSTOMINFOTYPE_EXCLUSIONTYPE = _descriptor.EnumDescriptor( - name="ExclusionType", - full_name="google.privacy.dlp.v2.CustomInfoType.ExclusionType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="EXCLUSION_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="EXCLUSION_TYPE_EXCLUDE", - index=1, - number=1, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1635, - serialized_end=1710, -) -_sym_db.RegisterEnumDescriptor(_CUSTOMINFOTYPE_EXCLUSIONTYPE) - -_CLOUDSTORAGEOPTIONS_SAMPLEMETHOD = _descriptor.EnumDescriptor( - name="SampleMethod", - full_name="google.privacy.dlp.v2.CloudStorageOptions.SampleMethod", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="SAMPLE_METHOD_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TOP", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RANDOM_START", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2482, - serialized_end=2554, -) -_sym_db.RegisterEnumDescriptor(_CLOUDSTORAGEOPTIONS_SAMPLEMETHOD) - -_BIGQUERYOPTIONS_SAMPLEMETHOD = _descriptor.EnumDescriptor( - name="SampleMethod", - full_name="google.privacy.dlp.v2.BigQueryOptions.SampleMethod", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="SAMPLE_METHOD_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TOP", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RANDOM_START", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2482, - serialized_end=2554, -) -_sym_db.RegisterEnumDescriptor(_BIGQUERYOPTIONS_SAMPLEMETHOD) - - -_INFOTYPE = _descriptor.Descriptor( - name="InfoType", - full_name="google.privacy.dlp.v2.InfoType", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.privacy.dlp.v2.InfoType.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=134, - serialized_end=158, -) - - -_STOREDTYPE = _descriptor.Descriptor( - name="StoredType", - full_name="google.privacy.dlp.v2.StoredType", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.privacy.dlp.v2.StoredType.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.privacy.dlp.v2.StoredType.create_time", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=160, - serialized_end=235, -) - - -_CUSTOMINFOTYPE_DICTIONARY_WORDLIST = _descriptor.Descriptor( - name="WordList", - full_name="google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="words", - full_name="google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList.words", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=955, - serialized_end=980, -) - -_CUSTOMINFOTYPE_DICTIONARY = _descriptor.Descriptor( - name="Dictionary", - full_name="google.privacy.dlp.v2.CustomInfoType.Dictionary", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="word_list", - full_name="google.privacy.dlp.v2.CustomInfoType.Dictionary.word_list", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cloud_storage_path", - full_name="google.privacy.dlp.v2.CustomInfoType.Dictionary.cloud_storage_path", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_CUSTOMINFOTYPE_DICTIONARY_WORDLIST], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="source", - full_name="google.privacy.dlp.v2.CustomInfoType.Dictionary.source", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=790, - serialized_end=990, -) - -_CUSTOMINFOTYPE_REGEX = _descriptor.Descriptor( - name="Regex", - full_name="google.privacy.dlp.v2.CustomInfoType.Regex", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="pattern", - full_name="google.privacy.dlp.v2.CustomInfoType.Regex.pattern", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="group_indexes", - full_name="google.privacy.dlp.v2.CustomInfoType.Regex.group_indexes", - index=1, - number=2, - type=5, - cpp_type=1, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=992, - serialized_end=1039, -) - -_CUSTOMINFOTYPE_SURROGATETYPE = _descriptor.Descriptor( - name="SurrogateType", - full_name="google.privacy.dlp.v2.CustomInfoType.SurrogateType", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1041, - serialized_end=1056, -) - -_CUSTOMINFOTYPE_DETECTIONRULE_PROXIMITY = _descriptor.Descriptor( - name="Proximity", - full_name="google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="window_before", - full_name="google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity.window_before", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="window_after", - full_name="google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity.window_after", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1165, - serialized_end=1221, -) - -_CUSTOMINFOTYPE_DETECTIONRULE_LIKELIHOODADJUSTMENT = _descriptor.Descriptor( - name="LikelihoodAdjustment", - full_name="google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="fixed_likelihood", - full_name="google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment.fixed_likelihood", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="relative_likelihood", - full_name="google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment.relative_likelihood", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="adjustment", - full_name="google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment.adjustment", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1224, - serialized_end=1354, -) - -_CUSTOMINFOTYPE_DETECTIONRULE_HOTWORDRULE = _descriptor.Descriptor( - name="HotwordRule", - full_name="google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="hotword_regex", - full_name="google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.hotword_regex", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="proximity", - full_name="google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.proximity", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="likelihood_adjustment", - full_name="google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule.likelihood_adjustment", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1357, - serialized_end=1625, -) - -_CUSTOMINFOTYPE_DETECTIONRULE = _descriptor.Descriptor( - name="DetectionRule", - full_name="google.privacy.dlp.v2.CustomInfoType.DetectionRule", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="hotword_rule", - full_name="google.privacy.dlp.v2.CustomInfoType.DetectionRule.hotword_rule", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[ - _CUSTOMINFOTYPE_DETECTIONRULE_PROXIMITY, - _CUSTOMINFOTYPE_DETECTIONRULE_LIKELIHOODADJUSTMENT, - _CUSTOMINFOTYPE_DETECTIONRULE_HOTWORDRULE, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="type", - full_name="google.privacy.dlp.v2.CustomInfoType.DetectionRule.type", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1059, - serialized_end=1633, -) - -_CUSTOMINFOTYPE = _descriptor.Descriptor( - name="CustomInfoType", - full_name="google.privacy.dlp.v2.CustomInfoType", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="info_type", - full_name="google.privacy.dlp.v2.CustomInfoType.info_type", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="likelihood", - full_name="google.privacy.dlp.v2.CustomInfoType.likelihood", - index=1, - number=6, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="dictionary", - full_name="google.privacy.dlp.v2.CustomInfoType.dictionary", - index=2, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="regex", - full_name="google.privacy.dlp.v2.CustomInfoType.regex", - index=3, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="surrogate_type", - full_name="google.privacy.dlp.v2.CustomInfoType.surrogate_type", - index=4, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="stored_type", - full_name="google.privacy.dlp.v2.CustomInfoType.stored_type", - index=5, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detection_rules", - full_name="google.privacy.dlp.v2.CustomInfoType.detection_rules", - index=6, - number=7, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="exclusion_type", - full_name="google.privacy.dlp.v2.CustomInfoType.exclusion_type", - index=7, - number=8, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[ - _CUSTOMINFOTYPE_DICTIONARY, - _CUSTOMINFOTYPE_REGEX, - _CUSTOMINFOTYPE_SURROGATETYPE, - _CUSTOMINFOTYPE_DETECTIONRULE, - ], - enum_types=[_CUSTOMINFOTYPE_EXCLUSIONTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="type", - full_name="google.privacy.dlp.v2.CustomInfoType.type", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=238, - serialized_end=1718, -) - - -_FIELDID = _descriptor.Descriptor( - name="FieldId", - full_name="google.privacy.dlp.v2.FieldId", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.privacy.dlp.v2.FieldId.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1720, - serialized_end=1743, -) - - -_PARTITIONID = _descriptor.Descriptor( - name="PartitionId", - full_name="google.privacy.dlp.v2.PartitionId", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.privacy.dlp.v2.PartitionId.project_id", - index=0, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="namespace_id", - full_name="google.privacy.dlp.v2.PartitionId.namespace_id", - index=1, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1745, - serialized_end=1800, -) - - -_KINDEXPRESSION = _descriptor.Descriptor( - name="KindExpression", - full_name="google.privacy.dlp.v2.KindExpression", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.privacy.dlp.v2.KindExpression.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1802, - serialized_end=1832, -) - - -_DATASTOREOPTIONS = _descriptor.Descriptor( - name="DatastoreOptions", - full_name="google.privacy.dlp.v2.DatastoreOptions", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="partition_id", - full_name="google.privacy.dlp.v2.DatastoreOptions.partition_id", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="kind", - full_name="google.privacy.dlp.v2.DatastoreOptions.kind", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1835, - serialized_end=1964, -) - - -_CLOUDSTORAGEREGEXFILESET = _descriptor.Descriptor( - name="CloudStorageRegexFileSet", - full_name="google.privacy.dlp.v2.CloudStorageRegexFileSet", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bucket_name", - full_name="google.privacy.dlp.v2.CloudStorageRegexFileSet.bucket_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="include_regex", - full_name="google.privacy.dlp.v2.CloudStorageRegexFileSet.include_regex", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="exclude_regex", - full_name="google.privacy.dlp.v2.CloudStorageRegexFileSet.exclude_regex", - index=2, - number=3, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1966, - serialized_end=2059, -) - - -_CLOUDSTORAGEOPTIONS_FILESET = _descriptor.Descriptor( - name="FileSet", - full_name="google.privacy.dlp.v2.CloudStorageOptions.FileSet", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="url", - full_name="google.privacy.dlp.v2.CloudStorageOptions.FileSet.url", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="regex_file_set", - full_name="google.privacy.dlp.v2.CloudStorageOptions.FileSet.regex_file_set", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2385, - serialized_end=2480, -) - -_CLOUDSTORAGEOPTIONS = _descriptor.Descriptor( - name="CloudStorageOptions", - full_name="google.privacy.dlp.v2.CloudStorageOptions", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="file_set", - full_name="google.privacy.dlp.v2.CloudStorageOptions.file_set", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bytes_limit_per_file", - full_name="google.privacy.dlp.v2.CloudStorageOptions.bytes_limit_per_file", - index=1, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bytes_limit_per_file_percent", - full_name="google.privacy.dlp.v2.CloudStorageOptions.bytes_limit_per_file_percent", - index=2, - number=8, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="file_types", - full_name="google.privacy.dlp.v2.CloudStorageOptions.file_types", - index=3, - number=5, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="sample_method", - full_name="google.privacy.dlp.v2.CloudStorageOptions.sample_method", - index=4, - number=6, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="files_limit_percent", - full_name="google.privacy.dlp.v2.CloudStorageOptions.files_limit_percent", - index=5, - number=7, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_CLOUDSTORAGEOPTIONS_FILESET], - enum_types=[_CLOUDSTORAGEOPTIONS_SAMPLEMETHOD], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2062, - serialized_end=2554, -) - - -_CLOUDSTORAGEFILESET = _descriptor.Descriptor( - name="CloudStorageFileSet", - full_name="google.privacy.dlp.v2.CloudStorageFileSet", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="url", - full_name="google.privacy.dlp.v2.CloudStorageFileSet.url", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2556, - serialized_end=2590, -) - - -_CLOUDSTORAGEPATH = _descriptor.Descriptor( - name="CloudStoragePath", - full_name="google.privacy.dlp.v2.CloudStoragePath", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="path", - full_name="google.privacy.dlp.v2.CloudStoragePath.path", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2592, - serialized_end=2624, -) - - -_BIGQUERYOPTIONS = _descriptor.Descriptor( - name="BigQueryOptions", - full_name="google.privacy.dlp.v2.BigQueryOptions", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="table_reference", - full_name="google.privacy.dlp.v2.BigQueryOptions.table_reference", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="identifying_fields", - full_name="google.privacy.dlp.v2.BigQueryOptions.identifying_fields", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="rows_limit", - full_name="google.privacy.dlp.v2.BigQueryOptions.rows_limit", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="rows_limit_percent", - full_name="google.privacy.dlp.v2.BigQueryOptions.rows_limit_percent", - index=3, - number=6, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="sample_method", - full_name="google.privacy.dlp.v2.BigQueryOptions.sample_method", - index=4, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="excluded_fields", - full_name="google.privacy.dlp.v2.BigQueryOptions.excluded_fields", - index=5, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_BIGQUERYOPTIONS_SAMPLEMETHOD], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2627, - serialized_end=3022, -) - - -_STORAGECONFIG_TIMESPANCONFIG = _descriptor.Descriptor( - name="TimespanConfig", - full_name="google.privacy.dlp.v2.StorageConfig.TimespanConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.privacy.dlp.v2.StorageConfig.TimespanConfig.start_time", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.privacy.dlp.v2.StorageConfig.TimespanConfig.end_time", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="timestamp_field", - full_name="google.privacy.dlp.v2.StorageConfig.TimespanConfig.timestamp_field", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enable_auto_population_of_timespan_config", - full_name="google.privacy.dlp.v2.StorageConfig.TimespanConfig.enable_auto_population_of_timespan_config", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3337, - serialized_end=3555, -) - -_STORAGECONFIG = _descriptor.Descriptor( - name="StorageConfig", - full_name="google.privacy.dlp.v2.StorageConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="datastore_options", - full_name="google.privacy.dlp.v2.StorageConfig.datastore_options", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="cloud_storage_options", - full_name="google.privacy.dlp.v2.StorageConfig.cloud_storage_options", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="big_query_options", - full_name="google.privacy.dlp.v2.StorageConfig.big_query_options", - index=2, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="timespan_config", - full_name="google.privacy.dlp.v2.StorageConfig.timespan_config", - index=3, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_STORAGECONFIG_TIMESPANCONFIG], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="type", - full_name="google.privacy.dlp.v2.StorageConfig.type", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=3025, - serialized_end=3563, -) - - -_BIGQUERYKEY = _descriptor.Descriptor( - name="BigQueryKey", - full_name="google.privacy.dlp.v2.BigQueryKey", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="table_reference", - full_name="google.privacy.dlp.v2.BigQueryKey.table_reference", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="row_number", - full_name="google.privacy.dlp.v2.BigQueryKey.row_number", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3565, - serialized_end=3661, -) - - -_DATASTOREKEY = _descriptor.Descriptor( - name="DatastoreKey", - full_name="google.privacy.dlp.v2.DatastoreKey", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entity_key", - full_name="google.privacy.dlp.v2.DatastoreKey.entity_key", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3663, - serialized_end=3725, -) - - -_KEY_PATHELEMENT = _descriptor.Descriptor( - name="PathElement", - full_name="google.privacy.dlp.v2.Key.PathElement", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="kind", - full_name="google.privacy.dlp.v2.Key.PathElement.kind", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="id", - full_name="google.privacy.dlp.v2.Key.PathElement.id", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.privacy.dlp.v2.Key.PathElement.name", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="id_type", - full_name="google.privacy.dlp.v2.Key.PathElement.id_type", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=3847, - serialized_end=3915, -) - -_KEY = _descriptor.Descriptor( - name="Key", - full_name="google.privacy.dlp.v2.Key", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="partition_id", - full_name="google.privacy.dlp.v2.Key.partition_id", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="path", - full_name="google.privacy.dlp.v2.Key.path", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_KEY_PATHELEMENT], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3728, - serialized_end=3915, -) - - -_RECORDKEY = _descriptor.Descriptor( - name="RecordKey", - full_name="google.privacy.dlp.v2.RecordKey", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="datastore_key", - full_name="google.privacy.dlp.v2.RecordKey.datastore_key", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="big_query_key", - full_name="google.privacy.dlp.v2.RecordKey.big_query_key", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="id_values", - full_name="google.privacy.dlp.v2.RecordKey.id_values", - index=2, - number=5, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="type", - full_name="google.privacy.dlp.v2.RecordKey.type", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=3918, - serialized_end=4079, -) - - -_BIGQUERYTABLE = _descriptor.Descriptor( - name="BigQueryTable", - full_name="google.privacy.dlp.v2.BigQueryTable", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.privacy.dlp.v2.BigQueryTable.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="dataset_id", - full_name="google.privacy.dlp.v2.BigQueryTable.dataset_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="table_id", - full_name="google.privacy.dlp.v2.BigQueryTable.table_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4081, - serialized_end=4154, -) - - -_BIGQUERYFIELD = _descriptor.Descriptor( - name="BigQueryField", - full_name="google.privacy.dlp.v2.BigQueryField", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="table", - full_name="google.privacy.dlp.v2.BigQueryField.table", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="field", - full_name="google.privacy.dlp.v2.BigQueryField.field", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4156, - serialized_end=4271, -) - - -_ENTITYID = _descriptor.Descriptor( - name="EntityId", - full_name="google.privacy.dlp.v2.EntityId", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="field", - full_name="google.privacy.dlp.v2.EntityId.field", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4273, - serialized_end=4330, -) - -_STOREDTYPE.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_CUSTOMINFOTYPE_DICTIONARY_WORDLIST.containing_type = _CUSTOMINFOTYPE_DICTIONARY -_CUSTOMINFOTYPE_DICTIONARY.fields_by_name[ - "word_list" -].message_type = _CUSTOMINFOTYPE_DICTIONARY_WORDLIST -_CUSTOMINFOTYPE_DICTIONARY.fields_by_name[ - "cloud_storage_path" -].message_type = _CLOUDSTORAGEPATH -_CUSTOMINFOTYPE_DICTIONARY.containing_type = _CUSTOMINFOTYPE -_CUSTOMINFOTYPE_DICTIONARY.oneofs_by_name["source"].fields.append( - _CUSTOMINFOTYPE_DICTIONARY.fields_by_name["word_list"] -) -_CUSTOMINFOTYPE_DICTIONARY.fields_by_name[ - "word_list" -].containing_oneof = _CUSTOMINFOTYPE_DICTIONARY.oneofs_by_name["source"] -_CUSTOMINFOTYPE_DICTIONARY.oneofs_by_name["source"].fields.append( - _CUSTOMINFOTYPE_DICTIONARY.fields_by_name["cloud_storage_path"] -) -_CUSTOMINFOTYPE_DICTIONARY.fields_by_name[ - "cloud_storage_path" -].containing_oneof = _CUSTOMINFOTYPE_DICTIONARY.oneofs_by_name["source"] -_CUSTOMINFOTYPE_REGEX.containing_type = _CUSTOMINFOTYPE -_CUSTOMINFOTYPE_SURROGATETYPE.containing_type = _CUSTOMINFOTYPE -_CUSTOMINFOTYPE_DETECTIONRULE_PROXIMITY.containing_type = _CUSTOMINFOTYPE_DETECTIONRULE -_CUSTOMINFOTYPE_DETECTIONRULE_LIKELIHOODADJUSTMENT.fields_by_name[ - "fixed_likelihood" -].enum_type = _LIKELIHOOD -_CUSTOMINFOTYPE_DETECTIONRULE_LIKELIHOODADJUSTMENT.containing_type = ( - _CUSTOMINFOTYPE_DETECTIONRULE -) -_CUSTOMINFOTYPE_DETECTIONRULE_LIKELIHOODADJUSTMENT.oneofs_by_name[ - "adjustment" -].fields.append( - _CUSTOMINFOTYPE_DETECTIONRULE_LIKELIHOODADJUSTMENT.fields_by_name[ - "fixed_likelihood" - ] -) -_CUSTOMINFOTYPE_DETECTIONRULE_LIKELIHOODADJUSTMENT.fields_by_name[ - "fixed_likelihood" -].containing_oneof = _CUSTOMINFOTYPE_DETECTIONRULE_LIKELIHOODADJUSTMENT.oneofs_by_name[ - "adjustment" -] -_CUSTOMINFOTYPE_DETECTIONRULE_LIKELIHOODADJUSTMENT.oneofs_by_name[ - "adjustment" -].fields.append( - _CUSTOMINFOTYPE_DETECTIONRULE_LIKELIHOODADJUSTMENT.fields_by_name[ - "relative_likelihood" - ] -) -_CUSTOMINFOTYPE_DETECTIONRULE_LIKELIHOODADJUSTMENT.fields_by_name[ - "relative_likelihood" -].containing_oneof = _CUSTOMINFOTYPE_DETECTIONRULE_LIKELIHOODADJUSTMENT.oneofs_by_name[ - "adjustment" -] -_CUSTOMINFOTYPE_DETECTIONRULE_HOTWORDRULE.fields_by_name[ - "hotword_regex" -].message_type = _CUSTOMINFOTYPE_REGEX -_CUSTOMINFOTYPE_DETECTIONRULE_HOTWORDRULE.fields_by_name[ - "proximity" -].message_type = _CUSTOMINFOTYPE_DETECTIONRULE_PROXIMITY -_CUSTOMINFOTYPE_DETECTIONRULE_HOTWORDRULE.fields_by_name[ - "likelihood_adjustment" -].message_type = _CUSTOMINFOTYPE_DETECTIONRULE_LIKELIHOODADJUSTMENT -_CUSTOMINFOTYPE_DETECTIONRULE_HOTWORDRULE.containing_type = ( - _CUSTOMINFOTYPE_DETECTIONRULE -) -_CUSTOMINFOTYPE_DETECTIONRULE.fields_by_name[ - "hotword_rule" -].message_type = _CUSTOMINFOTYPE_DETECTIONRULE_HOTWORDRULE -_CUSTOMINFOTYPE_DETECTIONRULE.containing_type = _CUSTOMINFOTYPE -_CUSTOMINFOTYPE_DETECTIONRULE.oneofs_by_name["type"].fields.append( - _CUSTOMINFOTYPE_DETECTIONRULE.fields_by_name["hotword_rule"] -) -_CUSTOMINFOTYPE_DETECTIONRULE.fields_by_name[ - "hotword_rule" -].containing_oneof = _CUSTOMINFOTYPE_DETECTIONRULE.oneofs_by_name["type"] -_CUSTOMINFOTYPE.fields_by_name["info_type"].message_type = _INFOTYPE -_CUSTOMINFOTYPE.fields_by_name["likelihood"].enum_type = _LIKELIHOOD -_CUSTOMINFOTYPE.fields_by_name["dictionary"].message_type = _CUSTOMINFOTYPE_DICTIONARY -_CUSTOMINFOTYPE.fields_by_name["regex"].message_type = _CUSTOMINFOTYPE_REGEX -_CUSTOMINFOTYPE.fields_by_name[ - "surrogate_type" -].message_type = _CUSTOMINFOTYPE_SURROGATETYPE -_CUSTOMINFOTYPE.fields_by_name["stored_type"].message_type = _STOREDTYPE -_CUSTOMINFOTYPE.fields_by_name[ - "detection_rules" -].message_type = _CUSTOMINFOTYPE_DETECTIONRULE -_CUSTOMINFOTYPE.fields_by_name[ - "exclusion_type" -].enum_type = _CUSTOMINFOTYPE_EXCLUSIONTYPE -_CUSTOMINFOTYPE_EXCLUSIONTYPE.containing_type = _CUSTOMINFOTYPE -_CUSTOMINFOTYPE.oneofs_by_name["type"].fields.append( - _CUSTOMINFOTYPE.fields_by_name["dictionary"] -) -_CUSTOMINFOTYPE.fields_by_name[ - "dictionary" -].containing_oneof = _CUSTOMINFOTYPE.oneofs_by_name["type"] -_CUSTOMINFOTYPE.oneofs_by_name["type"].fields.append( - _CUSTOMINFOTYPE.fields_by_name["regex"] -) -_CUSTOMINFOTYPE.fields_by_name[ - "regex" -].containing_oneof = _CUSTOMINFOTYPE.oneofs_by_name["type"] -_CUSTOMINFOTYPE.oneofs_by_name["type"].fields.append( - _CUSTOMINFOTYPE.fields_by_name["surrogate_type"] -) -_CUSTOMINFOTYPE.fields_by_name[ - "surrogate_type" -].containing_oneof = _CUSTOMINFOTYPE.oneofs_by_name["type"] -_CUSTOMINFOTYPE.oneofs_by_name["type"].fields.append( - _CUSTOMINFOTYPE.fields_by_name["stored_type"] -) -_CUSTOMINFOTYPE.fields_by_name[ - "stored_type" -].containing_oneof = _CUSTOMINFOTYPE.oneofs_by_name["type"] -_DATASTOREOPTIONS.fields_by_name["partition_id"].message_type = _PARTITIONID -_DATASTOREOPTIONS.fields_by_name["kind"].message_type = _KINDEXPRESSION -_CLOUDSTORAGEOPTIONS_FILESET.fields_by_name[ - "regex_file_set" -].message_type = _CLOUDSTORAGEREGEXFILESET -_CLOUDSTORAGEOPTIONS_FILESET.containing_type = _CLOUDSTORAGEOPTIONS -_CLOUDSTORAGEOPTIONS.fields_by_name[ - "file_set" -].message_type = _CLOUDSTORAGEOPTIONS_FILESET -_CLOUDSTORAGEOPTIONS.fields_by_name["file_types"].enum_type = _FILETYPE -_CLOUDSTORAGEOPTIONS.fields_by_name[ - "sample_method" -].enum_type = _CLOUDSTORAGEOPTIONS_SAMPLEMETHOD -_CLOUDSTORAGEOPTIONS_SAMPLEMETHOD.containing_type = _CLOUDSTORAGEOPTIONS -_BIGQUERYOPTIONS.fields_by_name["table_reference"].message_type = _BIGQUERYTABLE -_BIGQUERYOPTIONS.fields_by_name["identifying_fields"].message_type = _FIELDID -_BIGQUERYOPTIONS.fields_by_name[ - "sample_method" -].enum_type = _BIGQUERYOPTIONS_SAMPLEMETHOD -_BIGQUERYOPTIONS.fields_by_name["excluded_fields"].message_type = _FIELDID -_BIGQUERYOPTIONS_SAMPLEMETHOD.containing_type = _BIGQUERYOPTIONS -_STORAGECONFIG_TIMESPANCONFIG.fields_by_name[ - "start_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_STORAGECONFIG_TIMESPANCONFIG.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_STORAGECONFIG_TIMESPANCONFIG.fields_by_name["timestamp_field"].message_type = _FIELDID -_STORAGECONFIG_TIMESPANCONFIG.containing_type = _STORAGECONFIG -_STORAGECONFIG.fields_by_name["datastore_options"].message_type = _DATASTOREOPTIONS -_STORAGECONFIG.fields_by_name[ - "cloud_storage_options" -].message_type = _CLOUDSTORAGEOPTIONS -_STORAGECONFIG.fields_by_name["big_query_options"].message_type = _BIGQUERYOPTIONS -_STORAGECONFIG.fields_by_name[ - "timespan_config" -].message_type = _STORAGECONFIG_TIMESPANCONFIG -_STORAGECONFIG.oneofs_by_name["type"].fields.append( - _STORAGECONFIG.fields_by_name["datastore_options"] -) -_STORAGECONFIG.fields_by_name[ - "datastore_options" -].containing_oneof = _STORAGECONFIG.oneofs_by_name["type"] -_STORAGECONFIG.oneofs_by_name["type"].fields.append( - _STORAGECONFIG.fields_by_name["cloud_storage_options"] -) -_STORAGECONFIG.fields_by_name[ - "cloud_storage_options" -].containing_oneof = _STORAGECONFIG.oneofs_by_name["type"] -_STORAGECONFIG.oneofs_by_name["type"].fields.append( - _STORAGECONFIG.fields_by_name["big_query_options"] -) -_STORAGECONFIG.fields_by_name[ - "big_query_options" -].containing_oneof = _STORAGECONFIG.oneofs_by_name["type"] -_BIGQUERYKEY.fields_by_name["table_reference"].message_type = _BIGQUERYTABLE -_DATASTOREKEY.fields_by_name["entity_key"].message_type = _KEY -_KEY_PATHELEMENT.containing_type = _KEY -_KEY_PATHELEMENT.oneofs_by_name["id_type"].fields.append( - _KEY_PATHELEMENT.fields_by_name["id"] -) -_KEY_PATHELEMENT.fields_by_name[ - "id" -].containing_oneof = _KEY_PATHELEMENT.oneofs_by_name["id_type"] -_KEY_PATHELEMENT.oneofs_by_name["id_type"].fields.append( - _KEY_PATHELEMENT.fields_by_name["name"] -) -_KEY_PATHELEMENT.fields_by_name[ - "name" -].containing_oneof = _KEY_PATHELEMENT.oneofs_by_name["id_type"] -_KEY.fields_by_name["partition_id"].message_type = _PARTITIONID -_KEY.fields_by_name["path"].message_type = _KEY_PATHELEMENT -_RECORDKEY.fields_by_name["datastore_key"].message_type = _DATASTOREKEY -_RECORDKEY.fields_by_name["big_query_key"].message_type = _BIGQUERYKEY -_RECORDKEY.oneofs_by_name["type"].fields.append( - _RECORDKEY.fields_by_name["datastore_key"] -) -_RECORDKEY.fields_by_name["datastore_key"].containing_oneof = _RECORDKEY.oneofs_by_name[ - "type" -] -_RECORDKEY.oneofs_by_name["type"].fields.append( - _RECORDKEY.fields_by_name["big_query_key"] -) -_RECORDKEY.fields_by_name["big_query_key"].containing_oneof = _RECORDKEY.oneofs_by_name[ - "type" -] -_BIGQUERYFIELD.fields_by_name["table"].message_type = _BIGQUERYTABLE -_BIGQUERYFIELD.fields_by_name["field"].message_type = _FIELDID -_ENTITYID.fields_by_name["field"].message_type = _FIELDID -DESCRIPTOR.message_types_by_name["InfoType"] = _INFOTYPE -DESCRIPTOR.message_types_by_name["StoredType"] = _STOREDTYPE -DESCRIPTOR.message_types_by_name["CustomInfoType"] = _CUSTOMINFOTYPE -DESCRIPTOR.message_types_by_name["FieldId"] = _FIELDID -DESCRIPTOR.message_types_by_name["PartitionId"] = _PARTITIONID -DESCRIPTOR.message_types_by_name["KindExpression"] = _KINDEXPRESSION -DESCRIPTOR.message_types_by_name["DatastoreOptions"] = _DATASTOREOPTIONS -DESCRIPTOR.message_types_by_name["CloudStorageRegexFileSet"] = _CLOUDSTORAGEREGEXFILESET -DESCRIPTOR.message_types_by_name["CloudStorageOptions"] = _CLOUDSTORAGEOPTIONS -DESCRIPTOR.message_types_by_name["CloudStorageFileSet"] = _CLOUDSTORAGEFILESET -DESCRIPTOR.message_types_by_name["CloudStoragePath"] = _CLOUDSTORAGEPATH -DESCRIPTOR.message_types_by_name["BigQueryOptions"] = _BIGQUERYOPTIONS -DESCRIPTOR.message_types_by_name["StorageConfig"] = _STORAGECONFIG -DESCRIPTOR.message_types_by_name["BigQueryKey"] = _BIGQUERYKEY -DESCRIPTOR.message_types_by_name["DatastoreKey"] = _DATASTOREKEY -DESCRIPTOR.message_types_by_name["Key"] = _KEY -DESCRIPTOR.message_types_by_name["RecordKey"] = _RECORDKEY -DESCRIPTOR.message_types_by_name["BigQueryTable"] = _BIGQUERYTABLE -DESCRIPTOR.message_types_by_name["BigQueryField"] = _BIGQUERYFIELD -DESCRIPTOR.message_types_by_name["EntityId"] = _ENTITYID -DESCRIPTOR.enum_types_by_name["Likelihood"] = _LIKELIHOOD -DESCRIPTOR.enum_types_by_name["FileType"] = _FILETYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -InfoType = _reflection.GeneratedProtocolMessageType( - "InfoType", - (_message.Message,), - dict( - DESCRIPTOR=_INFOTYPE, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Type of information detected by the API. - - - Attributes: - name: - Name of the information type. Either a name of your choosing - when creating a CustomInfoType, or one of the names listed at - https://cloud.google.com/dlp/docs/infotypes-reference when - specifying a built-in type. InfoType names should conform to - the pattern [a-zA-Z0-9\_]{1,64}. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.InfoType) - ), -) -_sym_db.RegisterMessage(InfoType) - -StoredType = _reflection.GeneratedProtocolMessageType( - "StoredType", - (_message.Message,), - dict( - DESCRIPTOR=_STOREDTYPE, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""A reference to a StoredInfoType to use with scanning. - - - Attributes: - name: - Resource name of the requested ``StoredInfoType``, for example - ``organizations/433245324/storedInfoTypes/432452342`` or - ``projects/project-id/storedInfoTypes/432452342``. - create_time: - Timestamp indicating when the version of the - ``StoredInfoType`` used for inspection was created. Output- - only field, populated by the system. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.StoredType) - ), -) -_sym_db.RegisterMessage(StoredType) - -CustomInfoType = _reflection.GeneratedProtocolMessageType( - "CustomInfoType", - (_message.Message,), - dict( - Dictionary=_reflection.GeneratedProtocolMessageType( - "Dictionary", - (_message.Message,), - dict( - WordList=_reflection.GeneratedProtocolMessageType( - "WordList", - (_message.Message,), - dict( - DESCRIPTOR=_CUSTOMINFOTYPE_DICTIONARY_WORDLIST, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Message defining a list of words or phrases to search for - in the data. - - - Attributes: - words: - Words or phrases defining the dictionary. The dictionary must - contain at least one phrase and every phrase must contain at - least 2 characters that are letters or digits. [required] - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList) - ), - ), - DESCRIPTOR=_CUSTOMINFOTYPE_DICTIONARY, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Custom information type based on a dictionary of words or - phrases. This can be used to match sensitive information specific to the - data, such as a list of employee IDs or job titles. - - Dictionary words are case-insensitive and all characters other than - letters and digits in the unicode `Basic Multilingual - Plane `__ - will be replaced with whitespace when scanning for matches, so the - dictionary phrase "Sam Johnson" will match all three phrases "sam - johnson", "Sam, Johnson", and "Sam (Johnson)". Additionally, the - characters surrounding any match must be of a different type than the - adjacent characters within the word, so letters must be next to - non-letters and digits next to non-digits. For example, the dictionary - word "jen" will match the first three letters of the text "jen123" but - will return no matches for "jennifer". - - Dictionary words containing a large number of characters that are not - letters or digits may result in unexpected findings because such - characters are treated as whitespace. The - `limits `__ page contains details - about the size limits of dictionaries. For dictionaries that do not fit - within these constraints, consider using ``LargeCustomDictionaryConfig`` - in the ``StoredInfoType`` API. - - - Attributes: - word_list: - List of words or phrases to search for. - cloud_storage_path: - Newline-delimited file of words in Cloud Storage. Only a - single file is accepted. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CustomInfoType.Dictionary) - ), - ), - Regex=_reflection.GeneratedProtocolMessageType( - "Regex", - (_message.Message,), - dict( - DESCRIPTOR=_CUSTOMINFOTYPE_REGEX, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Message defining a custom regular expression. - - - Attributes: - pattern: - Pattern defining the regular expression. Its syntax - (https://github.com/google/re2/wiki/Syntax) can be found under - the google/re2 repository on GitHub. - group_indexes: - The index of the submatch to extract as findings. When not - specified, the entire match is returned. No more than 3 may be - included. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CustomInfoType.Regex) - ), - ), - SurrogateType=_reflection.GeneratedProtocolMessageType( - "SurrogateType", - (_message.Message,), - dict( - DESCRIPTOR=_CUSTOMINFOTYPE_SURROGATETYPE, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Message for detecting output from deidentification - transformations such as - ```CryptoReplaceFfxFpeConfig`` `__. - These types of transformations are those that perform pseudonymization, - thereby producing a "surrogate" as output. This should be used in - conjunction with a field on the transformation such as - ``surrogate_info_type``. This CustomInfoType does not support the use of - ``detection_rules``. - - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CustomInfoType.SurrogateType) - ), - ), - DetectionRule=_reflection.GeneratedProtocolMessageType( - "DetectionRule", - (_message.Message,), - dict( - Proximity=_reflection.GeneratedProtocolMessageType( - "Proximity", - (_message.Message,), - dict( - DESCRIPTOR=_CUSTOMINFOTYPE_DETECTIONRULE_PROXIMITY, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Message for specifying a window around a finding to apply - a detection rule. - - - Attributes: - window_before: - Number of characters before the finding to consider. - window_after: - Number of characters after the finding to consider. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity) - ), - ), - LikelihoodAdjustment=_reflection.GeneratedProtocolMessageType( - "LikelihoodAdjustment", - (_message.Message,), - dict( - DESCRIPTOR=_CUSTOMINFOTYPE_DETECTIONRULE_LIKELIHOODADJUSTMENT, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Message for specifying an adjustment to the likelihood of - a finding as part of a detection rule. - - - Attributes: - fixed_likelihood: - Set the likelihood of a finding to a fixed value. - relative_likelihood: - Increase or decrease the likelihood by the specified number of - levels. For example, if a finding would be ``POSSIBLE`` - without the detection rule and ``relative_likelihood`` is 1, - then it is upgraded to ``LIKELY``, while a value of -1 would - downgrade it to ``UNLIKELY``. Likelihood may never drop below - ``VERY_UNLIKELY`` or exceed ``VERY_LIKELY``, so applying an - adjustment of 1 followed by an adjustment of -1 when base - likelihood is ``VERY_LIKELY`` will result in a final - likelihood of ``LIKELY``. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CustomInfoType.DetectionRule.LikelihoodAdjustment) - ), - ), - HotwordRule=_reflection.GeneratedProtocolMessageType( - "HotwordRule", - (_message.Message,), - dict( - DESCRIPTOR=_CUSTOMINFOTYPE_DETECTIONRULE_HOTWORDRULE, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""The rule that adjusts the likelihood of findings within a - certain proximity of hotwords. - - - Attributes: - hotword_regex: \ - Regular expression pattern defining what qualifies as a \ - hotword. - proximity: - Proximity of the finding within which the entire hotword must - reside. The total length of the window cannot exceed 1000 - characters. Note that the finding itself will be included in - the window, so that hotwords may be used to match substrings - of the finding itself. For example, the certainty of a phone - number regex "(\d\{3\}) \d\{3\}-\d\{4\} "\ - could be adjusted upwards if the area code is \ - known to be the local area code of a company office using the - hotword regex "(xxx)", where "xxx" is the area code in - question. - likelihood_adjustment: \ - Likelihood adjustment to apply to all matching findings. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule) - ), - ), - DESCRIPTOR=_CUSTOMINFOTYPE_DETECTIONRULE, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Deprecated; use ``InspectionRuleSet`` instead. Rule for - modifying a ``CustomInfoType`` to alter behavior under certain - circumstances, depending on the specific details of the rule. Not - supported for the ``surrogate_type`` custom infoType. - - - Attributes: - hotword_rule: - Hotword-based detection rule. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CustomInfoType.DetectionRule) - ), - ), - DESCRIPTOR=_CUSTOMINFOTYPE, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Custom information type provided by the user. Used to find - domain-specific sensitive information configurable to the data in - question. - - - Attributes: - info_type: - CustomInfoType can either be a new infoType, or an extension - of built-in infoType, when the name matches one of existing - infoTypes and that infoType is specified in - ``InspectContent.info_types`` field. Specifying the latter - adds findings to the one detected by the system. If built-in - info type is not specified in ``InspectContent.info_types`` - list then the name is treated as a custom info type. - likelihood: - Likelihood to return for this CustomInfoType. This base value - can be altered by a detection rule if the finding meets the - criteria specified by the rule. Defaults to ``VERY_LIKELY`` if - not specified. - dictionary: - A list of phrases to detect as a CustomInfoType. - regex: - Regular expression based CustomInfoType. - surrogate_type: - Message for detecting output from deidentification - transformations that support reversing. - stored_type: - Load an existing ``StoredInfoType`` resource for use in - ``InspectDataSource``. Not currently supported in - ``InspectContent``. - detection_rules: - Set of detection rules to apply to all findings of this - CustomInfoType. Rules are applied in order that they are - specified. Not supported for the ``surrogate_type`` - CustomInfoType. - exclusion_type: - If set to EXCLUSION\_TYPE\_EXCLUDE this infoType will not - cause a finding to be returned. It still can be used for rules - matching. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CustomInfoType) - ), -) -_sym_db.RegisterMessage(CustomInfoType) -_sym_db.RegisterMessage(CustomInfoType.Dictionary) -_sym_db.RegisterMessage(CustomInfoType.Dictionary.WordList) -_sym_db.RegisterMessage(CustomInfoType.Regex) -_sym_db.RegisterMessage(CustomInfoType.SurrogateType) -_sym_db.RegisterMessage(CustomInfoType.DetectionRule) -_sym_db.RegisterMessage(CustomInfoType.DetectionRule.Proximity) -_sym_db.RegisterMessage(CustomInfoType.DetectionRule.LikelihoodAdjustment) -_sym_db.RegisterMessage(CustomInfoType.DetectionRule.HotwordRule) - -FieldId = _reflection.GeneratedProtocolMessageType( - "FieldId", - (_message.Message,), - dict( - DESCRIPTOR=_FIELDID, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""General identifier of a data field in a storage service. - - - Attributes: - name: - Name describing the field. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.FieldId) - ), -) -_sym_db.RegisterMessage(FieldId) - -PartitionId = _reflection.GeneratedProtocolMessageType( - "PartitionId", - (_message.Message,), - dict( - DESCRIPTOR=_PARTITIONID, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Datastore partition ID. A partition ID identifies a - grouping of entities. The grouping is always by project and namespace, - however the namespace ID may be empty. - - A partition ID contains several dimensions: project ID and namespace ID. - - - Attributes: - project_id: - The ID of the project to which the entities belong. - namespace_id: - If not empty, the ID of the namespace to which the entities - belong. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.PartitionId) - ), -) -_sym_db.RegisterMessage(PartitionId) - -KindExpression = _reflection.GeneratedProtocolMessageType( - "KindExpression", - (_message.Message,), - dict( - DESCRIPTOR=_KINDEXPRESSION, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""A representation of a Datastore kind. - - - Attributes: - name: - The name of the kind. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.KindExpression) - ), -) -_sym_db.RegisterMessage(KindExpression) - -DatastoreOptions = _reflection.GeneratedProtocolMessageType( - "DatastoreOptions", - (_message.Message,), - dict( - DESCRIPTOR=_DATASTOREOPTIONS, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Options defining a data set within Google Cloud Datastore. - - - Attributes: - partition_id: - A partition ID identifies a grouping of entities. The grouping - is always by project and namespace, however the namespace ID - may be empty. - kind: - The kind to process. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.DatastoreOptions) - ), -) -_sym_db.RegisterMessage(DatastoreOptions) - -CloudStorageRegexFileSet = _reflection.GeneratedProtocolMessageType( - "CloudStorageRegexFileSet", - (_message.Message,), - dict( - DESCRIPTOR=_CLOUDSTORAGEREGEXFILESET, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Message representing a set of files in a Cloud Storage - bucket. Regular expressions are used to allow fine-grained control over - which files in the bucket to include. - - Included files are those that match at least one item in - ``include_regex`` and do not match any items in ``exclude_regex``. Note - that a file that matches items from both lists will *not* be included. - For a match to occur, the entire file path (i.e., everything in the url - after the bucket name) must match the regular expression. - - For example, given the input - ``{bucket_name: "mybucket", include_regex: ["directory1/.*"], exclude_regex: ["directory1/excluded.*"]}``: - - - ``gs://mybucket/directory1/myfile`` will be included - - ``gs://mybucket/directory1/directory2/myfile`` will be included - (``.*`` matches across ``/``) - - ``gs://mybucket/directory0/directory1/myfile`` will *not* be included - (the full path doesn't match any items in ``include_regex``) - - ``gs://mybucket/directory1/excludedfile`` will *not* be included (the - path matches an item in ``exclude_regex``) - - If ``include_regex`` is left empty, it will match all files by default - (this is equivalent to setting ``include_regex: [".*"]``). - - Some other common use cases: - - - ``{bucket_name: "mybucket", exclude_regex: [".*\.pdf"]}`` will - include all files in ``mybucket`` except for .pdf files - - ``{bucket_name: "mybucket", include_regex: ["directory/[^/]+"]}`` - will include all files directly under ``gs://mybucket/directory/``, - without matching across ``/`` - - - Attributes: - bucket_name: - The name of a Cloud Storage bucket. Required. - include_regex: - A list of regular expressions matching file paths to include. - All files in the bucket that match at least one of these - regular expressions will be included in the set of files, - except for those that also match an item in ``exclude_regex``. - Leaving this field empty will match all files by default (this - is equivalent to including ``.*`` in the list). Regular - expressions use RE2 `syntax - `__; a guide can be - found under the google/re2 repository on GitHub. - exclude_regex: - A list of regular expressions matching file paths to exclude. - All files in the bucket that match at least one of these - regular expressions will be excluded from the scan. Regular - expressions use RE2 `syntax - `__; a guide can be - found under the google/re2 repository on GitHub. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CloudStorageRegexFileSet) - ), -) -_sym_db.RegisterMessage(CloudStorageRegexFileSet) - -CloudStorageOptions = _reflection.GeneratedProtocolMessageType( - "CloudStorageOptions", - (_message.Message,), - dict( - FileSet=_reflection.GeneratedProtocolMessageType( - "FileSet", - (_message.Message,), - dict( - DESCRIPTOR=_CLOUDSTORAGEOPTIONS_FILESET, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Set of files to scan. - - - Attributes: - url: - The Cloud Storage url of the file(s) to scan, in the format - ``gs:///``. Trailing wildcard in the path is - allowed. If the url ends in a trailing slash, the bucket or - directory represented by the url will be scanned non- - recursively (content in sub-directories will not be scanned). - This means that ``gs://mybucket/`` is equivalent to - ``gs://mybucket/*``, and ``gs://mybucket/directory/`` is - equivalent to ``gs://mybucket/directory/*``. Exactly one of - ``url`` or ``regex_file_set`` must be set. - regex_file_set: - The regex-filtered set of files to scan. Exactly one of - ``url`` or ``regex_file_set`` must be set. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CloudStorageOptions.FileSet) - ), - ), - DESCRIPTOR=_CLOUDSTORAGEOPTIONS, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Options defining a file or a set of files within a Google - Cloud Storage bucket. - - - Attributes: - file_set: - The set of one or more files to scan. - bytes_limit_per_file: - Max number of bytes to scan from a file. If a scanned file's - size is bigger than this value then the rest of the bytes are - omitted. Only one of bytes\_limit\_per\_file and - bytes\_limit\_per\_file\_percent can be specified. - bytes_limit_per_file_percent: - Max percentage of bytes to scan from a file. The rest are - omitted. The number of bytes scanned is rounded down. Must be - between 0 and 100, inclusively. Both 0 and 100 means no limit. - Defaults to 0. Only one of bytes\_limit\_per\_file and - bytes\_limit\_per\_file\_percent can be specified. - file_types: - List of file type groups to include in the scan. If empty, all - files are scanned and available data format processors are - applied. In addition, the binary content of the selected files - is always scanned as well. - files_limit_percent: - Limits the number of files to scan to this percentage of the - input FileSet. Number of files scanned is rounded down. Must - be between 0 and 100, inclusively. Both 0 and 100 means no - limit. Defaults to 0. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CloudStorageOptions) - ), -) -_sym_db.RegisterMessage(CloudStorageOptions) -_sym_db.RegisterMessage(CloudStorageOptions.FileSet) - -CloudStorageFileSet = _reflection.GeneratedProtocolMessageType( - "CloudStorageFileSet", - (_message.Message,), - dict( - DESCRIPTOR=_CLOUDSTORAGEFILESET, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Message representing a set of files in Cloud Storage. - - - Attributes: - url: - The url, in the format ``gs:///``. Trailing - wildcard in the path is allowed. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CloudStorageFileSet) - ), -) -_sym_db.RegisterMessage(CloudStorageFileSet) - -CloudStoragePath = _reflection.GeneratedProtocolMessageType( - "CloudStoragePath", - (_message.Message,), - dict( - DESCRIPTOR=_CLOUDSTORAGEPATH, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Message representing a single file or path in Cloud - Storage. - - - Attributes: - path: - A url representing a file or path (no wildcards) in Cloud - Storage. Example: gs://[BUCKET\_NAME]/dictionary.txt - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CloudStoragePath) - ), -) -_sym_db.RegisterMessage(CloudStoragePath) - -BigQueryOptions = _reflection.GeneratedProtocolMessageType( - "BigQueryOptions", - (_message.Message,), - dict( - DESCRIPTOR=_BIGQUERYOPTIONS, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Options defining BigQuery table and row identifiers. - - - Attributes: - table_reference: - Complete BigQuery table reference. - identifying_fields: - References to fields uniquely identifying rows within the - table. Nested fields in the format, like - ``person.birthdate.year``, are allowed. - rows_limit: - Max number of rows to scan. If the table has more rows than - this value, the rest of the rows are omitted. If not set, or - if set to 0, all rows will be scanned. Only one of rows\_limit - and rows\_limit\_percent can be specified. Cannot be used in - conjunction with TimespanConfig. - rows_limit_percent: - Max percentage of rows to scan. The rest are omitted. The - number of rows scanned is rounded down. Must be between 0 and - 100, inclusively. Both 0 and 100 means no limit. Defaults to - 0. Only one of rows\_limit and rows\_limit\_percent can be - specified. Cannot be used in conjunction with TimespanConfig. - excluded_fields: - References to fields excluded from scanning. This allows you - to skip inspection of entire columns which you know have no - findings. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.BigQueryOptions) - ), -) -_sym_db.RegisterMessage(BigQueryOptions) - -StorageConfig = _reflection.GeneratedProtocolMessageType( - "StorageConfig", - (_message.Message,), - dict( - TimespanConfig=_reflection.GeneratedProtocolMessageType( - "TimespanConfig", - (_message.Message,), - dict( - DESCRIPTOR=_STORAGECONFIG_TIMESPANCONFIG, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Configuration of the timespan of the items to include in - scanning. Currently only supported when inspecting Google Cloud Storage - and BigQuery. - - - Attributes: - start_time: - Exclude files or rows older than this value. - end_time: - Exclude files or rows newer than this value. If set to zero, - no upper time limit is applied. - timestamp_field: - Specification of the field containing the timestamp of scanned - items. Used for data sources like Datastore and BigQuery. For - BigQuery: Required to filter out rows based on the given start - and end times. If not specified and the table was modified - between the given start and end times, the entire table will - be scanned. The valid data types of the timestamp field are: - ``INTEGER``, ``DATE``, ``TIMESTAMP``, or ``DATETIME`` BigQuery - column. For Datastore. Valid data types of the timestamp - field are: ``TIMESTAMP``. Datastore entity will be scanned if - the timestamp property does not exist or its value is empty or - invalid. - enable_auto_population_of_timespan_config: - When the job is started by a JobTrigger we will automatically - figure out a valid start\_time to avoid scanning files that - have not been modified since the last time the JobTrigger - executed. This will be based on the time of the execution of - the last run of the JobTrigger. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.StorageConfig.TimespanConfig) - ), - ), - DESCRIPTOR=_STORAGECONFIG, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Shared message indicating Cloud storage type. - - - Attributes: - datastore_options: - Google Cloud Datastore options specification. - cloud_storage_options: - Google Cloud Storage options specification. - big_query_options: - BigQuery options specification. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.StorageConfig) - ), -) -_sym_db.RegisterMessage(StorageConfig) -_sym_db.RegisterMessage(StorageConfig.TimespanConfig) - -BigQueryKey = _reflection.GeneratedProtocolMessageType( - "BigQueryKey", - (_message.Message,), - dict( - DESCRIPTOR=_BIGQUERYKEY, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Row key for identifying a record in BigQuery table. - - - Attributes: - table_reference: - Complete BigQuery table reference. - row_number: - Absolute number of the row from the beginning of the table at - the time of scanning. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.BigQueryKey) - ), -) -_sym_db.RegisterMessage(BigQueryKey) - -DatastoreKey = _reflection.GeneratedProtocolMessageType( - "DatastoreKey", - (_message.Message,), - dict( - DESCRIPTOR=_DATASTOREKEY, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Record key for a finding in Cloud Datastore. - - - Attributes: - entity_key: - Datastore entity key. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.DatastoreKey) - ), -) -_sym_db.RegisterMessage(DatastoreKey) - -Key = _reflection.GeneratedProtocolMessageType( - "Key", - (_message.Message,), - dict( - PathElement=_reflection.GeneratedProtocolMessageType( - "PathElement", - (_message.Message,), - dict( - DESCRIPTOR=_KEY_PATHELEMENT, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""A (kind, ID/name) pair used to construct a key path. - - If either name or ID is set, the element is complete. If neither is set, - the element is incomplete. - - - Attributes: - kind: - The kind of the entity. A kind matching regex ``__.*__`` is - reserved/read-only. A kind must not contain more than 1500 - bytes when UTF-8 encoded. Cannot be ``""``. - id_type: - The type of ID. - id: - The auto-allocated ID of the entity. Never equal to zero. - Values less than zero are discouraged and may not be supported - in the future. - name: - The name of the entity. A name matching regex ``__.*__`` is - reserved/read-only. A name must not be more than 1500 bytes - when UTF-8 encoded. Cannot be ``""``. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.Key.PathElement) - ), - ), - DESCRIPTOR=_KEY, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""A unique identifier for a Datastore entity. If a key's - partition ID or any of its path kinds or names are reserved/read-only, - the key is reserved/read-only. A reserved/read-only key is forbidden in - certain documented contexts. - - - Attributes: - partition_id: - Entities are partitioned into subsets, currently identified by - a project ID and namespace ID. Queries are scoped to a single - partition. - path: - The entity path. An entity path consists of one or more - elements composed of a kind and a string or numerical - identifier, which identify entities. The first element - identifies a *root entity*, the second element identifies a - *child* of the root entity, the third element identifies a - child of the second entity, and so forth. The entities - identified by all prefixes of the path are called the - element's *ancestors*. A path can never be empty, and a path - can have at most 100 elements. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.Key) - ), -) -_sym_db.RegisterMessage(Key) -_sym_db.RegisterMessage(Key.PathElement) - -RecordKey = _reflection.GeneratedProtocolMessageType( - "RecordKey", - (_message.Message,), - dict( - DESCRIPTOR=_RECORDKEY, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Message for a unique key indicating a record that contains - a finding. - - - Attributes: - id_values: - Values of identifying columns in the given row. Order of - values matches the order of field identifiers specified in the - scanning request. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.RecordKey) - ), -) -_sym_db.RegisterMessage(RecordKey) - -BigQueryTable = _reflection.GeneratedProtocolMessageType( - "BigQueryTable", - (_message.Message,), - dict( - DESCRIPTOR=_BIGQUERYTABLE, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Message defining the location of a BigQuery table. A table - is uniquely identified by its project\_id, dataset\_id, and table\_name. - Within a query a table is often referenced with a string in the format - of: ``:.`` or - ``..``. - - - Attributes: - project_id: - The Google Cloud Platform project ID of the project containing - the table. If omitted, project ID is inferred from the API - call. - dataset_id: - Dataset ID of the table. - table_id: - Name of the table. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.BigQueryTable) - ), -) -_sym_db.RegisterMessage(BigQueryTable) - -BigQueryField = _reflection.GeneratedProtocolMessageType( - "BigQueryField", - (_message.Message,), - dict( - DESCRIPTOR=_BIGQUERYFIELD, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""Message defining a field of a BigQuery table. - - - Attributes: - table: - Source table of the field. - field: - Designated field in the BigQuery table. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.BigQueryField) - ), -) -_sym_db.RegisterMessage(BigQueryField) - -EntityId = _reflection.GeneratedProtocolMessageType( - "EntityId", - (_message.Message,), - dict( - DESCRIPTOR=_ENTITYID, - __module__="google.cloud.dlp_v2.proto.storage_pb2", - __doc__="""An entity in a dataset is a field or set of fields that - correspond to a single person. For example, in medical records the - ``EntityId`` might be a patient identifier, or for financial records it - might be an account identifier. This message is used when - generalizations or analysis must take into account that multiple rows - correspond to the same entity. - - - Attributes: - field: - Composite key indicating which field contains the entity - identifier. - """, - # @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.EntityId) - ), -) -_sym_db.RegisterMessage(EntityId) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/dlp/google/cloud/dlp_v2/proto/storage_pb2_grpc.py b/dlp/google/cloud/dlp_v2/proto/storage_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/dlp/google/cloud/dlp_v2/proto/storage_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/dlp/google/cloud/dlp_v2/types.py b/dlp/google/cloud/dlp_v2/types.py deleted file mode 100644 index 222848dc3ad3..000000000000 --- a/dlp/google/cloud/dlp_v2/types.py +++ /dev/null @@ -1,61 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.dlp_v2.proto import dlp_pb2 -from google.cloud.dlp_v2.proto import storage_pb2 -from google.protobuf import any_pb2 -from google.protobuf import duration_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 -from google.protobuf import timestamp_pb2 -from google.rpc import status_pb2 -from google.type import date_pb2 -from google.type import timeofday_pb2 - - -_shared_modules = [ - any_pb2, - duration_pb2, - empty_pb2, - field_mask_pb2, - timestamp_pb2, - status_pb2, - date_pb2, - timeofday_pb2, -] - -_local_modules = [dlp_pb2, storage_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.dlp_v2.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/dlp/noxfile.py b/dlp/noxfile.py deleted file mode 100644 index a2eefbb6765f..000000000000 --- a/dlp/noxfile.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/dlp/setup.cfg b/dlp/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/dlp/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/dlp/setup.py b/dlp/setup.py deleted file mode 100644 index be532407ed41..000000000000 --- a/dlp/setup.py +++ /dev/null @@ -1,75 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import io -import os - -import setuptools - -name = "google-cloud-dlp" -description = "Cloud Data Loss Prevention (DLP) API API client library" -version = "0.13.0" -release_status = "Development Status :: 3 - Alpha" -dependencies = [ - "google-api-core[grpc] >= 1.14.0, < 2.0.0dev", - 'enum34; python_version < "3.4"', -] - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/GoogleCloudPlatform/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", - include_package_data=True, - zip_safe=False, -) diff --git a/dlp/synth.metadata b/dlp/synth.metadata deleted file mode 100644 index 3935be954ecd..000000000000 --- a/dlp/synth.metadata +++ /dev/null @@ -1,165 +0,0 @@ -{ - "updateTime": "2020-01-30T13:23:11.616418Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c1246a29e22b0f98e800a536b5b0da2d933a55f2", - "internalRef": "292310790", - "log": "c1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\ncf3b61102ed5f36b827bc82ec39be09525f018c8\n Fix to protos for v1p1beta1 release of Cloud Security Command Center\n\nPiperOrigin-RevId: 292034635\n\n4e1cfaa7c0fede9e65d64213ca3da1b1255816c0\nUpdate the public proto to support UTF-8 encoded id for CatalogService API, increase the ListCatalogItems deadline to 300s and some minor documentation change\n\nPiperOrigin-RevId: 292030970\n\n9c483584f8fd5a1b862ae07973f4cc7bb3e46648\nasset: add annotations to v1p1beta1\n\nPiperOrigin-RevId: 292009868\n\ne19209fac29731d0baf6d9ac23da1164f7bdca24\nAdd the google.rpc.context.AttributeContext message to the open source\ndirectories.\n\nPiperOrigin-RevId: 291999930\n\nae5662960573f279502bf98a108a35ba1175e782\noslogin API: move file level option on top of the file to avoid protobuf.js bug.\n\nPiperOrigin-RevId: 291990506\n\neba3897fff7c49ed85d3c47fc96fe96e47f6f684\nAdd cc_proto_library and cc_grpc_library targets for Spanner and IAM protos.\n\nPiperOrigin-RevId: 291988651\n\n8e981acfd9b97ea2f312f11bbaa7b6c16e412dea\nBeta launch for PersonDetection and FaceDetection features.\n\nPiperOrigin-RevId: 291821782\n\n994e067fae3b21e195f7da932b08fff806d70b5d\nasset: add annotations to v1p2beta1\n\nPiperOrigin-RevId: 291815259\n\n244e1d2c89346ca2e0701b39e65552330d68545a\nAdd Playable Locations service\n\nPiperOrigin-RevId: 291806349\n\n909f8f67963daf45dd88d020877fb9029b76788d\nasset: add annotations to v1beta2\n\nPiperOrigin-RevId: 291805301\n\n3c39a1d6e23c1ef63c7fba4019c25e76c40dfe19\nKMS: add file-level message for CryptoKeyPath, it is defined in gapic yaml but not\nin proto files.\n\nPiperOrigin-RevId: 291420695\n\nc6f3f350b8387f8d1b85ed4506f30187ebaaddc3\ncontaineranalysis: update v1beta1 and bazel build with annotations\n\nPiperOrigin-RevId: 291401900\n\n92887d74b44e4e636252b7b8477d0d2570cd82db\nfix: fix the location of grpc config file.\n\nPiperOrigin-RevId: 291396015\n\ne26cab8afd19d396b929039dac5d874cf0b5336c\nexpr: add default_host and method_signature annotations to CelService\n\nPiperOrigin-RevId: 291240093\n\n06093ae3952441c34ec176d1f7431b8765cec0be\nirm: fix v1alpha2 bazel build by adding missing proto imports\n\nPiperOrigin-RevId: 291227940\n\na8a2514af326e4673063f9a3c9d0ef1091c87e6c\nAdd proto annotation for cloud/irm API\n\nPiperOrigin-RevId: 291217859\n\n8d16f76de065f530d395a4c7eabbf766d6a120fd\nGenerate Memcache v1beta2 API protos and gRPC ServiceConfig files\n\nPiperOrigin-RevId: 291008516\n\n3af1dabd93df9a9f17bf3624d3b875c11235360b\ngrafeas: Add containeranalysis default_host to Grafeas service\n\nPiperOrigin-RevId: 290965849\n\nbe2663fa95e31cba67d0cd62611a6674db9f74b7\nfix(google/maps/roads): add missing opening bracket\n\nPiperOrigin-RevId: 290964086\n\nfacc26550a0af0696e0534bc9cae9df14275aa7c\nUpdating v2 protos with the latest inline documentation (in comments) and adding a per-service .yaml file.\n\nPiperOrigin-RevId: 290952261\n\ncda99c1f7dc5e4ca9b1caeae1dc330838cbc1461\nChange api_name to 'asset' for v1p1beta1\n\nPiperOrigin-RevId: 290800639\n\n94e9e90c303a820ce40643d9129e7f0d2054e8a1\nAdds Google Maps Road service\n\nPiperOrigin-RevId: 290795667\n\na3b23dcb2eaecce98c600c7d009451bdec52dbda\nrpc: new message ErrorInfo, other comment updates\n\nPiperOrigin-RevId: 290781668\n\n26420ef4e46c37f193c0fbe53d6ebac481de460e\nAdd proto definition for Org Policy v1.\n\nPiperOrigin-RevId: 290771923\n\n7f0dab8177cf371ae019a082e2512de7ac102888\nPublish Routes Preferred API v1 service definitions.\n\nPiperOrigin-RevId: 290326986\n\nad6e508d0728e1d1bca6e3f328cd562718cb772d\nFix: Qualify resource type references with \"jobs.googleapis.com/\"\n\nPiperOrigin-RevId: 290285762\n\n58e770d568a2b78168ddc19a874178fee8265a9d\ncts client library\n\nPiperOrigin-RevId: 290146169\n\naf9daa4c3b4c4a8b7133b81588dd9ffd37270af2\nAdd more programming language options to public proto\n\nPiperOrigin-RevId: 290144091\n\nd9f2bbf2df301ef84641d4cec7c828736a0bd907\ntalent: add missing resource.proto dep to Bazel build target\n\nPiperOrigin-RevId: 290143164\n\n3b3968237451d027b42471cd28884a5a1faed6c7\nAnnotate Talent API.\nAdd gRPC service config for retry.\nUpdate bazel file with google.api.resource dependency.\n\nPiperOrigin-RevId: 290125172\n\n0735b4b096872960568d1f366bfa75b7b0e1f1a3\nWeekly library update.\n\nPiperOrigin-RevId: 289939042\n\n8760d3d9a4543d7f9c0d1c7870aca08b116e4095\nWeekly library update.\n\nPiperOrigin-RevId: 289939020\n\n8607df842f782a901805187e02fff598145b0b0e\nChange Talent API timeout to 30s.\n\nPiperOrigin-RevId: 289912621\n\n908155991fe32570653bcb72ecfdcfc896642f41\nAdd Recommendations AI V1Beta1\n\nPiperOrigin-RevId: 289901914\n\n5c9a8c2bebd8b71aa66d1cc473edfaac837a2c78\nAdding no-arg method signatures for ListBillingAccounts and ListServices\n\nPiperOrigin-RevId: 289891136\n\n50b0e8286ac988b0593bd890eb31fef6ea2f5767\nlongrunning: add grpc service config and default_host annotation to operations.proto\n\nPiperOrigin-RevId: 289876944\n\n6cac27dabe51c54807b0401698c32d34998948a9\n Updating default deadline for Cloud Security Command Center's v1 APIs.\n\nPiperOrigin-RevId: 289875412\n\nd99df0d67057a233c711187e0689baa4f8e6333d\nFix: Correct spelling in C# namespace option\n\nPiperOrigin-RevId: 289709813\n\n2fa8d48165cc48e35b0c62e6f7bdade12229326c\nfeat: Publish Recommender v1 to GitHub.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289619243\n\n9118db63d1ab493a2e44a3b4973fde810a835c49\nfirestore: don't retry reads that fail with Aborted\n\nFor transaction reads that fail with ABORTED, we need to rollback and start a new transaction. Our current configuration makes it so that GAPIC retries ABORTED reads multiple times without making any progress. Instead, we should retry at the transaction level.\n\nPiperOrigin-RevId: 289532382\n\n1dbfd3fe4330790b1e99c0bb20beb692f1e20b8a\nFix bazel build\nAdd other langauges (Java was already there) for bigquery/storage/v1alpha2 api.\n\nPiperOrigin-RevId: 289519766\n\nc06599cdd7d11f8d3fd25f8d3249e5bb1a3d5d73\nInitial commit of google.cloud.policytroubleshooter API, The API helps in troubleshooting GCP policies. Refer https://cloud.google.com/iam/docs/troubleshooting-access for more information\n\nPiperOrigin-RevId: 289491444\n\nfce7d80fa16ea241e87f7bc33d68595422e94ecd\nDo not pass samples option for Artman config of recommender v1 API.\n\nPiperOrigin-RevId: 289477403\n\nef179e8c61436297e6bb124352e47e45c8c80cb1\nfix: Address missing Bazel dependency.\n\nBazel builds stopped working in 06ec6d5 because\nthe google/longrunning/operations.proto file took\nan import from google/api/client.proto, but that\nimport was not added to BUILD.bazel.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289446074\n\n8841655b242c84fd691d77d7bcf21b61044f01ff\nMigrate Data Labeling v1beta1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289446026\n\n06ec6d5d053fff299eaa6eaa38afdd36c5e2fc68\nAdd annotations to google.longrunning.v1\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289413169\n\n0480cf40be1d3cc231f4268a2fdb36a8dd60e641\nMigrate IAM Admin v1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289411084\n\n1017173e9adeb858587639af61889ad970c728b1\nSpecify a C# namespace for BigQuery Connection v1beta1\n\nPiperOrigin-RevId: 289396763\n\n" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "dlp", - "apiVersion": "v2", - "language": "python", - "generator": "gapic", - "config": "google/privacy/dlp/artman_dlp_v2.yaml" - } - } - ], - "newFiles": [ - { - "path": ".coveragerc" - }, - { - "path": ".flake8" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "LICENSE" - }, - { - "path": "MANIFEST.in" - }, - { - "path": "README.rst" - }, - { - "path": "docs/README.rst" - }, - { - "path": "docs/_static/custom.css" - }, - { - "path": "docs/_templates/layout.html" - }, - { - "path": "docs/changelog.md" - }, - { - "path": "docs/conf.py" - }, - { - "path": "docs/gapic/v2/api.rst" - }, - { - "path": "docs/gapic/v2/types.rst" - }, - { - "path": "docs/index.rst" - }, - { - "path": "google/__init__.py" - }, - { - "path": "google/cloud/__init__.py" - }, - { - "path": "google/cloud/dlp.py" - }, - { - "path": "google/cloud/dlp_v2/__init__.py" - }, - { - "path": "google/cloud/dlp_v2/gapic/__init__.py" - }, - { - "path": "google/cloud/dlp_v2/gapic/dlp_service_client.py" - }, - { - "path": "google/cloud/dlp_v2/gapic/dlp_service_client_config.py" - }, - { - "path": "google/cloud/dlp_v2/gapic/enums.py" - }, - { - "path": "google/cloud/dlp_v2/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/dlp_v2/gapic/transports/dlp_service_grpc_transport.py" - }, - { - "path": "google/cloud/dlp_v2/proto/__init__.py" - }, - { - "path": "google/cloud/dlp_v2/proto/dlp.proto" - }, - { - "path": "google/cloud/dlp_v2/proto/dlp_pb2.py" - }, - { - "path": "google/cloud/dlp_v2/proto/dlp_pb2_grpc.py" - }, - { - "path": "google/cloud/dlp_v2/proto/storage.proto" - }, - { - "path": "google/cloud/dlp_v2/proto/storage_pb2.py" - }, - { - "path": "google/cloud/dlp_v2/proto/storage_pb2_grpc.py" - }, - { - "path": "google/cloud/dlp_v2/types.py" - }, - { - "path": "noxfile.py" - }, - { - "path": "setup.cfg" - }, - { - "path": "setup.py" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "tests/system/gapic/v2/test_system_dlp_service_v2.py" - }, - { - "path": "tests/system/gapic/v2/test_system_dlp_service_v2_vpcsc.py" - }, - { - "path": "tests/unit/gapic/v2/test_dlp_service_client_v2.py" - } - ] -} \ No newline at end of file diff --git a/dlp/synth.py b/dlp/synth.py deleted file mode 100644 index 86862894f5bc..000000000000 --- a/dlp/synth.py +++ /dev/null @@ -1,258 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -import synthtool.gcp as gcp -import logging - -logging.basicConfig(level=logging.DEBUG) - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() - -# ---------------------------------------------------------------------------- -# Generate dlp GAPIC layer -# ---------------------------------------------------------------------------- -library = gapic.py_library( - "dlp", - "v2", - config_path="/google/privacy/dlp/artman_dlp_v2.yaml", - include_protos=True, -) - -excludes = ["README.rst", "nox.py", "setup.py", "docs/index.rst"] -s.move(library, excludes=excludes) - -# Fix namespace -s.replace("google/**/*.py", "google\.cloud\.privacy\.dlp_v2", "google.cloud.dlp_v2") - -# Add missing utf-8 marker -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "# Generated by the protocol buffer compiler. DO NOT EDIT!", - "# -*- coding: utf-8 -*-\n\g<0>", -) - -# Fix raw-latex bits in storage_pb2.py -s.replace( - "google/cloud/dlp_v2/proto/storage_pb2.py", - "number regex.*\n(\s+)latex:.*\n", - r'number regex "(\\d\{3\}) \\d\{3\}-\\d\{4\} "\\\n' - "\g<1>could be adjusted upwards if the area code is \\\n", -) - -# Fix Docstrings in google/cloud/dlp_v2/proto/storage_pb2.py -s.replace( - "google/cloud/dlp_v2/proto/storage_pb2.py", - "(hotword_regex:)\n(\s+Regular expression.*)\n", - "\g<1> \\\n\g<2> \\\n", -) - -s.replace( - "google/cloud/dlp_v2/proto/storage_pb2.py", - "(likelihood_adjustment:)\n", - "\g<1> \\\n", -) - -# Fix Docstrings in google/cloud/dlp_v2/proto/dlp_pb2.py -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "(max_findings_per_item:)\n(\s+Max number.*)\n(\s+scanned. When.*)\n" - "(\s+maximum returned is 1000.*)\n(\s+When set within.*)\n", - "\g<1> \\\n\g<2> \\\n\g<3> \\\n\g<4> \\\n\g<5> \\\n", -) - -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "(max_findings_per_request:)\n(\s+Max number of.*)\n(\s+When set .*)\n", - "\g<1> \\\n\g<2> \\\n\g<3> \\\n", -) - -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "(max_findings_per_info_type:)\n", - "\g<1> \\\n", -) - -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "(snapshot_inspect_template:)\n(\s+If run with an .*)\n", - "\g<1> \\\n\g<2> \\\n", -) - -to_replace = [ - "processed_bytes:", - "total_estimated_bytes:", - "info_type_stats:", - "Statistics of how many instances of each info type were found", - "requested_options:", -] - -for replace in to_replace: - s.replace("google/cloud/dlp_v2/proto/dlp_pb2.py", f"({replace})\n", "\g<1> \\\n") - -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "(sensitive_value_frequency_lower_bound:)\n(\s+Lower bound.*)\n", - "\g<1> \\\n\g<2> \\\n", -) - -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "(sensitive_value_frequency_upper_bound:)\n(\s+Upper bound.*)\n", - "\g<1> \\\n\g<2> \\\n", -) - -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "(bucket_size:)\n(\s+Total number of equivalence.*)\n", - "\g<1> \\\n\g<2>\n", -) - -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "(bucket_values:)\n(\s+Sample of equivalence.*)\n", - "\g<1> \\\n\g<2> \\\n", -) - -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "(offset_minutes:)\n(\s+Set only.*)\n", - "\g<1> \\\n\g<2> \\\n", -) - -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "(result:)\n(\s+A summary of the outcome of this inspect job.)", - "\g<1> \\\n\g<2>", -) - -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "(storage_config:)\n(\s+The data to scan.\n)", - "\g<1> \\\n\g<2>", -) - -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "(inspect_config:)\n(\s+How and what to scan for.\n)", - "\g<1> \\\n\g<2>", -) - -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "(inspect_template_name:)\n(\s+If provided, will be.*)\n" - "(\s+InspectConfig.*)\n(\s+values persisted.*)\n(\s+actions:)\n" - "(\s+Actions to.*)\n", - "\g<1> \\\n\g<2> \\\n\g<3> \\\n\g<4> \\\n\g<5> \\\n\g<6> \\\n", -) - -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - " (\s+Set of values defining the equivalence class.*)\n" - " (\s+quasi-identifier.*)\n" - " (\s+message. The order.*)\n", - "\g<1> \\\n\g<2> \\\n\g<3>\n", -) - -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - " (\s+Size of the equivalence class, for example number of rows with)\n" - " (\s+the above set of values.)\n", - "\g<1> \\\n\g<2>\n", -) - -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "(equivalence_class_size_lower_bound:)\n(\s+Lower bound.*)\n", - "\g<1> \\\n\g<2> \\\n", -) - -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "(equivalence_class_size_upper_bound:)\n(\s+Upper bound.*)\n", - "\g<1> \\\n\g<2> \\\n", -) - -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "(bucket_value_count:)\n(\s+Total number of distinct equivalence.*)\n", - "\g<1> \\\n\g<2>\n", -) - -# Docstrings from categorical histogram bucket -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "(value_frequency_lower_bound:)\n\s+(Lower bound.*)\n\s+(bucket.\n)" - "(\s+value_frequency_upper.*)\n\s+(Upper.*)\n\s+(bucket.\n)" - "(\s+bucket_size:)\n\s+(Total.*\n)" - "(\s+bucket_values:)\n\s+(Sample of value.*)\n\s+(of values.*\n)" - "(\s+bucket_value_count:)\n\s+(Total number.*\n)", - "\g<1> \g<2> \g<3>\g<4> \g<5> \g<6>\g<7> \g<8>" "\g<9> \g<10> \g<11>\g<12> \g<13>", -) - -# Fix docstrings tagged field indentation issues in dlp_pb2.py -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "(DESCRIPTOR .*_TAGGEDFIELD,\n\s+__module__.*\n\s+,\n\s+__doc__.*\n)" - "(\s+field:)\n(\s+Identifies .*)\n(\s+tag:)\n(\s+Semantic.*)\n" - "(\s+determine.*)\n(\s+reidentifiability.*)\n(\s+info_type:)\n" - "(\s+A column.*)\n(\s+public dataset.*)\n(\s+available.*)\n(\s+ages.*)\n" - "(\s+supported Info.*)\n(\s+supported.*)\n(\s+custom_tag:)\n(\s+A col.*)\n" - "(\s+user must.*)\n(\s+statist.*)\n(\s+\(below.*)\n(\s+inferred:)\n" - "(\s+If no semantic.*)\n", - "\g<1>\g<2> \\\n\g<3>\n\g<4> \\\n\g<5> \\\n\g<6> \\\n" - "\g<7> \\\n\g<8> \\\n\g<9> \\\n\g<10> \\\n\g<11> \\\n\g<12> \\\n" - "\g<13> \\\n\g<14>\n\g<15> \\\n\g<16> \\\n\g<17> \\\n\g<18> \\\n" - "\g<19>\n\g<20> \\\n\g<21> \\\n", -) - -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - r'''(\s+)__doc__ = """Attributes:''', - r'\g<1>__doc="""\n Attributes:' -) - - -s.replace( - "google/cloud/dlp_v2/proto/dlp_pb2.py", - "(////////.*)\n\s+(///////////////\n)", - "\g<1> \g<2>", -) - -# Fix Docstrings in google/cloud/dlp_v2/gapic/dlp_service_client.py -s.replace( - "google/cloud/dlp_v2/gapic/dlp_service_client.py", - "^\s+resource was created.", - " \g<0>", -) - -# Fix Docstrings in google/cloud/dlp_v2/gapic/enums.py -s.replace( - "google/cloud/dlp_v2/gapic/enums.py", - "(\s+)WHITESPACE \(int\).*\n", - "\g<1>WHITESPACE (int): Whitespace character\n", -) - -s.replace("google/cloud/dlp_v2/gapic/enums.py", ".*:raw-latex:.*\n", "") - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = common.py_library(unit_cov_level=97, cov_level=100) -s.move(templated_files, excludes=['noxfile.py']) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/dlp/tests/system/gapic/v2/test_system_dlp_service_v2.py b/dlp/tests/system/gapic/v2/test_system_dlp_service_v2.py deleted file mode 100644 index e24f6a22bf1b..000000000000 --- a/dlp/tests/system/gapic/v2/test_system_dlp_service_v2.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import json -import os - -from google.cloud import dlp_v2 -from google.cloud.dlp_v2 import enums -from google.cloud.dlp_v2.proto import dlp_pb2 - - -class TestSystemDlpService(object): - def _get_project_id(self): - env_var_name = "GOOGLE_APPLICATION_CREDENTIALS" - path = os.environ[env_var_name] - json_data = open(path).read() - data = json.loads(json_data) - return data["project_id"] - - def test_inspect_content(self): - # get project id from json file - project_id = self._get_project_id() - - client = dlp_v2.DlpServiceClient() - min_likelihood = enums.Likelihood.POSSIBLE - info_types = [{"name": "FIRST_NAME"}, {"name": "LAST_NAME"}] - inspect_config = {"info_types": info_types, "min_likelihood": min_likelihood} - item = {"value": "Robert Frost"} - parent = client.project_path(project_id) - response = client.inspect_content(parent, inspect_config, item) diff --git a/dlp/tests/system/gapic/v2/test_system_dlp_service_v2_vpcsc.py b/dlp/tests/system/gapic/v2/test_system_dlp_service_v2_vpcsc.py deleted file mode 100644 index 289e927dd505..000000000000 --- a/dlp/tests/system/gapic/v2/test_system_dlp_service_v2_vpcsc.py +++ /dev/null @@ -1,499 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import pytest - -from google.cloud import dlp_v2 -from google.cloud.dlp_v2 import enums -from google.cloud.dlp_v2.proto import dlp_pb2 -from google.api_core import exceptions - -from test_utils.vpcsc_config import vpcsc_config - - -_VPCSC_PROHIBITED_MESSAGE = "Request is prohibited by organization's policy" - - -@pytest.fixture(scope="module") -def client(): - return dlp_v2.DlpServiceClient() - - -@pytest.fixture(scope="module") -def name_inside(client): - return client.project_path(vpcsc_config.project_inside) - - -@pytest.fixture(scope="module") -def name_outside(client): - return client.project_path(vpcsc_config.project_outside) - - -@pytest.fixture(scope="module") -def content_item(): - return dlp_pb2.ContentItem(value="testing") - - -@pytest.fixture(scope="module") -def bytes_content_item(): - return dlp_pb2.ByteContentItem(data=b"DEADBEEF") - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_inspect_content_inside(client, name_inside, content_item): - client.inspect_content(name_inside, item=content_item) # no perms issue - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_inspect_content_outside(client, name_outside, content_item): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.inspect_content(name_outside, item=content_item) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_redact_image_inside(client, name_inside, bytes_content_item): - with pytest.raises(exceptions.InvalidArgument): # no perms issue - client.redact_image(name_inside, byte_item=bytes_content_item) - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_redact_image_outside(client, name_outside, bytes_content_item): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.redact_image(name_outside, byte_item=bytes_content_item) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_deidentify_content_inside(client, name_inside, content_item): - with pytest.raises(exceptions.InvalidArgument): # no perms issue - client.deidentify_content(name_inside, item=content_item) - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_deidentify_content_outside(client, name_outside, content_item): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.deidentify_content(name_outside, item=content_item) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_reidentify_content_inside(client, name_inside, content_item): - with pytest.raises(exceptions.InvalidArgument): # no perms issue - client.reidentify_content(name_inside, item=content_item) - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_reidentify_content_outside(client, name_outside, content_item): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.reidentify_content(name_outside, item=content_item) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - -@pytest.fixture(scope="module") -def inspect_template_path_inside(client): - inspect_template_id = 1234567 - return client.project_inspect_template_path( - vpcsc_config.project_inside, inspect_template_id - ) - - -@pytest.fixture(scope="module") -def inspect_template_path_outside(client): - inspect_template_id = 1234567 - return client.project_inspect_template_path( - vpcsc_config.project_outside, inspect_template_id - ) - - -@vpcsc_config.skip_unless_inside_vpcsc -class TestCRUDInspectTemplate(object): - @staticmethod - def test_create_inspect_template_inside(client, name_inside): - client.create_inspect_template(name_inside) # no perms issue - - @staticmethod - def test_create_inspect_template_outside(client, name_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.create_inspect_template(name_outside) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_list_inspect_templates_inside(client, name_inside): - list(client.list_inspect_templates(name_inside)) - - @staticmethod - def test_list_inspect_templates_outside(client, name_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - list(client.list_inspect_templates(name_outside)) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_update_inspect_template_inside(client, inspect_template_path_inside): - with pytest.raises(exceptions.NotFound): # no perms issue - client.update_inspect_template(inspect_template_path_inside) - - @staticmethod - def test_update_inspect_template_outside(client, inspect_template_path_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.update_inspect_template(inspect_template_path_outside) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_get_inspect_template_inside(client, inspect_template_path_inside): - with pytest.raises(exceptions.NotFound): # no perms issue - client.get_inspect_template(inspect_template_path_inside) - - @staticmethod - def test_get_inspect_template_outside(client, inspect_template_path_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.get_inspect_template(inspect_template_path_outside) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_delete_inspect_template_inside(client, inspect_template_path_inside): - with pytest.raises(exceptions.NotFound): # no perms issue - client.delete_inspect_template(inspect_template_path_inside) - - @staticmethod - def test_delete_inspect_template_outside(client, inspect_template_path_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.delete_inspect_template(inspect_template_path_outside) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - -@pytest.fixture(scope="module") -def deidentify_template_path_inside(client): - deidentify_template_id = 1234567 - return client.project_deidentify_template_path( - vpcsc_config.project_inside, deidentify_template_id - ) - - -@pytest.fixture(scope="module") -def deidentify_template_path_outside(client): - deidentify_template_id = 1234567 - return client.project_deidentify_template_path( - vpcsc_config.project_outside, deidentify_template_id - ) - - -@vpcsc_config.skip_unless_inside_vpcsc -class TestCRUDDeidentifyTemplate(object): - @staticmethod - def test_create_deidentify_template_inside(client, name_inside): - client.create_deidentify_template(name_inside) - - @staticmethod - def test_create_deidentify_template_outside(client, name_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.create_deidentify_template(name_outside) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_list_deidentify_templates_inside(client, name_inside): - list(client.list_deidentify_templates(name_inside)) - - @staticmethod - def test_list_deidentify_templates_outside(client, name_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - list(client.list_deidentify_templates(name_outside)) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_update_deidentify_template_inside(client, deidentify_template_path_inside): - with pytest.raises(exceptions.NotFound): # no perms issue - client.update_deidentify_template(deidentify_template_path_inside) - - @staticmethod - def test_update_deidentify_template_outside( - client, deidentify_template_path_outside - ): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.update_deidentify_template(deidentify_template_path_outside) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_get_deidentify_template_inside(client, deidentify_template_path_inside): - with pytest.raises(exceptions.NotFound): # no perms issue - client.get_deidentify_template(deidentify_template_path_inside) - - @staticmethod - def test_get_deidentify_template_outside(client, deidentify_template_path_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.get_deidentify_template(deidentify_template_path_outside) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_delete_deidentify_template_inside(client, deidentify_template_path_inside): - with pytest.raises(exceptions.NotFound): # no perms issue - client.delete_deidentify_template(deidentify_template_path_inside) - - @staticmethod - def test_delete_deidentify_template_outside( - client, deidentify_template_path_outside - ): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.delete_deidentify_template(deidentify_template_path_outside) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - -@pytest.fixture(scope="module") -def job_path_inside(name_inside): - job_id = 1234567 - return "{}/jobs/{}".format(name_inside, job_id) - - -@pytest.fixture(scope="module") -def job_path_outside(name_outside): - job_id = 1234567 - return "{}/jobs/{}".format(name_outside, job_id) - - -@pytest.fixture(scope="module") -def inspect_job(): - from google.cloud.dlp_v2.proto.dlp_pb2 import InspectJobConfig - - return InspectJobConfig() - - -@vpcsc_config.skip_unless_inside_vpcsc -class TestCRUDDlpJob(object): - @staticmethod - def test_create_dlp_job_inside(client, name_inside, inspect_job): - with pytest.raises(exceptions.InvalidArgument): # no perms issue - client.create_dlp_job(name_inside, inspect_job=inspect_job) - - @staticmethod - def test_create_dlp_job_outside(client, name_outside, inspect_job): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.create_dlp_job(name_outside, inspect_job=inspect_job) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_list_dlp_jobs_inside(client, name_inside): - list(client.list_dlp_jobs(name_inside)) - - @staticmethod - def test_list_dlp_jobs_outside(client, name_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - list(client.list_dlp_jobs(name_outside)) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_get_dlp_job_inside(client, job_path_inside): - with pytest.raises(exceptions.InvalidArgument): # no perms issue - client.get_dlp_job(job_path_inside) - - @staticmethod - def test_get_dlp_job_outside(client, job_path_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.get_dlp_job(job_path_outside) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_delete_dlp_job_inside(client, job_path_inside): - with pytest.raises(exceptions.InvalidArgument): # no perms issue - client.delete_dlp_job(job_path_inside) - - @staticmethod - def test_delete_dlp_job_outside(client, job_path_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.delete_dlp_job(job_path_outside) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_cancel_dlp_job_inside(client, job_path_inside): - with pytest.raises(exceptions.InvalidArgument): # no perms issue - client.cancel_dlp_job(job_path_inside) - - @staticmethod - def test_cancel_dlp_job_outside(client, job_path_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.cancel_dlp_job(job_path_outside) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - -@pytest.fixture(scope="module") -def job_trigger_path_inside(client): - job_trigger_id = 1234567 - return client.project_job_trigger_path(vpcsc_config.project_inside, job_trigger_id) - - -@pytest.fixture(scope="module") -def job_trigger_path_outside(client): - job_trigger_id = 1234567 - return client.project_job_trigger_path(vpcsc_config.project_outside, job_trigger_id) - - -@vpcsc_config.skip_unless_inside_vpcsc -class TestCRUDJobTrigger(object): - @staticmethod - def test_create_job_trigger_inside(client, name_inside): - with pytest.raises(exceptions.InvalidArgument): # no perms issue - client.create_job_trigger(name_inside) - - @staticmethod - def test_create_job_trigger_outside(client, name_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.create_job_trigger(name_outside) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_list_job_triggers_inside(client, name_inside): - list(client.list_job_triggers(name_inside)) - - @staticmethod - def test_list_job_triggers_outside(client, name_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - list(client.list_job_triggers(name_outside)) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_get_job_trigger_inside(client, job_trigger_path_inside): - with pytest.raises(exceptions.NotFound): # no perms issue - client.get_job_trigger(job_trigger_path_inside) - - @staticmethod - def test_get_job_trigger_outside(client, job_trigger_path_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.get_job_trigger(job_trigger_path_outside) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_update_job_trigger_inside(client, job_trigger_path_inside): - with pytest.raises(exceptions.InvalidArgument): # no perms issue - client.update_job_trigger(job_trigger_path_inside) - - @staticmethod - def test_update_job_trigger_outside(client, job_trigger_path_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.update_job_trigger(job_trigger_path_outside) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_delete_job_trigger_inside(client, job_trigger_path_inside): - with pytest.raises(exceptions.NotFound): # no perms issue - client.delete_job_trigger(job_trigger_path_inside) - - @staticmethod - def test_delete_job_trigger_outside(client, job_trigger_path_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.delete_job_trigger(job_trigger_path_outside) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - -@pytest.fixture(scope="module") -def stored_info_type_path_inside(client): - stored_info_type_id = 1234567 - return client.project_stored_info_type_path( - vpcsc_config.project_inside, stored_info_type_id - ) - - -@pytest.fixture(scope="module") -def stored_info_type_path_outside(client): - stored_info_type_id = 1234567 - return client.project_stored_info_type_path( - vpcsc_config.project_outside, stored_info_type_id - ) - - -@vpcsc_config.skip_unless_inside_vpcsc -class TestCRUDStoredInfoType(object): - @staticmethod - def test_create_stored_info_type_inside(client, name_inside): - with pytest.raises(exceptions.InvalidArgument): # no perms issue - client.create_stored_info_type(name_inside) - - @staticmethod - def test_create_stored_info_type_outside(client, name_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.create_stored_info_type(name_outside) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_list_stored_info_types_inside(client, name_inside): - list(client.list_stored_info_types(name_inside)) - - @staticmethod - def test_list_stored_info_types_outside(client, name_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - list(client.list_stored_info_types(name_outside)) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_get_stored_info_type_inside(client, stored_info_type_path_inside): - with pytest.raises(exceptions.NotFound): # no perms issue - client.get_stored_info_type(stored_info_type_path_inside) - - @staticmethod - def test_get_stored_info_type_outside(client, stored_info_type_path_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.get_stored_info_type(stored_info_type_path_outside) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_update_stored_info_type_inside(client, stored_info_type_path_inside): - with pytest.raises(exceptions.NotFound): # no perms issue - client.update_stored_info_type(stored_info_type_path_inside) - - @staticmethod - def test_update_stored_info_type_outside(client, stored_info_type_path_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.update_stored_info_type(stored_info_type_path_outside) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - @staticmethod - def test_delete_stored_info_type_inside(client, stored_info_type_path_inside): - with pytest.raises(exceptions.NotFound): # no perms issue - client.delete_stored_info_type(stored_info_type_path_inside) - - @staticmethod - def test_delete_stored_info_type_outside(client, stored_info_type_path_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.delete_stored_info_type(stored_info_type_path_outside) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message diff --git a/dlp/tests/unit/gapic/v2/test_dlp_service_client_v2.py b/dlp/tests/unit/gapic/v2/test_dlp_service_client_v2.py deleted file mode 100644 index 4c3d448e9686..000000000000 --- a/dlp/tests/unit/gapic/v2/test_dlp_service_client_v2.py +++ /dev/null @@ -1,1273 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import dlp_v2 -from google.cloud.dlp_v2.proto import dlp_pb2 -from google.protobuf import empty_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestDlpServiceClient(object): - def test_inspect_content(self): - # Setup Expected Response - expected_response = {} - expected_response = dlp_pb2.InspectContentResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - - response = client.inspect_content(parent) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.InspectContentRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_inspect_content_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - parent = client.project_path("[PROJECT]") - - with pytest.raises(CustomException): - client.inspect_content(parent) - - def test_redact_image(self): - # Setup Expected Response - redacted_image = b"28" - extracted_text = "extractedText998260012" - expected_response = { - "redacted_image": redacted_image, - "extracted_text": extracted_text, - } - expected_response = dlp_pb2.RedactImageResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - - response = client.redact_image(parent) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.RedactImageRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_redact_image_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - parent = client.project_path("[PROJECT]") - - with pytest.raises(CustomException): - client.redact_image(parent) - - def test_deidentify_content(self): - # Setup Expected Response - expected_response = {} - expected_response = dlp_pb2.DeidentifyContentResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - - response = client.deidentify_content(parent) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.DeidentifyContentRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_deidentify_content_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - parent = client.project_path("[PROJECT]") - - with pytest.raises(CustomException): - client.deidentify_content(parent) - - def test_reidentify_content(self): - # Setup Expected Response - expected_response = {} - expected_response = dlp_pb2.ReidentifyContentResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - - response = client.reidentify_content(parent) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.ReidentifyContentRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_reidentify_content_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - parent = client.project_path("[PROJECT]") - - with pytest.raises(CustomException): - client.reidentify_content(parent) - - def test_list_info_types(self): - # Setup Expected Response - expected_response = {} - expected_response = dlp_pb2.ListInfoTypesResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - response = client.list_info_types() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.ListInfoTypesRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_info_types_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - with pytest.raises(CustomException): - client.list_info_types() - - def test_create_inspect_template(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - } - expected_response = dlp_pb2.InspectTemplate(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - parent = client.organization_path("[ORGANIZATION]") - - response = client.create_inspect_template(parent) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.CreateInspectTemplateRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_inspect_template_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - parent = client.organization_path("[ORGANIZATION]") - - with pytest.raises(CustomException): - client.create_inspect_template(parent) - - def test_update_inspect_template(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name_2, - "display_name": display_name, - "description": description, - } - expected_response = dlp_pb2.InspectTemplate(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - name = client.organization_inspect_template_path( - "[ORGANIZATION]", "[INSPECT_TEMPLATE]" - ) - - response = client.update_inspect_template(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.UpdateInspectTemplateRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_inspect_template_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - name = client.organization_inspect_template_path( - "[ORGANIZATION]", "[INSPECT_TEMPLATE]" - ) - - with pytest.raises(CustomException): - client.update_inspect_template(name) - - def test_get_inspect_template(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - } - expected_response = dlp_pb2.InspectTemplate(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - response = client.get_inspect_template() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.GetInspectTemplateRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_inspect_template_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - with pytest.raises(CustomException): - client.get_inspect_template() - - def test_list_inspect_templates(self): - # Setup Expected Response - next_page_token = "" - inspect_templates_element = {} - inspect_templates = [inspect_templates_element] - expected_response = { - "next_page_token": next_page_token, - "inspect_templates": inspect_templates, - } - expected_response = dlp_pb2.ListInspectTemplatesResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - parent = client.organization_path("[ORGANIZATION]") - - paged_list_response = client.list_inspect_templates(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.inspect_templates[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.ListInspectTemplatesRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_inspect_templates_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - parent = client.organization_path("[ORGANIZATION]") - - paged_list_response = client.list_inspect_templates(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_delete_inspect_template(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - name = client.organization_inspect_template_path( - "[ORGANIZATION]", "[INSPECT_TEMPLATE]" - ) - - client.delete_inspect_template(name) - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.DeleteInspectTemplateRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_inspect_template_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - name = client.organization_inspect_template_path( - "[ORGANIZATION]", "[INSPECT_TEMPLATE]" - ) - - with pytest.raises(CustomException): - client.delete_inspect_template(name) - - def test_create_deidentify_template(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - } - expected_response = dlp_pb2.DeidentifyTemplate(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - parent = client.organization_path("[ORGANIZATION]") - - response = client.create_deidentify_template(parent) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.CreateDeidentifyTemplateRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_deidentify_template_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - parent = client.organization_path("[ORGANIZATION]") - - with pytest.raises(CustomException): - client.create_deidentify_template(parent) - - def test_update_deidentify_template(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name_2, - "display_name": display_name, - "description": description, - } - expected_response = dlp_pb2.DeidentifyTemplate(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - name = client.organization_deidentify_template_path( - "[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]" - ) - - response = client.update_deidentify_template(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.UpdateDeidentifyTemplateRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_deidentify_template_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - name = client.organization_deidentify_template_path( - "[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]" - ) - - with pytest.raises(CustomException): - client.update_deidentify_template(name) - - def test_get_deidentify_template(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name_2, - "display_name": display_name, - "description": description, - } - expected_response = dlp_pb2.DeidentifyTemplate(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - name = client.organization_deidentify_template_path( - "[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]" - ) - - response = client.get_deidentify_template(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.GetDeidentifyTemplateRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_deidentify_template_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - name = client.organization_deidentify_template_path( - "[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]" - ) - - with pytest.raises(CustomException): - client.get_deidentify_template(name) - - def test_list_deidentify_templates(self): - # Setup Expected Response - next_page_token = "" - deidentify_templates_element = {} - deidentify_templates = [deidentify_templates_element] - expected_response = { - "next_page_token": next_page_token, - "deidentify_templates": deidentify_templates, - } - expected_response = dlp_pb2.ListDeidentifyTemplatesResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - parent = client.organization_path("[ORGANIZATION]") - - paged_list_response = client.list_deidentify_templates(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.deidentify_templates[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.ListDeidentifyTemplatesRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_deidentify_templates_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - parent = client.organization_path("[ORGANIZATION]") - - paged_list_response = client.list_deidentify_templates(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_delete_deidentify_template(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - name = client.organization_deidentify_template_path( - "[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]" - ) - - client.delete_deidentify_template(name) - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.DeleteDeidentifyTemplateRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_deidentify_template_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - name = client.organization_deidentify_template_path( - "[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]" - ) - - with pytest.raises(CustomException): - client.delete_deidentify_template(name) - - def test_create_dlp_job(self): - # Setup Expected Response - name = "name3373707" - job_trigger_name = "jobTriggerName1819490804" - expected_response = {"name": name, "job_trigger_name": job_trigger_name} - expected_response = dlp_pb2.DlpJob(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - - response = client.create_dlp_job(parent) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.CreateDlpJobRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_dlp_job_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - parent = client.project_path("[PROJECT]") - - with pytest.raises(CustomException): - client.create_dlp_job(parent) - - def test_list_dlp_jobs(self): - # Setup Expected Response - next_page_token = "" - jobs_element = {} - jobs = [jobs_element] - expected_response = {"next_page_token": next_page_token, "jobs": jobs} - expected_response = dlp_pb2.ListDlpJobsResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - - paged_list_response = client.list_dlp_jobs(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.jobs[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.ListDlpJobsRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_dlp_jobs_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - parent = client.project_path("[PROJECT]") - - paged_list_response = client.list_dlp_jobs(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_dlp_job(self): - # Setup Expected Response - name_2 = "name2-1052831874" - job_trigger_name = "jobTriggerName1819490804" - expected_response = {"name": name_2, "job_trigger_name": job_trigger_name} - expected_response = dlp_pb2.DlpJob(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - name = client.dlp_job_path("[PROJECT]", "[DLP_JOB]") - - response = client.get_dlp_job(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.GetDlpJobRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_dlp_job_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - name = client.dlp_job_path("[PROJECT]", "[DLP_JOB]") - - with pytest.raises(CustomException): - client.get_dlp_job(name) - - def test_delete_dlp_job(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - name = client.dlp_job_path("[PROJECT]", "[DLP_JOB]") - - client.delete_dlp_job(name) - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.DeleteDlpJobRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_dlp_job_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - name = client.dlp_job_path("[PROJECT]", "[DLP_JOB]") - - with pytest.raises(CustomException): - client.delete_dlp_job(name) - - def test_cancel_dlp_job(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - name = client.dlp_job_path("[PROJECT]", "[DLP_JOB]") - - client.cancel_dlp_job(name) - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.CancelDlpJobRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_cancel_dlp_job_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - name = client.dlp_job_path("[PROJECT]", "[DLP_JOB]") - - with pytest.raises(CustomException): - client.cancel_dlp_job(name) - - def test_list_job_triggers(self): - # Setup Expected Response - next_page_token = "" - job_triggers_element = {} - job_triggers = [job_triggers_element] - expected_response = { - "next_page_token": next_page_token, - "job_triggers": job_triggers, - } - expected_response = dlp_pb2.ListJobTriggersResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - - paged_list_response = client.list_job_triggers(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.job_triggers[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.ListJobTriggersRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_job_triggers_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - parent = client.project_path("[PROJECT]") - - paged_list_response = client.list_job_triggers(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_job_trigger(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name_2, - "display_name": display_name, - "description": description, - } - expected_response = dlp_pb2.JobTrigger(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - name = client.project_job_trigger_path("[PROJECT]", "[JOB_TRIGGER]") - - response = client.get_job_trigger(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.GetJobTriggerRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_job_trigger_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - name = client.project_job_trigger_path("[PROJECT]", "[JOB_TRIGGER]") - - with pytest.raises(CustomException): - client.get_job_trigger(name) - - def test_delete_job_trigger(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - name = "name3373707" - - client.delete_job_trigger(name) - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.DeleteJobTriggerRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_job_trigger_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - name = "name3373707" - - with pytest.raises(CustomException): - client.delete_job_trigger(name) - - def test_update_job_trigger(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name_2, - "display_name": display_name, - "description": description, - } - expected_response = dlp_pb2.JobTrigger(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - name = client.project_job_trigger_path("[PROJECT]", "[JOB_TRIGGER]") - - response = client.update_job_trigger(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.UpdateJobTriggerRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_job_trigger_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - name = client.project_job_trigger_path("[PROJECT]", "[JOB_TRIGGER]") - - with pytest.raises(CustomException): - client.update_job_trigger(name) - - def test_create_job_trigger(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - } - expected_response = dlp_pb2.JobTrigger(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - - response = client.create_job_trigger(parent) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.CreateJobTriggerRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_job_trigger_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - parent = client.project_path("[PROJECT]") - - with pytest.raises(CustomException): - client.create_job_trigger(parent) - - def test_create_stored_info_type(self): - # Setup Expected Response - name = "name3373707" - expected_response = {"name": name} - expected_response = dlp_pb2.StoredInfoType(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - parent = client.organization_path("[ORGANIZATION]") - - response = client.create_stored_info_type(parent) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.CreateStoredInfoTypeRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_stored_info_type_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - parent = client.organization_path("[ORGANIZATION]") - - with pytest.raises(CustomException): - client.create_stored_info_type(parent) - - def test_update_stored_info_type(self): - # Setup Expected Response - name_2 = "name2-1052831874" - expected_response = {"name": name_2} - expected_response = dlp_pb2.StoredInfoType(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - name = client.organization_stored_info_type_path( - "[ORGANIZATION]", "[STORED_INFO_TYPE]" - ) - - response = client.update_stored_info_type(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.UpdateStoredInfoTypeRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_stored_info_type_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - name = client.organization_stored_info_type_path( - "[ORGANIZATION]", "[STORED_INFO_TYPE]" - ) - - with pytest.raises(CustomException): - client.update_stored_info_type(name) - - def test_get_stored_info_type(self): - # Setup Expected Response - name_2 = "name2-1052831874" - expected_response = {"name": name_2} - expected_response = dlp_pb2.StoredInfoType(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - name = client.organization_stored_info_type_path( - "[ORGANIZATION]", "[STORED_INFO_TYPE]" - ) - - response = client.get_stored_info_type(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.GetStoredInfoTypeRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_stored_info_type_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - name = client.organization_stored_info_type_path( - "[ORGANIZATION]", "[STORED_INFO_TYPE]" - ) - - with pytest.raises(CustomException): - client.get_stored_info_type(name) - - def test_list_stored_info_types(self): - # Setup Expected Response - next_page_token = "" - stored_info_types_element = {} - stored_info_types = [stored_info_types_element] - expected_response = { - "next_page_token": next_page_token, - "stored_info_types": stored_info_types, - } - expected_response = dlp_pb2.ListStoredInfoTypesResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - parent = client.organization_path("[ORGANIZATION]") - - paged_list_response = client.list_stored_info_types(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.stored_info_types[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.ListStoredInfoTypesRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_stored_info_types_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - parent = client.organization_path("[ORGANIZATION]") - - paged_list_response = client.list_stored_info_types(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_delete_stored_info_type(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup Request - name = client.organization_stored_info_type_path( - "[ORGANIZATION]", "[STORED_INFO_TYPE]" - ) - - client.delete_stored_info_type(name) - - assert len(channel.requests) == 1 - expected_request = dlp_pb2.DeleteStoredInfoTypeRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_stored_info_type_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = dlp_v2.DlpServiceClient() - - # Setup request - name = client.organization_stored_info_type_path( - "[ORGANIZATION]", "[STORED_INFO_TYPE]" - ) - - with pytest.raises(CustomException): - client.delete_stored_info_type(name) diff --git a/dns/.coveragerc b/dns/.coveragerc deleted file mode 100644 index 098720f672e1..000000000000 --- a/dns/.coveragerc +++ /dev/null @@ -1,16 +0,0 @@ -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py diff --git a/dns/.flake8 b/dns/.flake8 deleted file mode 100644 index 61766fa84d02..000000000000 --- a/dns/.flake8 +++ /dev/null @@ -1,13 +0,0 @@ -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/dns/.repo-metadata.json b/dns/.repo-metadata.json deleted file mode 100644 index 835bbd8ffb2b..000000000000 --- a/dns/.repo-metadata.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "dns", - "name_pretty": "Cloud DNS", - "product_documentation": "https://cloud.google.com/dns", - "client_documentation": "https://googleapis.dev/python/dns/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559772", - "release_level": "alpha", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-dns", - "requires_billing": true -} \ No newline at end of file diff --git a/dns/CHANGELOG.md b/dns/CHANGELOG.md deleted file mode 100644 index 86088ee8e792..000000000000 --- a/dns/CHANGELOG.md +++ /dev/null @@ -1,130 +0,0 @@ -# Changelog - -[PyPI History][1] - -[1]: https://pypi.org/project/google-cloud-dns/#history - -## 0.31.0 - -10-15-2019 06:42 PDT - - -### Dependencies -- Pin 'google-cloud-core >= 1.0.3, < 2.0.0dev'. ([#9445](https://github.com/googleapis/google-cloud-python/pull/9445)) - -### Documentation -- Fix intersphinx reference to `requests`. ([#9294](https://github.com/googleapis/google-cloud-python/pull/9294)) -- Fix broken links in docs. ([#9148](https://github.com/googleapis/google-cloud-python/pull/9148)) -- Remove CI for gh-pages, use googleapis.dev for `api_core` refs. ([#9085](https://github.com/googleapis/google-cloud-python/pull/9085)) -- Remove compatability badges from READMEs. ([#9035](https://github.com/googleapis/google-cloud-python/pull/9035)) -- Update intersphinx mapping for requests. ([#8805](https://github.com/googleapis/google-cloud-python/pull/8805)) -- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705)) - -## 0.30.2 - -07-11-2019 10:09 PDT - -### Implementation Changes -- Change base url to dns.googleapis.com ([#8641](https://github.com/googleapis/google-cloud-python/pull/8641)) - -### Internal / Testing Changes -- Add nox session 'docs' to remaining manual clients. ([#8478](https://github.com/googleapis/google-cloud-python/pull/8478)) -- Add docs job to publish to googleapis.dev. ([#8464](https://github.com/googleapis/google-cloud-python/pull/8464)) - -## 0.30.1 - -06-04-2019 11:13 PDT - - -### Dependencies -- Don't pin 'google-api-core' in libs using 'google-cloud-core'. ([#8213](https://github.com/googleapis/google-cloud-python/pull/8213)) - -## 0.30.0 - -05-16-2019 12:23 PDT - - -### Implementation Changes -- Remove classifier for Python 3.4 for end-of-life. ([#7535](https://github.com/googleapis/google-cloud-python/pull/7535)) - -### New Features -- Add `client_info` support to client / connection. ([#7869](https://github.com/googleapis/google-cloud-python/pull/7869)) - -### Dependencies -- Pin `google-cloud-core >= 1.0.0, < 2.0dev`. ([#7993](https://github.com/googleapis/google-cloud-python/pull/7993)) - -### Documentation -- Update client library documentation URLs. ([#7307](https://github.com/googleapis/google-cloud-python/pull/7307)) - -## 0.29.2 - -12-17-2018 16:47 PST - - -### Implementation Changes -- Ensure that `ManagedZone:exists()` does not misreport `True` result. ([#6884](https://github.com/googleapis/google-cloud-python/pull/6884)) - -### Documentation -- Document Python 2 deprecation ([#6910](https://github.com/googleapis/google-cloud-python/pull/6910)) -- Docs/fixit: normalize docs for `page_size` / `max_results` / `page_token` ([#6842](https://github.com/googleapis/google-cloud-python/pull/6842)) - -## 0.29.1 - -12-10-2018 12:50 PST - - -### Dependencies -- Update dependency to google-cloud-core ([#6835](https://github.com/googleapis/google-cloud-python/pull/6835)) -- Bump minimum `api_core` version for all GAPIC libs to 1.4.1. ([#6391](https://github.com/googleapis/google-cloud-python/pull/6391)) - -### Documentation -- Fix 'Datastore' in text as well as examples / links - -### Internal / Testing Changes -- Add blacken to noxfile ([#6795](https://github.com/googleapis/google-cloud-python/pull/6795)) -- Blackening Continued... ([#6667](https://github.com/googleapis/google-cloud-python/pull/6667)) -- Add templates for flake8, coveragerc, noxfile, and black. ([#6642](https://github.com/googleapis/google-cloud-python/pull/6642)) -- Docs: normalize use of support level badges ([#6159](https://github.com/googleapis/google-cloud-python/pull/6159)) -- Add / fix badges for PyPI / versions. ([#6158](https://github.com/googleapis/google-cloud-python/pull/6158)) -- Fix copy-pasta from datastore README. ([#6208](https://github.com/googleapis/google-cloud-python/pull/6208)) -- Use new Nox ([#6175](https://github.com/googleapis/google-cloud-python/pull/6175)) -- Prep dns docs for repo split. ([#6020](https://github.com/googleapis/google-cloud-python/pull/6020)) -- Nox: use inplace installs ([#5865](https://github.com/googleapis/google-cloud-python/pull/5865)) -- Add Test runs for Python 3.7 and remove 3.4 ([#5295](https://github.com/googleapis/google-cloud-python/pull/5295)) -- Fix bad trove classifier - -## 0.29.0 - -### Implementation changes - -- Renaming `makeResource` -> `make_resource`. (#4355) - -### Dependencies - -- Update dependency range for api-core to include v1.0.0 releases (#4944) - -### Documentation - -- Fixing "Fore" -> "For" typo in README docs. (#4317) - -### Testing and internal changes - -- Install local dependencies when running lint (#4936) -- Re-enable lint for tests, remove usage of pylint (#4921) -- Normalize all setup.py files (#4909) -- Making a `nox -s default` session for all packages. (#4324) -- Shorten test names (#4321) - -## 0.28.0 - -### Documentation - -- Added link to "Python Development Environment Setup Guide" in - project README (#4187, h/t to @michaelawyu) - -### Dependencies - -- Upgrading to `google-cloud-core >= 0.28.0` and adding dependency - on `google-api-core` (#4221, #4280) - -PyPI: https://pypi.org/project/google-cloud-dns/0.28.0/ diff --git a/dns/LICENSE b/dns/LICENSE deleted file mode 100644 index d64569567334..000000000000 --- a/dns/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/dns/MANIFEST.in b/dns/MANIFEST.in deleted file mode 100644 index fc77f8c82ff0..000000000000 --- a/dns/MANIFEST.in +++ /dev/null @@ -1,4 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.pyc __pycache__ diff --git a/dns/README.rst b/dns/README.rst deleted file mode 100644 index 7b1b15bcb7b1..000000000000 --- a/dns/README.rst +++ /dev/null @@ -1,87 +0,0 @@ -Python Client for Google Cloud DNS -================================== - -|alpha| |pypi| |versions| - -The `Google Cloud DNS`_ API provides methods that you can use to -manage DNS for your applications. - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. |alpha| image:: https://img.shields.io/badge/support-alpha-orange.svg - :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#alpha-support -.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-dns.svg - :target: https://pypi.org/project/google-cloud-dns/ -.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-dns.svg -.. _Google Cloud DNS: https://cloud.google.com/dns/ -.. _Client Library Documentation: https://googleapis.dev/python/dns/latest -.. _Product Documentation: https://cloud.google.com/dns/docs/ - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the Google Cloud DNS API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Google Cloud DNS API.: https://cloud.google.com/dns -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Supported Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.5 - -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7. Python 2.7 support will be removed on January 1, 2020. - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-dns - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-dns - - -Next Steps -~~~~~~~~~~ - -- Read the `Client Library Documentation`_ for Google Cloud DNS - API to see other available methods on the client. -- Read the `Product documentation`_ to learn - more about the product and see How-to Guides. diff --git a/dns/docs/README.rst b/dns/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/dns/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/dns/docs/_static/custom.css b/dns/docs/_static/custom.css deleted file mode 100644 index 9a6f9f8ddc3a..000000000000 --- a/dns/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/dns/docs/_templates/layout.html b/dns/docs/_templates/layout.html deleted file mode 100644 index de457b2c2767..000000000000 --- a/dns/docs/_templates/layout.html +++ /dev/null @@ -1,49 +0,0 @@ -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/dns/docs/changelog.md b/dns/docs/changelog.md deleted file mode 120000 index 174ea63d7208..000000000000 --- a/dns/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../../dns/CHANGELOG.md \ No newline at end of file diff --git a/dns/docs/changes.rst b/dns/docs/changes.rst deleted file mode 100644 index 9510ebbcc013..000000000000 --- a/dns/docs/changes.rst +++ /dev/null @@ -1,6 +0,0 @@ -Change Sets -~~~~~~~~~~~ - -.. automodule:: google.cloud.dns.changes - :members: - :show-inheritance: diff --git a/dns/docs/client.rst b/dns/docs/client.rst deleted file mode 100644 index 76cbb66f5649..000000000000 --- a/dns/docs/client.rst +++ /dev/null @@ -1,6 +0,0 @@ -DNS Client -========== - -.. automodule:: google.cloud.dns.client - :members: - :show-inheritance: diff --git a/dns/docs/conf.py b/dns/docs/conf.py deleted file mode 100644 index a6a2c9451da1..000000000000 --- a/dns/docs/conf.py +++ /dev/null @@ -1,353 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-dns documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-dns" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-dns-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-dns.tex", - u"google-cloud-dns Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, "google-cloud-dns", u"google-cloud-dns Documentation", [author], 1) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-dns", - u"google-cloud-dns Documentation", - author, - "google-cloud-dns", - "GAPIC library for the DNS API", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/stable/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/dns/docs/index.rst b/dns/docs/index.rst deleted file mode 100644 index 71e0f49f5b18..000000000000 --- a/dns/docs/index.rst +++ /dev/null @@ -1,201 +0,0 @@ -.. include:: README.rst - -Using the Library ------------------ - -Client -~~~~~~ - -:class:`Client ` objects provide a means to -configure your DNS applications. Each instance holds both a ``project`` -and an authenticated connection to the DNS service. - -For an overview of authentication in ``google-cloud-python``, see `Authentication `_.. - -Assuming your environment is set up as described in that document, -create an instance of :class:`Client `. - - .. code-block:: python - - >>> from google.cloud import dns - >>> client = dns.Client() - -Projects -~~~~~~~~ - -A project is the top-level container in the ``DNS`` API: it is tied -closely to billing, and can provide default access control across all its -datasets. If no ``project`` is passed to the client container, the library -attempts to infer a project using the environment (including explicit -environment variables, GAE, or GCE). - -To override the project inferred from the environment, pass an explicit -``project`` to the constructor, or to either of the alternative -``classmethod`` factories: - - .. code-block:: python - - >>> from google.cloud import dns - >>> client = dns.Client(project='PROJECT_ID') - -Project Quotas -~~~~~~~~~~~~~~ - -Query the quotas for a given project: - - .. code-block:: python - - >>> from google.cloud import dns - >>> client = dns.Client(project='PROJECT_ID') - >>> quotas = client.quotas() # API request - >>> for key, value in sorted(quotas.items()): - ... print('%s: %s' % (key, value)) - managedZones: 10000 - resourceRecordsPerRrset: 100 - rrsetsPerManagedZone: 10000 - rrsetAdditionsPerChange: 100 - rrsetDeletionsPerChange: 100 - totalRrdataSizePerChange: 10000 - - -Project ACLs -^^^^^^^^^^^^ - -Each project has an access control list granting reader / writer / owner -permission to one or more entities. This list cannot be queried or set -via the API: it must be managed using the Google Developer Console. - - -Managed Zones -~~~~~~~~~~~~~ - -A "managed zone" is the container for DNS records for the same DNS name -suffix and has a set of name servers that accept and responds to queries: - - .. code-block:: python - - >>> from google.cloud import dns - >>> client = dns.Client(project='PROJECT_ID') - >>> zone = client.zone('acme-co', 'example.com', - ... description='Acme Company zone') - - >>> zone.exists() # API request - False - >>> zone.create() # API request - >>> zone.exists() # API request - True - -List the zones for a given project: - - .. code-block:: python - - >>> from google.cloud import dns - >>> client = dns.Client(project='PROJECT_ID') - >>> zones = client.list_zones() # API request - >>> [zone.name for zone in zones] - ['acme-co'] - - -Resource Record Sets -~~~~~~~~~~~~~~~~~~~~ - -Each managed zone exposes a read-only set of resource records: - - .. code-block:: python - - >>> from google.cloud import dns - >>> client = dns.Client(project='PROJECT_ID') - >>> zone = client.zone('acme-co', 'example.com') - >>> records, page_token = zone.list_resource_record_sets() # API request - >>> [(record.name, record.record_type, record.ttl, record.rrdatas) - ... for record in records] - [('example.com.', 'SOA', 21600, ['ns-cloud1.googlecomains.com dns-admin.google.com 1 21600 3600 1209600 300'])] - -.. note:: - - The ``page_token`` returned from ``zone.list_resource_record_sets()`` will - be an opaque string if there are more resources than can be returned in a - single request. To enumerate them all, repeat calling - ``zone.list_resource_record_sets()``, passing the ``page_token``, until - the token is ``None``. E.g. - - .. code-block:: python - - >>> records, page_token = zone.list_resource_record_sets() # API request - >>> while page_token is not None: - ... next_batch, page_token = zone.list_resource_record_sets( - ... page_token=page_token) # API request - ... records.extend(next_batch) - - -Change requests -~~~~~~~~~~~~~~~ - -Update the resource record set for a zone by creating a change request -bundling additions to or deletions from the set. - - .. code-block:: python - - >>> import time - >>> from google.cloud import dns - >>> client = dns.Client(project='PROJECT_ID') - >>> zone = client.zone('acme-co', 'example.com') - >>> TWO_HOURS = 2 * 60 * 60 # seconds - >>> record_set = zone.resource_record_set( - ... 'www.example.com.', 'CNAME', TWO_HOURS, ['www1.example.com.',]) - >>> changes = zone.changes() - >>> changes.add_record_set(record_set) - >>> changes.create() # API request - >>> while changes.status != 'done': - ... print('Waiting for changes to complete') - ... time.sleep(60) # or whatever interval is appropriate - ... changes.reload() # API request - - -List changes made to the resource record set for a given zone: - - .. code-block:: python - - >>> from google.cloud import dns - >>> client = dns.Client(project='PROJECT_ID') - >>> zone = client.zone('acme-co', 'example.com') - >>> changes = [] - >>> changes, page_token = zone.list_changes() # API request - -.. note:: - - The ``page_token`` returned from ``zone.list_changes()`` will be - an opaque string if there are more changes than can be returned in a - single request. To enumerate them all, repeat calling - ``zone.list_changes()``, passing the ``page_token``, until the token - is ``None``. E.g.: - - .. code-block:: python - - >>> changes, page_token = zone.list_changes() # API request - >>> while page_token is not None: - ... next_batch, page_token = zone.list_changes( - ... page_token=page_token) # API request - ... changes.extend(next_batch) - - -API Reference -------------- -.. toctree:: - :maxdepth: 2 - - client - zone - resource-record-set - changes - -Changelog ---------- - -For a list of all ``google-cloud-dns`` releases: - -.. toctree:: - :maxdepth: 2 - - changelog - diff --git a/dns/docs/resource-record-set.rst b/dns/docs/resource-record-set.rst deleted file mode 100644 index 1112d16aaa4f..000000000000 --- a/dns/docs/resource-record-set.rst +++ /dev/null @@ -1,6 +0,0 @@ -Resource Record Sets -~~~~~~~~~~~~~~~~~~~~ - -.. automodule:: google.cloud.dns.resource_record_set - :members: - :show-inheritance: diff --git a/dns/docs/usage.html b/dns/docs/usage.html deleted file mode 100644 index 9b81d6976cda..000000000000 --- a/dns/docs/usage.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/dns/docs/zone.rst b/dns/docs/zone.rst deleted file mode 100644 index b65081f00a92..000000000000 --- a/dns/docs/zone.rst +++ /dev/null @@ -1,6 +0,0 @@ -Managed Zones -~~~~~~~~~~~~~ - -.. automodule:: google.cloud.dns.zone - :members: - :show-inheritance: diff --git a/dns/google/__init__.py b/dns/google/__init__.py deleted file mode 100644 index 0e1bc5131ba6..000000000000 --- a/dns/google/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/dns/google/cloud/__init__.py b/dns/google/cloud/__init__.py deleted file mode 100644 index 0e1bc5131ba6..000000000000 --- a/dns/google/cloud/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/dns/google/cloud/dns/__init__.py b/dns/google/cloud/dns/__init__.py deleted file mode 100644 index dc3754ec4c22..000000000000 --- a/dns/google/cloud/dns/__init__.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 2015 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Google Cloud DNS API wrapper. - -The main concepts with this API are: - -- :class:`~google.cloud.DNS.zone.ManagedZone` represents an collection of - tables. -- :class:`~google.cloud.DNS.resource_record_set.ResourceRecordSet` represents - a single resource definition within a zone. -- :class:`~google.cloud.DNS.changes.Changes` represents a set of changes - (adding/deleting resource record sets) to a zone. -""" - - -from pkg_resources import get_distribution - -__version__ = get_distribution("google-cloud-dns").version - -from google.cloud.dns.zone import Changes -from google.cloud.dns.client import Client -from google.cloud.dns.zone import ManagedZone -from google.cloud.dns.resource_record_set import ResourceRecordSet - - -SCOPE = Client.SCOPE - - -__all__ = [ - "__version__", - "Changes", - "Client", - "ManagedZone", - "ResourceRecordSet", - "SCOPE", -] diff --git a/dns/google/cloud/dns/_http.py b/dns/google/cloud/dns/_http.py deleted file mode 100644 index 51f3f5634af7..000000000000 --- a/dns/google/cloud/dns/_http.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2015 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Create / interact with Google Cloud DNS connections.""" - -from google.cloud import _http - -from google.cloud.dns import __version__ - - -class Connection(_http.JSONConnection): - """A connection to Google Cloud DNS via the JSON REST API. - - :type client: :class:`~google.cloud.dns.client.Client` - :param client: The client that owns the current connection. - - :type client_info: :class:`~google.api_core.client_info.ClientInfo` - :param client_info: (Optional) instance used to generate user agent. - """ - - DEFAULT_API_ENDPOINT = "https://dns.googleapis.com" - - def __init__(self, client, client_info=None, api_endpoint=DEFAULT_API_ENDPOINT): - super(Connection, self).__init__(client, client_info) - self.API_BASE_URL = api_endpoint - self._client_info.gapic_version = __version__ - self._client_info.client_library_version = __version__ - - API_VERSION = "v1" - """The version of the API, used in building the API call's URL.""" - - API_URL_TEMPLATE = "{api_base_url}/dns/{api_version}{path}" - """A template for the URL of a particular API call.""" diff --git a/dns/google/cloud/dns/changes.py b/dns/google/cloud/dns/changes.py deleted file mode 100644 index 759997cbe4f1..000000000000 --- a/dns/google/cloud/dns/changes.py +++ /dev/null @@ -1,278 +0,0 @@ -# Copyright 2015 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Define API ResourceRecordSets.""" - -import six - -from google.cloud._helpers import _rfc3339_to_datetime -from google.cloud.exceptions import NotFound -from google.cloud.dns.resource_record_set import ResourceRecordSet - - -class Changes(object): - """Changes are bundled additions / deletions of DNS resource records. - - Changes are owned by a :class:`google.cloud.dns.zone.ManagedZone` instance. - - See - https://cloud.google.com/dns/api/v1/changes - - :type zone: :class:`google.cloud.dns.zone.ManagedZone` - :param zone: A zone which holds one or more record sets. - """ - - def __init__(self, zone): - self.zone = zone - self._properties = {} - self._additions = self._deletions = () - - @classmethod - def from_api_repr(cls, resource, zone): - """Factory: construct a change set given its API representation - - :type resource: dict - :param resource: change set representation returned from the API. - - :type zone: :class:`google.cloud.dns.zone.ManagedZone` - :param zone: A zone which holds zero or more change sets. - - :rtype: :class:`google.cloud.dns.changes.Changes` - :returns: RRS parsed from ``resource``. - """ - changes = cls(zone=zone) - changes._set_properties(resource) - return changes - - def _set_properties(self, resource): - """Helper method for :meth:`from_api_repr`, :meth:`create`, etc. - - :type resource: dict - :param resource: change set representation returned from the API. - """ - resource = resource.copy() - self._additions = tuple( - [ - ResourceRecordSet.from_api_repr(added_res, self.zone) - for added_res in resource.pop("additions", ()) - ] - ) - self._deletions = tuple( - [ - ResourceRecordSet.from_api_repr(added_res, self.zone) - for added_res in resource.pop("deletions", ()) - ] - ) - self._properties = resource - - @property - def path(self): - """URL path for change set APIs. - - :rtype: str - :returns: the path based on project, zone, and change set names. - """ - return "/projects/%s/managedZones/%s/changes/%s" % ( - self.zone.project, - self.zone.name, - self.name, - ) - - @property - def name(self): - """Name of the change set. - - :rtype: str or ``NoneType`` - :returns: Name, as set by the back-end, or None. - """ - return self._properties.get("id") - - @name.setter - def name(self, value): - """Update name of the change set. - - :type value: str - :param value: New name for the changeset. - """ - if not isinstance(value, six.string_types): - raise ValueError("Pass a string") - self._properties["id"] = value - - @property - def status(self): - """Status of the change set. - - :rtype: str or ``NoneType`` - :returns: Status, as set by the back-end, or None. - """ - return self._properties.get("status") - - @property - def started(self): - """Time when the change set was started. - - :rtype: ``datetime.datetime`` or ``NoneType`` - :returns: Time, as set by the back-end, or None. - """ - stamp = self._properties.get("startTime") - if stamp is not None: - return _rfc3339_to_datetime(stamp) - - @property - def additions(self): - """Resource record sets to be added to the zone. - - :rtype: sequence of - :class:`google.cloud.dns.resource_record_set.ResourceRecordSet`. - :returns: record sets appended via :meth:`add_record_set`. - """ - return self._additions - - @property - def deletions(self): - """Resource record sets to be deleted from the zone. - - :rtype: sequence of - :class:`google.cloud.dns.resource_record_set.ResourceRecordSet`. - :returns: record sets appended via :meth:`delete_record_set`. - """ - return self._deletions - - def add_record_set(self, record_set): - """Append a record set to the 'additions' for the change set. - - :type record_set: - :class:`google.cloud.dns.resource_record_set.ResourceRecordSet` - :param record_set: the record set to append. - - :raises: ``ValueError`` if ``record_set`` is not of the required type. - """ - if not isinstance(record_set, ResourceRecordSet): - raise ValueError("Pass a ResourceRecordSet") - self._additions += (record_set,) - - def delete_record_set(self, record_set): - """Append a record set to the 'deletions' for the change set. - - :type record_set: - :class:`google.cloud.dns.resource_record_set.ResourceRecordSet` - :param record_set: the record set to append. - - :raises: ``ValueError`` if ``record_set`` is not of the required type. - """ - if not isinstance(record_set, ResourceRecordSet): - raise ValueError("Pass a ResourceRecordSet") - self._deletions += (record_set,) - - def _require_client(self, client): - """Check client or verify over-ride. - - :type client: :class:`google.cloud.dns.client.Client` - :param client: - (Optional) the client to use. If not passed, falls back to the - ``client`` stored on the current zone. - - :rtype: :class:`google.cloud.dns.client.Client` - :returns: The client passed in or the currently bound client. - """ - if client is None: - client = self.zone._client - return client - - def _build_resource(self): - """Generate a resource for ``create``.""" - additions = [ - { - "name": added.name, - "type": added.record_type, - "ttl": str(added.ttl), - "rrdatas": added.rrdatas, - } - for added in self.additions - ] - - deletions = [ - { - "name": deleted.name, - "type": deleted.record_type, - "ttl": str(deleted.ttl), - "rrdatas": deleted.rrdatas, - } - for deleted in self.deletions - ] - - return {"additions": additions, "deletions": deletions} - - def create(self, client=None): - """API call: create the change set via a POST request. - - See - https://cloud.google.com/dns/api/v1/changes/create - - :type client: :class:`google.cloud.dns.client.Client` - :param client: - (Optional) the client to use. If not passed, falls back to the - ``client`` stored on the current zone. - """ - if len(self.additions) == 0 and len(self.deletions) == 0: - raise ValueError("No record sets added or deleted") - client = self._require_client(client) - path = "/projects/%s/managedZones/%s/changes" % ( - self.zone.project, - self.zone.name, - ) - api_response = client._connection.api_request( - method="POST", path=path, data=self._build_resource() - ) - self._set_properties(api_response) - - def exists(self, client=None): - """API call: test for the existence of the change set via a GET request. - - See - https://cloud.google.com/dns/api/v1/changes/get - - :type client: :class:`google.cloud.dns.client.Client` - :param client: - (Optional) the client to use. If not passed, falls back to the - ``client`` stored on the current zone. - - :rtype: bool - :returns: Boolean indicating existence of the changes. - """ - client = self._require_client(client) - try: - client._connection.api_request( - method="GET", path=self.path, query_params={"fields": "id"} - ) - except NotFound: - return False - else: - return True - - def reload(self, client=None): - """API call: refresh zone properties via a GET request. - - See - https://cloud.google.com/dns/api/v1/changes/get - - :type client: :class:`google.cloud.dns.client.Client` - :param client: - (Optional) the client to use. If not passed, falls back to the - ``client`` stored on the current zone. - """ - client = self._require_client(client) - - api_response = client._connection.api_request(method="GET", path=self.path) - self._set_properties(api_response) diff --git a/dns/google/cloud/dns/client.py b/dns/google/cloud/dns/client.py deleted file mode 100644 index f1817a3cac2c..000000000000 --- a/dns/google/cloud/dns/client.py +++ /dev/null @@ -1,169 +0,0 @@ -# Copyright 2015 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Client for interacting with the Google Cloud DNS API.""" - -from google.api_core import page_iterator -from google.api_core import client_options as client_options_mod -from google.cloud.client import ClientWithProject - -from google.cloud.dns._http import Connection -from google.cloud.dns.zone import ManagedZone - - -class Client(ClientWithProject): - """Client to bundle configuration needed for API requests. - - :type project: str - :param project: the project which the client acts on behalf of. Will be - passed when creating a zone. If not passed, - falls back to the default inferred from the environment. - - :type credentials: :class:`~google.auth.credentials.Credentials` - :param credentials: (Optional) The OAuth2 Credentials to use for this - client. If not passed (and if no ``_http`` object is - passed), falls back to the default inferred from the - environment. - - :type _http: :class:`~requests.Session` - :param _http: (Optional) HTTP object to make requests. Can be any object - that defines ``request()`` with the same interface as - :meth:`requests.Session.request`. If not passed, an - ``_http`` object is created that is bound to the - ``credentials`` for the current object. - This parameter should be considered private, and could - change in the future. - - :type client_info: :class:`~google.api_core.client_info.ClientInfo` - :param client_info: - The client info used to send a user-agent string along with API - requests. If ``None``, then default info will be used. Generally, - you only need to set this if you're developing your own library - or partner tool. - - :type client_options: :class:`~google.api_core.client_options.ClientOptions` - or :class:`dict` - :param client_options: (Optional) Client options used to set user options - on the client. API Endpoint should be set through client_options. - """ - - SCOPE = ("https://www.googleapis.com/auth/ndev.clouddns.readwrite",) - """The scopes required for authenticating as a Cloud DNS consumer.""" - - def __init__( - self, - project=None, - credentials=None, - _http=None, - client_info=None, - client_options=None, - ): - super(Client, self).__init__( - project=project, credentials=credentials, _http=_http - ) - - kwargs = {"client_info": client_info} - if client_options: - if isinstance(client_options, dict): - client_options = client_options_mod.from_dict(client_options) - - if client_options.api_endpoint: - kwargs["api_endpoint"] = client_options.api_endpoint - - self._connection = Connection(self, **kwargs) - - def quotas(self): - """Return DNS quotas for the project associated with this client. - - See - https://cloud.google.com/dns/api/v1/projects/get - - :rtype: mapping - :returns: keys for the mapping correspond to those of the ``quota`` - sub-mapping of the project resource. - """ - path = "/projects/%s" % (self.project,) - resp = self._connection.api_request(method="GET", path=path) - - return { - key: int(value) for key, value in resp["quota"].items() if key != "kind" - } - - def list_zones(self, max_results=None, page_token=None): - """List zones for the project associated with this client. - - See - https://cloud.google.com/dns/api/v1/managedZones/list - - :type max_results: int - :param max_results: maximum number of zones to return, If not - passed, defaults to a value set by the API. - - :type page_token: str - :param page_token: Optional. If present, return the next batch of - zones, using the value, which must correspond to the - ``nextPageToken`` value returned in the previous response. - Deprecated: use the ``pages`` property of the returned iterator - instead of manually passing the token. - - :rtype: :class:`~google.api_core.page_iterator.Iterator` - :returns: Iterator of :class:`~google.cloud.dns.zone.ManagedZone` - belonging to this project. - """ - path = "/projects/%s/managedZones" % (self.project,) - return page_iterator.HTTPIterator( - client=self, - api_request=self._connection.api_request, - path=path, - item_to_value=_item_to_zone, - items_key="managedZones", - page_token=page_token, - max_results=max_results, - ) - - def zone(self, name, dns_name=None, description=None): - """Construct a zone bound to this client. - - :type name: str - :param name: Name of the zone. - - :type dns_name: str - :param dns_name: - (Optional) DNS name of the zone. If not passed, then calls to - :meth:`zone.create` will fail. - - :type description: str - :param description: - (Optional) the description for the zone. If not passed, defaults - to the value of 'dns_name'. - - :rtype: :class:`google.cloud.dns.zone.ManagedZone` - :returns: a new ``ManagedZone`` instance. - """ - return ManagedZone(name, dns_name, client=self, description=description) - - -def _item_to_zone(iterator, resource): - """Convert a JSON managed zone to the native object. - - :type iterator: :class:`~google.api_core.page_iterator.Iterator` - :param iterator: The iterator that has retrieved the item. - - :type resource: dict - :param resource: An item to be converted to a managed zone. - - :rtype: :class:`.ManagedZone` - :returns: The next managed zone in the page. - """ - return ManagedZone.from_api_repr(resource, iterator.client) diff --git a/dns/google/cloud/dns/resource_record_set.py b/dns/google/cloud/dns/resource_record_set.py deleted file mode 100644 index ebb9310faa83..000000000000 --- a/dns/google/cloud/dns/resource_record_set.py +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 2015 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Define API ResourceRecordSets.""" - - -class ResourceRecordSet(object): - """ResourceRecordSets are DNS resource records. - - RRS are owned by a :class:`google.cloud.dns.zone.ManagedZone` instance. - - See - https://cloud.google.com/dns/api/v1/resourceRecordSets - - :type name: str - :param name: the name of the record set. - - :type record_type: str - :param record_type: the RR type of the zone. - - :type ttl: int - :param ttl: TTL (in seconds) for caching the record sets. - - :type rrdatas: list of string - :param rrdatas: one or more lines containing the resource data. - - :type zone: :class:`google.cloud.dns.zone.ManagedZone` - :param zone: A zone which holds one or more record sets. - """ - - def __init__(self, name, record_type, ttl, rrdatas, zone): - self.name = name - self.record_type = record_type - self.ttl = ttl - self.rrdatas = rrdatas - self.zone = zone - - @classmethod - def from_api_repr(cls, resource, zone): - """Factory: construct a record set given its API representation - - :type resource: dict - :param resource: record sets representation returned from the API - - :type zone: :class:`google.cloud.dns.zone.ManagedZone` - :param zone: A zone which holds one or more record sets. - - :rtype: :class:`google.cloud.dns.zone.ResourceRecordSet` - :returns: RRS parsed from ``resource``. - """ - name = resource["name"] - record_type = resource["type"] - ttl = int(resource["ttl"]) - rrdatas = resource["rrdatas"] - return cls(name, record_type, ttl, rrdatas, zone=zone) diff --git a/dns/google/cloud/dns/zone.py b/dns/google/cloud/dns/zone.py deleted file mode 100644 index fb37f6bdbf6a..000000000000 --- a/dns/google/cloud/dns/zone.py +++ /dev/null @@ -1,428 +0,0 @@ -# Copyright 2015 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Define API ManagedZones.""" - -import six - -from google.api_core import page_iterator -from google.cloud._helpers import _rfc3339_to_datetime -from google.cloud.exceptions import NotFound -from google.cloud.dns.changes import Changes -from google.cloud.dns.resource_record_set import ResourceRecordSet - - -class ManagedZone(object): - """ManagedZones are containers for DNS resource records. - - See - https://cloud.google.com/dns/api/v1/managedZones - - :type name: str - :param name: the name of the zone - - :type dns_name: str - :param dns_name: - (Optional) the DNS name of the zone. If not passed, then calls to - :meth:`create` will fail. - - :type client: :class:`google.cloud.dns.client.Client` - :param client: A client which holds credentials and project configuration - for the zone (which requires a project). - - :type description: str - :param description: - (Optional) the description for the zone. If not passed, defaults to - the value of 'dns_name'. - """ - - def __init__(self, name, dns_name=None, client=None, description=None): - self.name = name - self.dns_name = dns_name - self._client = client - self._properties = {} - if description is None: - description = dns_name - self.description = description - - @classmethod - def from_api_repr(cls, resource, client): - """Factory: construct a zone given its API representation - - :type resource: dict - :param resource: zone resource representation returned from the API - - :type client: :class:`google.cloud.dns.client.Client` - :param client: Client which holds credentials and project - configuration for the zone. - - :rtype: :class:`google.cloud.dns.zone.ManagedZone` - :returns: Zone parsed from ``resource``. - """ - name = resource.get("name") - dns_name = resource.get("dnsName") - if name is None or dns_name is None: - raise KeyError( - "Resource lacks required identity information:" '["name"]["dnsName"]' - ) - zone = cls(name, dns_name, client=client) - zone._set_properties(resource) - return zone - - @property - def project(self): - """Project bound to the zone. - - :rtype: str - :returns: the project (derived from the client). - """ - return self._client.project - - @property - def path(self): - """URL path for the zone's APIs. - - :rtype: str - :returns: the path based on project and dataste name. - """ - return "/projects/%s/managedZones/%s" % (self.project, self.name) - - @property - def created(self): - """Datetime at which the zone was created. - - :rtype: ``datetime.datetime``, or ``NoneType`` - :returns: the creation time (None until set from the server). - """ - return self._properties.get("creationTime") - - @property - def name_servers(self): - """Datetime at which the zone was created. - - :rtype: list of strings, or ``NoneType``. - :returns: the assigned name servers (None until set from the server). - """ - return self._properties.get("nameServers") - - @property - def zone_id(self): - """ID for the zone resource. - - :rtype: str, or ``NoneType`` - :returns: the ID (None until set from the server). - """ - return self._properties.get("id") - - @property - def description(self): - """Description of the zone. - - :rtype: str, or ``NoneType`` - :returns: The description as set by the user, or None (the default). - """ - return self._properties.get("description") - - @description.setter - def description(self, value): - """Update description of the zone. - - :type value: str - :param value: (Optional) new description - - :raises: ValueError for invalid value types. - """ - if not isinstance(value, six.string_types) and value is not None: - raise ValueError("Pass a string, or None") - self._properties["description"] = value - - @property - def name_server_set(self): - """Named set of DNS name servers that all host the same ManagedZones. - - Most users will leave this blank. - - See - https://cloud.google.com/dns/api/v1/managedZones#nameServerSet - - :rtype: str, or ``NoneType`` - :returns: The name as set by the user, or None (the default). - """ - return self._properties.get("nameServerSet") - - @name_server_set.setter - def name_server_set(self, value): - """Update named set of DNS name servers. - - :type value: str - :param value: (Optional) new title - - :raises: ValueError for invalid value types. - """ - if not isinstance(value, six.string_types) and value is not None: - raise ValueError("Pass a string, or None") - self._properties["nameServerSet"] = value - - def resource_record_set(self, name, record_type, ttl, rrdatas): - """Construct a resource record set bound to this zone. - - :type name: str - :param name: Name of the record set. - - :type record_type: str - :param record_type: RR type - - :type ttl: int - :param ttl: TTL for the RR, in seconds - - :type rrdatas: list of string - :param rrdatas: resource data for the RR - - :rtype: :class:`google.cloud.dns.resource_record_set.ResourceRecordSet` - :returns: a new ``ResourceRecordSet`` instance - """ - return ResourceRecordSet(name, record_type, ttl, rrdatas, zone=self) - - def changes(self): - """Construct a change set bound to this zone. - - :rtype: :class:`google.cloud.dns.changes.Changes` - :returns: a new ``Changes`` instance - """ - return Changes(zone=self) - - def _require_client(self, client): - """Check client or verify over-ride. - - :type client: :class:`google.cloud.dns.client.Client` - :param client: - (Optional) the client to use. If not passed, falls back to the - ``client`` stored on the current zone. - - :rtype: :class:`google.cloud.dns.client.Client` - :returns: The client passed in or the currently bound client. - """ - if client is None: - client = self._client - return client - - def _set_properties(self, api_response): - """Update properties from resource in body of ``api_response`` - - :type api_response: dict - :param api_response: response returned from an API call - """ - self._properties.clear() - cleaned = api_response.copy() - self.dns_name = cleaned.pop("dnsName", None) - if "creationTime" in cleaned: - cleaned["creationTime"] = _rfc3339_to_datetime(cleaned["creationTime"]) - self._properties.update(cleaned) - - def _build_resource(self): - """Generate a resource for ``create`` or ``update``.""" - resource = {"name": self.name} - - if self.dns_name is not None: - resource["dnsName"] = self.dns_name - - if self.description is not None: - resource["description"] = self.description - - if self.name_server_set is not None: - resource["nameServerSet"] = self.name_server_set - - return resource - - def create(self, client=None): - """API call: create the zone via a PUT request - - See - https://cloud.google.com/dns/api/v1/managedZones/create - - :type client: :class:`google.cloud.dns.client.Client` - :param client: - (Optional) the client to use. If not passed, falls back to the - ``client`` stored on the current zone. - """ - client = self._require_client(client) - path = "/projects/%s/managedZones" % (self.project,) - api_response = client._connection.api_request( - method="POST", path=path, data=self._build_resource() - ) - self._set_properties(api_response) - - def exists(self, client=None): - """API call: test for the existence of the zone via a GET request - - See - https://cloud.google.com/dns/api/v1/managedZones/get - - :type client: :class:`google.cloud.dns.client.Client` - :param client: - (Optional) the client to use. If not passed, falls back to the - ``client`` stored on the current zone. - - :rtype: bool - :returns: Boolean indicating existence of the managed zone. - """ - client = self._require_client(client) - - try: - client._connection.api_request(method="GET", path=self.path) - except NotFound: - return False - else: - return True - - def reload(self, client=None): - """API call: refresh zone properties via a GET request - - See - https://cloud.google.com/dns/api/v1/managedZones/get - - :type client: :class:`google.cloud.dns.client.Client` - :param client: - (Optional) the client to use. If not passed, falls back to the - ``client`` stored on the current zone. - """ - client = self._require_client(client) - - api_response = client._connection.api_request(method="GET", path=self.path) - self._set_properties(api_response) - - def delete(self, client=None): - """API call: delete the zone via a DELETE request - - See - https://cloud.google.com/dns/api/v1/managedZones/delete - - :type client: :class:`google.cloud.dns.client.Client` - :param client: - (Optional) the client to use. If not passed, falls back to the - ``client`` stored on the current zone. - """ - client = self._require_client(client) - client._connection.api_request(method="DELETE", path=self.path) - - def list_resource_record_sets(self, max_results=None, page_token=None, client=None): - """List resource record sets for this zone. - - See - https://cloud.google.com/dns/api/v1/resourceRecordSets/list - - :type max_results: int - :param max_results: Optional. The maximum number of resource record - sets to return. Defaults to a sensible value - set by the API. - - :type page_token: str - :param page_token: Optional. If present, return the next batch of - resource record sets, using the value, which must correspond to - the ``nextPageToken`` value returned in the previous response. - Deprecated: use the ``pages`` property of the returned iterator - instead of manually passing the token. - - :type client: :class:`google.cloud.dns.client.Client` - :param client: - (Optional) the client to use. If not passed, falls back to the - ``client`` stored on the current zone. - - :rtype: :class:`~google.api_core.page_iterator.Iterator` - :returns: Iterator of :class:`~.resource_record_set.ResourceRecordSet` - belonging to this zone. - """ - client = self._require_client(client) - path = "/projects/%s/managedZones/%s/rrsets" % (self.project, self.name) - iterator = page_iterator.HTTPIterator( - client=client, - api_request=client._connection.api_request, - path=path, - item_to_value=_item_to_resource_record_set, - items_key="rrsets", - page_token=page_token, - max_results=max_results, - ) - iterator.zone = self - return iterator - - def list_changes(self, max_results=None, page_token=None, client=None): - """List change sets for this zone. - - See - https://cloud.google.com/dns/api/v1/resourceRecordSets/list - - :type max_results: int - :param max_results: Optional. The maximum number of change sets - to return. Defaults to a sensible value set by the API. - - :type page_token: str - :param page_token: Optional. If present, return the next batch of - change sets, using the value, which must correspond to the - ``nextPageToken`` value returned in the previous response. - Deprecated: use the ``pages`` property of the returned iterator - instead of manually passing the token. - - :type client: :class:`google.cloud.dns.client.Client` - :param client: - (Optional) the client to use. If not passed, falls back to the - ``client`` stored on the current zone. - - :rtype: :class:`~google.api_core.page_iterator.Iterator` - :returns: Iterator of :class:`~.changes.Changes` - belonging to this zone. - """ - client = self._require_client(client) - path = "/projects/%s/managedZones/%s/changes" % (self.project, self.name) - iterator = page_iterator.HTTPIterator( - client=client, - api_request=client._connection.api_request, - path=path, - item_to_value=_item_to_changes, - items_key="changes", - page_token=page_token, - max_results=max_results, - ) - iterator.zone = self - return iterator - - -def _item_to_resource_record_set(iterator, resource): - """Convert a JSON resource record set value to the native object. - - :type iterator: :class:`~google.api_core.page_iterator.Iterator` - :param iterator: The iterator that has retrieved the item. - - :type resource: dict - :param resource: An item to be converted to a resource record set. - - :rtype: :class:`~.resource_record_set.ResourceRecordSet` - :returns: The next resource record set in the page. - """ - return ResourceRecordSet.from_api_repr(resource, iterator.zone) - - -def _item_to_changes(iterator, resource): - """Convert a JSON "changes" value to the native object. - - :type iterator: :class:`~google.api_core.page_iterator.Iterator` - :param iterator: The iterator that has retrieved the item. - - :type resource: dict - :param resource: An item to be converted to a "changes". - - :rtype: :class:`.Changes` - :returns: The next "changes" in the page. - """ - return Changes.from_api_repr(resource, iterator.zone) diff --git a/dns/noxfile.py b/dns/noxfile.py deleted file mode 100644 index 3d065844f151..000000000000 --- a/dns/noxfile.py +++ /dev/null @@ -1,134 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from __future__ import absolute_import - -import os -import shutil - -import nox - - -LOCAL_DEPS = ( - os.path.join('..', 'api_core'), - os.path.join('..', 'core'), -) - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", "black", *LOCAL_DEPS) - session.run( - "black", - "--check", - "google", - "tests", - "docs", - ) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - Format code to uniform standard. - """ - session.install("black") - session.run( - "black", - "google", - "tests", - "docs", - ) - - -@nox.session(python='3.6') -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install('docutils', 'Pygments') - session.run( - 'python', 'setup.py', 'check', '--restructuredtext', '--strict') - - -def default(session): - """Default unit test session. - - This is intended to be run **without** an interpreter set, so - that the current ``python`` (on the ``PATH``) or the version of - Python corresponding to the ``nox`` binary the ``PATH`` can - run the tests. - """ - # Install all test dependencies, then install local packages in-place. - session.install('mock', 'pytest', 'pytest-cov') - for local_dep in LOCAL_DEPS: - session.install('-e', local_dep) - session.install('-e', '.') - - # Run py.test against the unit tests. - session.run( - 'py.test', - '--quiet', - '--cov=google.cloud.dns', - '--cov=tests.unit', - '--cov-append', - '--cov-config=.coveragerc', - '--cov-report=', - '--cov-fail-under=97', - 'tests/unit', - ) - - -@nox.session(python=['2.7', '3.5', '3.6', '3.7']) -def unit(session): - """Run the unit test suite.""" - - default(session) - - -@nox.session(python='3.6') -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install('coverage', 'pytest-cov') - session.run('coverage', 'report', '--show-missing', '--fail-under=100') - session.run('coverage', 'erase') - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/dns/pylint.config.py b/dns/pylint.config.py deleted file mode 100644 index 5d64b9d2f256..000000000000 --- a/dns/pylint.config.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This module is used to configure gcp-devrel-py-tools run-pylint.""" - -# Library configuration - -# library_additions = {} -# library_replacements = {} - -# Test configuration - -# test_additions = copy.deepcopy(library_additions) -# test_replacements = copy.deepcopy(library_replacements) diff --git a/dns/setup.cfg b/dns/setup.cfg deleted file mode 100644 index 2a9acf13daa9..000000000000 --- a/dns/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[bdist_wheel] -universal = 1 diff --git a/dns/setup.py b/dns/setup.py deleted file mode 100644 index 42ab5422e9ed..000000000000 --- a/dns/setup.py +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import io -import os - -import setuptools - - -# Package metadata. - -name = 'google-cloud-dns' -description = 'Google Cloud DNS API client library' -version = '0.31.0' -# Should be one of: -# 'Development Status :: 3 - Alpha' -# 'Development Status :: 4 - Beta' -# 'Development Status :: 5 - Production/Stable' -release_status = 'Development Status :: 3 - Alpha' -dependencies = [ - "google-cloud-core >= 1.1.0, < 2.0dev", -] -extras = { -} - - -# Setup boilerplate below this line. - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, 'README.rst') -with io.open(readme_filename, encoding='utf-8') as readme_file: - readme = readme_file.read() - -# Only include packages under the 'google' namespace. Do not include tests, -# benchmarks, etc. -packages = [ - package for package in setuptools.find_packages() - if package.startswith('google')] - -# Determine which namespaces are needed. -namespaces = ['google'] -if 'google.cloud' in packages: - namespaces.append('google.cloud') - - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author='Google LLC', - author_email='googleapis-packages@google.com', - license='Apache 2.0', - url='https://github.com/GoogleCloudPlatform/google-cloud-python', - classifiers=[ - release_status, - 'Intended Audience :: Developers', - 'License :: OSI Approved :: Apache Software License', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Operating System :: OS Independent', - 'Topic :: Internet', - ], - platforms='Posix; MacOS X; Windows', - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - extras_require=extras, - python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*', - include_package_data=True, - zip_safe=False, -) diff --git a/dns/tests/__init__.py b/dns/tests/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/dns/tests/unit/__init__.py b/dns/tests/unit/__init__.py deleted file mode 100644 index df379f1e9d88..000000000000 --- a/dns/tests/unit/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/dns/tests/unit/test__http.py b/dns/tests/unit/test__http.py deleted file mode 100644 index f2f034bab695..000000000000 --- a/dns/tests/unit/test__http.py +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright 2015 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import unittest - -import mock - - -class TestConnection(unittest.TestCase): - @staticmethod - def _get_target_class(): - from google.cloud.dns._http import Connection - - return Connection - - def _make_one(self, *args, **kw): - return self._get_target_class()(*args, **kw) - - def test_build_api_url_no_extra_query_params(self): - conn = self._make_one(object()) - URI = "/".join([conn.API_BASE_URL, "dns", conn.API_VERSION, "foo"]) - self.assertEqual(conn.build_api_url("/foo"), URI) - - def test_build_api_url_w_extra_query_params(self): - from six.moves.urllib.parse import parse_qsl - from six.moves.urllib.parse import urlsplit - - conn = self._make_one(object()) - uri = conn.build_api_url("/foo", {"bar": "baz"}) - scheme, netloc, path, qs, _ = urlsplit(uri) - self.assertEqual("%s://%s" % (scheme, netloc), conn.API_BASE_URL) - self.assertEqual(path, "/".join(["", "dns", conn.API_VERSION, "foo"])) - parms = dict(parse_qsl(qs)) - self.assertEqual(parms["bar"], "baz") - - def test_build_api_url_w_custom_endpoint(self): - custom_endpoint = "https://foo-dns.googleapis.com" - conn = self._make_one(object(), api_endpoint=custom_endpoint) - URI = "/".join([custom_endpoint, "dns", conn.API_VERSION, "foo"]) - self.assertEqual(conn.build_api_url("/foo"), URI) - - def test_extra_headers(self): - import requests - from google.cloud import _http as base_http - - http = mock.create_autospec(requests.Session, instance=True) - response = requests.Response() - response.status_code = 200 - response_data = b"brent-spiner" - response._content = response_data - http.request.return_value = response - client = mock.Mock(_http=http, spec=["_http"]) - - conn = self._make_one(client) - req_data = "req-data-boring" - result = conn.api_request("GET", "/rainbow", data=req_data, expect_json=False) - self.assertEqual(result, response_data) - - expected_headers = { - "Accept-Encoding": "gzip", - base_http.CLIENT_INFO_HEADER: conn.user_agent, - "User-Agent": conn.user_agent, - } - expected_uri = conn.build_api_url("/rainbow") - http.request.assert_called_once_with( - data=req_data, - headers=expected_headers, - method="GET", - url=expected_uri, - timeout=None, - ) diff --git a/dns/tests/unit/test_changes.py b/dns/tests/unit/test_changes.py deleted file mode 100644 index 617110889b4f..000000000000 --- a/dns/tests/unit/test_changes.py +++ /dev/null @@ -1,373 +0,0 @@ -# Copyright 2015 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import unittest - - -class TestChanges(unittest.TestCase): - PROJECT = "project" - ZONE_NAME = "example.com" - CHANGES_NAME = "changeset_id" - - @staticmethod - def _get_target_class(): - from google.cloud.dns.changes import Changes - - return Changes - - def _make_one(self, *args, **kw): - return self._get_target_class()(*args, **kw) - - def _setUpConstants(self): - from google.cloud._helpers import UTC - from google.cloud._helpers import _NOW - - self.WHEN = _NOW().replace(tzinfo=UTC) - - def _make_resource(self): - from google.cloud._helpers import _datetime_to_rfc3339 - - when_str = _datetime_to_rfc3339(self.WHEN) - return { - "kind": "dns#change", - "id": self.CHANGES_NAME, - "startTime": when_str, - "status": "done", - "additions": [ - { - "name": "test.example.com", - "type": "CNAME", - "ttl": "3600", - "rrdatas": ["www.example.com"], - } - ], - "deletions": [ - { - "name": "test.example.com", - "type": "CNAME", - "ttl": "86400", - "rrdatas": ["other.example.com"], - } - ], - } - - def _verifyResourceProperties(self, changes, resource, zone): - from google.cloud._helpers import _rfc3339_to_datetime - - self.assertEqual(changes.name, resource["id"]) - started = _rfc3339_to_datetime(resource["startTime"]) - self.assertEqual(changes.started, started) - self.assertEqual(changes.status, resource["status"]) - - r_additions = resource.get("additions", ()) - self.assertEqual(len(changes.additions), len(r_additions)) - for found, expected in zip(changes.additions, r_additions): - self.assertEqual(found.name, expected["name"]) - self.assertEqual(found.record_type, expected["type"]) - self.assertEqual(found.ttl, int(expected["ttl"])) - self.assertEqual(found.rrdatas, expected["rrdatas"]) - self.assertIs(found.zone, zone) - - r_deletions = resource.get("deletions", ()) - self.assertEqual(len(changes.deletions), len(r_deletions)) - for found, expected in zip(changes.deletions, r_deletions): - self.assertEqual(found.name, expected["name"]) - self.assertEqual(found.record_type, expected["type"]) - self.assertEqual(found.ttl, int(expected["ttl"])) - self.assertEqual(found.rrdatas, expected["rrdatas"]) - self.assertIs(found.zone, zone) - - def test_ctor(self): - zone = _Zone() - - changes = self._make_one(zone) - - self.assertIs(changes.zone, zone) - self.assertIsNone(changes.name) - self.assertIsNone(changes.status) - self.assertIsNone(changes.started) - self.assertEqual(list(changes.additions), []) - self.assertEqual(list(changes.deletions), []) - - def test_from_api_repr_missing_additions_deletions(self): - self._setUpConstants() - RESOURCE = self._make_resource() - del RESOURCE["additions"] - del RESOURCE["deletions"] - zone = _Zone() - klass = self._get_target_class() - - changes = klass.from_api_repr(RESOURCE, zone=zone) - - self._verifyResourceProperties(changes, RESOURCE, zone) - - def test_from_api_repr(self): - self._setUpConstants() - RESOURCE = self._make_resource() - zone = _Zone() - klass = self._get_target_class() - - changes = klass.from_api_repr(RESOURCE, zone=zone) - - self._verifyResourceProperties(changes, RESOURCE, zone) - - def test_name_setter_bad_value(self): - zone = _Zone() - changes = self._make_one(zone) - with self.assertRaises(ValueError): - changes.name = 12345 - - def test_name_setter(self): - zone = _Zone() - changes = self._make_one(zone) - changes.name = "NAME" - self.assertEqual(changes.name, "NAME") - - def test_add_record_set_invalid_value(self): - zone = _Zone() - changes = self._make_one(zone) - - with self.assertRaises(ValueError): - changes.add_record_set(object()) - - def test_add_record_set(self): - from google.cloud.dns.resource_record_set import ResourceRecordSet - - zone = _Zone() - changes = self._make_one(zone) - rrs = ResourceRecordSet( - "test.example.com", "CNAME", 3600, ["www.example.com"], zone - ) - changes.add_record_set(rrs) - self.assertEqual(list(changes.additions), [rrs]) - - def test_delete_record_set_invalid_value(self): - zone = _Zone() - changes = self._make_one(zone) - - with self.assertRaises(ValueError): - changes.delete_record_set(object()) - - def test_delete_record_set(self): - from google.cloud.dns.resource_record_set import ResourceRecordSet - - zone = _Zone() - changes = self._make_one(zone) - rrs = ResourceRecordSet( - "test.example.com", "CNAME", 3600, ["www.example.com"], zone - ) - changes.delete_record_set(rrs) - self.assertEqual(list(changes.deletions), [rrs]) - - def test_create_wo_additions_or_deletions(self): - self._setUpConstants() - RESOURCE = self._make_resource() - conn = _Connection(RESOURCE) - client = _Client(project=self.PROJECT, connection=conn) - zone = _Zone(client) - changes = self._make_one(zone) - - with self.assertRaises(ValueError): - changes.create() - - self.assertEqual(len(conn._requested), 0) - - def test_create_w_bound_client(self): - from google.cloud.dns.resource_record_set import ResourceRecordSet - - self._setUpConstants() - RESOURCE = self._make_resource() - PATH = "projects/%s/managedZones/%s/changes" % (self.PROJECT, self.ZONE_NAME) - conn = _Connection(RESOURCE) - client = _Client(project=self.PROJECT, connection=conn) - zone = _Zone(client) - changes = self._make_one(zone) - changes.add_record_set( - ResourceRecordSet( - "test.example.com", "CNAME", 3600, ["www.example.com"], zone - ) - ) - changes.delete_record_set( - ResourceRecordSet( - "test.example.com", "CNAME", 86400, ["other.example.com"], zone - ) - ) - - changes.create() - - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "POST") - self.assertEqual(req["path"], "/%s" % PATH) - SENT = {"additions": RESOURCE["additions"], "deletions": RESOURCE["deletions"]} - self.assertEqual(req["data"], SENT) - self._verifyResourceProperties(changes, RESOURCE, zone) - - def test_create_w_alternate_client(self): - from google.cloud.dns.resource_record_set import ResourceRecordSet - - self._setUpConstants() - RESOURCE = self._make_resource() - PATH = "projects/%s/managedZones/%s/changes" % (self.PROJECT, self.ZONE_NAME) - conn1 = _Connection() - client1 = _Client(project=self.PROJECT, connection=conn1) - conn2 = _Connection(RESOURCE) - client2 = _Client(project=self.PROJECT, connection=conn2) - zone = _Zone(client1) - changes = self._make_one(zone) - changes.add_record_set( - ResourceRecordSet( - "test.example.com", "CNAME", 3600, ["www.example.com"], zone - ) - ) - changes.delete_record_set( - ResourceRecordSet( - "test.example.com", "CNAME", 86400, ["other.example.com"], zone - ) - ) - - changes.create(client=client2) - - self.assertEqual(len(conn1._requested), 0) - self.assertEqual(len(conn2._requested), 1) - req = conn2._requested[0] - self.assertEqual(req["method"], "POST") - self.assertEqual(req["path"], "/%s" % PATH) - SENT = {"additions": RESOURCE["additions"], "deletions": RESOURCE["deletions"]} - self.assertEqual(req["data"], SENT) - self._verifyResourceProperties(changes, RESOURCE, zone) - - def test_exists_miss_w_bound_client(self): - PATH = "projects/%s/managedZones/%s/changes/%s" % ( - self.PROJECT, - self.ZONE_NAME, - self.CHANGES_NAME, - ) - self._setUpConstants() - conn = _Connection() - client = _Client(project=self.PROJECT, connection=conn) - zone = _Zone(client) - changes = self._make_one(zone) - changes.name = self.CHANGES_NAME - - self.assertFalse(changes.exists()) - - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "GET") - self.assertEqual(req["path"], "/%s" % PATH) - self.assertEqual(req["query_params"], {"fields": "id"}) - - def test_exists_hit_w_alternate_client(self): - PATH = "projects/%s/managedZones/%s/changes/%s" % ( - self.PROJECT, - self.ZONE_NAME, - self.CHANGES_NAME, - ) - conn1 = _Connection() - client1 = _Client(project=self.PROJECT, connection=conn1) - conn2 = _Connection({}) - client2 = _Client(project=self.PROJECT, connection=conn2) - zone = _Zone(client1) - changes = self._make_one(zone) - changes.name = self.CHANGES_NAME - - self.assertTrue(changes.exists(client=client2)) - - self.assertEqual(len(conn1._requested), 0) - self.assertEqual(len(conn2._requested), 1) - req = conn2._requested[0] - self.assertEqual(req["method"], "GET") - self.assertEqual(req["path"], "/%s" % PATH) - self.assertEqual(req["query_params"], {"fields": "id"}) - - def test_reload_w_bound_client(self): - PATH = "projects/%s/managedZones/%s/changes/%s" % ( - self.PROJECT, - self.ZONE_NAME, - self.CHANGES_NAME, - ) - self._setUpConstants() - RESOURCE = self._make_resource() - conn = _Connection(RESOURCE) - client = _Client(project=self.PROJECT, connection=conn) - zone = _Zone(client) - changes = self._make_one(zone) - changes.name = self.CHANGES_NAME - - changes.reload() - - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "GET") - self.assertEqual(req["path"], "/%s" % PATH) - self._verifyResourceProperties(changes, RESOURCE, zone) - - def test_reload_w_alternate_client(self): - PATH = "projects/%s/managedZones/%s/changes/%s" % ( - self.PROJECT, - self.ZONE_NAME, - self.CHANGES_NAME, - ) - self._setUpConstants() - RESOURCE = self._make_resource() - conn1 = _Connection() - client1 = _Client(project=self.PROJECT, connection=conn1) - conn2 = _Connection(RESOURCE) - client2 = _Client(project=self.PROJECT, connection=conn2) - zone = _Zone(client1) - changes = self._make_one(zone) - changes.name = self.CHANGES_NAME - - changes.reload(client=client2) - - self.assertEqual(len(conn1._requested), 0) - self.assertEqual(len(conn2._requested), 1) - req = conn2._requested[0] - self.assertEqual(req["method"], "GET") - self.assertEqual(req["path"], "/%s" % PATH) - self._verifyResourceProperties(changes, RESOURCE, zone) - - -class _Zone(object): - def __init__( - self, client=None, project=TestChanges.PROJECT, name=TestChanges.ZONE_NAME - ): - self._client = client - self.project = project - self.name = name - - -class _Client(object): - def __init__(self, project="project", connection=None): - self.project = project - self._connection = connection - - -class _Connection(object): - def __init__(self, *responses): - self._responses = responses - self._requested = [] - - def api_request(self, **kw): - from google.cloud.exceptions import NotFound - - self._requested.append(kw) - - try: - response, self._responses = self._responses[0], self._responses[1:] - except IndexError: - raise NotFound("miss") - else: - return response diff --git a/dns/tests/unit/test_client.py b/dns/tests/unit/test_client.py deleted file mode 100644 index 2d1e274c98d9..000000000000 --- a/dns/tests/unit/test_client.py +++ /dev/null @@ -1,336 +0,0 @@ -# Copyright 2015 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import unittest - -import mock - - -def _make_credentials(): - import google.auth.credentials - - return mock.Mock(spec=google.auth.credentials.Credentials) - - -class TestClient(unittest.TestCase): - - PROJECT = "PROJECT" - ZONE_NAME = "zone-name" - - @staticmethod - def _get_target_class(): - from google.cloud.dns.client import Client - - return Client - - def _make_one(self, *args, **kw): - return self._get_target_class()(*args, **kw) - - def test_ctor_defaults(self): - from google.api_core.client_info import ClientInfo - from google.cloud.dns._http import Connection - - creds = _make_credentials() - http = object() - client = self._make_one(project=self.PROJECT, credentials=creds, _http=http) - self.assertIsInstance(client._connection, Connection) - self.assertIs(client._connection.credentials, creds) - self.assertIs(client._connection.http, http) - self.assertIsInstance(client._connection._client_info, ClientInfo) - self.assertEqual( - client._connection.API_BASE_URL, client._connection.DEFAULT_API_ENDPOINT - ) - - def test_ctor_w_client_info(self): - from google.api_core.client_info import ClientInfo - from google.cloud.dns._http import Connection - - client_info = ClientInfo() - - creds = _make_credentials() - http = object() - client = self._make_one( - project=self.PROJECT, credentials=creds, _http=http, client_info=client_info - ) - self.assertIsInstance(client._connection, Connection) - self.assertIs(client._connection.credentials, creds) - self.assertIs(client._connection.http, http) - self.assertIs(client._connection._client_info, client_info) - - def test_ctor_w_empty_client_options_object(self): - from google.api_core.client_info import ClientInfo - from google.api_core.client_options import ClientOptions - from google.cloud.dns._http import Connection - - creds = _make_credentials() - http = object() - client = self._make_one( - project=self.PROJECT, - credentials=creds, - _http=http, - client_options=ClientOptions(), - ) - self.assertIsInstance(client._connection, Connection) - self.assertIs(client._connection.credentials, creds) - self.assertIs(client._connection.http, http) - self.assertIsInstance(client._connection._client_info, ClientInfo) - self.assertEqual( - client._connection.API_BASE_URL, client._connection.DEFAULT_API_ENDPOINT - ) - - def test_ctor_w_client_options_object(self): - from google.api_core.client_options import ClientOptions - - api_endpoint = "https://foo-dns.googleapis.com" - creds = _make_credentials() - http = object() - client_options = ClientOptions(api_endpoint=api_endpoint) - client = self._make_one( - project=self.PROJECT, - credentials=creds, - _http=http, - client_options=client_options, - ) - self.assertEqual(client._connection.API_BASE_URL, api_endpoint) - - def test_ctor_w_client_options_dict(self): - api_endpoint = "https://foo-dns.googleapis.com" - creds = _make_credentials() - http = object() - client_options = {"api_endpoint": api_endpoint} - client = self._make_one( - project=self.PROJECT, - credentials=creds, - _http=http, - client_options=client_options, - ) - self.assertEqual(client._connection.API_BASE_URL, api_endpoint) - - def test_quotas_defaults(self): - PATH = "projects/%s" % (self.PROJECT,) - MANAGED_ZONES = 1234 - RRS_PER_RRSET = 23 - RRSETS_PER_ZONE = 345 - RRSET_ADDITIONS = 456 - RRSET_DELETIONS = 567 - TOTAL_SIZE = 67890 - DATA = { - "quota": { - "managedZones": str(MANAGED_ZONES), - "resourceRecordsPerRrset": str(RRS_PER_RRSET), - "rrsetsPerManagedZone": str(RRSETS_PER_ZONE), - "rrsetAdditionsPerChange": str(RRSET_ADDITIONS), - "rrsetDeletionsPerChange": str(RRSET_DELETIONS), - "totalRrdataSizePerChange": str(TOTAL_SIZE), - } - } - CONVERTED = {key: int(value) for key, value in DATA["quota"].items()} - creds = _make_credentials() - client = self._make_one(self.PROJECT, creds) - conn = client._connection = _Connection(DATA) - - quotas = client.quotas() - - self.assertEqual(quotas, CONVERTED) - - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "GET") - self.assertEqual(req["path"], "/%s" % PATH) - - def test_quotas_w_kind_key(self): - PATH = "projects/%s" % (self.PROJECT,) - MANAGED_ZONES = 1234 - RRS_PER_RRSET = 23 - RRSETS_PER_ZONE = 345 - RRSET_ADDITIONS = 456 - RRSET_DELETIONS = 567 - TOTAL_SIZE = 67890 - DATA = { - "quota": { - "managedZones": str(MANAGED_ZONES), - "resourceRecordsPerRrset": str(RRS_PER_RRSET), - "rrsetsPerManagedZone": str(RRSETS_PER_ZONE), - "rrsetAdditionsPerChange": str(RRSET_ADDITIONS), - "rrsetDeletionsPerChange": str(RRSET_DELETIONS), - "totalRrdataSizePerChange": str(TOTAL_SIZE), - } - } - CONVERTED = {key: int(value) for key, value in DATA["quota"].items()} - WITH_KIND = {"quota": DATA["quota"].copy()} - WITH_KIND["quota"]["kind"] = "dns#quota" - creds = _make_credentials() - client = self._make_one(self.PROJECT, creds) - conn = client._connection = _Connection(WITH_KIND) - - quotas = client.quotas() - - self.assertEqual(quotas, CONVERTED) - - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "GET") - self.assertEqual(req["path"], "/%s" % PATH) - - def test_list_zones_defaults(self): - import six - from google.cloud.dns.zone import ManagedZone - - ID_1 = "123" - ZONE_1 = "zone_one" - DNS_1 = "one.example.com" - ID_2 = "234" - ZONE_2 = "zone_two" - DNS_2 = "two.example.com" - PATH = "projects/%s/managedZones" % (self.PROJECT,) - TOKEN = "TOKEN" - DATA = { - "nextPageToken": TOKEN, - "managedZones": [ - { - "kind": "dns#managedZone", - "id": ID_1, - "name": ZONE_1, - "dnsName": DNS_1, - }, - { - "kind": "dns#managedZone", - "id": ID_2, - "name": ZONE_2, - "dnsName": DNS_2, - }, - ], - } - creds = _make_credentials() - client = self._make_one(self.PROJECT, creds) - conn = client._connection = _Connection(DATA) - - iterator = client.list_zones() - page = six.next(iterator.pages) - zones = list(page) - token = iterator.next_page_token - - self.assertEqual(len(zones), len(DATA["managedZones"])) - for found, expected in zip(zones, DATA["managedZones"]): - self.assertIsInstance(found, ManagedZone) - self.assertEqual(found.zone_id, expected["id"]) - self.assertEqual(found.name, expected["name"]) - self.assertEqual(found.dns_name, expected["dnsName"]) - self.assertEqual(token, TOKEN) - - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "GET") - self.assertEqual(req["path"], "/%s" % PATH) - - def test_list_zones_explicit(self): - import six - from google.cloud.dns.zone import ManagedZone - - ID_1 = "123" - ZONE_1 = "zone_one" - DNS_1 = "one.example.com" - ID_2 = "234" - ZONE_2 = "zone_two" - DNS_2 = "two.example.com" - PATH = "projects/%s/managedZones" % (self.PROJECT,) - TOKEN = "TOKEN" - DATA = { - "managedZones": [ - { - "kind": "dns#managedZone", - "id": ID_1, - "name": ZONE_1, - "dnsName": DNS_1, - }, - { - "kind": "dns#managedZone", - "id": ID_2, - "name": ZONE_2, - "dnsName": DNS_2, - }, - ] - } - creds = _make_credentials() - client = self._make_one(self.PROJECT, creds) - conn = client._connection = _Connection(DATA) - - iterator = client.list_zones(max_results=3, page_token=TOKEN) - page = six.next(iterator.pages) - zones = list(page) - token = iterator.next_page_token - - self.assertEqual(len(zones), len(DATA["managedZones"])) - for found, expected in zip(zones, DATA["managedZones"]): - self.assertIsInstance(found, ManagedZone) - self.assertEqual(found.zone_id, expected["id"]) - self.assertEqual(found.name, expected["name"]) - self.assertEqual(found.dns_name, expected["dnsName"]) - self.assertIsNone(token) - - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "GET") - self.assertEqual(req["path"], "/%s" % PATH) - self.assertEqual(req["query_params"], {"maxResults": 3, "pageToken": TOKEN}) - - def test_zone_explicit(self): - from google.cloud.dns.zone import ManagedZone - - DESCRIPTION = "DESCRIPTION" - DNS_NAME = "test.example.com" - creds = _make_credentials() - client = self._make_one(self.PROJECT, creds) - zone = client.zone(self.ZONE_NAME, DNS_NAME, DESCRIPTION) - self.assertIsInstance(zone, ManagedZone) - self.assertEqual(zone.name, self.ZONE_NAME) - self.assertEqual(zone.dns_name, DNS_NAME) - self.assertEqual(zone.description, DESCRIPTION) - self.assertIs(zone._client, client) - - def test_zone_w_dns_name_wo_description(self): - from google.cloud.dns.zone import ManagedZone - - DNS_NAME = "test.example.com" - creds = _make_credentials() - client = self._make_one(self.PROJECT, creds) - zone = client.zone(self.ZONE_NAME, DNS_NAME) - self.assertIsInstance(zone, ManagedZone) - self.assertEqual(zone.name, self.ZONE_NAME) - self.assertEqual(zone.dns_name, DNS_NAME) - self.assertEqual(zone.description, DNS_NAME) - self.assertIs(zone._client, client) - - def test_zone_wo_dns_name(self): - from google.cloud.dns.zone import ManagedZone - - creds = _make_credentials() - client = self._make_one(self.PROJECT, creds) - zone = client.zone(self.ZONE_NAME) - self.assertIsInstance(zone, ManagedZone) - self.assertEqual(zone.name, self.ZONE_NAME) - self.assertIsNone(zone.dns_name) - self.assertIsNone(zone.description) - self.assertIs(zone._client, client) - - -class _Connection(object): - def __init__(self, *responses): - self._responses = responses - self._requested = [] - - def api_request(self, **kw): - self._requested.append(kw) - response, self._responses = self._responses[0], self._responses[1:] - return response diff --git a/dns/tests/unit/test_resource_record_set.py b/dns/tests/unit/test_resource_record_set.py deleted file mode 100644 index d0869d27bdb6..000000000000 --- a/dns/tests/unit/test_resource_record_set.py +++ /dev/null @@ -1,107 +0,0 @@ -# Copyright 2015 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import unittest - - -class TestResourceRecordSet(unittest.TestCase): - @staticmethod - def _get_target_class(): - from google.cloud.dns.resource_record_set import ResourceRecordSet - - return ResourceRecordSet - - def _make_one(self, *args, **kw): - return self._get_target_class()(*args, **kw) - - def test_ctor(self): - zone = _Zone() - - rrs = self._make_one( - "test.example.com", "CNAME", 3600, ["www.example.com"], zone - ) - - self.assertEqual(rrs.name, "test.example.com") - self.assertEqual(rrs.record_type, "CNAME") - self.assertEqual(rrs.ttl, 3600) - self.assertEqual(rrs.rrdatas, ["www.example.com"]) - self.assertIs(rrs.zone, zone) - - def test_from_api_repr_missing_rrdatas(self): - zone = _Zone() - klass = self._get_target_class() - - with self.assertRaises(KeyError): - klass.from_api_repr( - {"name": "test.example.com", "type": "CNAME", "ttl": 3600}, zone=zone - ) - - def test_from_api_repr_missing_ttl(self): - zone = _Zone() - klass = self._get_target_class() - - with self.assertRaises(KeyError): - klass.from_api_repr( - { - "name": "test.example.com", - "type": "CNAME", - "rrdatas": ["www.example.com"], - }, - zone=zone, - ) - - def test_from_api_repr_missing_type(self): - zone = _Zone() - klass = self._get_target_class() - - with self.assertRaises(KeyError): - klass.from_api_repr( - { - "name": "test.example.com", - "ttl": 3600, - "rrdatas": ["www.example.com"], - }, - zone=zone, - ) - - def test_from_api_repr_missing_name(self): - zone = _Zone() - klass = self._get_target_class() - - with self.assertRaises(KeyError): - klass.from_api_repr( - {"type": "CNAME", "ttl": 3600, "rrdatas": ["www.example.com"]}, - zone=zone, - ) - - def test_from_api_repr_bare(self): - zone = _Zone() - RESOURCE = { - "kind": "dns#resourceRecordSet", - "name": "test.example.com", - "type": "CNAME", - "ttl": "3600", - "rrdatas": ["www.example.com"], - } - klass = self._get_target_class() - rrs = klass.from_api_repr(RESOURCE, zone=zone) - self.assertEqual(rrs.name, "test.example.com") - self.assertEqual(rrs.record_type, "CNAME") - self.assertEqual(rrs.ttl, 3600) - self.assertEqual(rrs.rrdatas, ["www.example.com"]) - self.assertIs(rrs.zone, zone) - - -class _Zone(object): - pass diff --git a/dns/tests/unit/test_zone.py b/dns/tests/unit/test_zone.py deleted file mode 100644 index 21d55bcc1b65..000000000000 --- a/dns/tests/unit/test_zone.py +++ /dev/null @@ -1,707 +0,0 @@ -# Copyright 2015 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import unittest - - -class TestManagedZone(unittest.TestCase): - PROJECT = "project" - ZONE_NAME = "zone-name" - DESCRIPTION = "ZONE DESCRIPTION" - DNS_NAME = "test.example.com" - - @staticmethod - def _get_target_class(): - from google.cloud.dns.zone import ManagedZone - - return ManagedZone - - def _make_one(self, *args, **kw): - return self._get_target_class()(*args, **kw) - - def _setUpConstants(self): - import datetime - from google.cloud._helpers import UTC - - year = 2015 - month = 7 - day = 24 - hour = 19 - minute = 53 - seconds = 19 - micros = 6000 - - self.WHEN_STR = "%d-%02d-%02dT%02d:%02d:%02d.%06dZ" % ( - year, - month, - day, - hour, - minute, - seconds, - micros, - ) - self.WHEN = datetime.datetime( - year, month, day, hour, minute, seconds, micros, tzinfo=UTC - ) - self.ZONE_ID = 12345 - - def _make_resource(self): - self._setUpConstants() - return { - "name": self.ZONE_NAME, - "dnsName": self.DNS_NAME, - "description": self.DESCRIPTION, - "id": self.ZONE_ID, - "creationTime": self.WHEN_STR, - "nameServers": [ - "ns-cloud1.googledomains.com", - "ns-cloud2.googledomains.com", - ], - } - - def _verifyReadonlyResourceProperties(self, zone, resource): - self.assertEqual(zone.zone_id, resource.get("id")) - - if "creationTime" in resource: - self.assertEqual(zone.created, self.WHEN) - else: - self.assertIsNone(zone.created) - - if "nameServers" in resource: - self.assertEqual(zone.name_servers, resource["nameServers"]) - else: - self.assertIsNone(zone.name_servers) - - def _verifyResourceProperties(self, zone, resource): - self._verifyReadonlyResourceProperties(zone, resource) - - self.assertEqual(zone.name, resource.get("name")) - self.assertEqual(zone.dns_name, resource.get("dnsName")) - self.assertEqual(zone.description, resource.get("description")) - self.assertEqual(zone.zone_id, resource.get("id")) - self.assertEqual(zone.name_server_set, resource.get("nameServerSet")) - - def test_ctor_defaults(self): - zone = self._make_one(self.ZONE_NAME) - self.assertEqual(zone.name, self.ZONE_NAME) - self.assertIsNone(zone.dns_name) - self.assertIsNone(zone._client) - - with self.assertRaises(AttributeError): - (zone.project) - - with self.assertRaises(AttributeError): - (zone.path) - - self.assertIsNone(zone.zone_id) - self.assertIsNone(zone.created) - self.assertIsNone(zone.description) - - def test_ctor_wo_description(self): - client = _Client(self.PROJECT) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client) - self.assertEqual(zone.name, self.ZONE_NAME) - self.assertEqual(zone.dns_name, self.DNS_NAME) - self.assertIs(zone._client, client) - self.assertEqual(zone.project, client.project) - self.assertEqual( - zone.path, "/projects/%s/managedZones/%s" % (self.PROJECT, self.ZONE_NAME) - ) - self.assertIsNone(zone.zone_id) - self.assertIsNone(zone.created) - self.assertEqual(zone.description, self.DNS_NAME) - - def test_ctor_explicit(self): - DESCRIPTION = "DESCRIPTION" - client = _Client(self.PROJECT) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client, DESCRIPTION) - self.assertEqual(zone.name, self.ZONE_NAME) - self.assertEqual(zone.dns_name, self.DNS_NAME) - self.assertIs(zone._client, client) - self.assertEqual(zone.project, client.project) - self.assertEqual( - zone.path, "/projects/%s/managedZones/%s" % (self.PROJECT, self.ZONE_NAME) - ) - self.assertIsNone(zone.zone_id) - self.assertIsNone(zone.created) - self.assertEqual(zone.description, DESCRIPTION) - - def test_from_api_repr_missing_identity(self): - self._setUpConstants() - client = _Client(self.PROJECT) - RESOURCE = {} - klass = self._get_target_class() - with self.assertRaises(KeyError): - klass.from_api_repr(RESOURCE, client=client) - - def test_from_api_repr_bare(self): - self._setUpConstants() - client = _Client(self.PROJECT) - RESOURCE = {"name": self.ZONE_NAME, "dnsName": self.DNS_NAME} - klass = self._get_target_class() - zone = klass.from_api_repr(RESOURCE, client=client) - self.assertIs(zone._client, client) - self._verifyResourceProperties(zone, RESOURCE) - - def test_from_api_repr_w_properties(self): - self._setUpConstants() - client = _Client(self.PROJECT) - RESOURCE = self._make_resource() - klass = self._get_target_class() - zone = klass.from_api_repr(RESOURCE, client=client) - self.assertIs(zone._client, client) - self._verifyResourceProperties(zone, RESOURCE) - - def test_description_setter_bad_value(self): - client = _Client(self.PROJECT) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client) - with self.assertRaises(ValueError): - zone.description = 12345 - - def test_description_setter(self): - client = _Client(self.PROJECT) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client) - zone.description = "DESCRIPTION" - self.assertEqual(zone.description, "DESCRIPTION") - - def test_name_server_set_setter_bad_value(self): - client = _Client(self.PROJECT) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client) - with self.assertRaises(ValueError): - zone.name_server_set = 12345 - - def test_name_server_set_setter(self): - client = _Client(self.PROJECT) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client) - zone.name_server_set = "NAME_SERVER_SET" - self.assertEqual(zone.name_server_set, "NAME_SERVER_SET") - - def test_resource_record_set(self): - from google.cloud.dns.resource_record_set import ResourceRecordSet - - RRS_NAME = "other.example.com" - RRS_TYPE = "CNAME" - TTL = 3600 - RRDATAS = ["www.example.com"] - client = _Client(self.PROJECT) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client) - rrs = zone.resource_record_set(RRS_NAME, RRS_TYPE, TTL, RRDATAS) - self.assertIsInstance(rrs, ResourceRecordSet) - self.assertEqual(rrs.name, RRS_NAME) - self.assertEqual(rrs.record_type, RRS_TYPE) - self.assertEqual(rrs.ttl, TTL) - self.assertEqual(rrs.rrdatas, RRDATAS) - self.assertIs(rrs.zone, zone) - - def test_changes(self): - from google.cloud.dns.changes import Changes - - client = _Client(self.PROJECT) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client) - changes = zone.changes() - self.assertIsInstance(changes, Changes) - self.assertIs(changes.zone, zone) - - def test_create_w_bound_client(self): - PATH = "projects/%s/managedZones" % self.PROJECT - RESOURCE = self._make_resource() - conn = _Connection(RESOURCE) - client = _Client(project=self.PROJECT, connection=conn) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client) - - zone.create() - - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "POST") - self.assertEqual(req["path"], "/%s" % PATH) - SENT = { - "name": self.ZONE_NAME, - "dnsName": self.DNS_NAME, - "description": self.DNS_NAME, - } - self.assertEqual(req["data"], SENT) - self._verifyResourceProperties(zone, RESOURCE) - - def test_create_w_alternate_client(self): - PATH = "projects/%s/managedZones" % self.PROJECT - DESCRIPTION = "DESCRIPTION" - NAME_SERVER_SET = "NAME_SERVER_SET" - RESOURCE = self._make_resource() - RESOURCE["nameServerSet"] = NAME_SERVER_SET - RESOURCE["description"] = DESCRIPTION - conn1 = _Connection() - client1 = _Client(project=self.PROJECT, connection=conn1) - conn2 = _Connection(RESOURCE) - client2 = _Client(project=self.PROJECT, connection=conn2) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client1) - zone.name_server_set = NAME_SERVER_SET - zone.description = DESCRIPTION - - zone.create(client=client2) - - self.assertEqual(len(conn1._requested), 0) - self.assertEqual(len(conn2._requested), 1) - req = conn2._requested[0] - self.assertEqual(req["method"], "POST") - self.assertEqual(req["path"], "/%s" % PATH) - SENT = { - "name": self.ZONE_NAME, - "dnsName": self.DNS_NAME, - "nameServerSet": NAME_SERVER_SET, - "description": DESCRIPTION, - } - self.assertEqual(req["data"], SENT) - self._verifyResourceProperties(zone, RESOURCE) - - def test_create_wo_dns_name_or_description(self): - from google.cloud.exceptions import BadRequest - - PATH = "projects/%s/managedZones" % self.PROJECT - - _requested = [] - - def _api_request(**kw): - _requested.append(kw) - raise BadRequest("missing dns_name / description") - - conn = _Connection() - conn.api_request = _api_request - client = _Client(project=self.PROJECT, connection=conn) - zone = self._make_one(self.ZONE_NAME, client=client) - - with self.assertRaises(BadRequest): - zone.create() - - self.assertEqual(len(_requested), 1) - req = _requested[0] - self.assertEqual(req["method"], "POST") - self.assertEqual(req["path"], "/%s" % PATH) - SENT = {"name": self.ZONE_NAME} - self.assertEqual(req["data"], SENT) - - def test_create_w_missing_output_properties(self): - # In the wild, the resource returned from 'zone.create' sometimes - # lacks 'creationTime' / 'lastModifiedTime' - PATH = "projects/%s/managedZones" % (self.PROJECT,) - RESOURCE = self._make_resource() - del RESOURCE["creationTime"] - del RESOURCE["id"] - del RESOURCE["nameServers"] - self.WHEN = None - conn = _Connection(RESOURCE) - client = _Client(project=self.PROJECT, connection=conn) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client) - - zone.create() - - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "POST") - self.assertEqual(req["path"], "/%s" % PATH) - SENT = { - "name": self.ZONE_NAME, - "dnsName": self.DNS_NAME, - "description": self.DNS_NAME, - } - self.assertEqual(req["data"], SENT) - self._verifyResourceProperties(zone, RESOURCE) - - def test_exists_miss_w_bound_client(self): - PATH = "projects/%s/managedZones/%s" % (self.PROJECT, self.ZONE_NAME) - conn = _Connection() - client = _Client(project=self.PROJECT, connection=conn) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client) - - self.assertFalse(zone.exists()) - - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "GET") - self.assertEqual(req["path"], "/%s" % PATH) - - def test_exists_hit_w_alternate_client(self): - PATH = "projects/%s/managedZones/%s" % (self.PROJECT, self.ZONE_NAME) - conn1 = _Connection() - client1 = _Client(project=self.PROJECT, connection=conn1) - conn2 = _Connection({}) - client2 = _Client(project=self.PROJECT, connection=conn2) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client1) - - self.assertTrue(zone.exists(client=client2)) - - self.assertEqual(len(conn1._requested), 0) - self.assertEqual(len(conn2._requested), 1) - req = conn2._requested[0] - self.assertEqual(req["method"], "GET") - self.assertEqual(req["path"], "/%s" % PATH) - - def test_reload_w_bound_client(self): - PATH = "projects/%s/managedZones/%s" % (self.PROJECT, self.ZONE_NAME) - RESOURCE = self._make_resource() - conn = _Connection(RESOURCE) - client = _Client(project=self.PROJECT, connection=conn) - zone = self._make_one(self.ZONE_NAME, client=client) - - zone.reload() - - self.assertEqual(zone.dns_name, self.DNS_NAME) - - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "GET") - self.assertEqual(req["path"], "/%s" % PATH) - self._verifyResourceProperties(zone, RESOURCE) - - def test_reload_w_alternate_client(self): - PATH = "projects/%s/managedZones/%s" % (self.PROJECT, self.ZONE_NAME) - RESOURCE = self._make_resource() - conn1 = _Connection() - client1 = _Client(project=self.PROJECT, connection=conn1) - conn2 = _Connection(RESOURCE) - client2 = _Client(project=self.PROJECT, connection=conn2) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client1) - - zone.reload(client=client2) - - self.assertEqual(len(conn1._requested), 0) - self.assertEqual(len(conn2._requested), 1) - req = conn2._requested[0] - self.assertEqual(req["method"], "GET") - self.assertEqual(req["path"], "/%s" % PATH) - self._verifyResourceProperties(zone, RESOURCE) - - def test_delete_w_bound_client(self): - PATH = "projects/%s/managedZones/%s" % (self.PROJECT, self.ZONE_NAME) - conn = _Connection({}) - client = _Client(project=self.PROJECT, connection=conn) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client) - - zone.delete() - - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "DELETE") - self.assertEqual(req["path"], "/%s" % PATH) - - def test_delete_w_alternate_client(self): - PATH = "projects/%s/managedZones/%s" % (self.PROJECT, self.ZONE_NAME) - conn1 = _Connection() - client1 = _Client(project=self.PROJECT, connection=conn1) - conn2 = _Connection({}) - client2 = _Client(project=self.PROJECT, connection=conn2) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client1) - - zone.delete(client=client2) - - self.assertEqual(len(conn1._requested), 0) - self.assertEqual(len(conn2._requested), 1) - req = conn2._requested[0] - self.assertEqual(req["method"], "DELETE") - self.assertEqual(req["path"], "/%s" % PATH) - - def test_list_resource_record_sets_defaults(self): - import six - from google.cloud.dns.resource_record_set import ResourceRecordSet - - PATH = "projects/%s/managedZones/%s/rrsets" % (self.PROJECT, self.ZONE_NAME) - TOKEN = "TOKEN" - NAME_1 = "www.example.com" - TYPE_1 = "A" - TTL_1 = "86400" - RRDATAS_1 = ["123.45.67.89"] - NAME_2 = "alias.example.com" - TYPE_2 = "CNAME" - TTL_2 = "3600" - RRDATAS_2 = ["www.example.com"] - DATA = { - "nextPageToken": TOKEN, - "rrsets": [ - { - "kind": "dns#resourceRecordSet", - "name": NAME_1, - "type": TYPE_1, - "ttl": TTL_1, - "rrdatas": RRDATAS_1, - }, - { - "kind": "dns#resourceRecordSet", - "name": NAME_2, - "type": TYPE_2, - "ttl": TTL_2, - "rrdatas": RRDATAS_2, - }, - ], - } - conn = _Connection(DATA) - client = _Client(project=self.PROJECT, connection=conn) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client) - - iterator = zone.list_resource_record_sets() - self.assertIs(zone, iterator.zone) - page = six.next(iterator.pages) - rrsets = list(page) - token = iterator.next_page_token - - self.assertEqual(len(rrsets), len(DATA["rrsets"])) - for found, expected in zip(rrsets, DATA["rrsets"]): - self.assertIsInstance(found, ResourceRecordSet) - self.assertEqual(found.name, expected["name"]) - self.assertEqual(found.record_type, expected["type"]) - self.assertEqual(found.ttl, int(expected["ttl"])) - self.assertEqual(found.rrdatas, expected["rrdatas"]) - self.assertEqual(token, TOKEN) - - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "GET") - self.assertEqual(req["path"], "/%s" % PATH) - - def test_list_resource_record_sets_explicit(self): - import six - from google.cloud.dns.resource_record_set import ResourceRecordSet - - PATH = "projects/%s/managedZones/%s/rrsets" % (self.PROJECT, self.ZONE_NAME) - TOKEN = "TOKEN" - NAME_1 = "www.example.com" - TYPE_1 = "A" - TTL_1 = "86400" - RRDATAS_1 = ["123.45.67.89"] - NAME_2 = "alias.example.com" - TYPE_2 = "CNAME" - TTL_2 = "3600" - RRDATAS_2 = ["www.example.com"] - DATA = { - "rrsets": [ - { - "kind": "dns#resourceRecordSet", - "name": NAME_1, - "type": TYPE_1, - "ttl": TTL_1, - "rrdatas": RRDATAS_1, - }, - { - "kind": "dns#resourceRecordSet", - "name": NAME_2, - "type": TYPE_2, - "ttl": TTL_2, - "rrdatas": RRDATAS_2, - }, - ] - } - conn1 = _Connection() - client1 = _Client(project=self.PROJECT, connection=conn1) - conn2 = _Connection(DATA) - client2 = _Client(project=self.PROJECT, connection=conn2) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client1) - - iterator = zone.list_resource_record_sets( - max_results=3, page_token=TOKEN, client=client2 - ) - self.assertIs(zone, iterator.zone) - page = six.next(iterator.pages) - rrsets = list(page) - token = iterator.next_page_token - - self.assertEqual(len(rrsets), len(DATA["rrsets"])) - for found, expected in zip(rrsets, DATA["rrsets"]): - self.assertIsInstance(found, ResourceRecordSet) - self.assertEqual(found.name, expected["name"]) - self.assertEqual(found.record_type, expected["type"]) - self.assertEqual(found.ttl, int(expected["ttl"])) - self.assertEqual(found.rrdatas, expected["rrdatas"]) - self.assertIsNone(token) - - self.assertEqual(len(conn1._requested), 0) - self.assertEqual(len(conn2._requested), 1) - req = conn2._requested[0] - self.assertEqual(req["method"], "GET") - self.assertEqual(req["path"], "/%s" % PATH) - self.assertEqual(req["query_params"], {"maxResults": 3, "pageToken": TOKEN}) - - def _get_changes(self, token, changes_name): - from google.cloud._helpers import _datetime_to_rfc3339 - - name_1 = "www.example.com" - type_1 = "A" - ttl_1 = "86400" - rrdatas_1 = ["123.45.67.89"] - name_2 = "alias.example.com" - type_2 = "CNAME" - ttl_2 = "3600" - rrdatas_2 = ["www.example.com"] - result = { - "changes": [ - { - "kind": "dns#change", - "id": changes_name, - "status": "pending", - "startTime": _datetime_to_rfc3339(self.WHEN), - "additions": [ - { - "kind": "dns#resourceRecordSet", - "name": name_1, - "type": type_1, - "ttl": ttl_1, - "rrdatas": rrdatas_1, - } - ], - "deletions": [ - { - "kind": "dns#change", - "name": name_2, - "type": type_2, - "ttl": ttl_2, - "rrdatas": rrdatas_2, - } - ], - } - ] - } - if token is not None: - result["nextPageToken"] = token - return result - - def test_list_changes_defaults(self): - import six - from google.cloud.dns.changes import Changes - from google.cloud.dns.resource_record_set import ResourceRecordSet - - self._setUpConstants() - path = "projects/%s/managedZones/%s/changes" % (self.PROJECT, self.ZONE_NAME) - token = "TOKEN" - changes_name = "changeset_id" - data = self._get_changes(token, changes_name) - - conn = _Connection(data) - client = _Client(project=self.PROJECT, connection=conn) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client) - - iterator = zone.list_changes() - self.assertIs(zone, iterator.zone) - page = six.next(iterator.pages) - changes = list(page) - token = iterator.next_page_token - - self.assertEqual(len(changes), len(data["changes"])) - for found, expected in zip(changes, data["changes"]): - self.assertIsInstance(found, Changes) - self.assertEqual(found.name, changes_name) - self.assertEqual(found.status, "pending") - self.assertEqual(found.started, self.WHEN) - - self.assertEqual(len(found.additions), len(expected["additions"])) - for found_rr, expected_rr in zip(found.additions, expected["additions"]): - self.assertIsInstance(found_rr, ResourceRecordSet) - self.assertEqual(found_rr.name, expected_rr["name"]) - self.assertEqual(found_rr.record_type, expected_rr["type"]) - self.assertEqual(found_rr.ttl, int(expected_rr["ttl"])) - self.assertEqual(found_rr.rrdatas, expected_rr["rrdatas"]) - - self.assertEqual(len(found.deletions), len(expected["deletions"])) - for found_rr, expected_rr in zip(found.deletions, expected["deletions"]): - self.assertIsInstance(found_rr, ResourceRecordSet) - self.assertEqual(found_rr.name, expected_rr["name"]) - self.assertEqual(found_rr.record_type, expected_rr["type"]) - self.assertEqual(found_rr.ttl, int(expected_rr["ttl"])) - self.assertEqual(found_rr.rrdatas, expected_rr["rrdatas"]) - - self.assertEqual(token, token) - - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "GET") - self.assertEqual(req["path"], "/%s" % (path,)) - - def test_list_changes_explicit(self): - import six - from google.cloud.dns.changes import Changes - from google.cloud.dns.resource_record_set import ResourceRecordSet - - self._setUpConstants() - path = "projects/%s/managedZones/%s/changes" % (self.PROJECT, self.ZONE_NAME) - changes_name = "changeset_id" - data = self._get_changes(None, changes_name) - conn1 = _Connection() - client1 = _Client(project=self.PROJECT, connection=conn1) - conn2 = _Connection(data) - client2 = _Client(project=self.PROJECT, connection=conn2) - zone = self._make_one(self.ZONE_NAME, self.DNS_NAME, client1) - - page_token = "TOKEN" - iterator = zone.list_changes( - max_results=3, page_token=page_token, client=client2 - ) - self.assertIs(zone, iterator.zone) - page = six.next(iterator.pages) - changes = list(page) - token = iterator.next_page_token - - self.assertEqual(len(changes), len(data["changes"])) - for found, expected in zip(changes, data["changes"]): - self.assertIsInstance(found, Changes) - self.assertEqual(found.name, changes_name) - self.assertEqual(found.status, "pending") - self.assertEqual(found.started, self.WHEN) - - self.assertEqual(len(found.additions), len(expected["additions"])) - for found_rr, expected_rr in zip(found.additions, expected["additions"]): - self.assertIsInstance(found_rr, ResourceRecordSet) - self.assertEqual(found_rr.name, expected_rr["name"]) - self.assertEqual(found_rr.record_type, expected_rr["type"]) - self.assertEqual(found_rr.ttl, int(expected_rr["ttl"])) - self.assertEqual(found_rr.rrdatas, expected_rr["rrdatas"]) - - self.assertEqual(len(found.deletions), len(expected["deletions"])) - for found_rr, expected_rr in zip(found.deletions, expected["deletions"]): - self.assertIsInstance(found_rr, ResourceRecordSet) - self.assertEqual(found_rr.name, expected_rr["name"]) - self.assertEqual(found_rr.record_type, expected_rr["type"]) - self.assertEqual(found_rr.ttl, int(expected_rr["ttl"])) - self.assertEqual(found_rr.rrdatas, expected_rr["rrdatas"]) - - self.assertIsNone(token) - - self.assertEqual(len(conn1._requested), 0) - self.assertEqual(len(conn2._requested), 1) - req = conn2._requested[0] - self.assertEqual(req["method"], "GET") - self.assertEqual(req["path"], "/%s" % (path,)) - self.assertEqual( - req["query_params"], {"maxResults": 3, "pageToken": page_token} - ) - - -class _Client(object): - def __init__(self, project="project", connection=None): - self.project = project - self._connection = connection - - -class _Connection(object): - def __init__(self, *responses): - self._responses = responses - self._requested = [] - - def api_request(self, **kw): - from google.cloud.exceptions import NotFound - - self._requested.append(kw) - - try: - response, self._responses = self._responses[0], self._responses[1:] - except IndexError: - raise NotFound("miss") - else: - return response diff --git a/documentai/.coveragerc b/documentai/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/documentai/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/documentai/.flake8 b/documentai/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/documentai/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/documentai/.repo-metadata.json b/documentai/.repo-metadata.json deleted file mode 100644 index 3f8832984651..000000000000 --- a/documentai/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "documentai", - "name_pretty": "Cloud Document Understanding API", - "product_documentation": "https://cloud.google.com/document-understanding/docs/", - "client_documentation": "https://googleapis.dev/python/documentai/latest", - "issue_tracker": "", - "release_level": "alpha", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-documentai", - "api_id": "documentai.googleapis.com", - "requires_billing": true -} \ No newline at end of file diff --git a/documentai/CHANGELOG.md b/documentai/CHANGELOG.md deleted file mode 100644 index 825c32f0d03d..000000000000 --- a/documentai/CHANGELOG.md +++ /dev/null @@ -1 +0,0 @@ -# Changelog diff --git a/documentai/LICENSE b/documentai/LICENSE deleted file mode 100644 index a8ee855de2aa..000000000000 --- a/documentai/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/documentai/MANIFEST.in b/documentai/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/documentai/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/documentai/README.rst b/documentai/README.rst deleted file mode 100644 index 13151dbcca07..000000000000 --- a/documentai/README.rst +++ /dev/null @@ -1,77 +0,0 @@ -Python Client for Cloud Document AI API (`Alpha`_) -================================================== - -`Cloud Document AI API`_: Service to parse structured information from unstructured or -semi-structured documents using state-of-the-art Google AI such as natural -language, computer vision, translation, and AutoML. - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. _Alpha: https://github.com/googleapis/google-cloud-python/blob/master/README.rst -.. _Cloud Document AI API: https://cloud.google.com/document-understanding/docs/ -.. _Client Library Documentation: https://googleapis.dev/python/documentai/latest -.. _Product Documentation: https://cloud.google.com/document-understanding/docs/ - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the Cloud Document AI API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Cloud Document AI API.: https://cloud.google.com/document-understanding/docs/ -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-documentai - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-documentai - -Next Steps -~~~~~~~~~~ - -- Read the `Client Library Documentation`_ for Cloud Document AI API - API to see other available methods on the client. -- Read the `Cloud Document AI API Product documentation`_ to learn - more about the product and see How-to Guides. -- View this `repository’s main README`_ to see the full list of Cloud - APIs that we cover. - -.. _Cloud Document AI API Product documentation: https://cloud.google.com/document-understanding/docs/ -.. _repository’s main README: https://github.com/googleapis/google-cloud-python/blob/master/README.rst \ No newline at end of file diff --git a/documentai/docs/README.rst b/documentai/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/documentai/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/documentai/docs/_static/custom.css b/documentai/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/documentai/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/documentai/docs/_templates/layout.html b/documentai/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/documentai/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/documentai/docs/changelog.md b/documentai/docs/changelog.md deleted file mode 120000 index 04c99a55caae..000000000000 --- a/documentai/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../CHANGELOG.md \ No newline at end of file diff --git a/documentai/docs/conf.py b/documentai/docs/conf.py deleted file mode 100644 index ceaa72c82a51..000000000000 --- a/documentai/docs/conf.py +++ /dev/null @@ -1,363 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-documentai documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-documentai" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-documentai-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-documentai.tex", - u"google-cloud-documentai Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - master_doc, - "google-cloud-documentai", - u"google-cloud-documentai Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-documentai", - u"google-cloud-documentai Documentation", - author, - "google-cloud-documentai", - "GAPIC library for the {metadata.shortName} v1beta1 service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/master/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/documentai/docs/gapic/v1beta1/api.rst b/documentai/docs/gapic/v1beta1/api.rst deleted file mode 100644 index e588392f040c..000000000000 --- a/documentai/docs/gapic/v1beta1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud Document AI API -================================ - -.. automodule:: google.cloud.documentai_v1beta1 - :members: - :inherited-members: \ No newline at end of file diff --git a/documentai/docs/gapic/v1beta1/types.rst b/documentai/docs/gapic/v1beta1/types.rst deleted file mode 100644 index 469eb1074bfe..000000000000 --- a/documentai/docs/gapic/v1beta1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud Document AI API Client -====================================== - -.. automodule:: google.cloud.documentai_v1beta1.types - :members: \ No newline at end of file diff --git a/documentai/docs/index.rst b/documentai/docs/index.rst deleted file mode 100644 index f15473e5a1e7..000000000000 --- a/documentai/docs/index.rst +++ /dev/null @@ -1,19 +0,0 @@ -.. include:: README.rst - -Api Reference -------------- -.. toctree:: - :maxdepth: 2 - - gapic/v1beta1/api - gapic/v1beta1/types - -Changelog ---------- - -For a list of all ``google-cloud-documentai`` releases: - -.. toctree:: - :maxdepth: 2 - - changelog \ No newline at end of file diff --git a/documentai/google/__init__.py b/documentai/google/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/documentai/google/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/documentai/google/cloud/__init__.py b/documentai/google/cloud/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/documentai/google/cloud/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/documentai/google/cloud/documentai.py b/documentai/google/cloud/documentai.py deleted file mode 100644 index de0e1a7ebaca..000000000000 --- a/documentai/google/cloud/documentai.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import - -from google.cloud.documentai_v1beta1 import DocumentUnderstandingServiceClient -from google.cloud.documentai_v1beta1 import enums -from google.cloud.documentai_v1beta1 import types - - -__all__ = ("enums", "types", "DocumentUnderstandingServiceClient") diff --git a/documentai/google/cloud/documentai_v1beta1/__init__.py b/documentai/google/cloud/documentai_v1beta1/__init__.py deleted file mode 100644 index a8d5baade569..000000000000 --- a/documentai/google/cloud/documentai_v1beta1/__init__.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.documentai_v1beta1 import types -from google.cloud.documentai_v1beta1.gapic import document_understanding_service_client -from google.cloud.documentai_v1beta1.gapic import enums - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class DocumentUnderstandingServiceClient( - document_understanding_service_client.DocumentUnderstandingServiceClient -): - __doc__ = ( - document_understanding_service_client.DocumentUnderstandingServiceClient.__doc__ - ) - enums = enums - - -__all__ = ("enums", "types", "DocumentUnderstandingServiceClient") diff --git a/documentai/google/cloud/documentai_v1beta1/gapic/__init__.py b/documentai/google/cloud/documentai_v1beta1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/documentai/google/cloud/documentai_v1beta1/gapic/document_understanding_service_client.py b/documentai/google/cloud/documentai_v1beta1/gapic/document_understanding_service_client.py deleted file mode 100644 index 4627e1dd293f..000000000000 --- a/documentai/google/cloud/documentai_v1beta1/gapic/document_understanding_service_client.py +++ /dev/null @@ -1,291 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.cloud.documentai.v1beta1 DocumentUnderstandingService API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.operation -import google.api_core.operations_v1 -import grpc - -from google.cloud.documentai_v1beta1.gapic import ( - document_understanding_service_client_config, -) -from google.cloud.documentai_v1beta1.gapic import enums -from google.cloud.documentai_v1beta1.gapic.transports import ( - document_understanding_service_grpc_transport, -) -from google.cloud.documentai_v1beta1.proto import document_understanding_pb2 -from google.cloud.documentai_v1beta1.proto import document_understanding_pb2_grpc -from google.longrunning import operations_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-documentai" -).version - - -class DocumentUnderstandingServiceClient(object): - """ - Service to parse structured information from unstructured or semi-structured - documents using state-of-the-art Google AI such as natural language, - computer vision, and translation. - """ - - SERVICE_ADDRESS = "documentai.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.documentai.v1beta1.DocumentUnderstandingService" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - DocumentUnderstandingServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.DocumentUnderstandingServiceGrpcTransport, - Callable[[~.Credentials, type], ~.DocumentUnderstandingServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = document_understanding_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=document_understanding_service_grpc_transport.DocumentUnderstandingServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = document_understanding_service_grpc_transport.DocumentUnderstandingServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def batch_process_documents( - self, - requests, - parent=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - LRO endpoint to batch process many documents. - - Example: - >>> from google.cloud import documentai_v1beta1 - >>> - >>> client = documentai_v1beta1.DocumentUnderstandingServiceClient() - >>> - >>> # TODO: Initialize `requests`: - >>> requests = [] - >>> - >>> response = client.batch_process_documents(requests) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - requests (list[Union[dict, ~google.cloud.documentai_v1beta1.types.ProcessDocumentRequest]]): Required. Individual requests for each document. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.documentai_v1beta1.types.ProcessDocumentRequest` - parent (str): Target project and location to make a call. - - Format: ``projects/{project-id}/locations/{location-id}``. - - If no location is specified, a region will be chosen automatically. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.documentai_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "batch_process_documents" not in self._inner_api_calls: - self._inner_api_calls[ - "batch_process_documents" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.batch_process_documents, - default_retry=self._method_configs["BatchProcessDocuments"].retry, - default_timeout=self._method_configs["BatchProcessDocuments"].timeout, - client_info=self._client_info, - ) - - request = document_understanding_pb2.BatchProcessDocumentsRequest( - requests=requests, parent=parent - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["batch_process_documents"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - document_understanding_pb2.BatchProcessDocumentsResponse, - metadata_type=document_understanding_pb2.OperationMetadata, - ) diff --git a/documentai/google/cloud/documentai_v1beta1/gapic/document_understanding_service_client_config.py b/documentai/google/cloud/documentai_v1beta1/gapic/document_understanding_service_client_config.py deleted file mode 100644 index 256950744b7d..000000000000 --- a/documentai/google/cloud/documentai_v1beta1/gapic/document_understanding_service_client_config.py +++ /dev/null @@ -1,28 +0,0 @@ -config = { - "interfaces": { - "google.cloud.documentai.v1beta1.DocumentUnderstandingService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "BatchProcessDocuments": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - } - }, - } - } -} diff --git a/documentai/google/cloud/documentai_v1beta1/gapic/enums.py b/documentai/google/cloud/documentai_v1beta1/gapic/enums.py deleted file mode 100644 index 92d666990bed..000000000000 --- a/documentai/google/cloud/documentai_v1beta1/gapic/enums.py +++ /dev/null @@ -1,84 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class Document(object): - class Page(object): - class Layout(object): - class Orientation(enum.IntEnum): - """ - Detected human reading orientation. - - Attributes: - ORIENTATION_UNSPECIFIED (int): Unspecified orientation. - PAGE_UP (int): Orientation is aligned with page up. - PAGE_RIGHT (int): Orientation is aligned with page right. - Turn the head 90 degrees clockwise from upright to read. - PAGE_DOWN (int): Orientation is aligned with page down. - Turn the head 180 degrees from upright to read. - PAGE_LEFT (int): Orientation is aligned with page left. - Turn the head 90 degrees counterclockwise from upright to read. - """ - - ORIENTATION_UNSPECIFIED = 0 - PAGE_UP = 1 - PAGE_RIGHT = 2 - PAGE_DOWN = 3 - PAGE_LEFT = 4 - - class Token(object): - class DetectedBreak(object): - class Type(enum.IntEnum): - """ - Enum to denote the type of break found. - - Attributes: - TYPE_UNSPECIFIED (int): Unspecified break type. - SPACE (int): A single whitespace. - WIDE_SPACE (int): A wider whitespace. - HYPHEN (int): A hyphen that indicates that a token has been split across lines. - """ - - TYPE_UNSPECIFIED = 0 - SPACE = 1 - WIDE_SPACE = 2 - HYPHEN = 3 - - -class OperationMetadata(object): - class State(enum.IntEnum): - """ - Attributes: - STATE_UNSPECIFIED (int): The default value. This value is used if the state is omitted. - ACCEPTED (int): Request is received. - WAITING (int): Request operation is waiting for scheduling. - RUNNING (int): Request is being processed. - SUCCEEDED (int): The batch processing completed successfully. - CANCELLED (int): The batch processing was cancelled. - FAILED (int): The batch processing has failed. - """ - - STATE_UNSPECIFIED = 0 - ACCEPTED = 1 - WAITING = 2 - RUNNING = 3 - SUCCEEDED = 4 - CANCELLED = 5 - FAILED = 6 diff --git a/documentai/google/cloud/documentai_v1beta1/gapic/transports/__init__.py b/documentai/google/cloud/documentai_v1beta1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/documentai/google/cloud/documentai_v1beta1/gapic/transports/document_understanding_service_grpc_transport.py b/documentai/google/cloud/documentai_v1beta1/gapic/transports/document_understanding_service_grpc_transport.py deleted file mode 100644 index 46b9503ac174..000000000000 --- a/documentai/google/cloud/documentai_v1beta1/gapic/transports/document_understanding_service_grpc_transport.py +++ /dev/null @@ -1,131 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers -import google.api_core.operations_v1 - -from google.cloud.documentai_v1beta1.proto import document_understanding_pb2_grpc - - -class DocumentUnderstandingServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.documentai.v1beta1 DocumentUnderstandingService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="documentai.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "document_understanding_service_stub": document_understanding_pb2_grpc.DocumentUnderstandingServiceStub( - channel - ) - } - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="documentai.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def batch_process_documents(self): - """Return the gRPC stub for :meth:`DocumentUnderstandingServiceClient.batch_process_documents`. - - LRO endpoint to batch process many documents. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["document_understanding_service_stub"].BatchProcessDocuments diff --git a/documentai/google/cloud/documentai_v1beta1/proto/__init__.py b/documentai/google/cloud/documentai_v1beta1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/documentai/google/cloud/documentai_v1beta1/proto/document.proto b/documentai/google/cloud/documentai_v1beta1/proto/document.proto deleted file mode 100644 index 1303c32dd2ba..000000000000 --- a/documentai/google/cloud/documentai_v1beta1/proto/document.proto +++ /dev/null @@ -1,446 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.documentai.v1beta1; - -import "google/api/annotations.proto"; -import "google/cloud/documentai/v1beta1/geometry.proto"; -import "google/rpc/status.proto"; -import "google/type/color.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1beta1;documentai"; -option java_multiple_files = true; -option java_outer_classname = "DocumentProto"; -option java_package = "com.google.cloud.documentai.v1beta1"; - -// Document represents the canonical document resource in Document Understanding -// AI. -// It is an interchange format that provides insights into documents and allows -// for collaboration between users and Document Understanding AI to iterate and -// optimize for quality. -message Document { - // For a large document, sharding may be performed to produce several - // document shards. Each document shard contains this field to detail which - // shard it is. - message ShardInfo { - // The 0-based index of this shard. - int64 shard_index = 1; - - // Total number of shards. - int64 shard_count = 2; - - // The index of the first character in - // [Document.text][google.cloud.documentai.v1beta1.Document.text] in the - // overall document global text. - int64 text_offset = 3; - } - - // Annotation for common text style attributes. This adheres to CSS - // conventions as much as possible. - message Style { - // Font size with unit. - message FontSize { - // Font size for the text. - float size = 1; - - // Unit for the font size. Follows CSS naming (in, px, pt, etc.). - string unit = 2; - } - - // Text anchor indexing into the - // [Document.text][google.cloud.documentai.v1beta1.Document.text]. - TextAnchor text_anchor = 1; - - // Text color. - google.type.Color color = 2; - - // Text background color. - google.type.Color background_color = 3; - - // Font weight. Possible values are normal, bold, bolder, and lighter. - // https://www.w3schools.com/cssref/pr_font_weight.asp - string font_weight = 4; - - // Text style. Possible values are normal, italic, and oblique. - // https://www.w3schools.com/cssref/pr_font_font-style.asp - string text_style = 5; - - // Text decoration. Follows CSS standard. - // - // https://www.w3schools.com/cssref/pr_text_text-decoration.asp - string text_decoration = 6; - - // Font size. - FontSize font_size = 7; - } - - // A page in a [Document][google.cloud.documentai.v1beta1.Document]. - message Page { - // Dimension for the page. - message Dimension { - // Page width. - float width = 1; - - // Page height. - float height = 2; - - // Dimension unit. - string unit = 3; - } - - // Visual element describing a layout unit on a page. - message Layout { - // Detected human reading orientation. - enum Orientation { - // Unspecified orientation. - ORIENTATION_UNSPECIFIED = 0; - - // Orientation is aligned with page up. - PAGE_UP = 1; - - // Orientation is aligned with page right. - // Turn the head 90 degrees clockwise from upright to read. - PAGE_RIGHT = 2; - - // Orientation is aligned with page down. - // Turn the head 180 degrees from upright to read. - PAGE_DOWN = 3; - - // Orientation is aligned with page left. - // Turn the head 90 degrees counterclockwise from upright to read. - PAGE_LEFT = 4; - } - - // Text anchor indexing into the - // [Document.text][google.cloud.documentai.v1beta1.Document.text]. - TextAnchor text_anchor = 1; - - // Confidence of the current - // [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] within - // context of the object this layout is for. e.g. confidence can be for a - // single token, a table, a visual element, etc. depending on context. - // Range [0, 1]. - float confidence = 2; - - // The bounding polygon for the - // [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout]. - BoundingPoly bounding_poly = 3; - - // Detected orientation for the - // [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout]. - Orientation orientation = 4; - } - - // A block has a set of lines (collected into paragraphs) that have a - // common line-spacing and orientation. - message Block { - // [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] for - // [Block][google.cloud.documentai.v1beta1.Document.Page.Block]. - Layout layout = 1; - - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 2; - } - - // A collection of lines that a human would perceive as a paragraph. - message Paragraph { - // [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] for - // [Paragraph][google.cloud.documentai.v1beta1.Document.Page.Paragraph]. - Layout layout = 1; - - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 2; - } - - // A collection of tokens that a human would perceive as a line. - // Does not cross column boundaries, can be horizontal, vertical, etc. - message Line { - // [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] for - // [Line][google.cloud.documentai.v1beta1.Document.Page.Line]. - Layout layout = 1; - - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 2; - } - - // A detected token. - message Token { - // Detected break at the end of a - // [Token][google.cloud.documentai.v1beta1.Document.Page.Token]. - message DetectedBreak { - // Enum to denote the type of break found. - enum Type { - // Unspecified break type. - TYPE_UNSPECIFIED = 0; - - // A single whitespace. - SPACE = 1; - - // A wider whitespace. - WIDE_SPACE = 2; - - // A hyphen that indicates that a token has been split across lines. - HYPHEN = 3; - } - - // Detected break type. - Type type = 1; - } - - // [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] for - // [Token][google.cloud.documentai.v1beta1.Document.Page.Token]. - Layout layout = 1; - - // Detected break at the end of a - // [Token][google.cloud.documentai.v1beta1.Document.Page.Token]. - DetectedBreak detected_break = 2; - - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 3; - } - - // Detected non-text visual elements e.g. checkbox, signature etc. on the - // page. - message VisualElement { - // [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] for - // [Token][google.cloud.documentai.v1beta1.Document.Page.Token]. - Layout layout = 1; - - // Type of the - // [VisualElement][google.cloud.documentai.v1beta1.Document.Page.VisualElement]. - string type = 2; - - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 3; - } - - // A table representation similar to HTML table structure. - message Table { - // A row of table cells. - message TableRow { - // Cells that make up this row. - repeated TableCell cells = 1; - } - - // A cell representation inside the table. - message TableCell { - // [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] for - // [TableCell][google.cloud.documentai.v1beta1.Document.Page.Table.TableCell]. - Layout layout = 1; - - // How many rows this cell spans. - int32 row_span = 2; - - // How many columns this cell spans. - int32 col_span = 3; - - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 4; - } - - // [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] for - // [Table][google.cloud.documentai.v1beta1.Document.Page.Table]. - Layout layout = 1; - - // Header rows of the table. - repeated TableRow header_rows = 2; - - // Body rows of the table. - repeated TableRow body_rows = 3; - - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 4; - } - - // A form field detected on the page. - message FormField { - // [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] for the - // [FormField][google.cloud.documentai.v1beta1.Document.Page.FormField] - // name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. - Layout field_name = 1; - - // [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] for the - // [FormField][google.cloud.documentai.v1beta1.Document.Page.FormField] - // value. - Layout field_value = 2; - - // A list of detected languages for name together with confidence. - repeated DetectedLanguage name_detected_languages = 3; - - // A list of detected languages for value together with confidence. - repeated DetectedLanguage value_detected_languages = 4; - } - - // Detected language for a structural component. - message DetectedLanguage { - // The BCP-47 language code, such as "en-US" or "sr-Latn". For more - // information, see - // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - string language_code = 1; - - // Confidence of detected language. Range [0, 1]. - float confidence = 2; - } - - // 1-based index for current - // [Page][google.cloud.documentai.v1beta1.Document.Page] in a parent - // [Document][google.cloud.documentai.v1beta1.Document]. Useful when a page - // is taken out of a [Document][google.cloud.documentai.v1beta1.Document] - // for individual processing. - int32 page_number = 1; - - // Physical dimension of the page. - Dimension dimension = 2; - - // [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] for the - // page. - Layout layout = 3; - - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 4; - - // A list of visually detected text blocks on the page. - // A block has a set of lines (collected into paragraphs) that have a common - // line-spacing and orientation. - repeated Block blocks = 5; - - // A list of visually detected text paragraphs on the page. - // A collection of lines that a human would perceive as a paragraph. - repeated Paragraph paragraphs = 6; - - // A list of visually detected text lines on the page. - // A collection of tokens that a human would perceive as a line. - repeated Line lines = 7; - - // A list of visually detected tokens on the page. - repeated Token tokens = 8; - - // A list of detected non-text visual elements e.g. checkbox, - // signature etc. on the page. - repeated VisualElement visual_elements = 9; - - // A list of visually detected tables on the page. - repeated Table tables = 10; - - // A list of visually detected form fields on the page. - repeated FormField form_fields = 11; - } - - // A phrase in the text that is a known entity type, such as a person, an - // organization, or location. - message Entity { - // Provenance of the entity. - // Text anchor indexing into the - // [Document.text][google.cloud.documentai.v1beta1.Document.text]. - TextAnchor text_anchor = 1; - - // Entity type from a schema e.g. `Address`. - string type = 2; - - // Text value in the document e.g. `1600 Amphitheatre Pkwy`. - string mention_text = 3; - - // Canonical mention name. This will be a unique value in the entity list - // for this document. - string mention_id = 4; - } - - // Relationship between - // [Entities][google.cloud.documentai.v1beta1.Document.Entity]. - message EntityRelation { - // Subject entity mention_id. - string subject_id = 1; - - // Object entity mention_id. - string object_id = 2; - - // Relationship description. - string relation = 3; - } - - // Text reference indexing into the - // [Document.text][google.cloud.documentai.v1beta1.Document.text]. - message TextAnchor { - // A text segment in the - // [Document.text][google.cloud.documentai.v1beta1.Document.text]. The - // indices may be out of bounds which indicate that the text extends into - // another document shard for large sharded documents. See - // [ShardInfo.text_offset][google.cloud.documentai.v1beta1.Document.ShardInfo.text_offset] - message TextSegment { - // [TextSegment][google.cloud.documentai.v1beta1.Document.TextAnchor.TextSegment] - // start UTF-8 char index in the - // [Document.text][google.cloud.documentai.v1beta1.Document.text]. - int64 start_index = 1; - - // [TextSegment][google.cloud.documentai.v1beta1.Document.TextAnchor.TextSegment] - // half open end UTF-8 char index in the - // [Document.text][google.cloud.documentai.v1beta1.Document.text]. - int64 end_index = 2; - } - - // The text segments from the - // [Document.text][google.cloud.documentai.v1beta1.Document.text]. - repeated TextSegment text_segments = 1; - } - - // Original source document from the user. - oneof source { - // Currently supports Google Cloud Storage URI of the form - // `gs://bucket_name/object_name`. Object versioning is not supported. - // See [Google Cloud Storage Request - // URIs](https://cloud.google.com/storage/docs/reference-uris) for more - // info. - string uri = 1; - - // Inline document content, represented as a stream of bytes. - // Note: As with all `bytes` fields, protobuffers use a pure binary - // representation, whereas JSON representations use base64. - bytes content = 2; - } - - // An IANA published MIME type (also referred to as media type). For more - // information, see - // https://www.iana.org/assignments/media-types/media-types.xhtml. - string mime_type = 3; - - // UTF-8 encoded text in reading order from the document. - string text = 4; - - // Styles for the - // [Document.text][google.cloud.documentai.v1beta1.Document.text]. - repeated Style text_styles = 5; - - // Visual page layout for the - // [Document][google.cloud.documentai.v1beta1.Document]. - repeated Page pages = 6; - - // A list of entities detected on - // [Document.text][google.cloud.documentai.v1beta1.Document.text]. For - // document shards, entities in this list may cross shard boundaries. - repeated Entity entities = 7; - - // Relationship among - // [Document.entities][google.cloud.documentai.v1beta1.Document.entities]. - repeated EntityRelation entity_relations = 8; - - // Information about the sharding if this document is sharded part of a larger - // document. If the document is not sharded, this message is not specified. - ShardInfo shard_info = 9; - - // Any error that occurred while processing this document. - google.rpc.Status error = 10; -} diff --git a/documentai/google/cloud/documentai_v1beta1/proto/document_pb2.py b/documentai/google/cloud/documentai_v1beta1/proto/document_pb2.py deleted file mode 100644 index 5973694f53df..000000000000 --- a/documentai/google/cloud/documentai_v1beta1/proto/document_pb2.py +++ /dev/null @@ -1,2698 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai_v1beta1/proto/document.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.cloud.documentai_v1beta1.proto import ( - geometry_pb2 as google_dot_cloud_dot_documentai__v1beta1_dot_proto_dot_geometry__pb2, -) -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 -from google.type import color_pb2 as google_dot_type_dot_color__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/documentai_v1beta1/proto/document.proto", - package="google.cloud.documentai.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n#com.google.cloud.documentai.v1beta1B\rDocumentProtoP\001ZIgoogle.golang.org/genproto/googleapis/cloud/documentai/v1beta1;documentai" - ), - serialized_pb=_b( - '\n4google/cloud/documentai_v1beta1/proto/document.proto\x12\x1fgoogle.cloud.documentai.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x34google/cloud/documentai_v1beta1/proto/geometry.proto\x1a\x17google/rpc/status.proto\x1a\x17google/type/color.proto"\xfa$\n\x08\x44ocument\x12\r\n\x03uri\x18\x01 \x01(\tH\x00\x12\x11\n\x07\x63ontent\x18\x02 \x01(\x0cH\x00\x12\x11\n\tmime_type\x18\x03 \x01(\t\x12\x0c\n\x04text\x18\x04 \x01(\t\x12\x44\n\x0btext_styles\x18\x05 \x03(\x0b\x32/.google.cloud.documentai.v1beta1.Document.Style\x12=\n\x05pages\x18\x06 \x03(\x0b\x32..google.cloud.documentai.v1beta1.Document.Page\x12\x42\n\x08\x65ntities\x18\x07 \x03(\x0b\x32\x30.google.cloud.documentai.v1beta1.Document.Entity\x12R\n\x10\x65ntity_relations\x18\x08 \x03(\x0b\x32\x38.google.cloud.documentai.v1beta1.Document.EntityRelation\x12G\n\nshard_info\x18\t \x01(\x0b\x32\x33.google.cloud.documentai.v1beta1.Document.ShardInfo\x12!\n\x05\x65rror\x18\n \x01(\x0b\x32\x12.google.rpc.Status\x1aJ\n\tShardInfo\x12\x13\n\x0bshard_index\x18\x01 \x01(\x03\x12\x13\n\x0bshard_count\x18\x02 \x01(\x03\x12\x13\n\x0btext_offset\x18\x03 \x01(\x03\x1a\xda\x02\n\x05Style\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta1.Document.TextAnchor\x12!\n\x05\x63olor\x18\x02 \x01(\x0b\x32\x12.google.type.Color\x12,\n\x10\x62\x61\x63kground_color\x18\x03 \x01(\x0b\x32\x12.google.type.Color\x12\x13\n\x0b\x66ont_weight\x18\x04 \x01(\t\x12\x12\n\ntext_style\x18\x05 \x01(\t\x12\x17\n\x0ftext_decoration\x18\x06 \x01(\t\x12K\n\tfont_size\x18\x07 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta1.Document.Style.FontSize\x1a&\n\x08\x46ontSize\x12\x0c\n\x04size\x18\x01 \x01(\x02\x12\x0c\n\x04unit\x18\x02 \x01(\t\x1a\xf6\x1a\n\x04Page\x12\x13\n\x0bpage_number\x18\x01 \x01(\x05\x12K\n\tdimension\x18\x02 \x01(\x0b\x32\x38.google.cloud.documentai.v1beta1.Document.Page.Dimension\x12\x45\n\x06layout\x18\x03 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta1.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage\x12\x44\n\x06\x62locks\x18\x05 \x03(\x0b\x32\x34.google.cloud.documentai.v1beta1.Document.Page.Block\x12L\n\nparagraphs\x18\x06 \x03(\x0b\x32\x38.google.cloud.documentai.v1beta1.Document.Page.Paragraph\x12\x42\n\x05lines\x18\x07 \x03(\x0b\x32\x33.google.cloud.documentai.v1beta1.Document.Page.Line\x12\x44\n\x06tokens\x18\x08 \x03(\x0b\x32\x34.google.cloud.documentai.v1beta1.Document.Page.Token\x12U\n\x0fvisual_elements\x18\t \x03(\x0b\x32<.google.cloud.documentai.v1beta1.Document.Page.VisualElement\x12\x44\n\x06tables\x18\n \x03(\x0b\x32\x34.google.cloud.documentai.v1beta1.Document.Page.Table\x12M\n\x0b\x66orm_fields\x18\x0b \x03(\x0b\x32\x38.google.cloud.documentai.v1beta1.Document.Page.FormField\x1a\x38\n\tDimension\x12\r\n\x05width\x18\x01 \x01(\x02\x12\x0e\n\x06height\x18\x02 \x01(\x02\x12\x0c\n\x04unit\x18\x03 \x01(\t\x1a\xec\x02\n\x06Layout\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta1.Document.TextAnchor\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x44\n\rbounding_poly\x18\x03 \x01(\x0b\x32-.google.cloud.documentai.v1beta1.BoundingPoly\x12V\n\x0borientation\x18\x04 \x01(\x0e\x32\x41.google.cloud.documentai.v1beta1.Document.Page.Layout.Orientation"e\n\x0bOrientation\x12\x1b\n\x17ORIENTATION_UNSPECIFIED\x10\x00\x12\x0b\n\x07PAGE_UP\x10\x01\x12\x0e\n\nPAGE_RIGHT\x10\x02\x12\r\n\tPAGE_DOWN\x10\x03\x12\r\n\tPAGE_LEFT\x10\x04\x1a\xab\x01\n\x05\x42lock\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta1.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32?.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage\x1a\xaf\x01\n\tParagraph\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta1.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32?.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage\x1a\xaa\x01\n\x04Line\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta1.Document.Page.Layout\x12[\n\x12\x64\x65tected_languages\x18\x02 \x03(\x0b\x32?.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage\x1a\xb5\x03\n\x05Token\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta1.Document.Page.Layout\x12Z\n\x0e\x64\x65tected_break\x18\x02 \x01(\x0b\x32\x42.google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak\x12[\n\x12\x64\x65tected_languages\x18\x03 \x03(\x0b\x32?.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage\x1a\xab\x01\n\rDetectedBreak\x12U\n\x04type\x18\x01 \x01(\x0e\x32G.google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak.Type"C\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05SPACE\x10\x01\x12\x0e\n\nWIDE_SPACE\x10\x02\x12\n\n\x06HYPHEN\x10\x03\x1a\xc1\x01\n\rVisualElement\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta1.Document.Page.Layout\x12\x0c\n\x04type\x18\x02 \x01(\t\x12[\n\x12\x64\x65tected_languages\x18\x03 \x03(\x0b\x32?.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage\x1a\x82\x05\n\x05Table\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta1.Document.Page.Layout\x12R\n\x0bheader_rows\x18\x02 \x03(\x0b\x32=.google.cloud.documentai.v1beta1.Document.Page.Table.TableRow\x12P\n\tbody_rows\x18\x03 \x03(\x0b\x32=.google.cloud.documentai.v1beta1.Document.Page.Table.TableRow\x12[\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage\x1aY\n\x08TableRow\x12M\n\x05\x63\x65lls\x18\x01 \x03(\x0b\x32>.google.cloud.documentai.v1beta1.Document.Page.Table.TableCell\x1a\xd3\x01\n\tTableCell\x12\x45\n\x06layout\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta1.Document.Page.Layout\x12\x10\n\x08row_span\x18\x02 \x01(\x05\x12\x10\n\x08\x63ol_span\x18\x03 \x01(\x05\x12[\n\x12\x64\x65tected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage\x1a\xe7\x02\n\tFormField\x12I\n\nfield_name\x18\x01 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta1.Document.Page.Layout\x12J\n\x0b\x66ield_value\x18\x02 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta1.Document.Page.Layout\x12`\n\x17name_detected_languages\x18\x03 \x03(\x0b\x32?.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage\x12\x61\n\x18value_detected_languages\x18\x04 \x03(\x0b\x32?.google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage\x1a=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x1a\x8b\x01\n\x06\x45ntity\x12I\n\x0btext_anchor\x18\x01 \x01(\x0b\x32\x34.google.cloud.documentai.v1beta1.Document.TextAnchor\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x14\n\x0cmention_text\x18\x03 \x01(\t\x12\x12\n\nmention_id\x18\x04 \x01(\t\x1aI\n\x0e\x45ntityRelation\x12\x12\n\nsubject_id\x18\x01 \x01(\t\x12\x11\n\tobject_id\x18\x02 \x01(\t\x12\x10\n\x08relation\x18\x03 \x01(\t\x1a\x9c\x01\n\nTextAnchor\x12W\n\rtext_segments\x18\x01 \x03(\x0b\x32@.google.cloud.documentai.v1beta1.Document.TextAnchor.TextSegment\x1a\x35\n\x0bTextSegment\x12\x13\n\x0bstart_index\x18\x01 \x01(\x03\x12\x11\n\tend_index\x18\x02 \x01(\x03\x42\x08\n\x06sourceB\x81\x01\n#com.google.cloud.documentai.v1beta1B\rDocumentProtoP\x01ZIgoogle.golang.org/genproto/googleapis/cloud/documentai/v1beta1;documentaib\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_cloud_dot_documentai__v1beta1_dot_proto_dot_geometry__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - google_dot_type_dot_color__pb2.DESCRIPTOR, - ], -) - - -_DOCUMENT_PAGE_LAYOUT_ORIENTATION = _descriptor.EnumDescriptor( - name="Orientation", - full_name="google.cloud.documentai.v1beta1.Document.Page.Layout.Orientation", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="ORIENTATION_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="PAGE_UP", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PAGE_RIGHT", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PAGE_DOWN", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PAGE_LEFT", index=4, number=4, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2236, - serialized_end=2337, -) -_sym_db.RegisterEnumDescriptor(_DOCUMENT_PAGE_LAYOUT_ORIENTATION) - -_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK_TYPE = _descriptor.EnumDescriptor( - name="Type", - full_name="google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak.Type", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SPACE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="WIDE_SPACE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="HYPHEN", index=3, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3235, - serialized_end=3302, -) -_sym_db.RegisterEnumDescriptor(_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK_TYPE) - - -_DOCUMENT_SHARDINFO = _descriptor.Descriptor( - name="ShardInfo", - full_name="google.cloud.documentai.v1beta1.Document.ShardInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="shard_index", - full_name="google.cloud.documentai.v1beta1.Document.ShardInfo.shard_index", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shard_count", - full_name="google.cloud.documentai.v1beta1.Document.ShardInfo.shard_count", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_offset", - full_name="google.cloud.documentai.v1beta1.Document.ShardInfo.text_offset", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=696, - serialized_end=770, -) - -_DOCUMENT_STYLE_FONTSIZE = _descriptor.Descriptor( - name="FontSize", - full_name="google.cloud.documentai.v1beta1.Document.Style.FontSize", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="size", - full_name="google.cloud.documentai.v1beta1.Document.Style.FontSize.size", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="unit", - full_name="google.cloud.documentai.v1beta1.Document.Style.FontSize.unit", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1081, - serialized_end=1119, -) - -_DOCUMENT_STYLE = _descriptor.Descriptor( - name="Style", - full_name="google.cloud.documentai.v1beta1.Document.Style", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="text_anchor", - full_name="google.cloud.documentai.v1beta1.Document.Style.text_anchor", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="color", - full_name="google.cloud.documentai.v1beta1.Document.Style.color", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="background_color", - full_name="google.cloud.documentai.v1beta1.Document.Style.background_color", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="font_weight", - full_name="google.cloud.documentai.v1beta1.Document.Style.font_weight", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_style", - full_name="google.cloud.documentai.v1beta1.Document.Style.text_style", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_decoration", - full_name="google.cloud.documentai.v1beta1.Document.Style.text_decoration", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="font_size", - full_name="google.cloud.documentai.v1beta1.Document.Style.font_size", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_DOCUMENT_STYLE_FONTSIZE], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=773, - serialized_end=1119, -) - -_DOCUMENT_PAGE_DIMENSION = _descriptor.Descriptor( - name="Dimension", - full_name="google.cloud.documentai.v1beta1.Document.Page.Dimension", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="width", - full_name="google.cloud.documentai.v1beta1.Document.Page.Dimension.width", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="height", - full_name="google.cloud.documentai.v1beta1.Document.Page.Dimension.height", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="unit", - full_name="google.cloud.documentai.v1beta1.Document.Page.Dimension.unit", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1914, - serialized_end=1970, -) - -_DOCUMENT_PAGE_LAYOUT = _descriptor.Descriptor( - name="Layout", - full_name="google.cloud.documentai.v1beta1.Document.Page.Layout", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="text_anchor", - full_name="google.cloud.documentai.v1beta1.Document.Page.Layout.text_anchor", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.documentai.v1beta1.Document.Page.Layout.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.documentai.v1beta1.Document.Page.Layout.bounding_poly", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="orientation", - full_name="google.cloud.documentai.v1beta1.Document.Page.Layout.orientation", - index=3, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_DOCUMENT_PAGE_LAYOUT_ORIENTATION], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1973, - serialized_end=2337, -) - -_DOCUMENT_PAGE_BLOCK = _descriptor.Descriptor( - name="Block", - full_name="google.cloud.documentai.v1beta1.Document.Page.Block", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="layout", - full_name="google.cloud.documentai.v1beta1.Document.Page.Block.layout", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.documentai.v1beta1.Document.Page.Block.detected_languages", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2340, - serialized_end=2511, -) - -_DOCUMENT_PAGE_PARAGRAPH = _descriptor.Descriptor( - name="Paragraph", - full_name="google.cloud.documentai.v1beta1.Document.Page.Paragraph", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="layout", - full_name="google.cloud.documentai.v1beta1.Document.Page.Paragraph.layout", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.documentai.v1beta1.Document.Page.Paragraph.detected_languages", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2514, - serialized_end=2689, -) - -_DOCUMENT_PAGE_LINE = _descriptor.Descriptor( - name="Line", - full_name="google.cloud.documentai.v1beta1.Document.Page.Line", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="layout", - full_name="google.cloud.documentai.v1beta1.Document.Page.Line.layout", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.documentai.v1beta1.Document.Page.Line.detected_languages", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2692, - serialized_end=2862, -) - -_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK = _descriptor.Descriptor( - name="DetectedBreak", - full_name="google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK_TYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3131, - serialized_end=3302, -) - -_DOCUMENT_PAGE_TOKEN = _descriptor.Descriptor( - name="Token", - full_name="google.cloud.documentai.v1beta1.Document.Page.Token", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="layout", - full_name="google.cloud.documentai.v1beta1.Document.Page.Token.layout", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detected_break", - full_name="google.cloud.documentai.v1beta1.Document.Page.Token.detected_break", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.documentai.v1beta1.Document.Page.Token.detected_languages", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2865, - serialized_end=3302, -) - -_DOCUMENT_PAGE_VISUALELEMENT = _descriptor.Descriptor( - name="VisualElement", - full_name="google.cloud.documentai.v1beta1.Document.Page.VisualElement", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="layout", - full_name="google.cloud.documentai.v1beta1.Document.Page.VisualElement.layout", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.documentai.v1beta1.Document.Page.VisualElement.type", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.documentai.v1beta1.Document.Page.VisualElement.detected_languages", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3305, - serialized_end=3498, -) - -_DOCUMENT_PAGE_TABLE_TABLEROW = _descriptor.Descriptor( - name="TableRow", - full_name="google.cloud.documentai.v1beta1.Document.Page.Table.TableRow", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="cells", - full_name="google.cloud.documentai.v1beta1.Document.Page.Table.TableRow.cells", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3840, - serialized_end=3929, -) - -_DOCUMENT_PAGE_TABLE_TABLECELL = _descriptor.Descriptor( - name="TableCell", - full_name="google.cloud.documentai.v1beta1.Document.Page.Table.TableCell", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="layout", - full_name="google.cloud.documentai.v1beta1.Document.Page.Table.TableCell.layout", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="row_span", - full_name="google.cloud.documentai.v1beta1.Document.Page.Table.TableCell.row_span", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="col_span", - full_name="google.cloud.documentai.v1beta1.Document.Page.Table.TableCell.col_span", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.documentai.v1beta1.Document.Page.Table.TableCell.detected_languages", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3932, - serialized_end=4143, -) - -_DOCUMENT_PAGE_TABLE = _descriptor.Descriptor( - name="Table", - full_name="google.cloud.documentai.v1beta1.Document.Page.Table", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="layout", - full_name="google.cloud.documentai.v1beta1.Document.Page.Table.layout", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="header_rows", - full_name="google.cloud.documentai.v1beta1.Document.Page.Table.header_rows", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="body_rows", - full_name="google.cloud.documentai.v1beta1.Document.Page.Table.body_rows", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.documentai.v1beta1.Document.Page.Table.detected_languages", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_DOCUMENT_PAGE_TABLE_TABLEROW, _DOCUMENT_PAGE_TABLE_TABLECELL], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3501, - serialized_end=4143, -) - -_DOCUMENT_PAGE_FORMFIELD = _descriptor.Descriptor( - name="FormField", - full_name="google.cloud.documentai.v1beta1.Document.Page.FormField", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="field_name", - full_name="google.cloud.documentai.v1beta1.Document.Page.FormField.field_name", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="field_value", - full_name="google.cloud.documentai.v1beta1.Document.Page.FormField.field_value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name_detected_languages", - full_name="google.cloud.documentai.v1beta1.Document.Page.FormField.name_detected_languages", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value_detected_languages", - full_name="google.cloud.documentai.v1beta1.Document.Page.FormField.value_detected_languages", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4146, - serialized_end=4505, -) - -_DOCUMENT_PAGE_DETECTEDLANGUAGE = _descriptor.Descriptor( - name="DetectedLanguage", - full_name="google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage.language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4507, - serialized_end=4568, -) - -_DOCUMENT_PAGE = _descriptor.Descriptor( - name="Page", - full_name="google.cloud.documentai.v1beta1.Document.Page", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="page_number", - full_name="google.cloud.documentai.v1beta1.Document.Page.page_number", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="dimension", - full_name="google.cloud.documentai.v1beta1.Document.Page.dimension", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="layout", - full_name="google.cloud.documentai.v1beta1.Document.Page.layout", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.documentai.v1beta1.Document.Page.detected_languages", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="blocks", - full_name="google.cloud.documentai.v1beta1.Document.Page.blocks", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="paragraphs", - full_name="google.cloud.documentai.v1beta1.Document.Page.paragraphs", - index=5, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="lines", - full_name="google.cloud.documentai.v1beta1.Document.Page.lines", - index=6, - number=7, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tokens", - full_name="google.cloud.documentai.v1beta1.Document.Page.tokens", - index=7, - number=8, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="visual_elements", - full_name="google.cloud.documentai.v1beta1.Document.Page.visual_elements", - index=8, - number=9, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tables", - full_name="google.cloud.documentai.v1beta1.Document.Page.tables", - index=9, - number=10, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="form_fields", - full_name="google.cloud.documentai.v1beta1.Document.Page.form_fields", - index=10, - number=11, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[ - _DOCUMENT_PAGE_DIMENSION, - _DOCUMENT_PAGE_LAYOUT, - _DOCUMENT_PAGE_BLOCK, - _DOCUMENT_PAGE_PARAGRAPH, - _DOCUMENT_PAGE_LINE, - _DOCUMENT_PAGE_TOKEN, - _DOCUMENT_PAGE_VISUALELEMENT, - _DOCUMENT_PAGE_TABLE, - _DOCUMENT_PAGE_FORMFIELD, - _DOCUMENT_PAGE_DETECTEDLANGUAGE, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1122, - serialized_end=4568, -) - -_DOCUMENT_ENTITY = _descriptor.Descriptor( - name="Entity", - full_name="google.cloud.documentai.v1beta1.Document.Entity", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="text_anchor", - full_name="google.cloud.documentai.v1beta1.Document.Entity.text_anchor", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.documentai.v1beta1.Document.Entity.type", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mention_text", - full_name="google.cloud.documentai.v1beta1.Document.Entity.mention_text", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mention_id", - full_name="google.cloud.documentai.v1beta1.Document.Entity.mention_id", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4571, - serialized_end=4710, -) - -_DOCUMENT_ENTITYRELATION = _descriptor.Descriptor( - name="EntityRelation", - full_name="google.cloud.documentai.v1beta1.Document.EntityRelation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="subject_id", - full_name="google.cloud.documentai.v1beta1.Document.EntityRelation.subject_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="object_id", - full_name="google.cloud.documentai.v1beta1.Document.EntityRelation.object_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="relation", - full_name="google.cloud.documentai.v1beta1.Document.EntityRelation.relation", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4712, - serialized_end=4785, -) - -_DOCUMENT_TEXTANCHOR_TEXTSEGMENT = _descriptor.Descriptor( - name="TextSegment", - full_name="google.cloud.documentai.v1beta1.Document.TextAnchor.TextSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_index", - full_name="google.cloud.documentai.v1beta1.Document.TextAnchor.TextSegment.start_index", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_index", - full_name="google.cloud.documentai.v1beta1.Document.TextAnchor.TextSegment.end_index", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4891, - serialized_end=4944, -) - -_DOCUMENT_TEXTANCHOR = _descriptor.Descriptor( - name="TextAnchor", - full_name="google.cloud.documentai.v1beta1.Document.TextAnchor", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="text_segments", - full_name="google.cloud.documentai.v1beta1.Document.TextAnchor.text_segments", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[_DOCUMENT_TEXTANCHOR_TEXTSEGMENT], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4788, - serialized_end=4944, -) - -_DOCUMENT = _descriptor.Descriptor( - name="Document", - full_name="google.cloud.documentai.v1beta1.Document", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.documentai.v1beta1.Document.uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="content", - full_name="google.cloud.documentai.v1beta1.Document.content", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.documentai.v1beta1.Document.mime_type", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text", - full_name="google.cloud.documentai.v1beta1.Document.text", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_styles", - full_name="google.cloud.documentai.v1beta1.Document.text_styles", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pages", - full_name="google.cloud.documentai.v1beta1.Document.pages", - index=5, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="entities", - full_name="google.cloud.documentai.v1beta1.Document.entities", - index=6, - number=7, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="entity_relations", - full_name="google.cloud.documentai.v1beta1.Document.entity_relations", - index=7, - number=8, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shard_info", - full_name="google.cloud.documentai.v1beta1.Document.shard_info", - index=8, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="error", - full_name="google.cloud.documentai.v1beta1.Document.error", - index=9, - number=10, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[ - _DOCUMENT_SHARDINFO, - _DOCUMENT_STYLE, - _DOCUMENT_PAGE, - _DOCUMENT_ENTITY, - _DOCUMENT_ENTITYRELATION, - _DOCUMENT_TEXTANCHOR, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="source", - full_name="google.cloud.documentai.v1beta1.Document.source", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=224, - serialized_end=4954, -) - -_DOCUMENT_SHARDINFO.containing_type = _DOCUMENT -_DOCUMENT_STYLE_FONTSIZE.containing_type = _DOCUMENT_STYLE -_DOCUMENT_STYLE.fields_by_name["text_anchor"].message_type = _DOCUMENT_TEXTANCHOR -_DOCUMENT_STYLE.fields_by_name[ - "color" -].message_type = google_dot_type_dot_color__pb2._COLOR -_DOCUMENT_STYLE.fields_by_name[ - "background_color" -].message_type = google_dot_type_dot_color__pb2._COLOR -_DOCUMENT_STYLE.fields_by_name["font_size"].message_type = _DOCUMENT_STYLE_FONTSIZE -_DOCUMENT_STYLE.containing_type = _DOCUMENT -_DOCUMENT_PAGE_DIMENSION.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_LAYOUT.fields_by_name["text_anchor"].message_type = _DOCUMENT_TEXTANCHOR -_DOCUMENT_PAGE_LAYOUT.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_documentai__v1beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_DOCUMENT_PAGE_LAYOUT.fields_by_name[ - "orientation" -].enum_type = _DOCUMENT_PAGE_LAYOUT_ORIENTATION -_DOCUMENT_PAGE_LAYOUT.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_LAYOUT_ORIENTATION.containing_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_BLOCK.fields_by_name["layout"].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_BLOCK.fields_by_name[ - "detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE_BLOCK.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_PARAGRAPH.fields_by_name["layout"].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_PARAGRAPH.fields_by_name[ - "detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE_PARAGRAPH.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_LINE.fields_by_name["layout"].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_LINE.fields_by_name[ - "detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE_LINE.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK.fields_by_name[ - "type" -].enum_type = _DOCUMENT_PAGE_TOKEN_DETECTEDBREAK_TYPE -_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK.containing_type = _DOCUMENT_PAGE_TOKEN -_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK_TYPE.containing_type = ( - _DOCUMENT_PAGE_TOKEN_DETECTEDBREAK -) -_DOCUMENT_PAGE_TOKEN.fields_by_name["layout"].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_TOKEN.fields_by_name[ - "detected_break" -].message_type = _DOCUMENT_PAGE_TOKEN_DETECTEDBREAK -_DOCUMENT_PAGE_TOKEN.fields_by_name[ - "detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE_TOKEN.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_VISUALELEMENT.fields_by_name[ - "layout" -].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_VISUALELEMENT.fields_by_name[ - "detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE_VISUALELEMENT.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_TABLE_TABLEROW.fields_by_name[ - "cells" -].message_type = _DOCUMENT_PAGE_TABLE_TABLECELL -_DOCUMENT_PAGE_TABLE_TABLEROW.containing_type = _DOCUMENT_PAGE_TABLE -_DOCUMENT_PAGE_TABLE_TABLECELL.fields_by_name[ - "layout" -].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_TABLE_TABLECELL.fields_by_name[ - "detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE_TABLE_TABLECELL.containing_type = _DOCUMENT_PAGE_TABLE -_DOCUMENT_PAGE_TABLE.fields_by_name["layout"].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_TABLE.fields_by_name[ - "header_rows" -].message_type = _DOCUMENT_PAGE_TABLE_TABLEROW -_DOCUMENT_PAGE_TABLE.fields_by_name[ - "body_rows" -].message_type = _DOCUMENT_PAGE_TABLE_TABLEROW -_DOCUMENT_PAGE_TABLE.fields_by_name[ - "detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE_TABLE.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_FORMFIELD.fields_by_name[ - "field_name" -].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_FORMFIELD.fields_by_name[ - "field_value" -].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE_FORMFIELD.fields_by_name[ - "name_detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE_FORMFIELD.fields_by_name[ - "value_detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE_FORMFIELD.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE_DETECTEDLANGUAGE.containing_type = _DOCUMENT_PAGE -_DOCUMENT_PAGE.fields_by_name["dimension"].message_type = _DOCUMENT_PAGE_DIMENSION -_DOCUMENT_PAGE.fields_by_name["layout"].message_type = _DOCUMENT_PAGE_LAYOUT -_DOCUMENT_PAGE.fields_by_name[ - "detected_languages" -].message_type = _DOCUMENT_PAGE_DETECTEDLANGUAGE -_DOCUMENT_PAGE.fields_by_name["blocks"].message_type = _DOCUMENT_PAGE_BLOCK -_DOCUMENT_PAGE.fields_by_name["paragraphs"].message_type = _DOCUMENT_PAGE_PARAGRAPH -_DOCUMENT_PAGE.fields_by_name["lines"].message_type = _DOCUMENT_PAGE_LINE -_DOCUMENT_PAGE.fields_by_name["tokens"].message_type = _DOCUMENT_PAGE_TOKEN -_DOCUMENT_PAGE.fields_by_name[ - "visual_elements" -].message_type = _DOCUMENT_PAGE_VISUALELEMENT -_DOCUMENT_PAGE.fields_by_name["tables"].message_type = _DOCUMENT_PAGE_TABLE -_DOCUMENT_PAGE.fields_by_name["form_fields"].message_type = _DOCUMENT_PAGE_FORMFIELD -_DOCUMENT_PAGE.containing_type = _DOCUMENT -_DOCUMENT_ENTITY.fields_by_name["text_anchor"].message_type = _DOCUMENT_TEXTANCHOR -_DOCUMENT_ENTITY.containing_type = _DOCUMENT -_DOCUMENT_ENTITYRELATION.containing_type = _DOCUMENT -_DOCUMENT_TEXTANCHOR_TEXTSEGMENT.containing_type = _DOCUMENT_TEXTANCHOR -_DOCUMENT_TEXTANCHOR.fields_by_name[ - "text_segments" -].message_type = _DOCUMENT_TEXTANCHOR_TEXTSEGMENT -_DOCUMENT_TEXTANCHOR.containing_type = _DOCUMENT -_DOCUMENT.fields_by_name["text_styles"].message_type = _DOCUMENT_STYLE -_DOCUMENT.fields_by_name["pages"].message_type = _DOCUMENT_PAGE -_DOCUMENT.fields_by_name["entities"].message_type = _DOCUMENT_ENTITY -_DOCUMENT.fields_by_name["entity_relations"].message_type = _DOCUMENT_ENTITYRELATION -_DOCUMENT.fields_by_name["shard_info"].message_type = _DOCUMENT_SHARDINFO -_DOCUMENT.fields_by_name["error"].message_type = google_dot_rpc_dot_status__pb2._STATUS -_DOCUMENT.oneofs_by_name["source"].fields.append(_DOCUMENT.fields_by_name["uri"]) -_DOCUMENT.fields_by_name["uri"].containing_oneof = _DOCUMENT.oneofs_by_name["source"] -_DOCUMENT.oneofs_by_name["source"].fields.append(_DOCUMENT.fields_by_name["content"]) -_DOCUMENT.fields_by_name["content"].containing_oneof = _DOCUMENT.oneofs_by_name[ - "source" -] -DESCRIPTOR.message_types_by_name["Document"] = _DOCUMENT -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Document = _reflection.GeneratedProtocolMessageType( - "Document", - (_message.Message,), - dict( - ShardInfo=_reflection.GeneratedProtocolMessageType( - "ShardInfo", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENT_SHARDINFO, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""For a large document, sharding may be performed to produce - several document shards. Each document shard contains this field to - detail which shard it is. - - - Attributes: - shard_index: - The 0-based index of this shard. - shard_count: - Total number of shards. - text_offset: - The index of the first character in - [Document.text][google.cloud.documentai.v1beta1.Document.text] - in the overall document global text. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.ShardInfo) - ), - ), - Style=_reflection.GeneratedProtocolMessageType( - "Style", - (_message.Message,), - dict( - FontSize=_reflection.GeneratedProtocolMessageType( - "FontSize", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENT_STYLE_FONTSIZE, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""Font size with unit. - - - Attributes: - size: - Font size for the text. - unit: - Unit for the font size. Follows CSS naming (in, px, pt, etc.). - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.Style.FontSize) - ), - ), - DESCRIPTOR=_DOCUMENT_STYLE, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""Annotation for common text style attributes. This adheres - to CSS conventions as much as possible. - - - Attributes: - text_anchor: - Text anchor indexing into the [Document.text][google.cloud.doc - umentai.v1beta1.Document.text]. - color: - Text color. - background_color: - Text background color. - font_weight: - Font weight. Possible values are normal, bold, bolder, and - lighter. https://www.w3schools.com/cssref/pr\_font\_weight.asp - text_style: - Text style. Possible values are normal, italic, and oblique. - https://www.w3schools.com/cssref/pr\_font\_font-style.asp - text_decoration: - Text decoration. Follows CSS standard. - https://www.w3schools.com/cssref/pr\_text\_text-decoration.asp - font_size: - Font size. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.Style) - ), - ), - Page=_reflection.GeneratedProtocolMessageType( - "Page", - (_message.Message,), - dict( - Dimension=_reflection.GeneratedProtocolMessageType( - "Dimension", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENT_PAGE_DIMENSION, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""Dimension for the page. - - - Attributes: - width: - Page width. - height: - Page height. - unit: - Dimension unit. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.Page.Dimension) - ), - ), - Layout=_reflection.GeneratedProtocolMessageType( - "Layout", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENT_PAGE_LAYOUT, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""Visual element describing a layout unit on a page. - - - Attributes: - text_anchor: - Text anchor indexing into the [Document.text][google.cloud.doc - umentai.v1beta1.Document.text]. - confidence: - Confidence of the current - [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] - within context of the object this layout is for. e.g. - confidence can be for a single token, a table, a visual - element, etc. depending on context. Range [0, 1]. - bounding_poly: - The bounding polygon for the [Layout][google.cloud.documentai. - v1beta1.Document.Page.Layout]. - orientation: - Detected orientation for the [Layout][google.cloud.documentai. - v1beta1.Document.Page.Layout]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.Page.Layout) - ), - ), - Block=_reflection.GeneratedProtocolMessageType( - "Block", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENT_PAGE_BLOCK, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""A block has a set of lines (collected into paragraphs) - that have a common line-spacing and orientation. - - - Attributes: - layout: - [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] - for - [Block][google.cloud.documentai.v1beta1.Document.Page.Block]. - detected_languages: - A list of detected languages together with confidence. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.Page.Block) - ), - ), - Paragraph=_reflection.GeneratedProtocolMessageType( - "Paragraph", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENT_PAGE_PARAGRAPH, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""A collection of lines that a human would perceive as a - paragraph. - - - Attributes: - layout: - [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] - for [Paragraph][google.cloud.documentai.v1beta1.Document.Page. - Paragraph]. - detected_languages: - A list of detected languages together with confidence. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.Page.Paragraph) - ), - ), - Line=_reflection.GeneratedProtocolMessageType( - "Line", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENT_PAGE_LINE, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""A collection of tokens that a human would perceive as a - line. Does not cross column boundaries, can be horizontal, vertical, - etc. - - - Attributes: - layout: - [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] - for - [Line][google.cloud.documentai.v1beta1.Document.Page.Line]. - detected_languages: - A list of detected languages together with confidence. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.Page.Line) - ), - ), - Token=_reflection.GeneratedProtocolMessageType( - "Token", - (_message.Message,), - dict( - DetectedBreak=_reflection.GeneratedProtocolMessageType( - "DetectedBreak", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENT_PAGE_TOKEN_DETECTEDBREAK, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""Detected break at the end of a - [Token][google.cloud.documentai.v1beta1.Document.Page.Token]. - - - Attributes: - type: - Detected break type. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak) - ), - ), - DESCRIPTOR=_DOCUMENT_PAGE_TOKEN, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""A detected token. - - - Attributes: - layout: - [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] - for - [Token][google.cloud.documentai.v1beta1.Document.Page.Token]. - detected_break: - Detected break at the end of a - [Token][google.cloud.documentai.v1beta1.Document.Page.Token]. - detected_languages: - A list of detected languages together with confidence. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.Page.Token) - ), - ), - VisualElement=_reflection.GeneratedProtocolMessageType( - "VisualElement", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENT_PAGE_VISUALELEMENT, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""Detected non-text visual elements e.g. checkbox, signature - etc. on the page. - - - Attributes: - layout: - [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] - for - [Token][google.cloud.documentai.v1beta1.Document.Page.Token]. - type: - Type of the [VisualElement][google.cloud.documentai.v1beta1.Do - cument.Page.VisualElement]. - detected_languages: - A list of detected languages together with confidence. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.Page.VisualElement) - ), - ), - Table=_reflection.GeneratedProtocolMessageType( - "Table", - (_message.Message,), - dict( - TableRow=_reflection.GeneratedProtocolMessageType( - "TableRow", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENT_PAGE_TABLE_TABLEROW, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""A row of table cells. - - - Attributes: - cells: - Cells that make up this row. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.Page.Table.TableRow) - ), - ), - TableCell=_reflection.GeneratedProtocolMessageType( - "TableCell", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENT_PAGE_TABLE_TABLECELL, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""A cell representation inside the table. - - - Attributes: - layout: - [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] - for [TableCell][google.cloud.documentai.v1beta1.Document.Page. - Table.TableCell]. - row_span: - How many rows this cell spans. - col_span: - How many columns this cell spans. - detected_languages: - A list of detected languages together with confidence. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.Page.Table.TableCell) - ), - ), - DESCRIPTOR=_DOCUMENT_PAGE_TABLE, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""A table representation similar to HTML table structure. - - - Attributes: - layout: - [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] - for - [Table][google.cloud.documentai.v1beta1.Document.Page.Table]. - header_rows: - Header rows of the table. - body_rows: - Body rows of the table. - detected_languages: - A list of detected languages together with confidence. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.Page.Table) - ), - ), - FormField=_reflection.GeneratedProtocolMessageType( - "FormField", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENT_PAGE_FORMFIELD, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""A form field detected on the page. - - - Attributes: - field_name: - [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] - for the [FormField][google.cloud.documentai.v1beta1.Document.P - age.FormField] name. e.g. ``Address``, ``Email``, ``Grand - total``, ``Phone number``, etc. - field_value: - [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] - for the [FormField][google.cloud.documentai.v1beta1.Document.P - age.FormField] value. - name_detected_languages: - A list of detected languages for name together with - confidence. - value_detected_languages: - A list of detected languages for value together with - confidence. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.Page.FormField) - ), - ), - DetectedLanguage=_reflection.GeneratedProtocolMessageType( - "DetectedLanguage", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENT_PAGE_DETECTEDLANGUAGE, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""Detected language for a structural component. - - - Attributes: - language_code: - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see http://www.unicode.org/reports/tr35/#Uni - code\_locale\_identifier. - confidence: - Confidence of detected language. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.Page.DetectedLanguage) - ), - ), - DESCRIPTOR=_DOCUMENT_PAGE, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""A page in a - [Document][google.cloud.documentai.v1beta1.Document]. - - - Attributes: - page_number: - 1-based index for current - [Page][google.cloud.documentai.v1beta1.Document.Page] in a - parent [Document][google.cloud.documentai.v1beta1.Document]. - Useful when a page is taken out of a - [Document][google.cloud.documentai.v1beta1.Document] for - individual processing. - dimension: - Physical dimension of the page. - layout: - [Layout][google.cloud.documentai.v1beta1.Document.Page.Layout] - for the page. - detected_languages: - A list of detected languages together with confidence. - blocks: - A list of visually detected text blocks on the page. A block - has a set of lines (collected into paragraphs) that have a - common line-spacing and orientation. - paragraphs: - A list of visually detected text paragraphs on the page. A - collection of lines that a human would perceive as a - paragraph. - lines: - A list of visually detected text lines on the page. A - collection of tokens that a human would perceive as a line. - tokens: - A list of visually detected tokens on the page. - visual_elements: - A list of detected non-text visual elements e.g. checkbox, - signature etc. on the page. - tables: - A list of visually detected tables on the page. - form_fields: - A list of visually detected form fields on the page. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.Page) - ), - ), - Entity=_reflection.GeneratedProtocolMessageType( - "Entity", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENT_ENTITY, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""A phrase in the text that is a known entity type, such as - a person, an organization, or location. - - - Attributes: - text_anchor: - Provenance of the entity. Text anchor indexing into the [Docum - ent.text][google.cloud.documentai.v1beta1.Document.text]. - type: - Entity type from a schema e.g. ``Address``. - mention_text: - Text value in the document e.g. ``1600 Amphitheatre Pkwy``. - mention_id: - Canonical mention name. This will be a unique value in the - entity list for this document. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.Entity) - ), - ), - EntityRelation=_reflection.GeneratedProtocolMessageType( - "EntityRelation", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENT_ENTITYRELATION, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""Relationship between - [Entities][google.cloud.documentai.v1beta1.Document.Entity]. - - - Attributes: - subject_id: - Subject entity mention\_id. - object_id: - Object entity mention\_id. - relation: - Relationship description. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.EntityRelation) - ), - ), - TextAnchor=_reflection.GeneratedProtocolMessageType( - "TextAnchor", - (_message.Message,), - dict( - TextSegment=_reflection.GeneratedProtocolMessageType( - "TextSegment", - (_message.Message,), - dict( - DESCRIPTOR=_DOCUMENT_TEXTANCHOR_TEXTSEGMENT, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""A text segment in the - [Document.text][google.cloud.documentai.v1beta1.Document.text]. The - indices may be out of bounds which indicate that the text extends into - another document shard for large sharded documents. See - [ShardInfo.text\_offset][google.cloud.documentai.v1beta1.Document.ShardInfo.text\_offset] - - - Attributes: - start_index: - [TextSegment][google.cloud.documentai.v1beta1.Document.TextAnc - hor.TextSegment] start UTF-8 char index in the [Document.text] - [google.cloud.documentai.v1beta1.Document.text]. - end_index: - [TextSegment][google.cloud.documentai.v1beta1.Document.TextAnc - hor.TextSegment] half open end UTF-8 char index in the [Docume - nt.text][google.cloud.documentai.v1beta1.Document.text]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.TextAnchor.TextSegment) - ), - ), - DESCRIPTOR=_DOCUMENT_TEXTANCHOR, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""Text reference indexing into the - [Document.text][google.cloud.documentai.v1beta1.Document.text]. - - - Attributes: - text_segments: - The text segments from the [Document.text][google.cloud.docume - ntai.v1beta1.Document.text]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document.TextAnchor) - ), - ), - DESCRIPTOR=_DOCUMENT, - __module__="google.cloud.documentai_v1beta1.proto.document_pb2", - __doc__="""Document represents the canonical document resource in - Document Understanding AI. It is an interchange format that provides - insights into documents and allows for collaboration between users and - Document Understanding AI to iterate and optimize for quality. - - - Attributes: - source: - Original source document from the user. - uri: - Currently supports Google Cloud Storage URI of the form - ``gs://bucket_name/object_name``. Object versioning is not - supported. See `Google Cloud Storage Request URIs - `__ for - more info. - content: - Inline document content, represented as a stream of bytes. - Note: As with all ``bytes`` fields, protobuffers use a pure - binary representation, whereas JSON representations use - base64. - mime_type: - An IANA published MIME type (also referred to as media type). - For more information, see - https://www.iana.org/assignments/media-types/media- - types.xhtml. - text: - UTF-8 encoded text in reading order from the document. - text_styles: - Styles for the [Document.text][google.cloud.documentai.v1beta1 - .Document.text]. - pages: - Visual page layout for the - [Document][google.cloud.documentai.v1beta1.Document]. - entities: - A list of entities detected on [Document.text][google.cloud.do - cumentai.v1beta1.Document.text]. For document shards, entities - in this list may cross shard boundaries. - entity_relations: - Relationship among [Document.entities][google.cloud.documentai - .v1beta1.Document.entities]. - shard_info: - Information about the sharding if this document is sharded - part of a larger document. If the document is not sharded, - this message is not specified. - error: - Any error that occurred while processing this document. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Document) - ), -) -_sym_db.RegisterMessage(Document) -_sym_db.RegisterMessage(Document.ShardInfo) -_sym_db.RegisterMessage(Document.Style) -_sym_db.RegisterMessage(Document.Style.FontSize) -_sym_db.RegisterMessage(Document.Page) -_sym_db.RegisterMessage(Document.Page.Dimension) -_sym_db.RegisterMessage(Document.Page.Layout) -_sym_db.RegisterMessage(Document.Page.Block) -_sym_db.RegisterMessage(Document.Page.Paragraph) -_sym_db.RegisterMessage(Document.Page.Line) -_sym_db.RegisterMessage(Document.Page.Token) -_sym_db.RegisterMessage(Document.Page.Token.DetectedBreak) -_sym_db.RegisterMessage(Document.Page.VisualElement) -_sym_db.RegisterMessage(Document.Page.Table) -_sym_db.RegisterMessage(Document.Page.Table.TableRow) -_sym_db.RegisterMessage(Document.Page.Table.TableCell) -_sym_db.RegisterMessage(Document.Page.FormField) -_sym_db.RegisterMessage(Document.Page.DetectedLanguage) -_sym_db.RegisterMessage(Document.Entity) -_sym_db.RegisterMessage(Document.EntityRelation) -_sym_db.RegisterMessage(Document.TextAnchor) -_sym_db.RegisterMessage(Document.TextAnchor.TextSegment) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/documentai/google/cloud/documentai_v1beta1/proto/document_pb2_grpc.py b/documentai/google/cloud/documentai_v1beta1/proto/document_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/documentai/google/cloud/documentai_v1beta1/proto/document_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/documentai/google/cloud/documentai_v1beta1/proto/document_understanding.proto b/documentai/google/cloud/documentai_v1beta1/proto/document_understanding.proto deleted file mode 100644 index 4f8dfb722986..000000000000 --- a/documentai/google/cloud/documentai_v1beta1/proto/document_understanding.proto +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.documentai.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/cloud/documentai/v1beta1/geometry.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1beta1;documentai"; -option java_multiple_files = true; -option java_outer_classname = "DocumentAiProto"; -option java_package = "com.google.cloud.documentai.v1beta1"; - -// Service to parse structured information from unstructured or semi-structured -// documents using state-of-the-art Google AI such as natural language, -// computer vision, and translation. -service DocumentUnderstandingService { - option (google.api.default_host) = "documentai.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // LRO endpoint to batch process many documents. - rpc BatchProcessDocuments(BatchProcessDocumentsRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/documents:batchProcess" - body: "*" - additional_bindings { - post: "/v1beta1/{parent=projects/*}/documents:batchProcess" - body: "*" - } - }; - option (google.api.method_signature) = "requests"; - option (google.longrunning.operation_info) = { - response_type: "BatchProcessDocumentsResponse" - metadata_type: "OperationMetadata" - }; - } -} - -// Request to batch process documents as an asynchronous operation. -message BatchProcessDocumentsRequest { - // Required. Individual requests for each document. - repeated ProcessDocumentRequest requests = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Target project and location to make a call. - // - // Format: `projects/{project-id}/locations/{location-id}`. - // - // If no location is specified, a region will be chosen automatically. - string parent = 2; -} - -// Request to process one document. -message ProcessDocumentRequest { - // Required. Information about the input file. - InputConfig input_config = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The desired output location. - OutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED]; - - // Specifies a known document type for deeper structure detection. Valid - // values are currently "general" and "invoice". If not provided, "general"\ - // is used as default. If any other value is given, the request is rejected. - string document_type = 3; - - // Controls table extraction behavior. If not specified, the system will - // decide reasonable defaults. - TableExtractionParams table_extraction_params = 4; - - // Controls form extraction behavior. If not specified, the system will - // decide reasonable defaults. - FormExtractionParams form_extraction_params = 5; - - // Controls entity extraction behavior. If not specified, the system will - // decide reasonable defaults. - EntityExtractionParams entity_extraction_params = 6; - - // Controls OCR behavior. If not specified, the system will decide reasonable - // defaults. - OcrParams ocr_params = 7; -} - -// Response to an batch document processing request. This is returned in -// the LRO Operation after the operation is complete. -message BatchProcessDocumentsResponse { - // Responses for each individual document. - repeated ProcessDocumentResponse responses = 1; -} - -// Response to a single document processing request. -message ProcessDocumentResponse { - // Information about the input file. This is the same as the corresponding - // input config in the request. - InputConfig input_config = 1; - - // The output location of the parsed responses. The responses are written to - // this location as JSON-serialized `Document` objects. - OutputConfig output_config = 2; -} - -// Parameters to control Optical Character Recognition (OCR) behavior. -message OcrParams { - // List of languages to use for OCR. In most cases, an empty value - // yields the best results since it enables automatic language detection. For - // languages based on the Latin alphabet, setting `language_hints` is not - // needed. In rare cases, when the language of the text in the image is known, - // setting a hint will help get better results (although it will be a - // significant hindrance if the hint is wrong). Document processing returns an - // error if one or more of the specified languages is not one of the - // supported languages. - repeated string language_hints = 1; -} - -// Parameters to control table extraction behavior. -message TableExtractionParams { - // Whether to enable table extraction. - bool enabled = 1; - - // Optional. Table bounding box hints that can be provided to complex cases - // which our algorithm cannot locate the table(s) in. - repeated TableBoundHint table_bound_hints = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Table header hints. The extraction will bias towards producing - // these terms as table headers, which may improve accuracy. - repeated string header_hints = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Model version of the table extraction system. Default is "builtin/stable". - // Specify "builtin/latest" for the latest model. - string model_version = 4; -} - -// A hint for a table bounding box on the page for table parsing. -message TableBoundHint { - // Optional. Page number for multi-paged inputs this hint applies to. If not - // provided, this hint will apply to all pages by default. This value is - // 1-based. - int32 page_number = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Bounding box hint for a table on this page. The coordinates must be - // normalized to [0,1] and the bounding box must be an axis-aligned rectangle. - BoundingPoly bounding_box = 2; -} - -// Parameters to control form extraction behavior. -message FormExtractionParams { - // Whether to enable form extraction. - bool enabled = 1; - - // User can provide pairs of (key text, value type) to improve the parsing - // result. - // - // For example, if a document has a field called "Date" that holds a date - // value and a field called "Amount" that may hold either a currency value - // (e.g., "$500.00") or a simple number value (e.g., "20"), you could use the - // following hints: [ {"key": "Date", value_types: [ "DATE"]}, {"key": - // "Amount", "value_types": [ "PRICE", "NUMBER" ]} ] - // - // If the value type is unknown, but you want to provide hints for the keys, - // you can leave the value_types field blank. e.g. {"key": "Date", - // "value_types": []} - repeated KeyValuePairHint key_value_pair_hints = 2; - - // Model version of the form extraction system. Default is - // "builtin/stable". Specify "builtin/latest" for the latest model. - string model_version = 3; -} - -// User-provided hint for key value pair. -message KeyValuePairHint { - // The key text for the hint. - string key = 1; - - // Type of the value. This is case-insensitive, and could be one of: - // ADDRESS, LOCATION, ORGANIZATION, PERSON, PHONE_NUMBER, - // ID, NUMBER, EMAIL, PRICE, TERMS, DATE, NAME. Types not in this list will - // be ignored. - repeated string value_types = 2; -} - -// Parameters to control entity extraction behavior. -message EntityExtractionParams { - // Whether to enable entity extraction. - bool enabled = 1; - - // Model version of the entity extraction. Default is - // "builtin/stable". Specify "builtin/latest" for the latest model. - string model_version = 2; -} - -// The desired input location and metadata. -message InputConfig { - // Required. - oneof source { - // The Google Cloud Storage location to read the input from. This must be a - // single file. - GcsSource gcs_source = 1; - } - - // Required. Mimetype of the input. Current supported mimetypes are - // application/pdf, image/tiff, and image/gif. - string mime_type = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The desired output location and metadata. -message OutputConfig { - // Required. - oneof destination { - // The Google Cloud Storage location to write the output to. - GcsDestination gcs_destination = 1; - } - - // The max number of pages to include into each output Document shard JSON on - // Google Cloud Storage. - // - // The valid range is [1, 100]. If not specified, the default value is 20. - // - // For example, for one pdf file with 100 pages, 100 parsed pages will be - // produced. If `pages_per_shard` = 20, then 5 Document shard JSON files each - // containing 20 parsed pages will be written under the prefix - // [OutputConfig.gcs_destination.uri][] and suffix pages-x-to-y.json where - // x and y are 1-indexed page numbers. - // - // Example GCS outputs with 157 pages and pages_per_shard = 50: - // - // pages-001-to-050.json - // pages-051-to-100.json - // pages-101-to-150.json - // pages-151-to-157.json - int32 pages_per_shard = 2; -} - -// The Google Cloud Storage location where the input file will be read from. -message GcsSource { - string uri = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The Google Cloud Storage location where the output file will be written to. -message GcsDestination { - string uri = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Contains metadata for the BatchProcessDocuments operation. -message OperationMetadata { - enum State { - // The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0; - - // Request is received. - ACCEPTED = 1; - - // Request operation is waiting for scheduling. - WAITING = 2; - - // Request is being processed. - RUNNING = 3; - - // The batch processing completed successfully. - SUCCEEDED = 4; - - // The batch processing was cancelled. - CANCELLED = 5; - - // The batch processing has failed. - FAILED = 6; - } - - // The state of the current batch processing. - State state = 1; - - // A message providing more details about the current state of processing. - string state_message = 2; - - // The creation time of the operation. - google.protobuf.Timestamp create_time = 3; - - // The last update time of the operation. - google.protobuf.Timestamp update_time = 4; -} diff --git a/documentai/google/cloud/documentai_v1beta1/proto/document_understanding_pb2.py b/documentai/google/cloud/documentai_v1beta1/proto/document_understanding_pb2.py deleted file mode 100644 index 02fbee61ce06..000000000000 --- a/documentai/google/cloud/documentai_v1beta1/proto/document_understanding_pb2.py +++ /dev/null @@ -1,1559 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai_v1beta1/proto/document_understanding.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.cloud.documentai_v1beta1.proto import ( - geometry_pb2 as google_dot_cloud_dot_documentai__v1beta1_dot_proto_dot_geometry__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/documentai_v1beta1/proto/document_understanding.proto", - package="google.cloud.documentai.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n#com.google.cloud.documentai.v1beta1B\017DocumentAiProtoP\001ZIgoogle.golang.org/genproto/googleapis/cloud/documentai/v1beta1;documentai" - ), - serialized_pb=_b( - '\nBgoogle/cloud/documentai_v1beta1/proto/document_understanding.proto\x12\x1fgoogle.cloud.documentai.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x34google/cloud/documentai_v1beta1/proto/geometry.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto"~\n\x1c\x42\x61tchProcessDocumentsRequest\x12N\n\x08requests\x18\x01 \x03(\x0b\x32\x37.google.cloud.documentai.v1beta1.ProcessDocumentRequestB\x03\xe0\x41\x02\x12\x0e\n\x06parent\x18\x02 \x01(\t"\x8e\x04\n\x16ProcessDocumentRequest\x12G\n\x0cinput_config\x18\x01 \x01(\x0b\x32,.google.cloud.documentai.v1beta1.InputConfigB\x03\xe0\x41\x02\x12I\n\routput_config\x18\x02 \x01(\x0b\x32-.google.cloud.documentai.v1beta1.OutputConfigB\x03\xe0\x41\x02\x12\x15\n\rdocument_type\x18\x03 \x01(\t\x12W\n\x17table_extraction_params\x18\x04 \x01(\x0b\x32\x36.google.cloud.documentai.v1beta1.TableExtractionParams\x12U\n\x16\x66orm_extraction_params\x18\x05 \x01(\x0b\x32\x35.google.cloud.documentai.v1beta1.FormExtractionParams\x12Y\n\x18\x65ntity_extraction_params\x18\x06 \x01(\x0b\x32\x37.google.cloud.documentai.v1beta1.EntityExtractionParams\x12>\n\nocr_params\x18\x07 \x01(\x0b\x32*.google.cloud.documentai.v1beta1.OcrParams"l\n\x1d\x42\x61tchProcessDocumentsResponse\x12K\n\tresponses\x18\x01 \x03(\x0b\x32\x38.google.cloud.documentai.v1beta1.ProcessDocumentResponse"\xa3\x01\n\x17ProcessDocumentResponse\x12\x42\n\x0cinput_config\x18\x01 \x01(\x0b\x32,.google.cloud.documentai.v1beta1.InputConfig\x12\x44\n\routput_config\x18\x02 \x01(\x0b\x32-.google.cloud.documentai.v1beta1.OutputConfig"#\n\tOcrParams\x12\x16\n\x0elanguage_hints\x18\x01 \x03(\t"\xab\x01\n\x15TableExtractionParams\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12O\n\x11table_bound_hints\x18\x02 \x03(\x0b\x32/.google.cloud.documentai.v1beta1.TableBoundHintB\x03\xe0\x41\x01\x12\x19\n\x0cheader_hints\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x15\n\rmodel_version\x18\x04 \x01(\t"o\n\x0eTableBoundHint\x12\x18\n\x0bpage_number\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x43\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32-.google.cloud.documentai.v1beta1.BoundingPoly"\x8f\x01\n\x14\x46ormExtractionParams\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12O\n\x14key_value_pair_hints\x18\x02 \x03(\x0b\x32\x31.google.cloud.documentai.v1beta1.KeyValuePairHint\x12\x15\n\rmodel_version\x18\x03 \x01(\t"4\n\x10KeyValuePairHint\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x13\n\x0bvalue_types\x18\x02 \x03(\t"@\n\x16\x45ntityExtractionParams\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x15\n\rmodel_version\x18\x02 \x01(\t"q\n\x0bInputConfig\x12@\n\ngcs_source\x18\x01 \x01(\x0b\x32*.google.cloud.documentai.v1beta1.GcsSourceH\x00\x12\x16\n\tmime_type\x18\x02 \x01(\tB\x03\xe0\x41\x02\x42\x08\n\x06source"\x82\x01\n\x0cOutputConfig\x12J\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32/.google.cloud.documentai.v1beta1.GcsDestinationH\x00\x12\x17\n\x0fpages_per_shard\x18\x02 \x01(\x05\x42\r\n\x0b\x64\x65stination"\x1d\n\tGcsSource\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02""\n\x0eGcsDestination\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02"\xc7\x02\n\x11OperationMetadata\x12G\n\x05state\x18\x01 \x01(\x0e\x32\x38.google.cloud.documentai.v1beta1.OperationMetadata.State\x12\x15\n\rstate_message\x18\x02 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"p\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x41\x43\x43\x45PTED\x10\x01\x12\x0b\n\x07WAITING\x10\x02\x12\x0b\n\x07RUNNING\x10\x03\x12\r\n\tSUCCEEDED\x10\x04\x12\r\n\tCANCELLED\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x32\xac\x03\n\x1c\x44ocumentUnderstandingService\x12\xbc\x02\n\x15\x42\x61tchProcessDocuments\x12=.google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest\x1a\x1d.google.longrunning.Operation"\xc4\x01\x82\xd3\xe4\x93\x02~"?/v1beta1/{parent=projects/*/locations/*}/documents:batchProcess:\x01*Z8"3/v1beta1/{parent=projects/*}/documents:batchProcess:\x01*\xda\x41\x08requests\xca\x41\x32\n\x1d\x42\x61tchProcessDocumentsResponse\x12\x11OperationMetadata\x1aM\xca\x41\x19\x64ocumentai.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x83\x01\n#com.google.cloud.documentai.v1beta1B\x0f\x44ocumentAiProtoP\x01ZIgoogle.golang.org/genproto/googleapis/cloud/documentai/v1beta1;documentaib\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_cloud_dot_documentai__v1beta1_dot_proto_dot_geometry__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_OPERATIONMETADATA_STATE = _descriptor.EnumDescriptor( - name="State", - full_name="google.cloud.documentai.v1beta1.OperationMetadata.State", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="ACCEPTED", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="WAITING", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RUNNING", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SUCCEEDED", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLED", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FAILED", index=6, number=6, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2369, - serialized_end=2481, -) -_sym_db.RegisterEnumDescriptor(_OPERATIONMETADATA_STATE) - - -_BATCHPROCESSDOCUMENTSREQUEST = _descriptor.Descriptor( - name="BatchProcessDocumentsRequest", - full_name="google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="requests", - full_name="google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest.requests", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest.parent", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=315, - serialized_end=441, -) - - -_PROCESSDOCUMENTREQUEST = _descriptor.Descriptor( - name="ProcessDocumentRequest", - full_name="google.cloud.documentai.v1beta1.ProcessDocumentRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_config", - full_name="google.cloud.documentai.v1beta1.ProcessDocumentRequest.input_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="output_config", - full_name="google.cloud.documentai.v1beta1.ProcessDocumentRequest.output_config", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="document_type", - full_name="google.cloud.documentai.v1beta1.ProcessDocumentRequest.document_type", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="table_extraction_params", - full_name="google.cloud.documentai.v1beta1.ProcessDocumentRequest.table_extraction_params", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="form_extraction_params", - full_name="google.cloud.documentai.v1beta1.ProcessDocumentRequest.form_extraction_params", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="entity_extraction_params", - full_name="google.cloud.documentai.v1beta1.ProcessDocumentRequest.entity_extraction_params", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ocr_params", - full_name="google.cloud.documentai.v1beta1.ProcessDocumentRequest.ocr_params", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=444, - serialized_end=970, -) - - -_BATCHPROCESSDOCUMENTSRESPONSE = _descriptor.Descriptor( - name="BatchProcessDocumentsResponse", - full_name="google.cloud.documentai.v1beta1.BatchProcessDocumentsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="responses", - full_name="google.cloud.documentai.v1beta1.BatchProcessDocumentsResponse.responses", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=972, - serialized_end=1080, -) - - -_PROCESSDOCUMENTRESPONSE = _descriptor.Descriptor( - name="ProcessDocumentResponse", - full_name="google.cloud.documentai.v1beta1.ProcessDocumentResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_config", - full_name="google.cloud.documentai.v1beta1.ProcessDocumentResponse.input_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="output_config", - full_name="google.cloud.documentai.v1beta1.ProcessDocumentResponse.output_config", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1083, - serialized_end=1246, -) - - -_OCRPARAMS = _descriptor.Descriptor( - name="OcrParams", - full_name="google.cloud.documentai.v1beta1.OcrParams", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_hints", - full_name="google.cloud.documentai.v1beta1.OcrParams.language_hints", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1248, - serialized_end=1283, -) - - -_TABLEEXTRACTIONPARAMS = _descriptor.Descriptor( - name="TableExtractionParams", - full_name="google.cloud.documentai.v1beta1.TableExtractionParams", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="enabled", - full_name="google.cloud.documentai.v1beta1.TableExtractionParams.enabled", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="table_bound_hints", - full_name="google.cloud.documentai.v1beta1.TableExtractionParams.table_bound_hints", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="header_hints", - full_name="google.cloud.documentai.v1beta1.TableExtractionParams.header_hints", - index=2, - number=3, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model_version", - full_name="google.cloud.documentai.v1beta1.TableExtractionParams.model_version", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1286, - serialized_end=1457, -) - - -_TABLEBOUNDHINT = _descriptor.Descriptor( - name="TableBoundHint", - full_name="google.cloud.documentai.v1beta1.TableBoundHint", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="page_number", - full_name="google.cloud.documentai.v1beta1.TableBoundHint.page_number", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box", - full_name="google.cloud.documentai.v1beta1.TableBoundHint.bounding_box", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1459, - serialized_end=1570, -) - - -_FORMEXTRACTIONPARAMS = _descriptor.Descriptor( - name="FormExtractionParams", - full_name="google.cloud.documentai.v1beta1.FormExtractionParams", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="enabled", - full_name="google.cloud.documentai.v1beta1.FormExtractionParams.enabled", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="key_value_pair_hints", - full_name="google.cloud.documentai.v1beta1.FormExtractionParams.key_value_pair_hints", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model_version", - full_name="google.cloud.documentai.v1beta1.FormExtractionParams.model_version", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1573, - serialized_end=1716, -) - - -_KEYVALUEPAIRHINT = _descriptor.Descriptor( - name="KeyValuePairHint", - full_name="google.cloud.documentai.v1beta1.KeyValuePairHint", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.documentai.v1beta1.KeyValuePairHint.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value_types", - full_name="google.cloud.documentai.v1beta1.KeyValuePairHint.value_types", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1718, - serialized_end=1770, -) - - -_ENTITYEXTRACTIONPARAMS = _descriptor.Descriptor( - name="EntityExtractionParams", - full_name="google.cloud.documentai.v1beta1.EntityExtractionParams", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="enabled", - full_name="google.cloud.documentai.v1beta1.EntityExtractionParams.enabled", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model_version", - full_name="google.cloud.documentai.v1beta1.EntityExtractionParams.model_version", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1772, - serialized_end=1836, -) - - -_INPUTCONFIG = _descriptor.Descriptor( - name="InputConfig", - full_name="google.cloud.documentai.v1beta1.InputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_source", - full_name="google.cloud.documentai.v1beta1.InputConfig.gcs_source", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.documentai.v1beta1.InputConfig.mime_type", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="source", - full_name="google.cloud.documentai.v1beta1.InputConfig.source", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1838, - serialized_end=1951, -) - - -_OUTPUTCONFIG = _descriptor.Descriptor( - name="OutputConfig", - full_name="google.cloud.documentai.v1beta1.OutputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_destination", - full_name="google.cloud.documentai.v1beta1.OutputConfig.gcs_destination", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pages_per_shard", - full_name="google.cloud.documentai.v1beta1.OutputConfig.pages_per_shard", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="destination", - full_name="google.cloud.documentai.v1beta1.OutputConfig.destination", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1954, - serialized_end=2084, -) - - -_GCSSOURCE = _descriptor.Descriptor( - name="GcsSource", - full_name="google.cloud.documentai.v1beta1.GcsSource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.documentai.v1beta1.GcsSource.uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2086, - serialized_end=2115, -) - - -_GCSDESTINATION = _descriptor.Descriptor( - name="GcsDestination", - full_name="google.cloud.documentai.v1beta1.GcsDestination", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.documentai.v1beta1.GcsDestination.uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2117, - serialized_end=2151, -) - - -_OPERATIONMETADATA = _descriptor.Descriptor( - name="OperationMetadata", - full_name="google.cloud.documentai.v1beta1.OperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="state", - full_name="google.cloud.documentai.v1beta1.OperationMetadata.state", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="state_message", - full_name="google.cloud.documentai.v1beta1.OperationMetadata.state_message", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.documentai.v1beta1.OperationMetadata.create_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_time", - full_name="google.cloud.documentai.v1beta1.OperationMetadata.update_time", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_OPERATIONMETADATA_STATE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2154, - serialized_end=2481, -) - -_BATCHPROCESSDOCUMENTSREQUEST.fields_by_name[ - "requests" -].message_type = _PROCESSDOCUMENTREQUEST -_PROCESSDOCUMENTREQUEST.fields_by_name["input_config"].message_type = _INPUTCONFIG -_PROCESSDOCUMENTREQUEST.fields_by_name["output_config"].message_type = _OUTPUTCONFIG -_PROCESSDOCUMENTREQUEST.fields_by_name[ - "table_extraction_params" -].message_type = _TABLEEXTRACTIONPARAMS -_PROCESSDOCUMENTREQUEST.fields_by_name[ - "form_extraction_params" -].message_type = _FORMEXTRACTIONPARAMS -_PROCESSDOCUMENTREQUEST.fields_by_name[ - "entity_extraction_params" -].message_type = _ENTITYEXTRACTIONPARAMS -_PROCESSDOCUMENTREQUEST.fields_by_name["ocr_params"].message_type = _OCRPARAMS -_BATCHPROCESSDOCUMENTSRESPONSE.fields_by_name[ - "responses" -].message_type = _PROCESSDOCUMENTRESPONSE -_PROCESSDOCUMENTRESPONSE.fields_by_name["input_config"].message_type = _INPUTCONFIG -_PROCESSDOCUMENTRESPONSE.fields_by_name["output_config"].message_type = _OUTPUTCONFIG -_TABLEEXTRACTIONPARAMS.fields_by_name[ - "table_bound_hints" -].message_type = _TABLEBOUNDHINT -_TABLEBOUNDHINT.fields_by_name[ - "bounding_box" -].message_type = ( - google_dot_cloud_dot_documentai__v1beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_FORMEXTRACTIONPARAMS.fields_by_name[ - "key_value_pair_hints" -].message_type = _KEYVALUEPAIRHINT -_INPUTCONFIG.fields_by_name["gcs_source"].message_type = _GCSSOURCE -_INPUTCONFIG.oneofs_by_name["source"].fields.append( - _INPUTCONFIG.fields_by_name["gcs_source"] -) -_INPUTCONFIG.fields_by_name[ - "gcs_source" -].containing_oneof = _INPUTCONFIG.oneofs_by_name["source"] -_OUTPUTCONFIG.fields_by_name["gcs_destination"].message_type = _GCSDESTINATION -_OUTPUTCONFIG.oneofs_by_name["destination"].fields.append( - _OUTPUTCONFIG.fields_by_name["gcs_destination"] -) -_OUTPUTCONFIG.fields_by_name[ - "gcs_destination" -].containing_oneof = _OUTPUTCONFIG.oneofs_by_name["destination"] -_OPERATIONMETADATA.fields_by_name["state"].enum_type = _OPERATIONMETADATA_STATE -_OPERATIONMETADATA.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_OPERATIONMETADATA.fields_by_name[ - "update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_OPERATIONMETADATA_STATE.containing_type = _OPERATIONMETADATA -DESCRIPTOR.message_types_by_name[ - "BatchProcessDocumentsRequest" -] = _BATCHPROCESSDOCUMENTSREQUEST -DESCRIPTOR.message_types_by_name["ProcessDocumentRequest"] = _PROCESSDOCUMENTREQUEST -DESCRIPTOR.message_types_by_name[ - "BatchProcessDocumentsResponse" -] = _BATCHPROCESSDOCUMENTSRESPONSE -DESCRIPTOR.message_types_by_name["ProcessDocumentResponse"] = _PROCESSDOCUMENTRESPONSE -DESCRIPTOR.message_types_by_name["OcrParams"] = _OCRPARAMS -DESCRIPTOR.message_types_by_name["TableExtractionParams"] = _TABLEEXTRACTIONPARAMS -DESCRIPTOR.message_types_by_name["TableBoundHint"] = _TABLEBOUNDHINT -DESCRIPTOR.message_types_by_name["FormExtractionParams"] = _FORMEXTRACTIONPARAMS -DESCRIPTOR.message_types_by_name["KeyValuePairHint"] = _KEYVALUEPAIRHINT -DESCRIPTOR.message_types_by_name["EntityExtractionParams"] = _ENTITYEXTRACTIONPARAMS -DESCRIPTOR.message_types_by_name["InputConfig"] = _INPUTCONFIG -DESCRIPTOR.message_types_by_name["OutputConfig"] = _OUTPUTCONFIG -DESCRIPTOR.message_types_by_name["GcsSource"] = _GCSSOURCE -DESCRIPTOR.message_types_by_name["GcsDestination"] = _GCSDESTINATION -DESCRIPTOR.message_types_by_name["OperationMetadata"] = _OPERATIONMETADATA -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -BatchProcessDocumentsRequest = _reflection.GeneratedProtocolMessageType( - "BatchProcessDocumentsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHPROCESSDOCUMENTSREQUEST, - __module__="google.cloud.documentai_v1beta1.proto.document_understanding_pb2", - __doc__="""Request to batch process documents as an asynchronous - operation. - - - Attributes: - requests: - Required. Individual requests for each document. - parent: - Target project and location to make a call. Format: - ``projects/{project-id}/locations/{location-id}``. If no - location is specified, a region will be chosen automatically. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.BatchProcessDocumentsRequest) - ), -) -_sym_db.RegisterMessage(BatchProcessDocumentsRequest) - -ProcessDocumentRequest = _reflection.GeneratedProtocolMessageType( - "ProcessDocumentRequest", - (_message.Message,), - dict( - DESCRIPTOR=_PROCESSDOCUMENTREQUEST, - __module__="google.cloud.documentai_v1beta1.proto.document_understanding_pb2", - __doc__="""Request to process one document. - - - Attributes: - input_config: - Required. Information about the input file. - output_config: - Required. The desired output location. | - document_type: - Specifies a known document type for deeper structure - detection. Valid values are currently "general" and "invoice". - If not provided, "general" | is used as default. If any - other value is given, the request is rejected. - table_extraction_params: - Controls table extraction behavior. If not specified, the - system will decide reasonable defaults. - form_extraction_params: - Controls form extraction behavior. If not specified, the - system will decide reasonable defaults. - entity_extraction_params: - Controls entity extraction behavior. If not specified, the - system will decide reasonable defaults. - ocr_params: - Controls OCR behavior. If not specified, the system will - decide reasonable defaults. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.ProcessDocumentRequest) - ), -) -_sym_db.RegisterMessage(ProcessDocumentRequest) - -BatchProcessDocumentsResponse = _reflection.GeneratedProtocolMessageType( - "BatchProcessDocumentsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHPROCESSDOCUMENTSRESPONSE, - __module__="google.cloud.documentai_v1beta1.proto.document_understanding_pb2", - __doc__="""Response to an batch document processing request. This is - returned in the LRO Operation after the operation is complete. - - - Attributes: - responses: - Responses for each individual document. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.BatchProcessDocumentsResponse) - ), -) -_sym_db.RegisterMessage(BatchProcessDocumentsResponse) - -ProcessDocumentResponse = _reflection.GeneratedProtocolMessageType( - "ProcessDocumentResponse", - (_message.Message,), - dict( - DESCRIPTOR=_PROCESSDOCUMENTRESPONSE, - __module__="google.cloud.documentai_v1beta1.proto.document_understanding_pb2", - __doc__="""Response to a single document processing request. - - - Attributes: - input_config: - Information about the input file. This is the same as the - corresponding input config in the request. - output_config: - The output location of the parsed responses. The responses are - written to this location as JSON-serialized ``Document`` - objects. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.ProcessDocumentResponse) - ), -) -_sym_db.RegisterMessage(ProcessDocumentResponse) - -OcrParams = _reflection.GeneratedProtocolMessageType( - "OcrParams", - (_message.Message,), - dict( - DESCRIPTOR=_OCRPARAMS, - __module__="google.cloud.documentai_v1beta1.proto.document_understanding_pb2", - __doc__="""Parameters to control Optical Character Recognition (OCR) - behavior. - - - Attributes: - language_hints: - List of languages to use for OCR. In most cases, an empty - value yields the best results since it enables automatic - language detection. For languages based on the Latin alphabet, - setting ``language_hints`` is not needed. In rare cases, when - the language of the text in the image is known, setting a hint - will help get better results (although it will be a - significant hindrance if the hint is wrong). Document - processing returns an error if one or more of the specified - languages is not one of the supported languages. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.OcrParams) - ), -) -_sym_db.RegisterMessage(OcrParams) - -TableExtractionParams = _reflection.GeneratedProtocolMessageType( - "TableExtractionParams", - (_message.Message,), - dict( - DESCRIPTOR=_TABLEEXTRACTIONPARAMS, - __module__="google.cloud.documentai_v1beta1.proto.document_understanding_pb2", - __doc__="""Parameters to control table extraction behavior. - - - Attributes: - enabled: - Whether to enable table extraction. - table_bound_hints: - Optional. Table bounding box hints that can be provided to - complex cases which our algorithm cannot locate the table(s) - in. - header_hints: - Optional. Table header hints. The extraction will bias towards - producing these terms as table headers, which may improve - accuracy. - model_version: - Model version of the table extraction system. Default is - "builtin/stable". Specify "builtin/latest" for the latest - model. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.TableExtractionParams) - ), -) -_sym_db.RegisterMessage(TableExtractionParams) - -TableBoundHint = _reflection.GeneratedProtocolMessageType( - "TableBoundHint", - (_message.Message,), - dict( - DESCRIPTOR=_TABLEBOUNDHINT, - __module__="google.cloud.documentai_v1beta1.proto.document_understanding_pb2", - __doc__="""A hint for a table bounding box on the page for table - parsing. - - - Attributes: - page_number: - Optional. Page number for multi-paged inputs this hint applies - to. If not provided, this hint will apply to all pages by - default. This value is 1-based. - bounding_box: - Bounding box hint for a table on this page. The coordinates - must be normalized to [0,1] and the bounding box must be an - axis-aligned rectangle. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.TableBoundHint) - ), -) -_sym_db.RegisterMessage(TableBoundHint) - -FormExtractionParams = _reflection.GeneratedProtocolMessageType( - "FormExtractionParams", - (_message.Message,), - dict( - DESCRIPTOR=_FORMEXTRACTIONPARAMS, - __module__="google.cloud.documentai_v1beta1.proto.document_understanding_pb2", - __doc__="""Parameters to control form extraction behavior. - - - Attributes: - enabled: - Whether to enable form extraction. - key_value_pair_hints: - User can provide pairs of (key text, value type) to improve - the parsing result. For example, if a document has a field - called "Date" that holds a date value and a field called - "Amount" that may hold either a currency value (e.g., - "$500.00") or a simple number value (e.g., "20"), you could - use the following hints: [ {"key": "Date", value\_types: [ - "DATE"]}, {"key": "Amount", "value\_types": [ "PRICE", - "NUMBER" ]} ] If the value type is unknown, but you want to - provide hints for the keys, you can leave the value\_types - field blank. e.g. {"key": "Date", "value\_types": []} - model_version: - Model version of the form extraction system. Default is - "builtin/stable". Specify "builtin/latest" for the latest - model. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.FormExtractionParams) - ), -) -_sym_db.RegisterMessage(FormExtractionParams) - -KeyValuePairHint = _reflection.GeneratedProtocolMessageType( - "KeyValuePairHint", - (_message.Message,), - dict( - DESCRIPTOR=_KEYVALUEPAIRHINT, - __module__="google.cloud.documentai_v1beta1.proto.document_understanding_pb2", - __doc__="""User-provided hint for key value pair. - - - Attributes: - key: - The key text for the hint. - value_types: - Type of the value. This is case-insensitive, and could be one - of: ADDRESS, LOCATION, ORGANIZATION, PERSON, PHONE\_NUMBER, - ID, NUMBER, EMAIL, PRICE, TERMS, DATE, NAME. Types not in this - list will be ignored. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.KeyValuePairHint) - ), -) -_sym_db.RegisterMessage(KeyValuePairHint) - -EntityExtractionParams = _reflection.GeneratedProtocolMessageType( - "EntityExtractionParams", - (_message.Message,), - dict( - DESCRIPTOR=_ENTITYEXTRACTIONPARAMS, - __module__="google.cloud.documentai_v1beta1.proto.document_understanding_pb2", - __doc__="""Parameters to control entity extraction behavior. - - - Attributes: - enabled: - Whether to enable entity extraction. - model_version: - Model version of the entity extraction. Default is - "builtin/stable". Specify "builtin/latest" for the latest - model. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.EntityExtractionParams) - ), -) -_sym_db.RegisterMessage(EntityExtractionParams) - -InputConfig = _reflection.GeneratedProtocolMessageType( - "InputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_INPUTCONFIG, - __module__="google.cloud.documentai_v1beta1.proto.document_understanding_pb2", - __doc__="""The desired input location and metadata. - - - Attributes: - source: - Required. - gcs_source: - The Google Cloud Storage location to read the input from. This - must be a single file. - mime_type: - Required. Mimetype of the input. Current supported mimetypes - are application/pdf, image/tiff, and image/gif. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.InputConfig) - ), -) -_sym_db.RegisterMessage(InputConfig) - -OutputConfig = _reflection.GeneratedProtocolMessageType( - "OutputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_OUTPUTCONFIG, - __module__="google.cloud.documentai_v1beta1.proto.document_understanding_pb2", - __doc__="""The desired output location and metadata. - - - Attributes: - destination: - Required. - gcs_destination: - The Google Cloud Storage location to write the output to. - pages_per_shard: - The max number of pages to include into each output Document - shard JSON on Google Cloud Storage. The valid range is [1, - 100]. If not specified, the default value is 20. For example, - for one pdf file with 100 pages, 100 parsed pages will be - produced. If ``pages_per_shard`` = 20, then 5 Document shard - JSON files each containing 20 parsed pages will be written - under the prefix [OutputConfig.gcs\_destination.uri][] and - suffix pages-x-to-y.json where x and y are 1-indexed page - numbers. Example GCS outputs with 157 pages and - pages\_per\_shard = 50: pages-001-to-050.json - pages-051-to-100.json pages-101-to-150.json - pages-151-to-157.json - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.OutputConfig) - ), -) -_sym_db.RegisterMessage(OutputConfig) - -GcsSource = _reflection.GeneratedProtocolMessageType( - "GcsSource", - (_message.Message,), - dict( - DESCRIPTOR=_GCSSOURCE, - __module__="google.cloud.documentai_v1beta1.proto.document_understanding_pb2", - __doc__="""The Google Cloud Storage location where the input file - will be read from. - - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.GcsSource) - ), -) -_sym_db.RegisterMessage(GcsSource) - -GcsDestination = _reflection.GeneratedProtocolMessageType( - "GcsDestination", - (_message.Message,), - dict( - DESCRIPTOR=_GCSDESTINATION, - __module__="google.cloud.documentai_v1beta1.proto.document_understanding_pb2", - __doc__="""The Google Cloud Storage location where the output file - will be written to. - - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.GcsDestination) - ), -) -_sym_db.RegisterMessage(GcsDestination) - -OperationMetadata = _reflection.GeneratedProtocolMessageType( - "OperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_OPERATIONMETADATA, - __module__="google.cloud.documentai_v1beta1.proto.document_understanding_pb2", - __doc__="""Contains metadata for the BatchProcessDocuments operation. - - - Attributes: - state: - The state of the current batch processing. - state_message: - A message providing more details about the current state of - processing. - create_time: - The creation time of the operation. - update_time: - The last update time of the operation. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.OperationMetadata) - ), -) -_sym_db.RegisterMessage(OperationMetadata) - - -DESCRIPTOR._options = None -_BATCHPROCESSDOCUMENTSREQUEST.fields_by_name["requests"]._options = None -_PROCESSDOCUMENTREQUEST.fields_by_name["input_config"]._options = None -_PROCESSDOCUMENTREQUEST.fields_by_name["output_config"]._options = None -_TABLEEXTRACTIONPARAMS.fields_by_name["table_bound_hints"]._options = None -_TABLEEXTRACTIONPARAMS.fields_by_name["header_hints"]._options = None -_TABLEBOUNDHINT.fields_by_name["page_number"]._options = None -_INPUTCONFIG.fields_by_name["mime_type"]._options = None -_GCSSOURCE.fields_by_name["uri"]._options = None -_GCSDESTINATION.fields_by_name["uri"]._options = None - -_DOCUMENTUNDERSTANDINGSERVICE = _descriptor.ServiceDescriptor( - name="DocumentUnderstandingService", - full_name="google.cloud.documentai.v1beta1.DocumentUnderstandingService", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\031documentai.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=2484, - serialized_end=2912, - methods=[ - _descriptor.MethodDescriptor( - name="BatchProcessDocuments", - full_name="google.cloud.documentai.v1beta1.DocumentUnderstandingService.BatchProcessDocuments", - index=0, - containing_service=None, - input_type=_BATCHPROCESSDOCUMENTSREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002~"?/v1beta1/{parent=projects/*/locations/*}/documents:batchProcess:\001*Z8"3/v1beta1/{parent=projects/*}/documents:batchProcess:\001*\332A\010requests\312A2\n\035BatchProcessDocumentsResponse\022\021OperationMetadata' - ), - ) - ], -) -_sym_db.RegisterServiceDescriptor(_DOCUMENTUNDERSTANDINGSERVICE) - -DESCRIPTOR.services_by_name[ - "DocumentUnderstandingService" -] = _DOCUMENTUNDERSTANDINGSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/documentai/google/cloud/documentai_v1beta1/proto/document_understanding_pb2_grpc.py b/documentai/google/cloud/documentai_v1beta1/proto/document_understanding_pb2_grpc.py deleted file mode 100644 index 6e6d2308d9af..000000000000 --- a/documentai/google/cloud/documentai_v1beta1/proto/document_understanding_pb2_grpc.py +++ /dev/null @@ -1,57 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.documentai_v1beta1.proto import ( - document_understanding_pb2 as google_dot_cloud_dot_documentai__v1beta1_dot_proto_dot_document__understanding__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -class DocumentUnderstandingServiceStub(object): - """Service to parse structured information from unstructured or semi-structured - documents using state-of-the-art Google AI such as natural language, - computer vision, and translation. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.BatchProcessDocuments = channel.unary_unary( - "/google.cloud.documentai.v1beta1.DocumentUnderstandingService/BatchProcessDocuments", - request_serializer=google_dot_cloud_dot_documentai__v1beta1_dot_proto_dot_document__understanding__pb2.BatchProcessDocumentsRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - - -class DocumentUnderstandingServiceServicer(object): - """Service to parse structured information from unstructured or semi-structured - documents using state-of-the-art Google AI such as natural language, - computer vision, and translation. - """ - - def BatchProcessDocuments(self, request, context): - """LRO endpoint to batch process many documents. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_DocumentUnderstandingServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "BatchProcessDocuments": grpc.unary_unary_rpc_method_handler( - servicer.BatchProcessDocuments, - request_deserializer=google_dot_cloud_dot_documentai__v1beta1_dot_proto_dot_document__understanding__pb2.BatchProcessDocumentsRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ) - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.documentai.v1beta1.DocumentUnderstandingService", - rpc_method_handlers, - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/documentai/google/cloud/documentai_v1beta1/proto/geometry.proto b/documentai/google/cloud/documentai_v1beta1/proto/geometry.proto deleted file mode 100644 index 9dbe2b78b134..000000000000 --- a/documentai/google/cloud/documentai_v1beta1/proto/geometry.proto +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.documentai.v1beta1; - -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1beta1;documentai"; -option java_multiple_files = true; -option java_outer_classname = "GeometryProto"; -option java_package = "com.google.cloud.documentai.v1beta1"; - -// A vertex represents a 2D point in the image. -// NOTE: the vertex coordinates are in the same scale as the original image. -message Vertex { - // X coordinate. - int32 x = 1; - - // Y coordinate. - int32 y = 2; -} - -// A vertex represents a 2D point in the image. -// NOTE: the normalized vertex coordinates are relative to the original image -// and range from 0 to 1. -message NormalizedVertex { - // X coordinate. - float x = 1; - - // Y coordinate. - float y = 2; -} - -// A bounding polygon for the detected image annotation. -message BoundingPoly { - // The bounding polygon vertices. - repeated Vertex vertices = 1; - - // The bounding polygon normalized vertices. - repeated NormalizedVertex normalized_vertices = 2; -} diff --git a/documentai/google/cloud/documentai_v1beta1/proto/geometry_pb2.py b/documentai/google/cloud/documentai_v1beta1/proto/geometry_pb2.py deleted file mode 100644 index 2e4217e32a0e..000000000000 --- a/documentai/google/cloud/documentai_v1beta1/proto/geometry_pb2.py +++ /dev/null @@ -1,270 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/documentai_v1beta1/proto/geometry.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/documentai_v1beta1/proto/geometry.proto", - package="google.cloud.documentai.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n#com.google.cloud.documentai.v1beta1B\rGeometryProtoP\001ZIgoogle.golang.org/genproto/googleapis/cloud/documentai/v1beta1;documentai" - ), - serialized_pb=_b( - '\n4google/cloud/documentai_v1beta1/proto/geometry.proto\x12\x1fgoogle.cloud.documentai.v1beta1\x1a\x1cgoogle/api/annotations.proto"\x1e\n\x06Vertex\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02"\x99\x01\n\x0c\x42oundingPoly\x12\x39\n\x08vertices\x18\x01 \x03(\x0b\x32\'.google.cloud.documentai.v1beta1.Vertex\x12N\n\x13normalized_vertices\x18\x02 \x03(\x0b\x32\x31.google.cloud.documentai.v1beta1.NormalizedVertexB\x81\x01\n#com.google.cloud.documentai.v1beta1B\rGeometryProtoP\x01ZIgoogle.golang.org/genproto/googleapis/cloud/documentai/v1beta1;documentaib\x06proto3' - ), - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], -) - - -_VERTEX = _descriptor.Descriptor( - name="Vertex", - full_name="google.cloud.documentai.v1beta1.Vertex", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.documentai.v1beta1.Vertex.x", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.documentai.v1beta1.Vertex.y", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=119, - serialized_end=149, -) - - -_NORMALIZEDVERTEX = _descriptor.Descriptor( - name="NormalizedVertex", - full_name="google.cloud.documentai.v1beta1.NormalizedVertex", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.documentai.v1beta1.NormalizedVertex.x", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.documentai.v1beta1.NormalizedVertex.y", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=151, - serialized_end=191, -) - - -_BOUNDINGPOLY = _descriptor.Descriptor( - name="BoundingPoly", - full_name="google.cloud.documentai.v1beta1.BoundingPoly", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="vertices", - full_name="google.cloud.documentai.v1beta1.BoundingPoly.vertices", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="normalized_vertices", - full_name="google.cloud.documentai.v1beta1.BoundingPoly.normalized_vertices", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=194, - serialized_end=347, -) - -_BOUNDINGPOLY.fields_by_name["vertices"].message_type = _VERTEX -_BOUNDINGPOLY.fields_by_name["normalized_vertices"].message_type = _NORMALIZEDVERTEX -DESCRIPTOR.message_types_by_name["Vertex"] = _VERTEX -DESCRIPTOR.message_types_by_name["NormalizedVertex"] = _NORMALIZEDVERTEX -DESCRIPTOR.message_types_by_name["BoundingPoly"] = _BOUNDINGPOLY -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Vertex = _reflection.GeneratedProtocolMessageType( - "Vertex", - (_message.Message,), - dict( - DESCRIPTOR=_VERTEX, - __module__="google.cloud.documentai_v1beta1.proto.geometry_pb2", - __doc__="""X coordinate. - - - Attributes: - y: - Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.Vertex) - ), -) -_sym_db.RegisterMessage(Vertex) - -NormalizedVertex = _reflection.GeneratedProtocolMessageType( - "NormalizedVertex", - (_message.Message,), - dict( - DESCRIPTOR=_NORMALIZEDVERTEX, - __module__="google.cloud.documentai_v1beta1.proto.geometry_pb2", - __doc__="""X coordinate. - - - Attributes: - y: - Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.NormalizedVertex) - ), -) -_sym_db.RegisterMessage(NormalizedVertex) - -BoundingPoly = _reflection.GeneratedProtocolMessageType( - "BoundingPoly", - (_message.Message,), - dict( - DESCRIPTOR=_BOUNDINGPOLY, - __module__="google.cloud.documentai_v1beta1.proto.geometry_pb2", - __doc__="""A bounding polygon for the detected image annotation. - - - Attributes: - vertices: - The bounding polygon vertices. - normalized_vertices: - The bounding polygon normalized vertices. - """, - # @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta1.BoundingPoly) - ), -) -_sym_db.RegisterMessage(BoundingPoly) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/documentai/google/cloud/documentai_v1beta1/proto/geometry_pb2_grpc.py b/documentai/google/cloud/documentai_v1beta1/proto/geometry_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/documentai/google/cloud/documentai_v1beta1/proto/geometry_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/documentai/google/cloud/documentai_v1beta1/types.py b/documentai/google/cloud/documentai_v1beta1/types.py deleted file mode 100644 index ccc4adc2bd23..000000000000 --- a/documentai/google/cloud/documentai_v1beta1/types.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.documentai_v1beta1.proto import document_pb2 -from google.cloud.documentai_v1beta1.proto import document_understanding_pb2 -from google.cloud.documentai_v1beta1.proto import geometry_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import timestamp_pb2 -from google.protobuf import wrappers_pb2 -from google.rpc import status_pb2 -from google.type import color_pb2 - - -_shared_modules = [ - operations_pb2, - any_pb2, - timestamp_pb2, - wrappers_pb2, - status_pb2, - color_pb2, -] - -_local_modules = [document_pb2, document_understanding_pb2, geometry_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.documentai_v1beta1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/documentai/noxfile.py b/documentai/noxfile.py deleted file mode 100644 index 7949a4e3925a..000000000000 --- a/documentai/noxfile.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/documentai/setup.cfg b/documentai/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/documentai/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/documentai/setup.py b/documentai/setup.py deleted file mode 100644 index 25a7befcff69..000000000000 --- a/documentai/setup.py +++ /dev/null @@ -1,73 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import io -import os - -import setuptools - -name = "google-cloud-documentai" -description = "Cloud Document AI API API client library" -version = "0.1.0" -release_status = "Development Status :: 3 - Alpha" -dependencies = [ - "google-api-core[grpc] >= 1.14.0, < 2.0.0dev", - 'enum34; python_version < "3.4"', -] - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/GoogleCloudPlatform/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", - include_package_data=True, - zip_safe=False, -) diff --git a/documentai/synth.metadata b/documentai/synth.metadata deleted file mode 100644 index 76fe91e4ca2b..000000000000 --- a/documentai/synth.metadata +++ /dev/null @@ -1,168 +0,0 @@ -{ - "updateTime": "2020-01-30T13:23:51.994737Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c1246a29e22b0f98e800a536b5b0da2d933a55f2", - "internalRef": "292310790", - "log": "c1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\n" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "documentai", - "apiVersion": "v1beta1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/documentai/artman_documentai_v1beta1.yaml" - } - } - ], - "newFiles": [ - { - "path": ".coveragerc" - }, - { - "path": ".flake8" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "LICENSE" - }, - { - "path": "MANIFEST.in" - }, - { - "path": "README.rst" - }, - { - "path": "docs/README.rst" - }, - { - "path": "docs/_static/custom.css" - }, - { - "path": "docs/_templates/layout.html" - }, - { - "path": "docs/changelog.md" - }, - { - "path": "docs/conf.py" - }, - { - "path": "docs/gapic/v1beta1/api.rst" - }, - { - "path": "docs/gapic/v1beta1/types.rst" - }, - { - "path": "docs/index.rst" - }, - { - "path": "google/__init__.py" - }, - { - "path": "google/cloud/__init__.py" - }, - { - "path": "google/cloud/documentai.py" - }, - { - "path": "google/cloud/documentai_v1beta1/__init__.py" - }, - { - "path": "google/cloud/documentai_v1beta1/gapic/__init__.py" - }, - { - "path": "google/cloud/documentai_v1beta1/gapic/document_understanding_service_client.py" - }, - { - "path": "google/cloud/documentai_v1beta1/gapic/document_understanding_service_client_config.py" - }, - { - "path": "google/cloud/documentai_v1beta1/gapic/enums.py" - }, - { - "path": "google/cloud/documentai_v1beta1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/documentai_v1beta1/gapic/transports/document_understanding_service_grpc_transport.py" - }, - { - "path": "google/cloud/documentai_v1beta1/proto/__init__.py" - }, - { - "path": "google/cloud/documentai_v1beta1/proto/document.proto" - }, - { - "path": "google/cloud/documentai_v1beta1/proto/document_pb2.py" - }, - { - "path": "google/cloud/documentai_v1beta1/proto/document_pb2_grpc.py" - }, - { - "path": "google/cloud/documentai_v1beta1/proto/document_understanding.proto" - }, - { - "path": "google/cloud/documentai_v1beta1/proto/document_understanding_pb2.py" - }, - { - "path": "google/cloud/documentai_v1beta1/proto/document_understanding_pb2_grpc.py" - }, - { - "path": "google/cloud/documentai_v1beta1/proto/geometry.proto" - }, - { - "path": "google/cloud/documentai_v1beta1/proto/geometry_pb2.py" - }, - { - "path": "google/cloud/documentai_v1beta1/proto/geometry_pb2_grpc.py" - }, - { - "path": "google/cloud/documentai_v1beta1/types.py" - }, - { - "path": "noxfile.py" - }, - { - "path": "setup.cfg" - }, - { - "path": "setup.py" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "tests/unit/gapic/v1beta1/test_document_understanding_service_client_v1beta1.py" - } - ] -} \ No newline at end of file diff --git a/documentai/synth.py b/documentai/synth.py deleted file mode 100644 index 9284c3cb676d..000000000000 --- a/documentai/synth.py +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -import synthtool.gcp as gcp -import logging - -logging.basicConfig(level=logging.DEBUG) - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() - -# ---------------------------------------------------------------------------- -# Generate document AI GAPIC layer -# ---------------------------------------------------------------------------- -library = gapic.py_library("documentai", "v1beta1", include_protos=True) - -excludes = ["README.rst", "nox.py", "setup.py", "docs/index.rst"] -s.move(library, excludes=excludes) - -# Fix bad docstring with stray pipe characters -s.replace( - "google/cloud/**/document_understanding_pb2.py", - """\| Specifies a known document type for deeper structure - detection\. Valid values are currently "general" and - "invoice"\. If not provided, "general" \| is used as default. - If any other value is given, the request is rejected\.""", - """Specifies a known document type for deeper structure - detection. Valid values are currently "general" and - "invoice". If not provided, "general" is used as default. - If any other value is given, the request is rejected.""", -) - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = common.py_library(unit_cov_level=97, cov_level=100) -s.move(templated_files) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/documentai/tests/unit/gapic/v1beta1/test_document_understanding_service_client_v1beta1.py b/documentai/tests/unit/gapic/v1beta1/test_document_understanding_service_client_v1beta1.py deleted file mode 100644 index ec66fab0ff60..000000000000 --- a/documentai/tests/unit/gapic/v1beta1/test_document_understanding_service_client_v1beta1.py +++ /dev/null @@ -1,118 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import documentai_v1beta1 -from google.cloud.documentai_v1beta1.proto import document_understanding_pb2 -from google.longrunning import operations_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestDocumentUnderstandingServiceClient(object): - def test_batch_process_documents(self): - # Setup Expected Response - expected_response = {} - expected_response = document_understanding_pb2.BatchProcessDocumentsResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_batch_process_documents", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = documentai_v1beta1.DocumentUnderstandingServiceClient() - - # Setup Request - requests = [] - - response = client.batch_process_documents(requests) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = document_understanding_pb2.BatchProcessDocumentsRequest( - requests=requests - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_batch_process_documents_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_batch_process_documents_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = documentai_v1beta1.DocumentUnderstandingServiceClient() - - # Setup Request - requests = [] - - response = client.batch_process_documents(requests) - exception = response.exception() - assert exception.errors[0] == error diff --git a/texttospeech/.coveragerc b/texttospeech/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/texttospeech/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/texttospeech/.flake8 b/texttospeech/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/texttospeech/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/texttospeech/.repo-metadata.json b/texttospeech/.repo-metadata.json deleted file mode 100644 index 59cb59726877..000000000000 --- a/texttospeech/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "texttospeech", - "name_pretty": "Google Cloud Text-to-Speech", - "product_documentation": "https://cloud.google.com/text-to-speech", - "client_documentation": "https://googleapis.dev/python/texttospeech/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/5235428", - "release_level": "alpha", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-texttospeech", - "api_id": "texttospeech.googleapis.com", - "requires_billing": true -} \ No newline at end of file diff --git a/texttospeech/CHANGELOG.md b/texttospeech/CHANGELOG.md deleted file mode 100644 index 2611568ea374..000000000000 --- a/texttospeech/CHANGELOG.md +++ /dev/null @@ -1,109 +0,0 @@ -# Changelog - -[PyPI History][1] - -[1]: https://pypi.org/project/google-cloud-texttospeech/#history - -## 0.5.0 - -07-24-2019 17:48 PDT - - -### Implementation Changes -- Allow kwargs to be passed to create_channel (via synth). ([#8407](https://github.com/googleapis/google-cloud-python/pull/8407)) -- Reformat protos, update nox session docs (via synth). ([#7941](https://github.com/googleapis/google-cloud-python/pull/7941)) -- Remove classifier for Python 3.4 for end-of-life. ([#7535](https://github.com/googleapis/google-cloud-python/pull/7535)) - -### New Features -- Add 'client_options' support (via synth). ([#8525](https://github.com/googleapis/google-cloud-python/pull/8525)) - -### Dependencies -- Bump minimum version for google-api-core to 1.14.0. ([#8709](https://github.com/googleapis/google-cloud-python/pull/8709)) - -### Documentation -- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705)) -- Add compatibility check badges to READMEs. ([#8288](https://github.com/googleapis/google-cloud-python/pull/8288)) -- Repair top-level API reference page. ([#8435](https://github.com/googleapis/google-cloud-python/pull/8435)) -- Updated client library documentation URLs. ([#7307](https://github.com/googleapis/google-cloud-python/pull/7307)) - -### Internal / Testing Changes -- Pin black version (via synth). ([#8599](https://github.com/googleapis/google-cloud-python/pull/8599)) -- Add docs job to publish to googleapis.dev. ([#8464](https://github.com/googleapis/google-cloud-python/pull/8464)) -- Declare encoding as utf-8 in pb2 files (via synth). ([#8367](https://github.com/googleapis/google-cloud-python/pull/8367)) -- Add disclaimer to auto-generated template files (via synth). ([#8331](https://github.com/googleapis/google-cloud-python/pull/8331)) -- Blacken (via synth). ([#8281](https://github.com/googleapis/google-cloud-python/pull/8281)) - -## 0.4.0 - -02-07-2019 15:21 PST - - -### Implementation Changes -- Pick up stub docstring fix in GAPIC generator. ([#6984](https://github.com/googleapis/google-cloud-python/pull/6984)) - -### New Features -- Protoc updates to include effects_profile_id. ([#7097](https://github.com/googleapis/google-cloud-python/pull/7097)) - -### Documentation -- Fix `Client Library Documentation` link ([#7109](https://github.com/googleapis/google-cloud-python/pull/7109)) - -### Internal / Testing Changes -- Copy proto files alongside protoc versions. -- Add protos as an artifact to library ([#7205](https://github.com/googleapis/google-cloud-python/pull/7205)) -- Update copyright headers and docstring quoting - -## 0.3.0 - -12-18-2018 09:54 PST - - -### Implementation Changes -- Import `iam.policy` from `google.api_core`. ([#6741](https://github.com/googleapis/google-cloud-python/pull/6741)) -- Pick up fixes to GAPIC generator. ([#6510](https://github.com/googleapis/google-cloud-python/pull/6510)) -- Fix `client_info` bug, update docstrings. ([#6423](https://github.com/googleapis/google-cloud-python/pull/6423)) -- Re-generate library using texttospeech/synth.py ([#5981](https://github.com/googleapis/google-cloud-python/pull/5981)) -- Add gRPC Transport layer. ([#5959](https://github.com/googleapis/google-cloud-python/pull/5959)) - -### Dependencies -- Bump minimum `api_core` version for all GAPIC libs to 1.4.1. ([#6391](https://github.com/googleapis/google-cloud-python/pull/6391)) -- Avoid broken 'google-common-apis 1.5.4' release. ([#6355](https://github.com/googleapis/google-cloud-python/pull/6355)) - -### Documentation -- Document Python 2 deprecation ([#6910](https://github.com/googleapis/google-cloud-python/pull/6910)) -- Docs: normalize use of support level badges ([#6159](https://github.com/googleapis/google-cloud-python/pull/6159)) -- Docs: Replace links to `/stable/` with `/latest/`. ([#5901](https://github.com/googleapis/google-cloud-python/pull/5901)) -- Fix docs links for TTS. ([#5483](https://github.com/googleapis/google-cloud-python/pull/5483)) - -### Internal / Testing Changes -- Add synth.metadata. ([#6870](https://github.com/googleapis/google-cloud-python/pull/6870)) -- Update noxfile. -- blacken all gen'd libs ([#6792](https://github.com/googleapis/google-cloud-python/pull/6792)) -- omit local deps ([#6701](https://github.com/googleapis/google-cloud-python/pull/6701)) -- Run black at end of synth.py ([#6698](https://github.com/googleapis/google-cloud-python/pull/6698)) -- Run Black on Generated libraries ([#6666](https://github.com/googleapis/google-cloud-python/pull/6666)) -- Add templates for flake8, coveragerc, noxfile, and black. ([#6642](https://github.com/googleapis/google-cloud-python/pull/6642)) -- Add 'mock' to unit test dependencies for autogen libs. ([#6402](https://github.com/googleapis/google-cloud-python/pull/6402)) -- Add / fix badges for PyPI / versions. ([#6158](https://github.com/googleapis/google-cloud-python/pull/6158)) -- Use new Nox ([#6175](https://github.com/googleapis/google-cloud-python/pull/6175)) - -## 0.2.0 - -### New Features - -- Add the text-to-speech v1 API surface. (#5468) -- Re-generate the text-to-speech v1beta1 API surface. (#5468) - -### Documentation - -- Rename releases to changelog and include from CHANGELOG.md (#5191) - -### Internal / Testing Changes - -- Add Test runs for Python 3.7 and remove 3.4 (#5295) - -## 0.1.0 - -### Interface additions - -- Added text-to-speech v1beta1. (#5049) - diff --git a/texttospeech/LICENSE b/texttospeech/LICENSE deleted file mode 100644 index a8ee855de2aa..000000000000 --- a/texttospeech/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/texttospeech/MANIFEST.in b/texttospeech/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/texttospeech/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/texttospeech/README.rst b/texttospeech/README.rst deleted file mode 100644 index 7887b150fef2..000000000000 --- a/texttospeech/README.rst +++ /dev/null @@ -1,90 +0,0 @@ -Python Client for Cloud Text-to-Speech API -========================================== - -|alpha| |pypi| |versions| - -`Cloud Text-to-Speech API`_: Synthesizes natural-sounding speech by applying -powerful neural network models. - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. |alpha| image:: https://img.shields.io/badge/support-alpha-orange.svg - :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#alpha-support -.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-texttospeech.svg - :target: https://pypi.org/project/google-cloud-texttospeech/ -.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-texttospeech.svg - :target: https://pypi.org/project/google-cloud-texttospeech/ -.. _Cloud Text-to-Speech API: https://cloud.google.com/texttospeech -.. _Client Library Documentation: https://googleapis.dev/python/texttospeech/latest -.. _Product Documentation: https://cloud.google.com/texttospeech - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the Cloud Text-to-Speech API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Cloud Text-to-Speech API.: https://cloud.google.com/texttospeech -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Supported Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.5 - -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7. Python 2.7 support will be removed on January 1, 2020. - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-texttospeech - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-texttospeech - -Next Steps -~~~~~~~~~~ - -- Read the `Client Library Documentation`_ for Cloud Text-to-Speech API - API to see other available methods on the client. -- Read the `Cloud Text-to-Speech API Product documentation`_ to learn - more about the product and see How-to Guides. - APIs that we cover. - -.. _Cloud Text-to-Speech API Product documentation: https://cloud.google.com/texttospeech diff --git a/texttospeech/docs/README.rst b/texttospeech/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/texttospeech/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/texttospeech/docs/_static/custom.css b/texttospeech/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/texttospeech/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/texttospeech/docs/_templates/layout.html b/texttospeech/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/texttospeech/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/texttospeech/docs/api.rst b/texttospeech/docs/api.rst deleted file mode 100644 index 8dd5fb3fdda2..000000000000 --- a/texttospeech/docs/api.rst +++ /dev/null @@ -1,30 +0,0 @@ -Text-to-Speech Client API Reference -=================================== - -This package includes clients for multiple versions of the Text-to-Speech -API. By default, you will get ``v1``, the latest GA version. - -.. toctree:: - :maxdepth: 2 - - gapic/v1/api - gapic/v1/types - -If you are interested in beta features ahead of the latest GA, you may -opt-in to the v1.1 beta, which is spelled ``v1beta1``. In order to do this, -you will want to import from ``google.cloud.texttospeech_v1beta1`` in lieu of -``google.cloud.texttospeech``. - -An API and type reference is provided for the v1.1 beta also: - -.. toctree:: - :maxdepth: 2 - - gapic/v1beta1/api - gapic/v1beta1/types - -.. note:: - - The client for the beta API is provided on a provisional basis. The API - surface is subject to change, and it is possible that this client will be - deprecated or removed after its features become GA. diff --git a/texttospeech/docs/changelog.md b/texttospeech/docs/changelog.md deleted file mode 120000 index d7f15f4c5706..000000000000 --- a/texttospeech/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../../texttospeech/CHANGELOG.md \ No newline at end of file diff --git a/texttospeech/docs/conf.py b/texttospeech/docs/conf.py deleted file mode 100644 index 5441a542bc9e..000000000000 --- a/texttospeech/docs/conf.py +++ /dev/null @@ -1,356 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-texttospeech documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-texttospeech" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-texttospeech-doc" - -# -- Options for warnings ------------------------------------------------------ - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-texttospeech.tex", - u"google-cloud-texttospeech Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - master_doc, - "google-cloud-texttospeech", - u"google-cloud-texttospeech Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-texttospeech", - u"google-cloud-texttospeech Documentation", - author, - "google-cloud-texttospeech", - "GAPIC library for the {metadata.shortName} v1 service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/stable/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/texttospeech/docs/gapic/v1/api.rst b/texttospeech/docs/gapic/v1/api.rst deleted file mode 100644 index 06d283f8de68..000000000000 --- a/texttospeech/docs/gapic/v1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud Text-to-Speech API -=================================== - -.. automodule:: google.cloud.texttospeech_v1 - :members: - :inherited-members: \ No newline at end of file diff --git a/texttospeech/docs/gapic/v1/types.rst b/texttospeech/docs/gapic/v1/types.rst deleted file mode 100644 index 4d23029781f1..000000000000 --- a/texttospeech/docs/gapic/v1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud Text-to-Speech API Client -========================================= - -.. automodule:: google.cloud.texttospeech_v1.types - :members: \ No newline at end of file diff --git a/texttospeech/docs/gapic/v1beta1/api.rst b/texttospeech/docs/gapic/v1beta1/api.rst deleted file mode 100644 index f43d33839f8b..000000000000 --- a/texttospeech/docs/gapic/v1beta1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud Text-to-Speech API -=================================== - -.. automodule:: google.cloud.texttospeech_v1beta1 - :members: - :inherited-members: \ No newline at end of file diff --git a/texttospeech/docs/gapic/v1beta1/types.rst b/texttospeech/docs/gapic/v1beta1/types.rst deleted file mode 100644 index 2cd731576213..000000000000 --- a/texttospeech/docs/gapic/v1beta1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud Text-to-Speech API Client -========================================= - -.. automodule:: google.cloud.texttospeech_v1beta1.types - :members: \ No newline at end of file diff --git a/texttospeech/docs/index.rst b/texttospeech/docs/index.rst deleted file mode 100644 index 54bbdd520430..000000000000 --- a/texttospeech/docs/index.rst +++ /dev/null @@ -1,22 +0,0 @@ -.. include:: README.rst - -Api Reference -------------- -.. toctree:: - :maxdepth: 2 - - api - gapic/v1/api - gapic/v1/types - gapic/v1beta1/api - gapic/v1beta1/types - -Changelog ---------- - -For a list of all ``google-cloud-texttospeech`` releases. - -.. toctree:: - :maxdepth: 2 - - changelog \ No newline at end of file diff --git a/texttospeech/google/__init__.py b/texttospeech/google/__init__.py deleted file mode 100644 index dd3a9f485275..000000000000 --- a/texttospeech/google/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/texttospeech/google/cloud/__init__.py b/texttospeech/google/cloud/__init__.py deleted file mode 100644 index dd3a9f485275..000000000000 --- a/texttospeech/google/cloud/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/texttospeech/google/cloud/texttospeech.py b/texttospeech/google/cloud/texttospeech.py deleted file mode 100644 index 4f5e350727ec..000000000000 --- a/texttospeech/google/cloud/texttospeech.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import - -from google.cloud.texttospeech_v1 import TextToSpeechClient -from google.cloud.texttospeech_v1 import enums -from google.cloud.texttospeech_v1 import types - - -__all__ = ("enums", "types", "TextToSpeechClient") diff --git a/texttospeech/google/cloud/texttospeech_v1/__init__.py b/texttospeech/google/cloud/texttospeech_v1/__init__.py deleted file mode 100644 index 1c5bf4b42ce8..000000000000 --- a/texttospeech/google/cloud/texttospeech_v1/__init__.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.texttospeech_v1 import types -from google.cloud.texttospeech_v1.gapic import enums -from google.cloud.texttospeech_v1.gapic import text_to_speech_client - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class TextToSpeechClient(text_to_speech_client.TextToSpeechClient): - __doc__ = text_to_speech_client.TextToSpeechClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "TextToSpeechClient") diff --git a/texttospeech/google/cloud/texttospeech_v1/gapic/__init__.py b/texttospeech/google/cloud/texttospeech_v1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/texttospeech/google/cloud/texttospeech_v1/gapic/enums.py b/texttospeech/google/cloud/texttospeech_v1/gapic/enums.py deleted file mode 100644 index b0bc27820fc4..000000000000 --- a/texttospeech/google/cloud/texttospeech_v1/gapic/enums.py +++ /dev/null @@ -1,63 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class AudioEncoding(enum.IntEnum): - """ - Configuration to set up audio encoder. The encoding determines the output - audio format that we'd like. - - Attributes: - AUDIO_ENCODING_UNSPECIFIED (int): Not specified. Will return result ``google.rpc.Code.INVALID_ARGUMENT``. - LINEAR16 (int): Uncompressed 16-bit signed little-endian samples (Linear PCM). - Audio content returned as LINEAR16 also contains a WAV header. - MP3 (int): MP3 audio at 32kbps. - OGG_OPUS (int): Opus encoded audio wrapped in an ogg container. The result will be a - file which can be played natively on Android, and in browsers (at least - Chrome and Firefox). The quality of the encoding is considerably higher - than MP3 while using approximately the same bitrate. - """ - - AUDIO_ENCODING_UNSPECIFIED = 0 - LINEAR16 = 1 - MP3 = 2 - OGG_OPUS = 3 - - -class SsmlVoiceGender(enum.IntEnum): - """ - Gender of the voice as described in `SSML voice - element `__. - - Attributes: - SSML_VOICE_GENDER_UNSPECIFIED (int): An unspecified gender. - In VoiceSelectionParams, this means that the client doesn't care which - gender the selected voice will have. In the Voice field of - ListVoicesResponse, this may mean that the voice doesn't fit any of the - other categories in this enum, or that the gender of the voice isn't known. - MALE (int): A male voice. - FEMALE (int): A female voice. - NEUTRAL (int): A gender-neutral voice. - """ - - SSML_VOICE_GENDER_UNSPECIFIED = 0 - MALE = 1 - FEMALE = 2 - NEUTRAL = 3 diff --git a/texttospeech/google/cloud/texttospeech_v1/gapic/text_to_speech_client.py b/texttospeech/google/cloud/texttospeech_v1/gapic/text_to_speech_client.py deleted file mode 100644 index eaa362a3d5a5..000000000000 --- a/texttospeech/google/cloud/texttospeech_v1/gapic/text_to_speech_client.py +++ /dev/null @@ -1,323 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.cloud.texttospeech.v1 TextToSpeech API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.grpc_helpers -import grpc - -from google.cloud.texttospeech_v1.gapic import enums -from google.cloud.texttospeech_v1.gapic import text_to_speech_client_config -from google.cloud.texttospeech_v1.gapic.transports import text_to_speech_grpc_transport -from google.cloud.texttospeech_v1.proto import cloud_tts_pb2 -from google.cloud.texttospeech_v1.proto import cloud_tts_pb2_grpc - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-texttospeech" -).version - - -class TextToSpeechClient(object): - """Service that implements Google Cloud Text-to-Speech API.""" - - SERVICE_ADDRESS = "texttospeech.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.texttospeech.v1.TextToSpeech" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - TextToSpeechClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.TextToSpeechGrpcTransport, - Callable[[~.Credentials, type], ~.TextToSpeechGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = text_to_speech_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=text_to_speech_grpc_transport.TextToSpeechGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = text_to_speech_grpc_transport.TextToSpeechGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def list_voices( - self, - language_code=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Returns a list of Voice supported for synthesis. - - Example: - >>> from google.cloud import texttospeech_v1 - >>> - >>> client = texttospeech_v1.TextToSpeechClient() - >>> - >>> response = client.list_voices() - - Args: - language_code (str): Optional. Recommended. - `BCP-47 `__ language tag. - If specified, the ListVoices call will only return voices that can be - used to synthesize this language\_code. E.g. when specifying "en-NZ", - you will get supported "en-*" voices; when specifying "no", you will get - supported "no-*" (Norwegian) and "nb-*" (Norwegian Bokmal) voices; - specifying "zh" will also get supported "cmn-*" voices; specifying - "zh-hk" will also get supported "yue-\*" voices. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.texttospeech_v1.types.ListVoicesResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_voices" not in self._inner_api_calls: - self._inner_api_calls[ - "list_voices" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_voices, - default_retry=self._method_configs["ListVoices"].retry, - default_timeout=self._method_configs["ListVoices"].timeout, - client_info=self._client_info, - ) - - request = cloud_tts_pb2.ListVoicesRequest(language_code=language_code) - return self._inner_api_calls["list_voices"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def synthesize_speech( - self, - input_, - voice, - audio_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Synthesizes speech synchronously: receive results after all text input - has been processed. - - Example: - >>> from google.cloud import texttospeech_v1 - >>> - >>> client = texttospeech_v1.TextToSpeechClient() - >>> - >>> # TODO: Initialize `input_`: - >>> input_ = {} - >>> - >>> # TODO: Initialize `voice`: - >>> voice = {} - >>> - >>> # TODO: Initialize `audio_config`: - >>> audio_config = {} - >>> - >>> response = client.synthesize_speech(input_, voice, audio_config) - - Args: - input_ (Union[dict, ~google.cloud.texttospeech_v1.types.SynthesisInput]): Required. The Synthesizer requires either plain text or SSML as input. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.texttospeech_v1.types.SynthesisInput` - voice (Union[dict, ~google.cloud.texttospeech_v1.types.VoiceSelectionParams]): Required. The desired voice of the synthesized audio. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.texttospeech_v1.types.VoiceSelectionParams` - audio_config (Union[dict, ~google.cloud.texttospeech_v1.types.AudioConfig]): Required. The configuration of the synthesized audio. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.texttospeech_v1.types.AudioConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.texttospeech_v1.types.SynthesizeSpeechResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "synthesize_speech" not in self._inner_api_calls: - self._inner_api_calls[ - "synthesize_speech" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.synthesize_speech, - default_retry=self._method_configs["SynthesizeSpeech"].retry, - default_timeout=self._method_configs["SynthesizeSpeech"].timeout, - client_info=self._client_info, - ) - - request = cloud_tts_pb2.SynthesizeSpeechRequest( - input=input_, voice=voice, audio_config=audio_config - ) - return self._inner_api_calls["synthesize_speech"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/texttospeech/google/cloud/texttospeech_v1/gapic/text_to_speech_client_config.py b/texttospeech/google/cloud/texttospeech_v1/gapic/text_to_speech_client_config.py deleted file mode 100644 index 5c86cb227911..000000000000 --- a/texttospeech/google/cloud/texttospeech_v1/gapic/text_to_speech_client_config.py +++ /dev/null @@ -1,33 +0,0 @@ -config = { - "interfaces": { - "google.cloud.texttospeech.v1.TextToSpeech": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "ListVoices": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "SynthesizeSpeech": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/texttospeech/google/cloud/texttospeech_v1/gapic/transports/__init__.py b/texttospeech/google/cloud/texttospeech_v1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/texttospeech/google/cloud/texttospeech_v1/gapic/transports/text_to_speech_grpc_transport.py b/texttospeech/google/cloud/texttospeech_v1/gapic/transports/text_to_speech_grpc_transport.py deleted file mode 100644 index 4c0b4922390c..000000000000 --- a/texttospeech/google/cloud/texttospeech_v1/gapic/transports/text_to_speech_grpc_transport.py +++ /dev/null @@ -1,135 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers - -from google.cloud.texttospeech_v1.proto import cloud_tts_pb2_grpc - - -class TextToSpeechGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.texttospeech.v1 TextToSpeech API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="texttospeech.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "text_to_speech_stub": cloud_tts_pb2_grpc.TextToSpeechStub(channel) - } - - @classmethod - def create_channel( - cls, address="texttospeech.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def list_voices(self): - """Return the gRPC stub for :meth:`TextToSpeechClient.list_voices`. - - Returns a list of Voice supported for synthesis. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["text_to_speech_stub"].ListVoices - - @property - def synthesize_speech(self): - """Return the gRPC stub for :meth:`TextToSpeechClient.synthesize_speech`. - - Synthesizes speech synchronously: receive results after all text input - has been processed. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["text_to_speech_stub"].SynthesizeSpeech diff --git a/texttospeech/google/cloud/texttospeech_v1/proto/__init__.py b/texttospeech/google/cloud/texttospeech_v1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts.proto b/texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts.proto deleted file mode 100644 index 6263da4ab085..000000000000 --- a/texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts.proto +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.texttospeech.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.TextToSpeech.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/texttospeech/v1;texttospeech"; -option java_multiple_files = true; -option java_outer_classname = "TextToSpeechProto"; -option java_package = "com.google.cloud.texttospeech.v1"; -option php_namespace = "Google\\Cloud\\TextToSpeech\\V1"; - -// Service that implements Google Cloud Text-to-Speech API. -service TextToSpeech { - option (google.api.default_host) = "texttospeech.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Returns a list of Voice supported for synthesis. - rpc ListVoices(ListVoicesRequest) returns (ListVoicesResponse) { - option (google.api.http) = { - get: "/v1/voices" - }; - option (google.api.method_signature) = "language_code"; - } - - // Synthesizes speech synchronously: receive results after all text input - // has been processed. - rpc SynthesizeSpeech(SynthesizeSpeechRequest) returns (SynthesizeSpeechResponse) { - option (google.api.http) = { - post: "/v1/text:synthesize" - body: "*" - }; - option (google.api.method_signature) = "input,voice,audio_config"; - } -} - -// The top-level message sent by the client for the `ListVoices` method. -message ListVoicesRequest { - // Optional. Recommended. - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If - // specified, the ListVoices call will only return voices that can be used to - // synthesize this language_code. E.g. when specifying "en-NZ", you will get - // supported "en-*" voices; when specifying "no", you will get supported - // "no-*" (Norwegian) and "nb-*" (Norwegian Bokmal) voices; specifying "zh" - // will also get supported "cmn-*" voices; specifying "zh-hk" will also get - // supported "yue-*" voices. - string language_code = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// Gender of the voice as described in -// [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). -enum SsmlVoiceGender { - // An unspecified gender. - // In VoiceSelectionParams, this means that the client doesn't care which - // gender the selected voice will have. In the Voice field of - // ListVoicesResponse, this may mean that the voice doesn't fit any of the - // other categories in this enum, or that the gender of the voice isn't known. - SSML_VOICE_GENDER_UNSPECIFIED = 0; - - // A male voice. - MALE = 1; - - // A female voice. - FEMALE = 2; - - // A gender-neutral voice. - NEUTRAL = 3; -} - -// Configuration to set up audio encoder. The encoding determines the output -// audio format that we'd like. -enum AudioEncoding { - // Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][]. - AUDIO_ENCODING_UNSPECIFIED = 0; - - // Uncompressed 16-bit signed little-endian samples (Linear PCM). - // Audio content returned as LINEAR16 also contains a WAV header. - LINEAR16 = 1; - - // MP3 audio at 32kbps. - MP3 = 2; - - // Opus encoded audio wrapped in an ogg container. The result will be a - // file which can be played natively on Android, and in browsers (at least - // Chrome and Firefox). The quality of the encoding is considerably higher - // than MP3 while using approximately the same bitrate. - OGG_OPUS = 3; -} - -// The message returned to the client by the `ListVoices` method. -message ListVoicesResponse { - // The list of voices. - repeated Voice voices = 1; -} - -// Description of a voice supported by the TTS service. -message Voice { - // The languages that this voice supports, expressed as - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. - // "en-US", "es-419", "cmn-tw"). - repeated string language_codes = 1; - - // The name of this voice. Each distinct voice has a unique name. - string name = 2; - - // The gender of this voice. - SsmlVoiceGender ssml_gender = 3; - - // The natural sample rate (in hertz) for this voice. - int32 natural_sample_rate_hertz = 4; -} - -// The top-level message sent by the client for the `SynthesizeSpeech` method. -message SynthesizeSpeechRequest { - // Required. The Synthesizer requires either plain text or SSML as input. - SynthesisInput input = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The desired voice of the synthesized audio. - VoiceSelectionParams voice = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The configuration of the synthesized audio. - AudioConfig audio_config = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Contains text input to be synthesized. Either `text` or `ssml` must be -// supplied. Supplying both or neither returns -// [google.rpc.Code.INVALID_ARGUMENT][]. The input size is limited to 5000 -// characters. -message SynthesisInput { - // The input source, which is either plain text or SSML. - oneof input_source { - // The raw text to be synthesized. - string text = 1; - - // The SSML document to be synthesized. The SSML document must be valid - // and well-formed. Otherwise the RPC will fail and return - // [google.rpc.Code.INVALID_ARGUMENT][]. For more information, see - // [SSML](/speech/text-to-speech/docs/ssml). - string ssml = 2; - } -} - -// Description of which voice to use for a synthesis request. -message VoiceSelectionParams { - // Required. The language (and potentially also the region) of the voice expressed as a - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g. - // "en-US". This should not include a script tag (e.g. use - // "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred - // from the input provided in the SynthesisInput. The TTS service - // will use this parameter to help choose an appropriate voice. Note that - // the TTS service may choose a voice with a slightly different language code - // than the one selected; it may substitute a different region - // (e.g. using en-US rather than en-CA if there isn't a Canadian voice - // available), or even a different language, e.g. using "nb" (Norwegian - // Bokmal) instead of "no" (Norwegian)". - string language_code = 1 [(google.api.field_behavior) = REQUIRED]; - - // The name of the voice. If not set, the service will choose a - // voice based on the other parameters such as language_code and gender. - string name = 2; - - // The preferred gender of the voice. If not set, the service will - // choose a voice based on the other parameters such as language_code and - // name. Note that this is only a preference, not requirement; if a - // voice of the appropriate gender is not available, the synthesizer should - // substitute a voice with a different gender rather than failing the request. - SsmlVoiceGender ssml_gender = 3; -} - -// Description of audio data to be synthesized. -message AudioConfig { - // Required. The format of the audio byte stream. - AudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is - // the normal native speed supported by the specific voice. 2.0 is twice as - // fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - // speed. Any other values < 0.25 or > 4.0 will return an error. - double speaking_rate = 2 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means - // increase 20 semitones from the original pitch. -20 means decrease 20 - // semitones from the original pitch. - double pitch = 3 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. Input only. Volume gain (in dB) of the normal native volume - // supported by the specific voice, in the range [-96.0, 16.0]. If unset, or - // set to a value of 0.0 (dB), will play at normal native signal amplitude. A - // value of -6.0 (dB) will play at approximately half the amplitude of the - // normal native signal amplitude. A value of +6.0 (dB) will play at - // approximately twice the amplitude of the normal native signal amplitude. - // Strongly recommend not to exceed +10 (dB) as there's usually no effective - // increase in loudness for any value greater than that. - double volume_gain_db = 4 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. The synthesis sample rate (in hertz) for this audio. When this is - // specified in SynthesizeSpeechRequest, if this is different from the voice's - // natural sample rate, then the synthesizer will honor this request by - // converting to the desired sample rate (which might result in worse audio - // quality), unless the specified sample rate is not supported for the - // encoding chosen, in which case it will fail the request and return - // [google.rpc.Code.INVALID_ARGUMENT][]. - int32 sample_rate_hertz = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Input only. An identifier which selects 'audio effects' profiles - // that are applied on (post synthesized) text to speech. Effects are applied - // on top of each other in the order they are given. See - // [audio - // profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for - // current supported profile ids. - repeated string effects_profile_id = 6 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// The message returned to the client by the `SynthesizeSpeech` method. -message SynthesizeSpeechResponse { - // The audio data bytes encoded as specified in the request, including the - // header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). - // For LINEAR16 audio, we include the WAV header. Note: as - // with all bytes fields, protobuffers use a pure binary representation, - // whereas JSON representations use base64. - bytes audio_content = 1; -} diff --git a/texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts_pb2.py b/texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts_pb2.py deleted file mode 100644 index a30cb386e366..000000000000 --- a/texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts_pb2.py +++ /dev/null @@ -1,993 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/texttospeech_v1/proto/cloud_tts.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/texttospeech_v1/proto/cloud_tts.proto", - package="google.cloud.texttospeech.v1", - syntax="proto3", - serialized_options=_b( - "\n com.google.cloud.texttospeech.v1B\021TextToSpeechProtoP\001ZHgoogle.golang.org/genproto/googleapis/cloud/texttospeech/v1;texttospeech\370\001\001\252\002\034Google.Cloud.TextToSpeech.V1\312\002\034Google\\Cloud\\TextToSpeech\\V1" - ), - serialized_pb=_b( - '\n2google/cloud/texttospeech_v1/proto/cloud_tts.proto\x12\x1cgoogle.cloud.texttospeech.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto"/\n\x11ListVoicesRequest\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x01"I\n\x12ListVoicesResponse\x12\x33\n\x06voices\x18\x01 \x03(\x0b\x32#.google.cloud.texttospeech.v1.Voice"\x94\x01\n\x05Voice\x12\x16\n\x0elanguage_codes\x18\x01 \x03(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x42\n\x0bssml_gender\x18\x03 \x01(\x0e\x32-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12!\n\x19natural_sample_rate_hertz\x18\x04 \x01(\x05"\xe9\x01\n\x17SynthesizeSpeechRequest\x12@\n\x05input\x18\x01 \x01(\x0b\x32,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xe0\x41\x02\x12\x46\n\x05voice\x18\x02 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xe0\x41\x02\x12\x44\n\x0c\x61udio_config\x18\x03 \x01(\x0b\x32).google.cloud.texttospeech.v1.AudioConfigB\x03\xe0\x41\x02"@\n\x0eSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x42\x0e\n\x0cinput_source"\x84\x01\n\x14VoiceSelectionParams\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x42\n\x0bssml_gender\x18\x03 \x01(\x0e\x32-.google.cloud.texttospeech.v1.SsmlVoiceGender"\xf1\x01\n\x0b\x41udioConfig\x12H\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xe0\x41\x02\x12\x1d\n\rspeaking_rate\x18\x02 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x15\n\x05pitch\x18\x03 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x0evolume_gain_db\x18\x04 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x11sample_rate_hertz\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12"\n\x12\x65\x66\x66\x65\x63ts_profile_id\x18\x06 \x03(\tB\x06\xe0\x41\x04\xe0\x41\x01"1\n\x18SynthesizeSpeechResponse\x12\x15\n\raudio_content\x18\x01 \x01(\x0c*W\n\x0fSsmlVoiceGender\x12!\n\x1dSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\n\x04MALE\x10\x01\x12\n\n\x06\x46\x45MALE\x10\x02\x12\x0b\n\x07NEUTRAL\x10\x03*T\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\x07\n\x03MP3\x10\x02\x12\x0c\n\x08OGG_OPUS\x10\x03\x32\xb4\x03\n\x0cTextToSpeech\x12\x93\x01\n\nListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1a\x30.google.cloud.texttospeech.v1.ListVoicesResponse""\x82\xd3\xe4\x93\x02\x0c\x12\n/v1/voices\xda\x41\rlanguage_code\x12\xbc\x01\n\x10SynthesizeSpeech\x12\x35.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1a\x36.google.cloud.texttospeech.v1.SynthesizeSpeechResponse"9\x82\xd3\xe4\x93\x02\x18"\x13/v1/text:synthesize:\x01*\xda\x41\x18input,voice,audio_config\x1aO\xca\x41\x1btexttospeech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc2\x01\n com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZHgoogle.golang.org/genproto/googleapis/cloud/texttospeech/v1;texttospeech\xf8\x01\x01\xaa\x02\x1cGoogle.Cloud.TextToSpeech.V1\xca\x02\x1cGoogle\\Cloud\\TextToSpeech\\V1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - ], -) - -_SSMLVOICEGENDER = _descriptor.EnumDescriptor( - name="SsmlVoiceGender", - full_name="google.cloud.texttospeech.v1.SsmlVoiceGender", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="SSML_VOICE_GENDER_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="MALE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FEMALE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="NEUTRAL", index=3, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1179, - serialized_end=1266, -) -_sym_db.RegisterEnumDescriptor(_SSMLVOICEGENDER) - -SsmlVoiceGender = enum_type_wrapper.EnumTypeWrapper(_SSMLVOICEGENDER) -_AUDIOENCODING = _descriptor.EnumDescriptor( - name="AudioEncoding", - full_name="google.cloud.texttospeech.v1.AudioEncoding", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="AUDIO_ENCODING_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LINEAR16", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MP3", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="OGG_OPUS", index=3, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1268, - serialized_end=1352, -) -_sym_db.RegisterEnumDescriptor(_AUDIOENCODING) - -AudioEncoding = enum_type_wrapper.EnumTypeWrapper(_AUDIOENCODING) -SSML_VOICE_GENDER_UNSPECIFIED = 0 -MALE = 1 -FEMALE = 2 -NEUTRAL = 3 -AUDIO_ENCODING_UNSPECIFIED = 0 -LINEAR16 = 1 -MP3 = 2 -OGG_OPUS = 3 - - -_LISTVOICESREQUEST = _descriptor.Descriptor( - name="ListVoicesRequest", - full_name="google.cloud.texttospeech.v1.ListVoicesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.texttospeech.v1.ListVoicesRequest.language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=172, - serialized_end=219, -) - - -_LISTVOICESRESPONSE = _descriptor.Descriptor( - name="ListVoicesResponse", - full_name="google.cloud.texttospeech.v1.ListVoicesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="voices", - full_name="google.cloud.texttospeech.v1.ListVoicesResponse.voices", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=221, - serialized_end=294, -) - - -_VOICE = _descriptor.Descriptor( - name="Voice", - full_name="google.cloud.texttospeech.v1.Voice", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_codes", - full_name="google.cloud.texttospeech.v1.Voice.language_codes", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.texttospeech.v1.Voice.name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ssml_gender", - full_name="google.cloud.texttospeech.v1.Voice.ssml_gender", - index=2, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="natural_sample_rate_hertz", - full_name="google.cloud.texttospeech.v1.Voice.natural_sample_rate_hertz", - index=3, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=297, - serialized_end=445, -) - - -_SYNTHESIZESPEECHREQUEST = _descriptor.Descriptor( - name="SynthesizeSpeechRequest", - full_name="google.cloud.texttospeech.v1.SynthesizeSpeechRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input", - full_name="google.cloud.texttospeech.v1.SynthesizeSpeechRequest.input", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="voice", - full_name="google.cloud.texttospeech.v1.SynthesizeSpeechRequest.voice", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="audio_config", - full_name="google.cloud.texttospeech.v1.SynthesizeSpeechRequest.audio_config", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=448, - serialized_end=681, -) - - -_SYNTHESISINPUT = _descriptor.Descriptor( - name="SynthesisInput", - full_name="google.cloud.texttospeech.v1.SynthesisInput", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="text", - full_name="google.cloud.texttospeech.v1.SynthesisInput.text", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ssml", - full_name="google.cloud.texttospeech.v1.SynthesisInput.ssml", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="input_source", - full_name="google.cloud.texttospeech.v1.SynthesisInput.input_source", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=683, - serialized_end=747, -) - - -_VOICESELECTIONPARAMS = _descriptor.Descriptor( - name="VoiceSelectionParams", - full_name="google.cloud.texttospeech.v1.VoiceSelectionParams", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.texttospeech.v1.VoiceSelectionParams.language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.texttospeech.v1.VoiceSelectionParams.name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ssml_gender", - full_name="google.cloud.texttospeech.v1.VoiceSelectionParams.ssml_gender", - index=2, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=750, - serialized_end=882, -) - - -_AUDIOCONFIG = _descriptor.Descriptor( - name="AudioConfig", - full_name="google.cloud.texttospeech.v1.AudioConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="audio_encoding", - full_name="google.cloud.texttospeech.v1.AudioConfig.audio_encoding", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="speaking_rate", - full_name="google.cloud.texttospeech.v1.AudioConfig.speaking_rate", - index=1, - number=2, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\004\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pitch", - full_name="google.cloud.texttospeech.v1.AudioConfig.pitch", - index=2, - number=3, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\004\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="volume_gain_db", - full_name="google.cloud.texttospeech.v1.AudioConfig.volume_gain_db", - index=3, - number=4, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\004\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="sample_rate_hertz", - full_name="google.cloud.texttospeech.v1.AudioConfig.sample_rate_hertz", - index=4, - number=5, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="effects_profile_id", - full_name="google.cloud.texttospeech.v1.AudioConfig.effects_profile_id", - index=5, - number=6, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\004\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=885, - serialized_end=1126, -) - - -_SYNTHESIZESPEECHRESPONSE = _descriptor.Descriptor( - name="SynthesizeSpeechResponse", - full_name="google.cloud.texttospeech.v1.SynthesizeSpeechResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="audio_content", - full_name="google.cloud.texttospeech.v1.SynthesizeSpeechResponse.audio_content", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1128, - serialized_end=1177, -) - -_LISTVOICESRESPONSE.fields_by_name["voices"].message_type = _VOICE -_VOICE.fields_by_name["ssml_gender"].enum_type = _SSMLVOICEGENDER -_SYNTHESIZESPEECHREQUEST.fields_by_name["input"].message_type = _SYNTHESISINPUT -_SYNTHESIZESPEECHREQUEST.fields_by_name["voice"].message_type = _VOICESELECTIONPARAMS -_SYNTHESIZESPEECHREQUEST.fields_by_name["audio_config"].message_type = _AUDIOCONFIG -_SYNTHESISINPUT.oneofs_by_name["input_source"].fields.append( - _SYNTHESISINPUT.fields_by_name["text"] -) -_SYNTHESISINPUT.fields_by_name[ - "text" -].containing_oneof = _SYNTHESISINPUT.oneofs_by_name["input_source"] -_SYNTHESISINPUT.oneofs_by_name["input_source"].fields.append( - _SYNTHESISINPUT.fields_by_name["ssml"] -) -_SYNTHESISINPUT.fields_by_name[ - "ssml" -].containing_oneof = _SYNTHESISINPUT.oneofs_by_name["input_source"] -_VOICESELECTIONPARAMS.fields_by_name["ssml_gender"].enum_type = _SSMLVOICEGENDER -_AUDIOCONFIG.fields_by_name["audio_encoding"].enum_type = _AUDIOENCODING -DESCRIPTOR.message_types_by_name["ListVoicesRequest"] = _LISTVOICESREQUEST -DESCRIPTOR.message_types_by_name["ListVoicesResponse"] = _LISTVOICESRESPONSE -DESCRIPTOR.message_types_by_name["Voice"] = _VOICE -DESCRIPTOR.message_types_by_name["SynthesizeSpeechRequest"] = _SYNTHESIZESPEECHREQUEST -DESCRIPTOR.message_types_by_name["SynthesisInput"] = _SYNTHESISINPUT -DESCRIPTOR.message_types_by_name["VoiceSelectionParams"] = _VOICESELECTIONPARAMS -DESCRIPTOR.message_types_by_name["AudioConfig"] = _AUDIOCONFIG -DESCRIPTOR.message_types_by_name["SynthesizeSpeechResponse"] = _SYNTHESIZESPEECHRESPONSE -DESCRIPTOR.enum_types_by_name["SsmlVoiceGender"] = _SSMLVOICEGENDER -DESCRIPTOR.enum_types_by_name["AudioEncoding"] = _AUDIOENCODING -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ListVoicesRequest = _reflection.GeneratedProtocolMessageType( - "ListVoicesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTVOICESREQUEST, - __module__="google.cloud.texttospeech_v1.proto.cloud_tts_pb2", - __doc__="""The top-level message sent by the client for the - ``ListVoices`` method. - - - Attributes: - language_code: - Optional. Recommended. `BCP-47 `__ language tag. If specified, - the ListVoices call will only return voices that can be used - to synthesize this language\_code. E.g. when specifying "en- - NZ", you will get supported "en-*" voices; when specifying - "no", you will get supported "no-*" (Norwegian) and "nb-*" - (Norwegian Bokmal) voices; specifying "zh" will also get - supported "cmn-*" voices; specifying "zh-hk" will also get - supported "yue-\*" voices. - """, - # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1.ListVoicesRequest) - ), -) -_sym_db.RegisterMessage(ListVoicesRequest) - -ListVoicesResponse = _reflection.GeneratedProtocolMessageType( - "ListVoicesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTVOICESRESPONSE, - __module__="google.cloud.texttospeech_v1.proto.cloud_tts_pb2", - __doc__="""The message returned to the client by the ``ListVoices`` - method. - - - Attributes: - voices: - The list of voices. - """, - # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1.ListVoicesResponse) - ), -) -_sym_db.RegisterMessage(ListVoicesResponse) - -Voice = _reflection.GeneratedProtocolMessageType( - "Voice", - (_message.Message,), - dict( - DESCRIPTOR=_VOICE, - __module__="google.cloud.texttospeech_v1.proto.cloud_tts_pb2", - __doc__="""Description of a voice supported by the TTS service. - - - Attributes: - language_codes: - The languages that this voice supports, expressed as `BCP-47 - `__ language - tags (e.g. "en-US", "es-419", "cmn-tw"). - name: - The name of this voice. Each distinct voice has a unique name. - ssml_gender: - The gender of this voice. - natural_sample_rate_hertz: - The natural sample rate (in hertz) for this voice. - """, - # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1.Voice) - ), -) -_sym_db.RegisterMessage(Voice) - -SynthesizeSpeechRequest = _reflection.GeneratedProtocolMessageType( - "SynthesizeSpeechRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SYNTHESIZESPEECHREQUEST, - __module__="google.cloud.texttospeech_v1.proto.cloud_tts_pb2", - __doc__="""The top-level message sent by the client for the - ``SynthesizeSpeech`` method. - - - Attributes: - input: - Required. The Synthesizer requires either plain text or SSML - as input. - voice: - Required. The desired voice of the synthesized audio. - audio_config: - Required. The configuration of the synthesized audio. - """, - # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1.SynthesizeSpeechRequest) - ), -) -_sym_db.RegisterMessage(SynthesizeSpeechRequest) - -SynthesisInput = _reflection.GeneratedProtocolMessageType( - "SynthesisInput", - (_message.Message,), - dict( - DESCRIPTOR=_SYNTHESISINPUT, - __module__="google.cloud.texttospeech_v1.proto.cloud_tts_pb2", - __doc__="""Contains text input to be synthesized. Either ``text`` or - ``ssml`` must be supplied. Supplying both or neither returns - [google.rpc.Code.INVALID\_ARGUMENT][]. The input size is limited to 5000 - characters. - - - Attributes: - input_source: - The input source, which is either plain text or SSML. - text: - The raw text to be synthesized. - ssml: - The SSML document to be synthesized. The SSML document must be - valid and well-formed. Otherwise the RPC will fail and return - [google.rpc.Code.INVALID\_ARGUMENT][]. For more information, - see `SSML `__. - """, - # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1.SynthesisInput) - ), -) -_sym_db.RegisterMessage(SynthesisInput) - -VoiceSelectionParams = _reflection.GeneratedProtocolMessageType( - "VoiceSelectionParams", - (_message.Message,), - dict( - DESCRIPTOR=_VOICESELECTIONPARAMS, - __module__="google.cloud.texttospeech_v1.proto.cloud_tts_pb2", - __doc__="""Description of which voice to use for a synthesis request. - - - Attributes: - language_code: - Required. The language (and potentially also the region) of - the voice expressed as a `BCP-47 `__ language tag, e.g. "en-US". - This should not include a script tag (e.g. use "cmn-cn" rather - than "cmn-Hant-cn"), because the script will be inferred from - the input provided in the SynthesisInput. The TTS service will - use this parameter to help choose an appropriate voice. Note - that the TTS service may choose a voice with a slightly - different language code than the one selected; it may - substitute a different region (e.g. using en-US rather than - en-CA if there isn't a Canadian voice available), or even a - different language, e.g. using "nb" (Norwegian Bokmal) instead - of "no" (Norwegian)". - name: - The name of the voice. If not set, the service will choose a - voice based on the other parameters such as language\_code and - gender. - ssml_gender: - The preferred gender of the voice. If not set, the service - will choose a voice based on the other parameters such as - language\_code and name. Note that this is only a preference, - not requirement; if a voice of the appropriate gender is not - available, the synthesizer should substitute a voice with a - different gender rather than failing the request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1.VoiceSelectionParams) - ), -) -_sym_db.RegisterMessage(VoiceSelectionParams) - -AudioConfig = _reflection.GeneratedProtocolMessageType( - "AudioConfig", - (_message.Message,), - dict( - DESCRIPTOR=_AUDIOCONFIG, - __module__="google.cloud.texttospeech_v1.proto.cloud_tts_pb2", - __doc__="""Description of audio data to be synthesized. - - - Attributes: - audio_encoding: - Required. The format of the audio byte stream. - speaking_rate: - Optional. Input only. Speaking rate/speed, in the range [0.25, - 4.0]. 1.0 is the normal native speed supported by the specific - voice. 2.0 is twice as fast, and 0.5 is half as fast. If - unset(0.0), defaults to the native 1.0 speed. Any other values - < 0.25 or > 4.0 will return an error. - pitch: - Optional. Input only. Speaking pitch, in the range [-20.0, - 20.0]. 20 means increase 20 semitones from the original pitch. - -20 means decrease 20 semitones from the original pitch. - volume_gain_db: - Optional. Input only. Volume gain (in dB) of the normal native - volume supported by the specific voice, in the range [-96.0, - 16.0]. If unset, or set to a value of 0.0 (dB), will play at - normal native signal amplitude. A value of -6.0 (dB) will play - at approximately half the amplitude of the normal native - signal amplitude. A value of +6.0 (dB) will play at - approximately twice the amplitude of the normal native signal - amplitude. Strongly recommend not to exceed +10 (dB) as - there's usually no effective increase in loudness for any - value greater than that. - sample_rate_hertz: - Optional. The synthesis sample rate (in hertz) for this audio. - When this is specified in SynthesizeSpeechRequest, if this is - different from the voice's natural sample rate, then the - synthesizer will honor this request by converting to the - desired sample rate (which might result in worse audio - quality), unless the specified sample rate is not supported - for the encoding chosen, in which case it will fail the - request and return [google.rpc.Code.INVALID\_ARGUMENT][]. - effects_profile_id: - Optional. Input only. An identifier which selects 'audio - effects' profiles that are applied on (post synthesized) text - to speech. Effects are applied on top of each other in the - order they are given. See `audio profiles - `__ for current supported profile ids. - """, - # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1.AudioConfig) - ), -) -_sym_db.RegisterMessage(AudioConfig) - -SynthesizeSpeechResponse = _reflection.GeneratedProtocolMessageType( - "SynthesizeSpeechResponse", - (_message.Message,), - dict( - DESCRIPTOR=_SYNTHESIZESPEECHRESPONSE, - __module__="google.cloud.texttospeech_v1.proto.cloud_tts_pb2", - __doc__="""The message returned to the client by the ``SynthesizeSpeech`` method. - - - Attributes: - audio_content: - The audio data bytes encoded as specified in the request, - including the header for encodings that are wrapped in - containers (e.g. MP3, OGG\_OPUS). For LINEAR16 audio, we - include the WAV header. Note: as with all bytes fields, - protobuffers use a pure binary representation, whereas JSON - representations use base64. - """, - # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1.SynthesizeSpeechResponse) - ), -) -_sym_db.RegisterMessage(SynthesizeSpeechResponse) - - -DESCRIPTOR._options = None -_LISTVOICESREQUEST.fields_by_name["language_code"]._options = None -_SYNTHESIZESPEECHREQUEST.fields_by_name["input"]._options = None -_SYNTHESIZESPEECHREQUEST.fields_by_name["voice"]._options = None -_SYNTHESIZESPEECHREQUEST.fields_by_name["audio_config"]._options = None -_VOICESELECTIONPARAMS.fields_by_name["language_code"]._options = None -_AUDIOCONFIG.fields_by_name["audio_encoding"]._options = None -_AUDIOCONFIG.fields_by_name["speaking_rate"]._options = None -_AUDIOCONFIG.fields_by_name["pitch"]._options = None -_AUDIOCONFIG.fields_by_name["volume_gain_db"]._options = None -_AUDIOCONFIG.fields_by_name["sample_rate_hertz"]._options = None -_AUDIOCONFIG.fields_by_name["effects_profile_id"]._options = None - -_TEXTTOSPEECH = _descriptor.ServiceDescriptor( - name="TextToSpeech", - full_name="google.cloud.texttospeech.v1.TextToSpeech", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\033texttospeech.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=1355, - serialized_end=1791, - methods=[ - _descriptor.MethodDescriptor( - name="ListVoices", - full_name="google.cloud.texttospeech.v1.TextToSpeech.ListVoices", - index=0, - containing_service=None, - input_type=_LISTVOICESREQUEST, - output_type=_LISTVOICESRESPONSE, - serialized_options=_b( - "\202\323\344\223\002\014\022\n/v1/voices\332A\rlanguage_code" - ), - ), - _descriptor.MethodDescriptor( - name="SynthesizeSpeech", - full_name="google.cloud.texttospeech.v1.TextToSpeech.SynthesizeSpeech", - index=1, - containing_service=None, - input_type=_SYNTHESIZESPEECHREQUEST, - output_type=_SYNTHESIZESPEECHRESPONSE, - serialized_options=_b( - '\202\323\344\223\002\030"\023/v1/text:synthesize:\001*\332A\030input,voice,audio_config' - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_TEXTTOSPEECH) - -DESCRIPTOR.services_by_name["TextToSpeech"] = _TEXTTOSPEECH - -# @@protoc_insertion_point(module_scope) diff --git a/texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts_pb2_grpc.py b/texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts_pb2_grpc.py deleted file mode 100644 index b1e7bfed73c8..000000000000 --- a/texttospeech/google/cloud/texttospeech_v1/proto/cloud_tts_pb2_grpc.py +++ /dev/null @@ -1,67 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.texttospeech_v1.proto import ( - cloud_tts_pb2 as google_dot_cloud_dot_texttospeech__v1_dot_proto_dot_cloud__tts__pb2, -) - - -class TextToSpeechStub(object): - """Service that implements Google Cloud Text-to-Speech API. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ListVoices = channel.unary_unary( - "/google.cloud.texttospeech.v1.TextToSpeech/ListVoices", - request_serializer=google_dot_cloud_dot_texttospeech__v1_dot_proto_dot_cloud__tts__pb2.ListVoicesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_texttospeech__v1_dot_proto_dot_cloud__tts__pb2.ListVoicesResponse.FromString, - ) - self.SynthesizeSpeech = channel.unary_unary( - "/google.cloud.texttospeech.v1.TextToSpeech/SynthesizeSpeech", - request_serializer=google_dot_cloud_dot_texttospeech__v1_dot_proto_dot_cloud__tts__pb2.SynthesizeSpeechRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_texttospeech__v1_dot_proto_dot_cloud__tts__pb2.SynthesizeSpeechResponse.FromString, - ) - - -class TextToSpeechServicer(object): - """Service that implements Google Cloud Text-to-Speech API. - """ - - def ListVoices(self, request, context): - """Returns a list of Voice supported for synthesis. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SynthesizeSpeech(self, request, context): - """Synthesizes speech synchronously: receive results after all text input - has been processed. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_TextToSpeechServicer_to_server(servicer, server): - rpc_method_handlers = { - "ListVoices": grpc.unary_unary_rpc_method_handler( - servicer.ListVoices, - request_deserializer=google_dot_cloud_dot_texttospeech__v1_dot_proto_dot_cloud__tts__pb2.ListVoicesRequest.FromString, - response_serializer=google_dot_cloud_dot_texttospeech__v1_dot_proto_dot_cloud__tts__pb2.ListVoicesResponse.SerializeToString, - ), - "SynthesizeSpeech": grpc.unary_unary_rpc_method_handler( - servicer.SynthesizeSpeech, - request_deserializer=google_dot_cloud_dot_texttospeech__v1_dot_proto_dot_cloud__tts__pb2.SynthesizeSpeechRequest.FromString, - response_serializer=google_dot_cloud_dot_texttospeech__v1_dot_proto_dot_cloud__tts__pb2.SynthesizeSpeechResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.texttospeech.v1.TextToSpeech", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/texttospeech/google/cloud/texttospeech_v1/types.py b/texttospeech/google/cloud/texttospeech_v1/types.py deleted file mode 100644 index 62a01d4c0979..000000000000 --- a/texttospeech/google/cloud/texttospeech_v1/types.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.texttospeech_v1.proto import cloud_tts_pb2 - - -_shared_modules = [] - -_local_modules = [cloud_tts_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.texttospeech_v1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/texttospeech/google/cloud/texttospeech_v1beta1/__init__.py b/texttospeech/google/cloud/texttospeech_v1beta1/__init__.py deleted file mode 100644 index 7c189d45b158..000000000000 --- a/texttospeech/google/cloud/texttospeech_v1beta1/__init__.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.texttospeech_v1beta1 import types -from google.cloud.texttospeech_v1beta1.gapic import enums -from google.cloud.texttospeech_v1beta1.gapic import text_to_speech_client - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class TextToSpeechClient(text_to_speech_client.TextToSpeechClient): - __doc__ = text_to_speech_client.TextToSpeechClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "TextToSpeechClient") diff --git a/texttospeech/google/cloud/texttospeech_v1beta1/gapic/__init__.py b/texttospeech/google/cloud/texttospeech_v1beta1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/texttospeech/google/cloud/texttospeech_v1beta1/gapic/enums.py b/texttospeech/google/cloud/texttospeech_v1beta1/gapic/enums.py deleted file mode 100644 index b0bc27820fc4..000000000000 --- a/texttospeech/google/cloud/texttospeech_v1beta1/gapic/enums.py +++ /dev/null @@ -1,63 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class AudioEncoding(enum.IntEnum): - """ - Configuration to set up audio encoder. The encoding determines the output - audio format that we'd like. - - Attributes: - AUDIO_ENCODING_UNSPECIFIED (int): Not specified. Will return result ``google.rpc.Code.INVALID_ARGUMENT``. - LINEAR16 (int): Uncompressed 16-bit signed little-endian samples (Linear PCM). - Audio content returned as LINEAR16 also contains a WAV header. - MP3 (int): MP3 audio at 32kbps. - OGG_OPUS (int): Opus encoded audio wrapped in an ogg container. The result will be a - file which can be played natively on Android, and in browsers (at least - Chrome and Firefox). The quality of the encoding is considerably higher - than MP3 while using approximately the same bitrate. - """ - - AUDIO_ENCODING_UNSPECIFIED = 0 - LINEAR16 = 1 - MP3 = 2 - OGG_OPUS = 3 - - -class SsmlVoiceGender(enum.IntEnum): - """ - Gender of the voice as described in `SSML voice - element `__. - - Attributes: - SSML_VOICE_GENDER_UNSPECIFIED (int): An unspecified gender. - In VoiceSelectionParams, this means that the client doesn't care which - gender the selected voice will have. In the Voice field of - ListVoicesResponse, this may mean that the voice doesn't fit any of the - other categories in this enum, or that the gender of the voice isn't known. - MALE (int): A male voice. - FEMALE (int): A female voice. - NEUTRAL (int): A gender-neutral voice. - """ - - SSML_VOICE_GENDER_UNSPECIFIED = 0 - MALE = 1 - FEMALE = 2 - NEUTRAL = 3 diff --git a/texttospeech/google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client.py b/texttospeech/google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client.py deleted file mode 100644 index 5ebb7a6c3a77..000000000000 --- a/texttospeech/google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client.py +++ /dev/null @@ -1,325 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.cloud.texttospeech.v1beta1 TextToSpeech API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.grpc_helpers -import grpc - -from google.cloud.texttospeech_v1beta1.gapic import enums -from google.cloud.texttospeech_v1beta1.gapic import text_to_speech_client_config -from google.cloud.texttospeech_v1beta1.gapic.transports import ( - text_to_speech_grpc_transport, -) -from google.cloud.texttospeech_v1beta1.proto import cloud_tts_pb2 -from google.cloud.texttospeech_v1beta1.proto import cloud_tts_pb2_grpc - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-texttospeech" -).version - - -class TextToSpeechClient(object): - """Service that implements Google Cloud Text-to-Speech API.""" - - SERVICE_ADDRESS = "texttospeech.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.texttospeech.v1beta1.TextToSpeech" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - TextToSpeechClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.TextToSpeechGrpcTransport, - Callable[[~.Credentials, type], ~.TextToSpeechGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = text_to_speech_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=text_to_speech_grpc_transport.TextToSpeechGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = text_to_speech_grpc_transport.TextToSpeechGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def list_voices( - self, - language_code=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Returns a list of Voice supported for synthesis. - - Example: - >>> from google.cloud import texttospeech_v1beta1 - >>> - >>> client = texttospeech_v1beta1.TextToSpeechClient() - >>> - >>> response = client.list_voices() - - Args: - language_code (str): Optional. Recommended. - `BCP-47 `__ language tag. - If specified, the ListVoices call will only return voices that can be - used to synthesize this language\_code. E.g. when specifying "en-NZ", - you will get supported "en-*" voices; when specifying "no", you will get - supported "no-*" (Norwegian) and "nb-*" (Norwegian Bokmal) voices; - specifying "zh" will also get supported "cmn-*" voices; specifying - "zh-hk" will also get supported "yue-\*" voices. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.texttospeech_v1beta1.types.ListVoicesResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_voices" not in self._inner_api_calls: - self._inner_api_calls[ - "list_voices" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_voices, - default_retry=self._method_configs["ListVoices"].retry, - default_timeout=self._method_configs["ListVoices"].timeout, - client_info=self._client_info, - ) - - request = cloud_tts_pb2.ListVoicesRequest(language_code=language_code) - return self._inner_api_calls["list_voices"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def synthesize_speech( - self, - input_, - voice, - audio_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Synthesizes speech synchronously: receive results after all text input - has been processed. - - Example: - >>> from google.cloud import texttospeech_v1beta1 - >>> - >>> client = texttospeech_v1beta1.TextToSpeechClient() - >>> - >>> # TODO: Initialize `input_`: - >>> input_ = {} - >>> - >>> # TODO: Initialize `voice`: - >>> voice = {} - >>> - >>> # TODO: Initialize `audio_config`: - >>> audio_config = {} - >>> - >>> response = client.synthesize_speech(input_, voice, audio_config) - - Args: - input_ (Union[dict, ~google.cloud.texttospeech_v1beta1.types.SynthesisInput]): Required. The Synthesizer requires either plain text or SSML as input. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.texttospeech_v1beta1.types.SynthesisInput` - voice (Union[dict, ~google.cloud.texttospeech_v1beta1.types.VoiceSelectionParams]): Required. The desired voice of the synthesized audio. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.texttospeech_v1beta1.types.VoiceSelectionParams` - audio_config (Union[dict, ~google.cloud.texttospeech_v1beta1.types.AudioConfig]): Required. The configuration of the synthesized audio. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.texttospeech_v1beta1.types.AudioConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.texttospeech_v1beta1.types.SynthesizeSpeechResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "synthesize_speech" not in self._inner_api_calls: - self._inner_api_calls[ - "synthesize_speech" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.synthesize_speech, - default_retry=self._method_configs["SynthesizeSpeech"].retry, - default_timeout=self._method_configs["SynthesizeSpeech"].timeout, - client_info=self._client_info, - ) - - request = cloud_tts_pb2.SynthesizeSpeechRequest( - input=input_, voice=voice, audio_config=audio_config - ) - return self._inner_api_calls["synthesize_speech"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/texttospeech/google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client_config.py b/texttospeech/google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client_config.py deleted file mode 100644 index 0463d0e9e778..000000000000 --- a/texttospeech/google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client_config.py +++ /dev/null @@ -1,33 +0,0 @@ -config = { - "interfaces": { - "google.cloud.texttospeech.v1beta1.TextToSpeech": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "ListVoices": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "SynthesizeSpeech": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/texttospeech/google/cloud/texttospeech_v1beta1/gapic/transports/__init__.py b/texttospeech/google/cloud/texttospeech_v1beta1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/texttospeech/google/cloud/texttospeech_v1beta1/gapic/transports/text_to_speech_grpc_transport.py b/texttospeech/google/cloud/texttospeech_v1beta1/gapic/transports/text_to_speech_grpc_transport.py deleted file mode 100644 index 53d10c8b5dec..000000000000 --- a/texttospeech/google/cloud/texttospeech_v1beta1/gapic/transports/text_to_speech_grpc_transport.py +++ /dev/null @@ -1,135 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers - -from google.cloud.texttospeech_v1beta1.proto import cloud_tts_pb2_grpc - - -class TextToSpeechGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.texttospeech.v1beta1 TextToSpeech API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="texttospeech.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "text_to_speech_stub": cloud_tts_pb2_grpc.TextToSpeechStub(channel) - } - - @classmethod - def create_channel( - cls, address="texttospeech.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def list_voices(self): - """Return the gRPC stub for :meth:`TextToSpeechClient.list_voices`. - - Returns a list of Voice supported for synthesis. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["text_to_speech_stub"].ListVoices - - @property - def synthesize_speech(self): - """Return the gRPC stub for :meth:`TextToSpeechClient.synthesize_speech`. - - Synthesizes speech synchronously: receive results after all text input - has been processed. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["text_to_speech_stub"].SynthesizeSpeech diff --git a/texttospeech/google/cloud/texttospeech_v1beta1/proto/__init__.py b/texttospeech/google/cloud/texttospeech_v1beta1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts.proto b/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts.proto deleted file mode 100644 index 443ff6d56f61..000000000000 --- a/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts.proto +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.texttospeech.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.TextToSpeech.V1beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/texttospeech/v1beta1;texttospeech"; -option java_multiple_files = true; -option java_outer_classname = "TextToSpeechProto"; -option java_package = "com.google.cloud.texttospeech.v1beta1"; -option php_namespace = "Google\\Cloud\\TextToSpeech\\V1beta1"; - -// Service that implements Google Cloud Text-to-Speech API. -service TextToSpeech { - option (google.api.default_host) = "texttospeech.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Returns a list of Voice supported for synthesis. - rpc ListVoices(ListVoicesRequest) returns (ListVoicesResponse) { - option (google.api.http) = { - get: "/v1beta1/voices" - }; - option (google.api.method_signature) = "language_code"; - } - - // Synthesizes speech synchronously: receive results after all text input - // has been processed. - rpc SynthesizeSpeech(SynthesizeSpeechRequest) returns (SynthesizeSpeechResponse) { - option (google.api.http) = { - post: "/v1beta1/text:synthesize" - body: "*" - }; - option (google.api.method_signature) = "input,voice,audio_config"; - } -} - -// The top-level message sent by the client for the `ListVoices` method. -message ListVoicesRequest { - // Optional. Recommended. - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If - // specified, the ListVoices call will only return voices that can be used to - // synthesize this language_code. E.g. when specifying "en-NZ", you will get - // supported "en-*" voices; when specifying "no", you will get supported - // "no-*" (Norwegian) and "nb-*" (Norwegian Bokmal) voices; specifying "zh" - // will also get supported "cmn-*" voices; specifying "zh-hk" will also get - // supported "yue-*" voices. - string language_code = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// Gender of the voice as described in -// [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). -enum SsmlVoiceGender { - // An unspecified gender. - // In VoiceSelectionParams, this means that the client doesn't care which - // gender the selected voice will have. In the Voice field of - // ListVoicesResponse, this may mean that the voice doesn't fit any of the - // other categories in this enum, or that the gender of the voice isn't known. - SSML_VOICE_GENDER_UNSPECIFIED = 0; - - // A male voice. - MALE = 1; - - // A female voice. - FEMALE = 2; - - // A gender-neutral voice. - NEUTRAL = 3; -} - -// Configuration to set up audio encoder. The encoding determines the output -// audio format that we'd like. -enum AudioEncoding { - // Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][]. - AUDIO_ENCODING_UNSPECIFIED = 0; - - // Uncompressed 16-bit signed little-endian samples (Linear PCM). - // Audio content returned as LINEAR16 also contains a WAV header. - LINEAR16 = 1; - - // MP3 audio at 32kbps. - MP3 = 2; - - // Opus encoded audio wrapped in an ogg container. The result will be a - // file which can be played natively on Android, and in browsers (at least - // Chrome and Firefox). The quality of the encoding is considerably higher - // than MP3 while using approximately the same bitrate. - OGG_OPUS = 3; -} - -// The message returned to the client by the `ListVoices` method. -message ListVoicesResponse { - // The list of voices. - repeated Voice voices = 1; -} - -// Description of a voice supported by the TTS service. -message Voice { - // The languages that this voice supports, expressed as - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. - // "en-US", "es-419", "cmn-tw"). - repeated string language_codes = 1; - - // The name of this voice. Each distinct voice has a unique name. - string name = 2; - - // The gender of this voice. - SsmlVoiceGender ssml_gender = 3; - - // The natural sample rate (in hertz) for this voice. - int32 natural_sample_rate_hertz = 4; -} - -// The top-level message sent by the client for the `SynthesizeSpeech` method. -message SynthesizeSpeechRequest { - // Required. The Synthesizer requires either plain text or SSML as input. - SynthesisInput input = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The desired voice of the synthesized audio. - VoiceSelectionParams voice = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The configuration of the synthesized audio. - AudioConfig audio_config = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Contains text input to be synthesized. Either `text` or `ssml` must be -// supplied. Supplying both or neither returns -// [google.rpc.Code.INVALID_ARGUMENT][]. The input size is limited to 5000 -// characters. -message SynthesisInput { - // The input source, which is either plain text or SSML. - oneof input_source { - // The raw text to be synthesized. - string text = 1; - - // The SSML document to be synthesized. The SSML document must be valid - // and well-formed. Otherwise the RPC will fail and return - // [google.rpc.Code.INVALID_ARGUMENT][]. For more information, see - // [SSML](/speech/text-to-speech/docs/ssml). - string ssml = 2; - } -} - -// Description of which voice to use for a synthesis request. -message VoiceSelectionParams { - // Required. The language (and potentially also the region) of the voice expressed as a - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g. - // "en-US". This should not include a script tag (e.g. use - // "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred - // from the input provided in the SynthesisInput. The TTS service - // will use this parameter to help choose an appropriate voice. Note that - // the TTS service may choose a voice with a slightly different language code - // than the one selected; it may substitute a different region - // (e.g. using en-US rather than en-CA if there isn't a Canadian voice - // available), or even a different language, e.g. using "nb" (Norwegian - // Bokmal) instead of "no" (Norwegian)". - string language_code = 1 [(google.api.field_behavior) = REQUIRED]; - - // The name of the voice. If not set, the service will choose a - // voice based on the other parameters such as language_code and gender. - string name = 2; - - // The preferred gender of the voice. If not set, the service will - // choose a voice based on the other parameters such as language_code and - // name. Note that this is only a preference, not requirement; if a - // voice of the appropriate gender is not available, the synthesizer should - // substitute a voice with a different gender rather than failing the request. - SsmlVoiceGender ssml_gender = 3; -} - -// Description of audio data to be synthesized. -message AudioConfig { - // Required. The format of the audio byte stream. - AudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is - // the normal native speed supported by the specific voice. 2.0 is twice as - // fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - // speed. Any other values < 0.25 or > 4.0 will return an error. - double speaking_rate = 2 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means - // increase 20 semitones from the original pitch. -20 means decrease 20 - // semitones from the original pitch. - double pitch = 3 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. Input only. Volume gain (in dB) of the normal native volume - // supported by the specific voice, in the range [-96.0, 16.0]. If unset, or - // set to a value of 0.0 (dB), will play at normal native signal amplitude. A - // value of -6.0 (dB) will play at approximately half the amplitude of the - // normal native signal amplitude. A value of +6.0 (dB) will play at - // approximately twice the amplitude of the normal native signal amplitude. - // Strongly recommend not to exceed +10 (dB) as there's usually no effective - // increase in loudness for any value greater than that. - double volume_gain_db = 4 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. The synthesis sample rate (in hertz) for this audio. When this is - // specified in SynthesizeSpeechRequest, if this is different from the voice's - // natural sample rate, then the synthesizer will honor this request by - // converting to the desired sample rate (which might result in worse audio - // quality), unless the specified sample rate is not supported for the - // encoding chosen, in which case it will fail the request and return - // [google.rpc.Code.INVALID_ARGUMENT][]. - int32 sample_rate_hertz = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Input only. An identifier which selects 'audio effects' profiles - // that are applied on (post synthesized) text to speech. Effects are applied - // on top of each other in the order they are given. See - // [audio - // profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for - // current supported profile ids. - repeated string effects_profile_id = 6 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// The message returned to the client by the `SynthesizeSpeech` method. -message SynthesizeSpeechResponse { - // The audio data bytes encoded as specified in the request, including the - // header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). - // For LINEAR16 audio, we include the WAV header. Note: as - // with all bytes fields, protobuffers use a pure binary representation, - // whereas JSON representations use base64. - bytes audio_content = 1; -} diff --git a/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2.py b/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2.py deleted file mode 100644 index 65ddd6281e53..000000000000 --- a/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2.py +++ /dev/null @@ -1,993 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/texttospeech_v1beta1/proto/cloud_tts.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/texttospeech_v1beta1/proto/cloud_tts.proto", - package="google.cloud.texttospeech.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n%com.google.cloud.texttospeech.v1beta1B\021TextToSpeechProtoP\001ZMgoogle.golang.org/genproto/googleapis/cloud/texttospeech/v1beta1;texttospeech\370\001\001\252\002!Google.Cloud.TextToSpeech.V1beta1\312\002!Google\\Cloud\\TextToSpeech\\V1beta1" - ), - serialized_pb=_b( - '\n7google/cloud/texttospeech_v1beta1/proto/cloud_tts.proto\x12!google.cloud.texttospeech.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto"/\n\x11ListVoicesRequest\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x01"N\n\x12ListVoicesResponse\x12\x38\n\x06voices\x18\x01 \x03(\x0b\x32(.google.cloud.texttospeech.v1beta1.Voice"\x99\x01\n\x05Voice\x12\x16\n\x0elanguage_codes\x18\x01 \x03(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12G\n\x0bssml_gender\x18\x03 \x01(\x0e\x32\x32.google.cloud.texttospeech.v1beta1.SsmlVoiceGender\x12!\n\x19natural_sample_rate_hertz\x18\x04 \x01(\x05"\xf8\x01\n\x17SynthesizeSpeechRequest\x12\x45\n\x05input\x18\x01 \x01(\x0b\x32\x31.google.cloud.texttospeech.v1beta1.SynthesisInputB\x03\xe0\x41\x02\x12K\n\x05voice\x18\x02 \x01(\x0b\x32\x37.google.cloud.texttospeech.v1beta1.VoiceSelectionParamsB\x03\xe0\x41\x02\x12I\n\x0c\x61udio_config\x18\x03 \x01(\x0b\x32..google.cloud.texttospeech.v1beta1.AudioConfigB\x03\xe0\x41\x02"@\n\x0eSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x42\x0e\n\x0cinput_source"\x89\x01\n\x14VoiceSelectionParams\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x02 \x01(\t\x12G\n\x0bssml_gender\x18\x03 \x01(\x0e\x32\x32.google.cloud.texttospeech.v1beta1.SsmlVoiceGender"\xf6\x01\n\x0b\x41udioConfig\x12M\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32\x30.google.cloud.texttospeech.v1beta1.AudioEncodingB\x03\xe0\x41\x02\x12\x1d\n\rspeaking_rate\x18\x02 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x15\n\x05pitch\x18\x03 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x0evolume_gain_db\x18\x04 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x11sample_rate_hertz\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12"\n\x12\x65\x66\x66\x65\x63ts_profile_id\x18\x06 \x03(\tB\x06\xe0\x41\x04\xe0\x41\x01"1\n\x18SynthesizeSpeechResponse\x12\x15\n\raudio_content\x18\x01 \x01(\x0c*W\n\x0fSsmlVoiceGender\x12!\n\x1dSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\n\x04MALE\x10\x01\x12\n\n\x06\x46\x45MALE\x10\x02\x12\x0b\n\x07NEUTRAL\x10\x03*T\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\x07\n\x03MP3\x10\x02\x12\x0c\n\x08OGG_OPUS\x10\x03\x32\xd2\x03\n\x0cTextToSpeech\x12\xa2\x01\n\nListVoices\x12\x34.google.cloud.texttospeech.v1beta1.ListVoicesRequest\x1a\x35.google.cloud.texttospeech.v1beta1.ListVoicesResponse"\'\x82\xd3\xe4\x93\x02\x11\x12\x0f/v1beta1/voices\xda\x41\rlanguage_code\x12\xcb\x01\n\x10SynthesizeSpeech\x12:.google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest\x1a;.google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse">\x82\xd3\xe4\x93\x02\x1d"\x18/v1beta1/text:synthesize:\x01*\xda\x41\x18input,voice,audio_config\x1aO\xca\x41\x1btexttospeech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd6\x01\n%com.google.cloud.texttospeech.v1beta1B\x11TextToSpeechProtoP\x01ZMgoogle.golang.org/genproto/googleapis/cloud/texttospeech/v1beta1;texttospeech\xf8\x01\x01\xaa\x02!Google.Cloud.TextToSpeech.V1beta1\xca\x02!Google\\Cloud\\TextToSpeech\\V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - ], -) - -_SSMLVOICEGENDER = _descriptor.EnumDescriptor( - name="SsmlVoiceGender", - full_name="google.cloud.texttospeech.v1beta1.SsmlVoiceGender", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="SSML_VOICE_GENDER_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="MALE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FEMALE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="NEUTRAL", index=3, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1224, - serialized_end=1311, -) -_sym_db.RegisterEnumDescriptor(_SSMLVOICEGENDER) - -SsmlVoiceGender = enum_type_wrapper.EnumTypeWrapper(_SSMLVOICEGENDER) -_AUDIOENCODING = _descriptor.EnumDescriptor( - name="AudioEncoding", - full_name="google.cloud.texttospeech.v1beta1.AudioEncoding", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="AUDIO_ENCODING_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LINEAR16", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MP3", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="OGG_OPUS", index=3, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1313, - serialized_end=1397, -) -_sym_db.RegisterEnumDescriptor(_AUDIOENCODING) - -AudioEncoding = enum_type_wrapper.EnumTypeWrapper(_AUDIOENCODING) -SSML_VOICE_GENDER_UNSPECIFIED = 0 -MALE = 1 -FEMALE = 2 -NEUTRAL = 3 -AUDIO_ENCODING_UNSPECIFIED = 0 -LINEAR16 = 1 -MP3 = 2 -OGG_OPUS = 3 - - -_LISTVOICESREQUEST = _descriptor.Descriptor( - name="ListVoicesRequest", - full_name="google.cloud.texttospeech.v1beta1.ListVoicesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.texttospeech.v1beta1.ListVoicesRequest.language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=182, - serialized_end=229, -) - - -_LISTVOICESRESPONSE = _descriptor.Descriptor( - name="ListVoicesResponse", - full_name="google.cloud.texttospeech.v1beta1.ListVoicesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="voices", - full_name="google.cloud.texttospeech.v1beta1.ListVoicesResponse.voices", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=231, - serialized_end=309, -) - - -_VOICE = _descriptor.Descriptor( - name="Voice", - full_name="google.cloud.texttospeech.v1beta1.Voice", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_codes", - full_name="google.cloud.texttospeech.v1beta1.Voice.language_codes", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.texttospeech.v1beta1.Voice.name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ssml_gender", - full_name="google.cloud.texttospeech.v1beta1.Voice.ssml_gender", - index=2, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="natural_sample_rate_hertz", - full_name="google.cloud.texttospeech.v1beta1.Voice.natural_sample_rate_hertz", - index=3, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=312, - serialized_end=465, -) - - -_SYNTHESIZESPEECHREQUEST = _descriptor.Descriptor( - name="SynthesizeSpeechRequest", - full_name="google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input", - full_name="google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest.input", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="voice", - full_name="google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest.voice", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="audio_config", - full_name="google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest.audio_config", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=468, - serialized_end=716, -) - - -_SYNTHESISINPUT = _descriptor.Descriptor( - name="SynthesisInput", - full_name="google.cloud.texttospeech.v1beta1.SynthesisInput", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="text", - full_name="google.cloud.texttospeech.v1beta1.SynthesisInput.text", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ssml", - full_name="google.cloud.texttospeech.v1beta1.SynthesisInput.ssml", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="input_source", - full_name="google.cloud.texttospeech.v1beta1.SynthesisInput.input_source", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=718, - serialized_end=782, -) - - -_VOICESELECTIONPARAMS = _descriptor.Descriptor( - name="VoiceSelectionParams", - full_name="google.cloud.texttospeech.v1beta1.VoiceSelectionParams", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.texttospeech.v1beta1.VoiceSelectionParams.language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.texttospeech.v1beta1.VoiceSelectionParams.name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ssml_gender", - full_name="google.cloud.texttospeech.v1beta1.VoiceSelectionParams.ssml_gender", - index=2, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=785, - serialized_end=922, -) - - -_AUDIOCONFIG = _descriptor.Descriptor( - name="AudioConfig", - full_name="google.cloud.texttospeech.v1beta1.AudioConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="audio_encoding", - full_name="google.cloud.texttospeech.v1beta1.AudioConfig.audio_encoding", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="speaking_rate", - full_name="google.cloud.texttospeech.v1beta1.AudioConfig.speaking_rate", - index=1, - number=2, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\004\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pitch", - full_name="google.cloud.texttospeech.v1beta1.AudioConfig.pitch", - index=2, - number=3, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\004\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="volume_gain_db", - full_name="google.cloud.texttospeech.v1beta1.AudioConfig.volume_gain_db", - index=3, - number=4, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\004\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="sample_rate_hertz", - full_name="google.cloud.texttospeech.v1beta1.AudioConfig.sample_rate_hertz", - index=4, - number=5, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="effects_profile_id", - full_name="google.cloud.texttospeech.v1beta1.AudioConfig.effects_profile_id", - index=5, - number=6, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\004\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=925, - serialized_end=1171, -) - - -_SYNTHESIZESPEECHRESPONSE = _descriptor.Descriptor( - name="SynthesizeSpeechResponse", - full_name="google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="audio_content", - full_name="google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse.audio_content", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1173, - serialized_end=1222, -) - -_LISTVOICESRESPONSE.fields_by_name["voices"].message_type = _VOICE -_VOICE.fields_by_name["ssml_gender"].enum_type = _SSMLVOICEGENDER -_SYNTHESIZESPEECHREQUEST.fields_by_name["input"].message_type = _SYNTHESISINPUT -_SYNTHESIZESPEECHREQUEST.fields_by_name["voice"].message_type = _VOICESELECTIONPARAMS -_SYNTHESIZESPEECHREQUEST.fields_by_name["audio_config"].message_type = _AUDIOCONFIG -_SYNTHESISINPUT.oneofs_by_name["input_source"].fields.append( - _SYNTHESISINPUT.fields_by_name["text"] -) -_SYNTHESISINPUT.fields_by_name[ - "text" -].containing_oneof = _SYNTHESISINPUT.oneofs_by_name["input_source"] -_SYNTHESISINPUT.oneofs_by_name["input_source"].fields.append( - _SYNTHESISINPUT.fields_by_name["ssml"] -) -_SYNTHESISINPUT.fields_by_name[ - "ssml" -].containing_oneof = _SYNTHESISINPUT.oneofs_by_name["input_source"] -_VOICESELECTIONPARAMS.fields_by_name["ssml_gender"].enum_type = _SSMLVOICEGENDER -_AUDIOCONFIG.fields_by_name["audio_encoding"].enum_type = _AUDIOENCODING -DESCRIPTOR.message_types_by_name["ListVoicesRequest"] = _LISTVOICESREQUEST -DESCRIPTOR.message_types_by_name["ListVoicesResponse"] = _LISTVOICESRESPONSE -DESCRIPTOR.message_types_by_name["Voice"] = _VOICE -DESCRIPTOR.message_types_by_name["SynthesizeSpeechRequest"] = _SYNTHESIZESPEECHREQUEST -DESCRIPTOR.message_types_by_name["SynthesisInput"] = _SYNTHESISINPUT -DESCRIPTOR.message_types_by_name["VoiceSelectionParams"] = _VOICESELECTIONPARAMS -DESCRIPTOR.message_types_by_name["AudioConfig"] = _AUDIOCONFIG -DESCRIPTOR.message_types_by_name["SynthesizeSpeechResponse"] = _SYNTHESIZESPEECHRESPONSE -DESCRIPTOR.enum_types_by_name["SsmlVoiceGender"] = _SSMLVOICEGENDER -DESCRIPTOR.enum_types_by_name["AudioEncoding"] = _AUDIOENCODING -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ListVoicesRequest = _reflection.GeneratedProtocolMessageType( - "ListVoicesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTVOICESREQUEST, - __module__="google.cloud.texttospeech_v1beta1.proto.cloud_tts_pb2", - __doc__="""The top-level message sent by the client for the - ``ListVoices`` method. - - - Attributes: - language_code: - Optional. Recommended. `BCP-47 `__ language tag. If specified, - the ListVoices call will only return voices that can be used - to synthesize this language\_code. E.g. when specifying "en- - NZ", you will get supported "en-*" voices; when specifying - "no", you will get supported "no-*" (Norwegian) and "nb-*" - (Norwegian Bokmal) voices; specifying "zh" will also get - supported "cmn-*" voices; specifying "zh-hk" will also get - supported "yue-\*" voices. - """, - # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1beta1.ListVoicesRequest) - ), -) -_sym_db.RegisterMessage(ListVoicesRequest) - -ListVoicesResponse = _reflection.GeneratedProtocolMessageType( - "ListVoicesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTVOICESRESPONSE, - __module__="google.cloud.texttospeech_v1beta1.proto.cloud_tts_pb2", - __doc__="""The message returned to the client by the ``ListVoices`` method. - - - Attributes: - voices: - The list of voices. - """, - # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1beta1.ListVoicesResponse) - ), -) -_sym_db.RegisterMessage(ListVoicesResponse) - -Voice = _reflection.GeneratedProtocolMessageType( - "Voice", - (_message.Message,), - dict( - DESCRIPTOR=_VOICE, - __module__="google.cloud.texttospeech_v1beta1.proto.cloud_tts_pb2", - __doc__="""Description of a voice supported by the TTS service. - - - Attributes: - language_codes: - The languages that this voice supports, expressed as `BCP-47 - `__ language - tags (e.g. "en-US", "es-419", "cmn-tw"). - name: - The name of this voice. Each distinct voice has a unique name. - ssml_gender: - The gender of this voice. - natural_sample_rate_hertz: - The natural sample rate (in hertz) for this voice. - """, - # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1beta1.Voice) - ), -) -_sym_db.RegisterMessage(Voice) - -SynthesizeSpeechRequest = _reflection.GeneratedProtocolMessageType( - "SynthesizeSpeechRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SYNTHESIZESPEECHREQUEST, - __module__="google.cloud.texttospeech_v1beta1.proto.cloud_tts_pb2", - __doc__="""The top-level message sent by the client for the - ``SynthesizeSpeech`` method. - - - Attributes: - input: - Required. The Synthesizer requires either plain text or SSML - as input. - voice: - Required. The desired voice of the synthesized audio. - audio_config: - Required. The configuration of the synthesized audio. - """, - # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest) - ), -) -_sym_db.RegisterMessage(SynthesizeSpeechRequest) - -SynthesisInput = _reflection.GeneratedProtocolMessageType( - "SynthesisInput", - (_message.Message,), - dict( - DESCRIPTOR=_SYNTHESISINPUT, - __module__="google.cloud.texttospeech_v1beta1.proto.cloud_tts_pb2", - __doc__="""Contains text input to be synthesized. Either ``text`` or - ``ssml`` must be supplied. Supplying both or neither returns - [google.rpc.Code.INVALID\_ARGUMENT][]. The input size is limited to 5000 - characters. - - - Attributes: - input_source: - The input source, which is either plain text or SSML. - text: - The raw text to be synthesized. - ssml: - The SSML document to be synthesized. The SSML document must be - valid and well-formed. Otherwise the RPC will fail and return - [google.rpc.Code.INVALID\_ARGUMENT][]. For more information, - see `SSML `__. - """, - # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1beta1.SynthesisInput) - ), -) -_sym_db.RegisterMessage(SynthesisInput) - -VoiceSelectionParams = _reflection.GeneratedProtocolMessageType( - "VoiceSelectionParams", - (_message.Message,), - dict( - DESCRIPTOR=_VOICESELECTIONPARAMS, - __module__="google.cloud.texttospeech_v1beta1.proto.cloud_tts_pb2", - __doc__="""Description of which voice to use for a synthesis request. - - - Attributes: - language_code: - Required. The language (and potentially also the region) of - the voice expressed as a `BCP-47 `__ language tag, e.g. "en-US". - This should not include a script tag (e.g. use "cmn-cn" rather - than "cmn-Hant-cn"), because the script will be inferred from - the input provided in the SynthesisInput. The TTS service will - use this parameter to help choose an appropriate voice. Note - that the TTS service may choose a voice with a slightly - different language code than the one selected; it may - substitute a different region (e.g. using en-US rather than - en-CA if there isn't a Canadian voice available), or even a - different language, e.g. using "nb" (Norwegian Bokmal) instead - of "no" (Norwegian)". - name: - The name of the voice. If not set, the service will choose a - voice based on the other parameters such as language\_code and - gender. - ssml_gender: - The preferred gender of the voice. If not set, the service - will choose a voice based on the other parameters such as - language\_code and name. Note that this is only a preference, - not requirement; if a voice of the appropriate gender is not - available, the synthesizer should substitute a voice with a - different gender rather than failing the request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1beta1.VoiceSelectionParams) - ), -) -_sym_db.RegisterMessage(VoiceSelectionParams) - -AudioConfig = _reflection.GeneratedProtocolMessageType( - "AudioConfig", - (_message.Message,), - dict( - DESCRIPTOR=_AUDIOCONFIG, - __module__="google.cloud.texttospeech_v1beta1.proto.cloud_tts_pb2", - __doc__="""Description of audio data to be synthesized. - - - Attributes: - audio_encoding: - Required. The format of the audio byte stream. - speaking_rate: - Optional. Input only. Speaking rate/speed, in the range [0.25, - 4.0]. 1.0 is the normal native speed supported by the specific - voice. 2.0 is twice as fast, and 0.5 is half as fast. If - unset(0.0), defaults to the native 1.0 speed. Any other values - < 0.25 or > 4.0 will return an error. - pitch: - Optional. Input only. Speaking pitch, in the range [-20.0, - 20.0]. 20 means increase 20 semitones from the original pitch. - -20 means decrease 20 semitones from the original pitch. - volume_gain_db: - Optional. Input only. Volume gain (in dB) of the normal native - volume supported by the specific voice, in the range [-96.0, - 16.0]. If unset, or set to a value of 0.0 (dB), will play at - normal native signal amplitude. A value of -6.0 (dB) will play - at approximately half the amplitude of the normal native - signal amplitude. A value of +6.0 (dB) will play at - approximately twice the amplitude of the normal native signal - amplitude. Strongly recommend not to exceed +10 (dB) as - there's usually no effective increase in loudness for any - value greater than that. - sample_rate_hertz: - Optional. The synthesis sample rate (in hertz) for this audio. - When this is specified in SynthesizeSpeechRequest, if this is - different from the voice's natural sample rate, then the - synthesizer will honor this request by converting to the - desired sample rate (which might result in worse audio - quality), unless the specified sample rate is not supported - for the encoding chosen, in which case it will fail the - request and return [google.rpc.Code.INVALID\_ARGUMENT][]. - effects_profile_id: - Optional. Input only. An identifier which selects 'audio - effects' profiles that are applied on (post synthesized) text - to speech. Effects are applied on top of each other in the - order they are given. See `audio profiles - `__ for current supported profile ids. - """, - # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1beta1.AudioConfig) - ), -) -_sym_db.RegisterMessage(AudioConfig) - -SynthesizeSpeechResponse = _reflection.GeneratedProtocolMessageType( - "SynthesizeSpeechResponse", - (_message.Message,), - dict( - DESCRIPTOR=_SYNTHESIZESPEECHRESPONSE, - __module__="google.cloud.texttospeech_v1beta1.proto.cloud_tts_pb2", - __doc__="""The message returned to the client by the - ``SynthesizeSpeech`` method. - - - Attributes: - audio_content: - The audio data bytes encoded as specified in the request, - including the header for encodings that are wrapped in - containers (e.g. MP3, OGG\_OPUS). For LINEAR16 audio, we - include the WAV header. Note: as with all bytes fields, - protobuffers use a pure binary representation, whereas JSON - representations use base64. - """, - # @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse) - ), -) -_sym_db.RegisterMessage(SynthesizeSpeechResponse) - - -DESCRIPTOR._options = None -_LISTVOICESREQUEST.fields_by_name["language_code"]._options = None -_SYNTHESIZESPEECHREQUEST.fields_by_name["input"]._options = None -_SYNTHESIZESPEECHREQUEST.fields_by_name["voice"]._options = None -_SYNTHESIZESPEECHREQUEST.fields_by_name["audio_config"]._options = None -_VOICESELECTIONPARAMS.fields_by_name["language_code"]._options = None -_AUDIOCONFIG.fields_by_name["audio_encoding"]._options = None -_AUDIOCONFIG.fields_by_name["speaking_rate"]._options = None -_AUDIOCONFIG.fields_by_name["pitch"]._options = None -_AUDIOCONFIG.fields_by_name["volume_gain_db"]._options = None -_AUDIOCONFIG.fields_by_name["sample_rate_hertz"]._options = None -_AUDIOCONFIG.fields_by_name["effects_profile_id"]._options = None - -_TEXTTOSPEECH = _descriptor.ServiceDescriptor( - name="TextToSpeech", - full_name="google.cloud.texttospeech.v1beta1.TextToSpeech", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\033texttospeech.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=1400, - serialized_end=1866, - methods=[ - _descriptor.MethodDescriptor( - name="ListVoices", - full_name="google.cloud.texttospeech.v1beta1.TextToSpeech.ListVoices", - index=0, - containing_service=None, - input_type=_LISTVOICESREQUEST, - output_type=_LISTVOICESRESPONSE, - serialized_options=_b( - "\202\323\344\223\002\021\022\017/v1beta1/voices\332A\rlanguage_code" - ), - ), - _descriptor.MethodDescriptor( - name="SynthesizeSpeech", - full_name="google.cloud.texttospeech.v1beta1.TextToSpeech.SynthesizeSpeech", - index=1, - containing_service=None, - input_type=_SYNTHESIZESPEECHREQUEST, - output_type=_SYNTHESIZESPEECHRESPONSE, - serialized_options=_b( - '\202\323\344\223\002\035"\030/v1beta1/text:synthesize:\001*\332A\030input,voice,audio_config' - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_TEXTTOSPEECH) - -DESCRIPTOR.services_by_name["TextToSpeech"] = _TEXTTOSPEECH - -# @@protoc_insertion_point(module_scope) diff --git a/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2_grpc.py b/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2_grpc.py deleted file mode 100644 index a469e83d1f46..000000000000 --- a/texttospeech/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2_grpc.py +++ /dev/null @@ -1,67 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.texttospeech_v1beta1.proto import ( - cloud_tts_pb2 as google_dot_cloud_dot_texttospeech__v1beta1_dot_proto_dot_cloud__tts__pb2, -) - - -class TextToSpeechStub(object): - """Service that implements Google Cloud Text-to-Speech API. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ListVoices = channel.unary_unary( - "/google.cloud.texttospeech.v1beta1.TextToSpeech/ListVoices", - request_serializer=google_dot_cloud_dot_texttospeech__v1beta1_dot_proto_dot_cloud__tts__pb2.ListVoicesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_texttospeech__v1beta1_dot_proto_dot_cloud__tts__pb2.ListVoicesResponse.FromString, - ) - self.SynthesizeSpeech = channel.unary_unary( - "/google.cloud.texttospeech.v1beta1.TextToSpeech/SynthesizeSpeech", - request_serializer=google_dot_cloud_dot_texttospeech__v1beta1_dot_proto_dot_cloud__tts__pb2.SynthesizeSpeechRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_texttospeech__v1beta1_dot_proto_dot_cloud__tts__pb2.SynthesizeSpeechResponse.FromString, - ) - - -class TextToSpeechServicer(object): - """Service that implements Google Cloud Text-to-Speech API. - """ - - def ListVoices(self, request, context): - """Returns a list of Voice supported for synthesis. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SynthesizeSpeech(self, request, context): - """Synthesizes speech synchronously: receive results after all text input - has been processed. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_TextToSpeechServicer_to_server(servicer, server): - rpc_method_handlers = { - "ListVoices": grpc.unary_unary_rpc_method_handler( - servicer.ListVoices, - request_deserializer=google_dot_cloud_dot_texttospeech__v1beta1_dot_proto_dot_cloud__tts__pb2.ListVoicesRequest.FromString, - response_serializer=google_dot_cloud_dot_texttospeech__v1beta1_dot_proto_dot_cloud__tts__pb2.ListVoicesResponse.SerializeToString, - ), - "SynthesizeSpeech": grpc.unary_unary_rpc_method_handler( - servicer.SynthesizeSpeech, - request_deserializer=google_dot_cloud_dot_texttospeech__v1beta1_dot_proto_dot_cloud__tts__pb2.SynthesizeSpeechRequest.FromString, - response_serializer=google_dot_cloud_dot_texttospeech__v1beta1_dot_proto_dot_cloud__tts__pb2.SynthesizeSpeechResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.texttospeech.v1beta1.TextToSpeech", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/texttospeech/google/cloud/texttospeech_v1beta1/types.py b/texttospeech/google/cloud/texttospeech_v1beta1/types.py deleted file mode 100644 index 724c9da6010e..000000000000 --- a/texttospeech/google/cloud/texttospeech_v1beta1/types.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.texttospeech_v1beta1.proto import cloud_tts_pb2 - - -_shared_modules = [] - -_local_modules = [cloud_tts_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.texttospeech_v1beta1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/texttospeech/noxfile.py b/texttospeech/noxfile.py deleted file mode 100644 index 7949a4e3925a..000000000000 --- a/texttospeech/noxfile.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/texttospeech/setup.cfg b/texttospeech/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/texttospeech/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/texttospeech/setup.py b/texttospeech/setup.py deleted file mode 100644 index bd3f306eb8a6..000000000000 --- a/texttospeech/setup.py +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import io -import os - -import setuptools - - -# Package metadata. - -name = "google-cloud-texttospeech" -description = "Google Cloud Text-to-Speech API client library" -version = "0.5.0" -# Should be one of: -# 'Development Status :: 3 - Alpha' -# 'Development Status :: 4 - Beta' -# 'Development Status :: 5 - Production/Stable' -release_status = "Development Status :: 3 - Alpha" -dependencies = ["google-api-core[grpc] >= 1.14.0, < 2.0.0dev"] -extras = {} - - -# Setup boilerplate below this line. - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -# Only include packages under the 'google' namespace. Do not include tests, -# benchmarks, etc. -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -# Determine which namespaces are needed. -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") - - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/GoogleCloudPlatform/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - extras_require=extras, - python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", - include_package_data=True, - zip_safe=False, -) diff --git a/texttospeech/synth.metadata b/texttospeech/synth.metadata deleted file mode 100644 index 6576efd0442c..000000000000 --- a/texttospeech/synth.metadata +++ /dev/null @@ -1,214 +0,0 @@ -{ - "updateTime": "2020-01-30T13:41:36.658254Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c1246a29e22b0f98e800a536b5b0da2d933a55f2", - "internalRef": "292310790", - "log": "c1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\n" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "texttospeech", - "apiVersion": "v1beta1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/texttospeech/artman_texttospeech_v1beta1.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "texttospeech", - "apiVersion": "v1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/texttospeech/artman_texttospeech_v1.yaml" - } - } - ], - "newFiles": [ - { - "path": ".coveragerc" - }, - { - "path": ".flake8" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "LICENSE" - }, - { - "path": "MANIFEST.in" - }, - { - "path": "README.rst" - }, - { - "path": "docs/README.rst" - }, - { - "path": "docs/_static/custom.css" - }, - { - "path": "docs/_templates/layout.html" - }, - { - "path": "docs/api.rst" - }, - { - "path": "docs/changelog.md" - }, - { - "path": "docs/conf.py" - }, - { - "path": "docs/gapic/v1/api.rst" - }, - { - "path": "docs/gapic/v1/types.rst" - }, - { - "path": "docs/gapic/v1beta1/api.rst" - }, - { - "path": "docs/gapic/v1beta1/types.rst" - }, - { - "path": "docs/index.rst" - }, - { - "path": "google/__init__.py" - }, - { - "path": "google/cloud/__init__.py" - }, - { - "path": "google/cloud/texttospeech.py" - }, - { - "path": "google/cloud/texttospeech_v1/__init__.py" - }, - { - "path": "google/cloud/texttospeech_v1/gapic/__init__.py" - }, - { - "path": "google/cloud/texttospeech_v1/gapic/enums.py" - }, - { - "path": "google/cloud/texttospeech_v1/gapic/text_to_speech_client.py" - }, - { - "path": "google/cloud/texttospeech_v1/gapic/text_to_speech_client_config.py" - }, - { - "path": "google/cloud/texttospeech_v1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/texttospeech_v1/gapic/transports/text_to_speech_grpc_transport.py" - }, - { - "path": "google/cloud/texttospeech_v1/proto/__init__.py" - }, - { - "path": "google/cloud/texttospeech_v1/proto/cloud_tts.proto" - }, - { - "path": "google/cloud/texttospeech_v1/proto/cloud_tts_pb2.py" - }, - { - "path": "google/cloud/texttospeech_v1/proto/cloud_tts_pb2_grpc.py" - }, - { - "path": "google/cloud/texttospeech_v1/types.py" - }, - { - "path": "google/cloud/texttospeech_v1beta1/__init__.py" - }, - { - "path": "google/cloud/texttospeech_v1beta1/gapic/__init__.py" - }, - { - "path": "google/cloud/texttospeech_v1beta1/gapic/enums.py" - }, - { - "path": "google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client.py" - }, - { - "path": "google/cloud/texttospeech_v1beta1/gapic/text_to_speech_client_config.py" - }, - { - "path": "google/cloud/texttospeech_v1beta1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/texttospeech_v1beta1/gapic/transports/text_to_speech_grpc_transport.py" - }, - { - "path": "google/cloud/texttospeech_v1beta1/proto/__init__.py" - }, - { - "path": "google/cloud/texttospeech_v1beta1/proto/cloud_tts.proto" - }, - { - "path": "google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2.py" - }, - { - "path": "google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2_grpc.py" - }, - { - "path": "google/cloud/texttospeech_v1beta1/types.py" - }, - { - "path": "noxfile.py" - }, - { - "path": "setup.cfg" - }, - { - "path": "setup.py" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "tests/system/v1/test_system_tts_v1.py" - }, - { - "path": "tests/system/v1beta1/test_system_tts_v1beta1.py" - }, - { - "path": "tests/unit/gapic/v1/test_text_to_speech_client_v1.py" - }, - { - "path": "tests/unit/gapic/v1beta1/test_text_to_speech_client_v1beta1.py" - } - ] -} \ No newline at end of file diff --git a/texttospeech/synth.py b/texttospeech/synth.py deleted file mode 100644 index d03c792a0888..000000000000 --- a/texttospeech/synth.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated parts of this library.""" -import re - -import synthtool as s -from synthtool import gcp - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() -versions = ["v1beta1", "v1"] - -# ---------------------------------------------------------------------------- -# Generate texttospeech GAPIC layer -# ---------------------------------------------------------------------------- -for version in versions: - library = gapic.py_library("texttospeech", version, include_protos=True) - s.move(library / f"google/cloud/texttospeech_{version}") - s.move(library / f"tests/unit/gapic/{version}") - s.move(library / f"docs/gapic/{version}") - -# Use the highest version library to generate import alias. -s.move(library / "google/cloud/texttospeech.py") - -# Fix bad docstrings. -s.replace("**/gapic/*_client.py", r'\\"(.+?)-\*\\"', r'"\1-\\*"') - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = common.py_library(unit_cov_level=97, cov_level=100) -s.move(templated_files) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/texttospeech/tests/system/v1/test_system_tts_v1.py b/texttospeech/tests/system/v1/test_system_tts_v1.py deleted file mode 100644 index 4d90bae50427..000000000000 --- a/texttospeech/tests/system/v1/test_system_tts_v1.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from google.cloud import texttospeech_v1 - - -class TestSystemSpeech(object): - def test_synthesize_speech(self): - client = texttospeech_v1.TextToSpeechClient() - - synthesis_input = texttospeech_v1.types.SynthesisInput(text="Hello, World!") - voice = texttospeech_v1.types.VoiceSelectionParams( - language_code="en-US", - ssml_gender=texttospeech_v1.enums.SsmlVoiceGender.NEUTRAL, - ) - audio_config = texttospeech_v1.types.AudioConfig( - audio_encoding=texttospeech_v1.enums.AudioEncoding.MP3 - ) - - response = client.synthesize_speech(synthesis_input, voice, audio_config) - assert response.audio_content is not None - - def test_list_voices(self): - client = texttospeech_v1.TextToSpeechClient() - - voices = client.list_voices() - assert len(voices.voices) > 0 diff --git a/texttospeech/tests/system/v1beta1/test_system_tts_v1beta1.py b/texttospeech/tests/system/v1beta1/test_system_tts_v1beta1.py deleted file mode 100644 index c6058acf27a0..000000000000 --- a/texttospeech/tests/system/v1beta1/test_system_tts_v1beta1.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from google.cloud import texttospeech_v1beta1 - - -class TestSystemSpeech(object): - def test_synthesize_speech(self): - client = texttospeech_v1beta1.TextToSpeechClient() - - synthesis_input = texttospeech_v1beta1.types.SynthesisInput( - text="Hello, World!" - ) - voice = texttospeech_v1beta1.types.VoiceSelectionParams( - language_code="en-US", - ssml_gender=texttospeech_v1beta1.enums.SsmlVoiceGender.NEUTRAL, - ) - audio_config = texttospeech_v1beta1.types.AudioConfig( - audio_encoding=texttospeech_v1beta1.enums.AudioEncoding.MP3 - ) - - response = client.synthesize_speech(synthesis_input, voice, audio_config) - assert response.audio_content is not None - - def test_list_voices(self): - client = texttospeech_v1beta1.TextToSpeechClient() - - voices = client.list_voices() - assert len(voices.voices) > 0 diff --git a/texttospeech/tests/unit/gapic/v1/test_text_to_speech_client_v1.py b/texttospeech/tests/unit/gapic/v1/test_text_to_speech_client_v1.py deleted file mode 100644 index c0c2c5a9d3df..000000000000 --- a/texttospeech/tests/unit/gapic/v1/test_text_to_speech_client_v1.py +++ /dev/null @@ -1,136 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import texttospeech_v1 -from google.cloud.texttospeech_v1.proto import cloud_tts_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestTextToSpeechClient(object): - def test_list_voices(self): - # Setup Expected Response - expected_response = {} - expected_response = cloud_tts_pb2.ListVoicesResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = texttospeech_v1.TextToSpeechClient() - - response = client.list_voices() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloud_tts_pb2.ListVoicesRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_voices_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = texttospeech_v1.TextToSpeechClient() - - with pytest.raises(CustomException): - client.list_voices() - - def test_synthesize_speech(self): - # Setup Expected Response - audio_content = b"16" - expected_response = {"audio_content": audio_content} - expected_response = cloud_tts_pb2.SynthesizeSpeechResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = texttospeech_v1.TextToSpeechClient() - - # Setup Request - input_ = {} - voice = {} - audio_config = {} - - response = client.synthesize_speech(input_, voice, audio_config) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloud_tts_pb2.SynthesizeSpeechRequest( - input=input_, voice=voice, audio_config=audio_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_synthesize_speech_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = texttospeech_v1.TextToSpeechClient() - - # Setup request - input_ = {} - voice = {} - audio_config = {} - - with pytest.raises(CustomException): - client.synthesize_speech(input_, voice, audio_config) diff --git a/texttospeech/tests/unit/gapic/v1beta1/test_text_to_speech_client_v1beta1.py b/texttospeech/tests/unit/gapic/v1beta1/test_text_to_speech_client_v1beta1.py deleted file mode 100644 index 52344757097f..000000000000 --- a/texttospeech/tests/unit/gapic/v1beta1/test_text_to_speech_client_v1beta1.py +++ /dev/null @@ -1,136 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import texttospeech_v1beta1 -from google.cloud.texttospeech_v1beta1.proto import cloud_tts_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestTextToSpeechClient(object): - def test_list_voices(self): - # Setup Expected Response - expected_response = {} - expected_response = cloud_tts_pb2.ListVoicesResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = texttospeech_v1beta1.TextToSpeechClient() - - response = client.list_voices() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloud_tts_pb2.ListVoicesRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_voices_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = texttospeech_v1beta1.TextToSpeechClient() - - with pytest.raises(CustomException): - client.list_voices() - - def test_synthesize_speech(self): - # Setup Expected Response - audio_content = b"16" - expected_response = {"audio_content": audio_content} - expected_response = cloud_tts_pb2.SynthesizeSpeechResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = texttospeech_v1beta1.TextToSpeechClient() - - # Setup Request - input_ = {} - voice = {} - audio_config = {} - - response = client.synthesize_speech(input_, voice, audio_config) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloud_tts_pb2.SynthesizeSpeechRequest( - input=input_, voice=voice, audio_config=audio_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_synthesize_speech_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = texttospeech_v1beta1.TextToSpeechClient() - - # Setup request - input_ = {} - voice = {} - audio_config = {} - - with pytest.raises(CustomException): - client.synthesize_speech(input_, voice, audio_config) diff --git a/translate/.coveragerc b/translate/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/translate/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/translate/.flake8 b/translate/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/translate/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/translate/.repo-metadata.json b/translate/.repo-metadata.json deleted file mode 100644 index 85f651a8088e..000000000000 --- a/translate/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "translation", - "name_pretty": "Cloud Translation", - "product_documentation": "https://cloud.google.com/translate/docs/", - "client_documentation": "https://googleapis.dev/python/translation/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559749", - "release_level": "ga", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-translate", - "api_id": "translation.googleapis.com", - "requires_billing": true -} diff --git a/translate/CHANGELOG.md b/translate/CHANGELOG.md deleted file mode 100644 index 594d539a168c..000000000000 --- a/translate/CHANGELOG.md +++ /dev/null @@ -1,179 +0,0 @@ -# Changelog - -[PyPI History][1] - -[1]: https://pypi.org/project/google-cloud-translate/#history - -## 2.0.0 - -10-23-2019 11:13 PDT - -### New Features -- Make v3 the default client. ([#9498](https://github.com/googleapis/google-cloud-python/pull/9498)) - -### Internal / Testing Changes -- Add VPC-SC system tests. ([#9272](https://github.com/googleapis/google-cloud-python/pull/9272)) - -## 1.7.0 - -10-07-2019 14:57 PDT - -### Implementation Changes -- Update docstrings, client confg (via synth). ([#9411](https://github.com/googleapis/google-cloud-python/pull/9411)) -- Remove send / receive message size limit (via synth). ([#8974](https://github.com/googleapis/google-cloud-python/pull/8974)) - -### New Features -- Add support for V3 of the API. ([#9020](https://github.com/googleapis/google-cloud-python/pull/9020)) -- Make `parent` argument required for all client methods in v3beta1; add `labels` argument (via synth). ([#9354](https://github.com/googleapis/google-cloud-python/pull/9354)) -- Add client options to translate_v2. ([#8737](https://github.com/googleapis/google-cloud-python/pull/8737)) - -### Dependencies -- Bump minimum version for google-api-core to 1.14.0. ([#8709](https://github.com/googleapis/google-cloud-python/pull/8709)) - -### Documentation -- Fix links to reference documentation. ([#8884](https://github.com/googleapis/google-cloud-python/pull/8884)) -- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705)) - -### Internal / Testing Changes -- Update `ListGlossaries` method annotation (via synth) ([#9385](https://github.com/googleapis/google-cloud-python/pull/9385)) -- Fix intersphinx reference to requests ([#9294](https://github.com/googleapis/google-cloud-python/pull/9294)) -- Remove CI for gh-pages, use googleapis.dev for api_core refs. ([#9085](https://github.com/googleapis/google-cloud-python/pull/9085)) -- Update intersphinx mapping for requests. ([#8805](https://github.com/googleapis/google-cloud-python/pull/8805)) - -## 1.6.0 - -07-09-2019 13:13 PDT - - -### Implementation Changes -- Allow kwargs to be passed to create_channel (via synth). ([#8409](https://github.com/googleapis/google-cloud-python/pull/8409)) -- Update service descriptions and add additional rpc bindings for Translate ([#8267](https://github.com/googleapis/google-cloud-python/pull/8267)) - -### New Features -- Add 'client_options' support, update list method docstrings (via synth). ([#8527](https://github.com/googleapis/google-cloud-python/pull/8527)) - -### Internal / Testing Changes -- Pin black version (via synth). ([#8600](https://github.com/googleapis/google-cloud-python/pull/8600)) -- Add docs job to publish to googleapis.dev. ([#8464](https://github.com/googleapis/google-cloud-python/pull/8464)) -- Declare encoding as utf-8 in pb2 files (via synth). ([#8369](https://github.com/googleapis/google-cloud-python/pull/8369)) -- Add disclaimer to auto-generated template files (via synth). ([#8333](https://github.com/googleapis/google-cloud-python/pull/8333)) -- Blacken (via synth). ([#8282](https://github.com/googleapis/google-cloud-python/pull/8282)) -- Suppress checking 'cov-fail-under' in nox default session (via synth). ([#8255](https://github.com/googleapis/google-cloud-python/pull/8255)) -- Fix coverage in 'types.py' (via synth). ([#8168](https://github.com/googleapis/google-cloud-python/pull/8168)) -- Blacken noxfile.py, setup.py (via synth). ([#8135](https://github.com/googleapis/google-cloud-python/pull/8135)) -- Add empty lines (via synth). ([#8076](https://github.com/googleapis/google-cloud-python/pull/8076)) - -## 1.5.0 - -05-16-2019 13:05 PDT - - -### Implementation Changes -- Add routing header to method metadata, fix docstring (via synth). ([#7660](https://github.com/googleapis/google-cloud-python/pull/7660)) - -### New Features -- Add `client_info` support to client / connection. ([#7873](https://github.com/googleapis/google-cloud-python/pull/7873)) - -### Dependencies -- Pin `google-cloud-core >= 1.0.0, < 2.0dev`. ([#7993](https://github.com/googleapis/google-cloud-python/pull/7993)) - -### Documentation -- Add docs for v3beta1. ([#7681](https://github.com/googleapis/google-cloud-python/pull/7681)) - -### Internal / Testing Changes -- Harden system test against back-end changes. ([#7987](https://github.com/googleapis/google-cloud-python/pull/7987)) -- Exclude `docs/conf.py` in synth. ([#7943](https://github.com/googleapis/google-cloud-python/pull/7943)) -- Update `docs/conf.py` (via synth). ([#7837](https://github.com/googleapis/google-cloud-python/pull/7837)) -- Add nox session `docs`, reorder methods (via synth). ([#7785](https://github.com/googleapis/google-cloud-python/pull/7785)) - -## 1.4.0 - -04-02-2019 14:24 PDT - - -### Implementation Changes -- Remove classifier for Python 3.4 for end-of-life. ([#7535](https://github.com/googleapis/google-cloud-python/pull/7535)) - -### New Features -- Add Translate v3 ([#7637](https://github.com/googleapis/google-cloud-python/pull/7637)) - -### Documentation -- Updated client library documentation URLs. ([#7307](https://github.com/googleapis/google-cloud-python/pull/7307)) - -## 1.3.3 - -12-17-2018 17:07 PST - - -### Documentation -- Document Python 2 deprecation ([#6910](https://github.com/googleapis/google-cloud-python/pull/6910)) - -## 1.3.2 - -12-10-2018 13:33 PST - - -### Implementation Changes -- Import `iam.policy` from `google.api_core`. ([#6741](https://github.com/googleapis/google-cloud-python/pull/6741)) -- Fix rtype for `Client.detect_language` for single values ([#5397](https://github.com/googleapis/google-cloud-python/pull/5397)) - -### Dependencies -- Update dependency to google-cloud-core ([#6835](https://github.com/googleapis/google-cloud-python/pull/6835)) -- Bump minimum `api_core` version for all GAPIC libs to 1.4.1. ([#6391](https://github.com/googleapis/google-cloud-python/pull/6391)) - -### Documentation -- Fix installation package in README.rst ([#6426](https://github.com/googleapis/google-cloud-python/pull/6426)) -- Fix [#6321](https://github.com/googleapis/google-cloud-python/pull/6321) Update README service links in quickstart guides. ([#6322](https://github.com/googleapis/google-cloud-python/pull/6322)) -- Docs: normalize use of support level badges ([#6159](https://github.com/googleapis/google-cloud-python/pull/6159)) -- Restore detailed usage docs. ([#5999](https://github.com/googleapis/google-cloud-python/pull/5999)) -- Redirect renamed 'usage.html'/'client.html' -> 'index.html'. ([#5996](https://github.com/googleapis/google-cloud-python/pull/5996)) -- Prep translate docs for repo split. ([#5941](https://github.com/googleapis/google-cloud-python/pull/5941)) - -### Internal / Testing Changes -- Add blacken to noxfile ([#6795](https://github.com/googleapis/google-cloud-python/pull/6795)) -- Blackening Continued... ([#6667](https://github.com/googleapis/google-cloud-python/pull/6667)) -- Add templates for flake8, coveragerc, noxfile, and black. ([#6642](https://github.com/googleapis/google-cloud-python/pull/6642)) -- Adapt system test to updated back-end translation. ([#6427](https://github.com/googleapis/google-cloud-python/pull/6427)) -- Use new Nox ([#6175](https://github.com/googleapis/google-cloud-python/pull/6175)) -- Nox: use inplace installs ([#5865](https://github.com/googleapis/google-cloud-python/pull/5865)) -- Modify system tests to use prerelease versions of grpcio ([#5304](https://github.com/googleapis/google-cloud-python/pull/5304)) -- Add Test runs for Python 3.7 and remove 3.4 ([#5295](https://github.com/googleapis/google-cloud-python/pull/5295)) -- Fix bad trove classifier - -## 1.3.1 - -### Dependencies - -- Update dependency range for api-core to include v1.0.0 releases (#4944) - -### Documentation - -- Fixing "Fore" -> "For" typo in README docs. (#4317) - -### Testing and internal changes - -- Install local dependencies when running lint (#4936) -- Re-enable lint for tests, remove usage of pylint (#4921) -- Normalize all setup.py files (#4909) -- Making a `nox -s default` session for all packages. (#4324) -- Shorten test names (#4321) - -## 1.3.0 - -### Notable Implementation Changes - -- Use POST (rather than GET) for API `translate` requests (#4095, - h/t to @Maerig) - -### Documentation - -- Added link to "Python Development Environment Setup Guide" in - project README (#4187, h/t to @michaelawyu) -- Fix example in `Config.get_variable()` (#3910) - -### Dependencies - -- Upgrading to `google-cloud-core >= 0.28.0` and adding dependency - on `google-api-core` (#4221, #4280) - -PyPI: https://pypi.org/project/google-cloud-translate/1.3.0/ diff --git a/translate/LICENSE b/translate/LICENSE deleted file mode 100644 index a8ee855de2aa..000000000000 --- a/translate/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/translate/MANIFEST.in b/translate/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/translate/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/translate/README.rst b/translate/README.rst deleted file mode 100644 index 1ca13ab74749..000000000000 --- a/translate/README.rst +++ /dev/null @@ -1,84 +0,0 @@ -Python Client for Google Cloud Translation -========================================== - -|GA| |pypi| |versions| - -With `Google Cloud Translation`_, you can dynamically translate text between -thousands of language pairs. The Google Cloud Translation API lets websites -and programs integrate with Google Cloud Translation programmatically. Google -Cloud Translation is available as a paid service. See the `Pricing`_ and -`FAQ`_ pages for details. - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. |GA| image:: https://img.shields.io/badge/support-GA-gold.svg - :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#general-availability -.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-translate.svg - :target: https://pypi.org/project/google-cloud-translate/ -.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-translate.svg - :target: https://pypi.org/project/google-cloud-translate/ -.. _Google Cloud Translation: https://cloud.google.com/translate/ -.. _Pricing: https://cloud.google.com/translate/pricing -.. _FAQ: https://cloud.google.com/translate/faq -.. _Client Library Documentation: https://googleapis.dev/python/translation/latest -.. _Product Documentation: https://cloud.google.com/translate/docs - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the Google Cloud Translate API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Google Cloud Translate API.: https://cloud.google.com/translate -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Supported Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.5 - -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7. Python 2.7 support will be removed on January 1, 2020. - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-translate - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-translate \ No newline at end of file diff --git a/translate/docs/README.rst b/translate/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/translate/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/translate/docs/_static/custom.css b/translate/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/translate/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/translate/docs/_templates/layout.html b/translate/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/translate/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/translate/docs/changelog.md b/translate/docs/changelog.md deleted file mode 120000 index 77abd36fd533..000000000000 --- a/translate/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../../translate/CHANGELOG.md \ No newline at end of file diff --git a/translate/docs/client.rst b/translate/docs/client.rst deleted file mode 100644 index fbd7a4a18aeb..000000000000 --- a/translate/docs/client.rst +++ /dev/null @@ -1,7 +0,0 @@ -Translation Client -================== - -.. automodule:: google.cloud.translate_v2.client - :members: - :undoc-members: - :show-inheritance: diff --git a/translate/docs/conf.py b/translate/docs/conf.py deleted file mode 100644 index d4e5c2f3861e..000000000000 --- a/translate/docs/conf.py +++ /dev/null @@ -1,357 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-translate documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.doctest", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-translate" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-translate-doc" - -# -- Options for warnings ------------------------------------------------------ - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-translate.tex", - u"google-cloud-translate Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - master_doc, - "google-cloud-translate", - u"google-cloud-translate Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-translate", - u"google-cloud-translate Documentation", - author, - "google-cloud-translate", - "GAPIC library for the {metadata.shortName} v3beta1 service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/stable/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/translate/docs/gapic/v3/api.rst b/translate/docs/gapic/v3/api.rst deleted file mode 100644 index e16ef6a89d51..000000000000 --- a/translate/docs/gapic/v3/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud Translation API -================================ - -.. automodule:: google.cloud.translate_v3 - :members: - :inherited-members: \ No newline at end of file diff --git a/translate/docs/gapic/v3/types.rst b/translate/docs/gapic/v3/types.rst deleted file mode 100644 index fb83ab0657b6..000000000000 --- a/translate/docs/gapic/v3/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud Translation API Client -====================================== - -.. automodule:: google.cloud.translate_v3.types - :members: \ No newline at end of file diff --git a/translate/docs/gapic/v3beta1/api.rst b/translate/docs/gapic/v3beta1/api.rst deleted file mode 100644 index 4d46ad1362b4..000000000000 --- a/translate/docs/gapic/v3beta1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud Translation API -================================ - -.. automodule:: google.cloud.translate_v3beta1 - :members: - :inherited-members: \ No newline at end of file diff --git a/translate/docs/gapic/v3beta1/types.rst b/translate/docs/gapic/v3beta1/types.rst deleted file mode 100644 index 8b9725da3b1d..000000000000 --- a/translate/docs/gapic/v3beta1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud Translation API Client -====================================== - -.. automodule:: google.cloud.translate_v3beta1.types - :members: \ No newline at end of file diff --git a/translate/docs/index.rst b/translate/docs/index.rst deleted file mode 100644 index b5d2405e2f47..000000000000 --- a/translate/docs/index.rst +++ /dev/null @@ -1,32 +0,0 @@ -.. include:: README.rst - -API Reference -------------- - -An API and type reference is provided for ``v3``, ``v3beta1``, and ``v2``. - -By default, you will get ``v3``. A beta release, spelled ``v3beta1`` is -provided for preview of upcoming features. In order to use this, you will -want to import from ``google.cloud.translate_v3beta1`` in lieu of -``google.cloud.translate``. The previous release ``v2`` is also available. -Import from ``google.cloud.translate_v2`` to use this release. - - -.. toctree:: - :maxdepth: 2 - - v3 - v3beta1 - v2 - - -Changelog ---------- - -For a list of all ``google-cloud-translate`` releases: - -.. toctree:: - :maxdepth: 2 - - changelog - diff --git a/translate/docs/usage.rst b/translate/docs/usage.rst deleted file mode 100644 index c6ee312c0cac..000000000000 --- a/translate/docs/usage.rst +++ /dev/null @@ -1,110 +0,0 @@ -Translation v2 Usage Guide --------------------------- - -To create a client: - -.. doctest:: - - >>> from google.cloud import translate_v2 - >>> client = translate_v2.Client() - -By default, the client targets English when doing detections -and translations, but a non-default value can be used as -well: - -.. doctest:: - - >>> from google.cloud import translate_v2 - >>> client = translate_v2.Client(target_language='es') - -The Google Cloud Translation v2 API has three supported methods, and they -map to three methods on a client: -:meth:`~google.cloud.translate_v2.client.Client.get_languages`, -:meth:`~google.cloud.translate_v2.client.Client.detect_language` and -:meth:`~google.cloud.translate_v2.client.Client.translate`. - -To get a list of languages supported by the Google Cloud Translation API - -.. doctest:: - - >>> from google.cloud import translate_v2 - >>> client = translate_v2.Client() - >>> client.get_languages() - [ - { - 'language': 'af', - 'name': 'Afrikaans', - }, - ... - ] - -To detect the language that some given text is written in: - -.. doctest:: - - >>> from google.cloud import translate_v2 - >>> client = translate_v2.Client() - >>> client.detect_language(['Me llamo', 'I am']) - [ - { - 'confidence': 0.25830904, - 'input': 'Me llamo', - 'language': 'es', - }, { - 'confidence': 0.17112699, - 'input': 'I am', - 'language': 'en', - }, - ] - -The `confidence`_ value is an optional floating point value between 0 and 1. -The closer this value is to 1, the higher the confidence level for the -language detection. This member is not always available. - -.. _confidence: https://cloud.google.com/translate/docs/detecting-language - -To translate text into the default destination language without knowing -the source language: - -.. doctest:: - - >>> from google.cloud import translate_v2 - >>> client = translate_v2.Client() - >>> client.translate('koszula') - { - 'translatedText': 'shirt', - 'detectedSourceLanguage': 'pl', - 'input': 'koszula', - } - -If the source language is known: - -.. doctest:: - - >>> from google.cloud import translate_v2 - >>> client = translate_v2.Client() - >>> client.translate('camisa', source_language='es') - { - 'translatedText': 'shirt', - 'input': 'camisa', - } - -or to use a non-default target language: - -.. doctest:: - - >>> from google.cloud import translate_v2 - >>> client = translate_v2.Client() - >>> client.translate(['Me llamo Jeff', 'My name is Jeff'], - ... target_language='de') - [ - { - 'translatedText': 'Mein Name ist Jeff', - 'detectedSourceLanguage': 'es', - 'input': 'Me llamo Jeff', - }, { - 'translatedText': 'Mein Name ist Jeff', - 'detectedSourceLanguage': 'en', - 'input': 'My name is Jeff', - }, - ] diff --git a/translate/docs/v2.rst b/translate/docs/v2.rst deleted file mode 100644 index 0e056c8ff63b..000000000000 --- a/translate/docs/v2.rst +++ /dev/null @@ -1,8 +0,0 @@ -v2 -=== - -.. toctree:: - :maxdepth: 2 - - client - usage diff --git a/translate/docs/v3.rst b/translate/docs/v3.rst deleted file mode 100644 index b6b8cd17e1e6..000000000000 --- a/translate/docs/v3.rst +++ /dev/null @@ -1,8 +0,0 @@ -v3 -=== - -.. toctree:: - :maxdepth: 2 - - gapic/v3/api - gapic/v3/types diff --git a/translate/docs/v3beta1.rst b/translate/docs/v3beta1.rst deleted file mode 100644 index 368aed30e243..000000000000 --- a/translate/docs/v3beta1.rst +++ /dev/null @@ -1,8 +0,0 @@ -v3beta1 -======= - -.. toctree:: - :maxdepth: 2 - - gapic/v3beta1/api - gapic/v3beta1/types diff --git a/translate/google/__init__.py b/translate/google/__init__.py deleted file mode 100644 index 8fcc60e2b9c6..000000000000 --- a/translate/google/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/translate/google/cloud/__init__.py b/translate/google/cloud/__init__.py deleted file mode 100644 index 8fcc60e2b9c6..000000000000 --- a/translate/google/cloud/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/translate/google/cloud/translate.py b/translate/google/cloud/translate.py deleted file mode 100644 index 541da1b57081..000000000000 --- a/translate/google/cloud/translate.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import - -from google.cloud.translate_v3 import TranslationServiceClient -from google.cloud.translate_v3 import types - - -__all__ = ("types", "TranslationServiceClient") diff --git a/translate/google/cloud/translate_v2/__init__.py b/translate/google/cloud/translate_v2/__init__.py deleted file mode 100644 index ba2897afbd74..000000000000 --- a/translate/google/cloud/translate_v2/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Google Cloud Translation API wrapper.""" - - -from pkg_resources import get_distribution - -__version__ = get_distribution("google-cloud-translate").version - -from google.cloud.translate_v2.client import Client - - -__all__ = ("__version__", "Client") diff --git a/translate/google/cloud/translate_v2/_http.py b/translate/google/cloud/translate_v2/_http.py deleted file mode 100644 index d33647c757ab..000000000000 --- a/translate/google/cloud/translate_v2/_http.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Create / interact with Google Cloud Translation connections.""" - -from google.cloud import _http - -from google.cloud.translate_v2 import __version__ - - -class Connection(_http.JSONConnection): - """A connection to Google Cloud Translation API via the JSON REST API. - - :type client: :class:`~google.cloud.translate.client.Client` - :param client: The client that owns the current connection. - - :type client_info: :class:`~google.api_core.client_info.ClientInfo` - :param client_info: (Optional) instance used to generate user agent. - """ - - DEFAULT_API_ENDPOINT = "https://translation.googleapis.com" - - def __init__(self, client, client_info=None, api_endpoint=DEFAULT_API_ENDPOINT): - super(Connection, self).__init__(client, client_info) - self.API_BASE_URL = api_endpoint - self._client_info.gapic_version = __version__ - self._client_info.client_library_version = __version__ - - API_VERSION = "v2" - """The version of the API, used in building the API call's URL.""" - - API_URL_TEMPLATE = "{api_base_url}/language/translate/{api_version}{path}" - """A template for the URL of a particular API call.""" diff --git a/translate/google/cloud/translate_v2/client.py b/translate/google/cloud/translate_v2/client.py deleted file mode 100644 index 6c561675d25e..000000000000 --- a/translate/google/cloud/translate_v2/client.py +++ /dev/null @@ -1,281 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Client for interacting with the Google Cloud Translation API.""" - - -import six - -import google.api_core.client_options -from google.cloud.client import Client as BaseClient - -from google.cloud.translate_v2._http import Connection - - -ENGLISH_ISO_639 = "en" -"""ISO 639-1 language code for English.""" - -BASE = "base" -"""Base translation model.""" - -NMT = "nmt" -"""Neural Machine Translation model.""" - - -class Client(BaseClient): - """Client to bundle configuration needed for API requests. - - :type target_language: str - :param target_language: (Optional) The target language used for - translations and language names. (Defaults to - :data:`ENGLISH_ISO_639`.) - - :type credentials: :class:`~google.auth.credentials.Credentials` - :param credentials: (Optional) The OAuth2 Credentials to use for this - client. If not passed (and if no ``_http`` object is - passed), falls back to the default inferred from the - environment. - - :type _http: :class:`~requests.Session` - :param _http: (Optional) HTTP object to make requests. Can be any object - that defines ``request()`` with the same interface as - :meth:`requests.Session.request`. If not passed, an - ``_http`` object is created that is bound to the - ``credentials`` for the current object. - This parameter should be considered private, and could - change in the future. - - :type client_info: :class:`~google.api_core.client_info.ClientInfo` - :param client_info: - The client info used to send a user-agent string along with API - requests. If ``None``, then default info will be used. Generally, - you only need to set this if you're developing your own library - or partner tool. - :type client_options: :class:`~google.api_core.client_options.ClientOptions` or :class:`dict` - :param client_options: (Optional) Client options used to set user options on the client. - API Endpoint should be set through client_options. - """ - - SCOPE = ("https://www.googleapis.com/auth/cloud-platform",) - """The scopes required for authenticating.""" - - def __init__( - self, - target_language=ENGLISH_ISO_639, - credentials=None, - _http=None, - client_info=None, - client_options=None, - ): - self.target_language = target_language - super(Client, self).__init__(credentials=credentials, _http=_http) - - kw_args = {"client_info": client_info} - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - kw_args["api_endpoint"] = api_endpoint - - self._connection = Connection(self, **kw_args) - - def get_languages(self, target_language=None): - """Get list of supported languages for translation. - - Response - - See - https://cloud.google.com/translate/docs/discovering-supported-languages - - :type target_language: str - :param target_language: (Optional) The language used to localize - returned language names. Defaults to the - target language on the current client. - - :rtype: list - :returns: List of dictionaries. Each dictionary contains a supported - ISO 639-1 language code (using the dictionary key - ``language``). If ``target_language`` is passed, each - dictionary will also contain the name of each supported - language (localized to the target language). - """ - query_params = {} - if target_language is None: - target_language = self.target_language - if target_language is not None: - query_params["target"] = target_language - response = self._connection.api_request( - method="GET", path="/languages", query_params=query_params - ) - return response.get("data", {}).get("languages", ()) - - def detect_language(self, values): - """Detect the language of a string or list of strings. - - See https://cloud.google.com/translate/docs/detecting-language - - :type values: str or list - :param values: String or list of strings that will have - language detected. - - :rtype: dict or list - :returns: A list of dictionaries for each queried value. Each - dictionary typically contains three keys - - * ``confidence``: The confidence in language detection, a - float between 0 and 1. - * ``input``: The corresponding input value. - * ``language``: The detected language (as an ISO 639-1 - language code). - - though the key ``confidence`` may not always be present. - - If only a single value is passed, then only a single - dictionary will be returned. - :raises: :class:`ValueError ` if the number of - detections is not equal to the number of values. - :class:`ValueError ` if a value - produces a list of detections with 0 or multiple results - in it. - """ - single_value = False - if isinstance(values, six.string_types): - single_value = True - values = [values] - - data = {"q": values} - - response = self._connection.api_request( - method="POST", path="/detect", data=data - ) - - detections = response.get("data", {}).get("detections", ()) - - if len(values) != len(detections): - raise ValueError( - "Expected same number of values and detections", values, detections - ) - - for index, value in enumerate(values): - # Empirically, even clearly ambiguous text like "no" only returns - # a single detection, so we replace the list of detections with - # the single detection contained. - if len(detections[index]) == 1: - detections[index] = detections[index][0] - else: - message = ( - "Expected a single detection per value, API " "returned %d" - ) % (len(detections[index]),) - raise ValueError(message, value, detections[index]) - - detections[index]["input"] = value - # The ``isReliable`` field is deprecated. - detections[index].pop("isReliable", None) - - if single_value: - return detections[0] - else: - return detections - - def translate( - self, - values, - target_language=None, - format_=None, - source_language=None, - customization_ids=(), - model=None, - ): - """Translate a string or list of strings. - - See https://cloud.google.com/translate/docs/translating-text - - :type values: str or list - :param values: String or list of strings to translate. - - :type target_language: str - :param target_language: The language to translate results into. This - is required by the API and defaults to - the target language of the current instance. - - :type format_: str - :param format_: (Optional) One of ``text`` or ``html``, to specify - if the input text is plain text or HTML. - - :type source_language: str - :param source_language: (Optional) The language of the text to - be translated. - - :type customization_ids: str or list - :param customization_ids: (Optional) ID or list of customization IDs - for translation. Sets the ``cid`` parameter - in the query. - - :type model: str - :param model: (Optional) The model used to translate the text, such - as ``'base'`` or ``'nmt'``. - - :rtype: str or list - :returns: A list of dictionaries for each queried value. Each - dictionary typically contains three keys (though not - all will be present in all cases) - - * ``detectedSourceLanguage``: The detected language (as an - ISO 639-1 language code) of the text. - * ``translatedText``: The translation of the text into the - target language. - * ``input``: The corresponding input value. - * ``model``: The model used to translate the text. - - If only a single value is passed, then only a single - dictionary will be returned. - :raises: :class:`~exceptions.ValueError` if the number of - values and translations differ. - """ - single_value = False - if isinstance(values, six.string_types): - single_value = True - values = [values] - - if target_language is None: - target_language = self.target_language - if isinstance(customization_ids, six.string_types): - customization_ids = [customization_ids] - - data = { - "target": target_language, - "q": values, - "cid": customization_ids, - "format": format_, - "source": source_language, - "model": model, - } - - response = self._connection.api_request(method="POST", path="", data=data) - - translations = response.get("data", {}).get("translations", ()) - if len(values) != len(translations): - raise ValueError( - "Expected iterations to have same length", values, translations - ) - for value, translation in six.moves.zip(values, translations): - translation["input"] = value - - if single_value: - return translations[0] - else: - return translations diff --git a/translate/google/cloud/translate_v3/__init__.py b/translate/google/cloud/translate_v3/__init__.py deleted file mode 100644 index dec3a565b8b0..000000000000 --- a/translate/google/cloud/translate_v3/__init__.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.translate_v3 import types -from google.cloud.translate_v3.gapic import translation_service_client - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class TranslationServiceClient(translation_service_client.TranslationServiceClient): - __doc__ = translation_service_client.TranslationServiceClient.__doc__ - - -__all__ = ("types", "TranslationServiceClient") diff --git a/translate/google/cloud/translate_v3/gapic/__init__.py b/translate/google/cloud/translate_v3/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/translate/google/cloud/translate_v3/gapic/enums.py b/translate/google/cloud/translate_v3/gapic/enums.py deleted file mode 100644 index 051328dab5b6..000000000000 --- a/translate/google/cloud/translate_v3/gapic/enums.py +++ /dev/null @@ -1,91 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class BatchTranslateMetadata(object): - class State(enum.IntEnum): - """ - State of the job. - - Attributes: - STATE_UNSPECIFIED (int): Invalid. - RUNNING (int): Request is being processed. - SUCCEEDED (int): The batch is processed, and at least one item was successfully - processed. - FAILED (int): The batch is done and no item was successfully processed. - CANCELLING (int): Request is in the process of being canceled after caller invoked - longrunning.Operations.CancelOperation on the request id. - CANCELLED (int): The batch is done after the user has called the - longrunning.Operations.CancelOperation. Any records processed before the - cancel command are output as specified in the request. - """ - - STATE_UNSPECIFIED = 0 - RUNNING = 1 - SUCCEEDED = 2 - FAILED = 3 - CANCELLING = 4 - CANCELLED = 5 - - -class CreateGlossaryMetadata(object): - class State(enum.IntEnum): - """ - Enumerates the possible states that the creation request can be in. - - Attributes: - STATE_UNSPECIFIED (int): Invalid. - RUNNING (int): Request is being processed. - SUCCEEDED (int): The glossary was successfully created. - FAILED (int): Failed to create the glossary. - CANCELLING (int): Request is in the process of being canceled after caller invoked - longrunning.Operations.CancelOperation on the request id. - CANCELLED (int): The glossary creation request was successfully canceled. - """ - - STATE_UNSPECIFIED = 0 - RUNNING = 1 - SUCCEEDED = 2 - FAILED = 3 - CANCELLING = 4 - CANCELLED = 5 - - -class DeleteGlossaryMetadata(object): - class State(enum.IntEnum): - """ - Enumerates the possible states that the creation request can be in. - - Attributes: - STATE_UNSPECIFIED (int): Invalid. - RUNNING (int): Request is being processed. - SUCCEEDED (int): The glossary was successfully deleted. - FAILED (int): Failed to delete the glossary. - CANCELLING (int): Request is in the process of being canceled after caller invoked - longrunning.Operations.CancelOperation on the request id. - CANCELLED (int): The glossary deletion request was successfully canceled. - """ - - STATE_UNSPECIFIED = 0 - RUNNING = 1 - SUCCEEDED = 2 - FAILED = 3 - CANCELLING = 4 - CANCELLED = 5 diff --git a/translate/google/cloud/translate_v3/gapic/translation_service_client.py b/translate/google/cloud/translate_v3/gapic/translation_service_client.py deleted file mode 100644 index 1540f9c72c54..000000000000 --- a/translate/google/cloud/translate_v3/gapic/translation_service_client.py +++ /dev/null @@ -1,1099 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.cloud.translation.v3 TranslationService API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.operation -import google.api_core.operations_v1 -import google.api_core.page_iterator -import google.api_core.path_template -import google.api_core.protobuf_helpers -import grpc - -from google.cloud.translate_v3.gapic import translation_service_client_config -from google.cloud.translate_v3.gapic.transports import ( - translation_service_grpc_transport, -) -from google.cloud.translate_v3.proto import translation_service_pb2 -from google.cloud.translate_v3.proto import translation_service_pb2_grpc -from google.longrunning import operations_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-translate" -).version - - -class TranslationServiceClient(object): - """Provides natural language translation operations.""" - - SERVICE_ADDRESS = "translate.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.translation.v3.TranslationService" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - TranslationServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def glossary_path(cls, project, location, glossary): - """Return a fully-qualified glossary string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/glossaries/{glossary}", - project=project, - location=location, - glossary=glossary, - ) - - @classmethod - def location_path(cls, project, location): - """Return a fully-qualified location string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}", - project=project, - location=location, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.TranslationServiceGrpcTransport, - Callable[[~.Credentials, type], ~.TranslationServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = translation_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=translation_service_grpc_transport.TranslationServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = translation_service_grpc_transport.TranslationServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def translate_text( - self, - contents, - target_language_code, - parent, - mime_type=None, - source_language_code=None, - model=None, - glossary_config=None, - labels=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Translates input text and returns translated text. - - Example: - >>> from google.cloud import translate_v3 - >>> - >>> client = translate_v3.TranslationServiceClient() - >>> - >>> # TODO: Initialize `contents`: - >>> contents = [] - >>> - >>> # TODO: Initialize `target_language_code`: - >>> target_language_code = '' - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> response = client.translate_text(contents, target_language_code, parent) - - Args: - contents (list[str]): Required. The content of the input in string format. - We recommend the total content be less than 30k codepoints. - Use BatchTranslateText for larger text. - target_language_code (str): Required. The BCP-47 language code to use for translation of the input - text, set to one of the language codes listed in Language Support. - parent (str): Required. Project or location to make a call. Must refer to a caller's - project. - - Format: ``projects/{project-number-or-id}`` or - ``projects/{project-number-or-id}/locations/{location-id}``. - - For global calls, use - ``projects/{project-number-or-id}/locations/global`` or - ``projects/{project-number-or-id}``. - - Non-global location is required for requests using AutoML models or - custom glossaries. - - Models and glossaries must be within the same region (have same - location-id), otherwise an INVALID\_ARGUMENT (400) error is returned. - mime_type (str): Optional. The format of the source text, for example, "text/html", - "text/plain". If left blank, the MIME type defaults to "text/html". - source_language_code (str): Optional. The BCP-47 language code of the input text if - known, for example, "en-US" or "sr-Latn". Supported language codes are - listed in Language Support. If the source language isn't specified, the API - attempts to identify the source language automatically and returns the - source language within the response. - model (str): Optional. The ``model`` type requested for this translation. - - The format depends on model type: - - - AutoML Translation models: - ``projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`` - - - General (built-in) models: - ``projects/{project-number-or-id}/locations/{location-id}/models/general/nmt``, - ``projects/{project-number-or-id}/locations/{location-id}/models/general/base`` - - For global (non-regionalized) requests, use ``location-id`` ``global``. - For example, - ``projects/{project-number-or-id}/locations/global/models/general/nmt``. - - If missing, the system decides which google base model to use. - glossary_config (Union[dict, ~google.cloud.translate_v3.types.TranslateTextGlossaryConfig]): Optional. Glossary to be applied. The glossary must be within the same - region (have the same location-id) as the model, otherwise an - INVALID\_ARGUMENT (400) error is returned. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.translate_v3.types.TranslateTextGlossaryConfig` - labels (dict[str -> str]): Optional. The labels with user-defined metadata for the request. - - Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/labels for more information. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.translate_v3.types.TranslateTextResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "translate_text" not in self._inner_api_calls: - self._inner_api_calls[ - "translate_text" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.translate_text, - default_retry=self._method_configs["TranslateText"].retry, - default_timeout=self._method_configs["TranslateText"].timeout, - client_info=self._client_info, - ) - - request = translation_service_pb2.TranslateTextRequest( - contents=contents, - target_language_code=target_language_code, - parent=parent, - mime_type=mime_type, - source_language_code=source_language_code, - model=model, - glossary_config=glossary_config, - labels=labels, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["translate_text"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def detect_language( - self, - parent, - model=None, - content=None, - mime_type=None, - labels=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Detects the language of text within a request. - - Example: - >>> from google.cloud import translate_v3 - >>> - >>> client = translate_v3.TranslationServiceClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> response = client.detect_language(parent) - - Args: - parent (str): Required. Project or location to make a call. Must refer to a caller's - project. - - Format: ``projects/{project-number-or-id}/locations/{location-id}`` or - ``projects/{project-number-or-id}``. - - For global calls, use - ``projects/{project-number-or-id}/locations/global`` or - ``projects/{project-number-or-id}``. - - Only models within the same region (has same location-id) can be used. - Otherwise an INVALID\_ARGUMENT (400) error is returned. - model (str): Optional. The language detection model to be used. - - Format: - ``projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`` - - Only one language detection model is currently supported: - ``projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default``. - - If not specified, the default model is used. - content (str): The content of the input stored as a string. - mime_type (str): Optional. The format of the source text, for example, "text/html", - "text/plain". If left blank, the MIME type defaults to "text/html". - labels (dict[str -> str]): Optional. The labels with user-defined metadata for the request. - - Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/labels for more information. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.translate_v3.types.DetectLanguageResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "detect_language" not in self._inner_api_calls: - self._inner_api_calls[ - "detect_language" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.detect_language, - default_retry=self._method_configs["DetectLanguage"].retry, - default_timeout=self._method_configs["DetectLanguage"].timeout, - client_info=self._client_info, - ) - - # Sanity check: We have some fields which are mutually exclusive; - # raise ValueError if more than one is sent. - google.api_core.protobuf_helpers.check_oneof(content=content) - - request = translation_service_pb2.DetectLanguageRequest( - parent=parent, - model=model, - content=content, - mime_type=mime_type, - labels=labels, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["detect_language"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_supported_languages( - self, - parent, - display_language_code=None, - model=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Returns a list of supported languages for translation. - - Example: - >>> from google.cloud import translate_v3 - >>> - >>> client = translate_v3.TranslationServiceClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> response = client.get_supported_languages(parent) - - Args: - parent (str): Required. Project or location to make a call. Must refer to a caller's - project. - - Format: ``projects/{project-number-or-id}`` or - ``projects/{project-number-or-id}/locations/{location-id}``. - - For global calls, use - ``projects/{project-number-or-id}/locations/global`` or - ``projects/{project-number-or-id}``. - - Non-global location is required for AutoML models. - - Only models within the same region (have same location-id) can be used, - otherwise an INVALID\_ARGUMENT (400) error is returned. - display_language_code (str): Optional. The language to use to return localized, human readable names - of supported languages. If missing, then display names are not returned - in a response. - model (str): Optional. Get supported languages of this model. - - The format depends on model type: - - - AutoML Translation models: - ``projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`` - - - General (built-in) models: - ``projects/{project-number-or-id}/locations/{location-id}/models/general/nmt``, - ``projects/{project-number-or-id}/locations/{location-id}/models/general/base`` - - Returns languages supported by the specified model. If missing, we get - supported languages of Google general base (PBMT) model. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.translate_v3.types.SupportedLanguages` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_supported_languages" not in self._inner_api_calls: - self._inner_api_calls[ - "get_supported_languages" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_supported_languages, - default_retry=self._method_configs["GetSupportedLanguages"].retry, - default_timeout=self._method_configs["GetSupportedLanguages"].timeout, - client_info=self._client_info, - ) - - request = translation_service_pb2.GetSupportedLanguagesRequest( - parent=parent, display_language_code=display_language_code, model=model - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_supported_languages"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def batch_translate_text( - self, - parent, - source_language_code, - target_language_codes, - input_configs, - output_config, - models=None, - glossaries=None, - labels=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Translates a large volume of text in asynchronous batch mode. - This function provides real-time output as the inputs are being processed. - If caller cancels a request, the partial results (for an input file, it's - all or nothing) may still be available on the specified output location. - - This call returns immediately and you can - use google.longrunning.Operation.name to poll the status of the call. - - Example: - >>> from google.cloud import translate_v3 - >>> - >>> client = translate_v3.TranslationServiceClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `source_language_code`: - >>> source_language_code = '' - >>> - >>> # TODO: Initialize `target_language_codes`: - >>> target_language_codes = [] - >>> - >>> # TODO: Initialize `input_configs`: - >>> input_configs = [] - >>> - >>> # TODO: Initialize `output_config`: - >>> output_config = {} - >>> - >>> response = client.batch_translate_text(parent, source_language_code, target_language_codes, input_configs, output_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - parent (str): Required. Location to make a call. Must refer to a caller's project. - - Format: ``projects/{project-number-or-id}/locations/{location-id}``. - - The ``global`` location is not supported for batch translation. - - Only AutoML Translation models or glossaries within the same region - (have the same location-id) can be used, otherwise an INVALID\_ARGUMENT - (400) error is returned. - source_language_code (str): Required. Source language code. - target_language_codes (list[str]): Required. Specify up to 10 language codes here. - input_configs (list[Union[dict, ~google.cloud.translate_v3.types.InputConfig]]): Required. Input configurations. - The total number of files matched should be <= 1000. - The total content size should be <= 100M Unicode codepoints. - The files must use UTF-8 encoding. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.translate_v3.types.InputConfig` - output_config (Union[dict, ~google.cloud.translate_v3.types.OutputConfig]): Required. Output configuration. - If 2 input configs match to the same file (that is, same input path), - we don't generate output for duplicate inputs. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.translate_v3.types.OutputConfig` - models (dict[str -> str]): Optional. The models to use for translation. Map's key is target - language code. Map's value is model name. Value can be a built-in - general model, or an AutoML Translation model. - - The value format depends on model type: - - - AutoML Translation models: - ``projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`` - - - General (built-in) models: - ``projects/{project-number-or-id}/locations/{location-id}/models/general/nmt``, - ``projects/{project-number-or-id}/locations/{location-id}/models/general/base`` - - If the map is empty or a specific model is not requested for a language - pair, then default google model (nmt) is used. - glossaries (dict[str -> Union[dict, ~google.cloud.translate_v3.types.TranslateTextGlossaryConfig]]): Optional. Glossaries to be applied for translation. - It's keyed by target language code. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.translate_v3.types.TranslateTextGlossaryConfig` - labels (dict[str -> str]): Optional. The labels with user-defined metadata for the request. - - Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/labels for more information. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.translate_v3.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "batch_translate_text" not in self._inner_api_calls: - self._inner_api_calls[ - "batch_translate_text" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.batch_translate_text, - default_retry=self._method_configs["BatchTranslateText"].retry, - default_timeout=self._method_configs["BatchTranslateText"].timeout, - client_info=self._client_info, - ) - - request = translation_service_pb2.BatchTranslateTextRequest( - parent=parent, - source_language_code=source_language_code, - target_language_codes=target_language_codes, - input_configs=input_configs, - output_config=output_config, - models=models, - glossaries=glossaries, - labels=labels, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["batch_translate_text"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - translation_service_pb2.BatchTranslateResponse, - metadata_type=translation_service_pb2.BatchTranslateMetadata, - ) - - def create_glossary( - self, - parent, - glossary, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a glossary and returns the long-running operation. Returns - NOT\_FOUND, if the project doesn't exist. - - Example: - >>> from google.cloud import translate_v3 - >>> - >>> client = translate_v3.TranslationServiceClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `glossary`: - >>> glossary = {} - >>> - >>> response = client.create_glossary(parent, glossary) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - parent (str): Required. The project name. - glossary (Union[dict, ~google.cloud.translate_v3.types.Glossary]): Required. The glossary to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.translate_v3.types.Glossary` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.translate_v3.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_glossary" not in self._inner_api_calls: - self._inner_api_calls[ - "create_glossary" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_glossary, - default_retry=self._method_configs["CreateGlossary"].retry, - default_timeout=self._method_configs["CreateGlossary"].timeout, - client_info=self._client_info, - ) - - request = translation_service_pb2.CreateGlossaryRequest( - parent=parent, glossary=glossary - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["create_glossary"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - translation_service_pb2.Glossary, - metadata_type=translation_service_pb2.CreateGlossaryMetadata, - ) - - def list_glossaries( - self, - parent, - page_size=None, - filter_=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists glossaries in a project. Returns NOT\_FOUND, if the project - doesn't exist. - - Example: - >>> from google.cloud import translate_v3 - >>> - >>> client = translate_v3.TranslationServiceClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # Iterate over all results - >>> for element in client.list_glossaries(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_glossaries(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The name of the project from which to list all of the glossaries. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - filter_ (str): Optional. Filter specifying constraints of a list operation. - Filtering is not supported yet, and the parameter currently has no effect. - If missing, no filtering is performed. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.translate_v3.types.Glossary` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_glossaries" not in self._inner_api_calls: - self._inner_api_calls[ - "list_glossaries" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_glossaries, - default_retry=self._method_configs["ListGlossaries"].retry, - default_timeout=self._method_configs["ListGlossaries"].timeout, - client_info=self._client_info, - ) - - request = translation_service_pb2.ListGlossariesRequest( - parent=parent, page_size=page_size, filter=filter_ - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_glossaries"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="glossaries", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_glossary( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a glossary. Returns NOT\_FOUND, if the glossary doesn't exist. - - Example: - >>> from google.cloud import translate_v3 - >>> - >>> client = translate_v3.TranslationServiceClient() - >>> - >>> name = client.glossary_path('[PROJECT]', '[LOCATION]', '[GLOSSARY]') - >>> - >>> response = client.get_glossary(name) - - Args: - name (str): Required. The name of the glossary to retrieve. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.translate_v3.types.Glossary` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_glossary" not in self._inner_api_calls: - self._inner_api_calls[ - "get_glossary" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_glossary, - default_retry=self._method_configs["GetGlossary"].retry, - default_timeout=self._method_configs["GetGlossary"].timeout, - client_info=self._client_info, - ) - - request = translation_service_pb2.GetGlossaryRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_glossary"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_glossary( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a glossary, or cancels glossary construction if the glossary - isn't created yet. Returns NOT\_FOUND, if the glossary doesn't exist. - - Example: - >>> from google.cloud import translate_v3 - >>> - >>> client = translate_v3.TranslationServiceClient() - >>> - >>> name = client.glossary_path('[PROJECT]', '[LOCATION]', '[GLOSSARY]') - >>> - >>> response = client.delete_glossary(name) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. The name of the glossary to delete. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.translate_v3.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_glossary" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_glossary" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_glossary, - default_retry=self._method_configs["DeleteGlossary"].retry, - default_timeout=self._method_configs["DeleteGlossary"].timeout, - client_info=self._client_info, - ) - - request = translation_service_pb2.DeleteGlossaryRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["delete_glossary"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - translation_service_pb2.DeleteGlossaryResponse, - metadata_type=translation_service_pb2.DeleteGlossaryMetadata, - ) diff --git a/translate/google/cloud/translate_v3/gapic/translation_service_client_config.py b/translate/google/cloud/translate_v3/gapic/translation_service_client_config.py deleted file mode 100644 index 0e611ae41d1a..000000000000 --- a/translate/google/cloud/translate_v3/gapic/translation_service_client_config.py +++ /dev/null @@ -1,63 +0,0 @@ -config = { - "interfaces": { - "google.cloud.translation.v3.TranslationService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "TranslateText": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DetectLanguage": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetSupportedLanguages": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "BatchTranslateText": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "CreateGlossary": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListGlossaries": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetGlossary": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteGlossary": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/translate/google/cloud/translate_v3/gapic/transports/__init__.py b/translate/google/cloud/translate_v3/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/translate/google/cloud/translate_v3/gapic/transports/translation_service_grpc_transport.py b/translate/google/cloud/translate_v3/gapic/transports/translation_service_grpc_transport.py deleted file mode 100644 index 45c59003ca19..000000000000 --- a/translate/google/cloud/translate_v3/gapic/transports/translation_service_grpc_transport.py +++ /dev/null @@ -1,234 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers -import google.api_core.operations_v1 - -from google.cloud.translate_v3.proto import translation_service_pb2_grpc - - -class TranslationServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.translation.v3 TranslationService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-translation", - ) - - def __init__( - self, channel=None, credentials=None, address="translate.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "translation_service_stub": translation_service_pb2_grpc.TranslationServiceStub( - channel - ) - } - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="translate.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def translate_text(self): - """Return the gRPC stub for :meth:`TranslationServiceClient.translate_text`. - - Translates input text and returns translated text. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["translation_service_stub"].TranslateText - - @property - def detect_language(self): - """Return the gRPC stub for :meth:`TranslationServiceClient.detect_language`. - - Detects the language of text within a request. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["translation_service_stub"].DetectLanguage - - @property - def get_supported_languages(self): - """Return the gRPC stub for :meth:`TranslationServiceClient.get_supported_languages`. - - Returns a list of supported languages for translation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["translation_service_stub"].GetSupportedLanguages - - @property - def batch_translate_text(self): - """Return the gRPC stub for :meth:`TranslationServiceClient.batch_translate_text`. - - Translates a large volume of text in asynchronous batch mode. - This function provides real-time output as the inputs are being processed. - If caller cancels a request, the partial results (for an input file, it's - all or nothing) may still be available on the specified output location. - - This call returns immediately and you can - use google.longrunning.Operation.name to poll the status of the call. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["translation_service_stub"].BatchTranslateText - - @property - def create_glossary(self): - """Return the gRPC stub for :meth:`TranslationServiceClient.create_glossary`. - - Creates a glossary and returns the long-running operation. Returns - NOT\_FOUND, if the project doesn't exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["translation_service_stub"].CreateGlossary - - @property - def list_glossaries(self): - """Return the gRPC stub for :meth:`TranslationServiceClient.list_glossaries`. - - Lists glossaries in a project. Returns NOT\_FOUND, if the project - doesn't exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["translation_service_stub"].ListGlossaries - - @property - def get_glossary(self): - """Return the gRPC stub for :meth:`TranslationServiceClient.get_glossary`. - - Gets a glossary. Returns NOT\_FOUND, if the glossary doesn't exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["translation_service_stub"].GetGlossary - - @property - def delete_glossary(self): - """Return the gRPC stub for :meth:`TranslationServiceClient.delete_glossary`. - - Deletes a glossary, or cancels glossary construction if the glossary - isn't created yet. Returns NOT\_FOUND, if the glossary doesn't exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["translation_service_stub"].DeleteGlossary diff --git a/translate/google/cloud/translate_v3/proto/__init__.py b/translate/google/cloud/translate_v3/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/translate/google/cloud/translate_v3/proto/translation_service.proto b/translate/google/cloud/translate_v3/proto/translation_service.proto deleted file mode 100644 index ad43831c29b0..000000000000 --- a/translate/google/cloud/translate_v3/proto/translation_service.proto +++ /dev/null @@ -1,926 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.translation.v3; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/timestamp.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.Translate.V3"; -option go_package = "google.golang.org/genproto/googleapis/cloud/translate/v3;translate"; -option java_multiple_files = true; -option java_outer_classname = "TranslationServiceProto"; -option java_package = "com.google.cloud.translate.v3"; -option php_namespace = "Google\\Cloud\\Translate\\V3"; -option ruby_package = "Google::Cloud::Translate::V3"; - -// Proto file for the Cloud Translation API (v3 GA). - -// Provides natural language translation operations. -service TranslationService { - option (google.api.default_host) = "translate.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/cloud-translation"; - - // Translates input text and returns translated text. - rpc TranslateText(TranslateTextRequest) returns (TranslateTextResponse) { - option (google.api.http) = { - post: "/v3/{parent=projects/*/locations/*}:translateText" - body: "*" - additional_bindings { - post: "/v3/{parent=projects/*}:translateText" - body: "*" - } - }; - option (google.api.method_signature) = - "parent,target_language_code,contents"; - option (google.api.method_signature) = - "parent,model,mime_type,source_language_code,target_language_code,contents"; - } - - // Detects the language of text within a request. - rpc DetectLanguage(DetectLanguageRequest) returns (DetectLanguageResponse) { - option (google.api.http) = { - post: "/v3/{parent=projects/*/locations/*}:detectLanguage" - body: "*" - additional_bindings { - post: "/v3/{parent=projects/*}:detectLanguage" - body: "*" - } - }; - option (google.api.method_signature) = "parent,model,mime_type,content"; - } - - // Returns a list of supported languages for translation. - rpc GetSupportedLanguages(GetSupportedLanguagesRequest) - returns (SupportedLanguages) { - option (google.api.http) = { - get: "/v3/{parent=projects/*/locations/*}/supportedLanguages" - additional_bindings { get: "/v3/{parent=projects/*}/supportedLanguages" } - }; - option (google.api.method_signature) = "parent,model,display_language_code"; - } - - // Translates a large volume of text in asynchronous batch mode. - // This function provides real-time output as the inputs are being processed. - // If caller cancels a request, the partial results (for an input file, it's - // all or nothing) may still be available on the specified output location. - // - // This call returns immediately and you can - // use google.longrunning.Operation.name to poll the status of the call. - rpc BatchTranslateText(BatchTranslateTextRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v3/{parent=projects/*/locations/*}:batchTranslateText" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "BatchTranslateResponse" - metadata_type: "BatchTranslateMetadata" - }; - } - - // Creates a glossary and returns the long-running operation. Returns - // NOT_FOUND, if the project doesn't exist. - rpc CreateGlossary(CreateGlossaryRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v3/{parent=projects/*/locations/*}/glossaries" - body: "glossary" - }; - option (google.api.method_signature) = "parent,glossary"; - option (google.longrunning.operation_info) = { - response_type: "Glossary" - metadata_type: "CreateGlossaryMetadata" - }; - } - - // Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - // exist. - rpc ListGlossaries(ListGlossariesRequest) returns (ListGlossariesResponse) { - option (google.api.http) = { - get: "/v3/{parent=projects/*/locations/*}/glossaries" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - // exist. - rpc GetGlossary(GetGlossaryRequest) returns (Glossary) { - option (google.api.http) = { - get: "/v3/{name=projects/*/locations/*/glossaries/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Deletes a glossary, or cancels glossary construction - // if the glossary isn't created yet. - // Returns NOT_FOUND, if the glossary doesn't exist. - rpc DeleteGlossary(DeleteGlossaryRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v3/{name=projects/*/locations/*/glossaries/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "DeleteGlossaryResponse" - metadata_type: "DeleteGlossaryMetadata" - }; - } -} - -// Configures which glossary should be used for a specific target language, -// and defines options for applying that glossary. -message TranslateTextGlossaryConfig { - // Required. Specifies the glossary used for this translation. Use - // this format: projects/*/locations/*/glossaries/* - string glossary = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Indicates match is case-insensitive. - // Default value is false if missing. - bool ignore_case = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// The request message for synchronous translation. -message TranslateTextRequest { - // Required. The content of the input in string format. - // We recommend the total content be less than 30k codepoints. - // Use BatchTranslateText for larger text. - repeated string contents = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The format of the source text, for example, "text/html", - // "text/plain". If left blank, the MIME type defaults to "text/html". - string mime_type = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The BCP-47 language code of the input text if - // known, for example, "en-US" or "sr-Latn". Supported language codes are - // listed in Language Support. If the source language isn't specified, the API - // attempts to identify the source language automatically and returns the - // source language within the response. - string source_language_code = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The BCP-47 language code to use for translation of the input - // text, set to one of the language codes listed in Language Support. - string target_language_code = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. Project or location to make a call. Must refer to a caller's - // project. - // - // Format: `projects/{project-number-or-id}` or - // `projects/{project-number-or-id}/locations/{location-id}`. - // - // For global calls, use `projects/{project-number-or-id}/locations/global` or - // `projects/{project-number-or-id}`. - // - // Non-global location is required for requests using AutoML models or - // custom glossaries. - // - // Models and glossaries must be within the same region (have same - // location-id), otherwise an INVALID_ARGUMENT (400) error is returned. - string parent = 8 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. The `model` type requested for this translation. - // - // The format depends on model type: - // - // - AutoML Translation models: - // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - // - // - General (built-in) models: - // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` - // - // - // For global (non-regionalized) requests, use `location-id` `global`. - // For example, - // `projects/{project-number-or-id}/locations/global/models/general/nmt`. - // - // If missing, the system decides which google base model to use. - string model = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Glossary to be applied. The glossary must be - // within the same region (have the same location-id) as the model, otherwise - // an INVALID_ARGUMENT (400) error is returned. - TranslateTextGlossaryConfig glossary_config = 7 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The labels with user-defined metadata for the request. - // - // Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/labels for more information. - map labels = 10 [(google.api.field_behavior) = OPTIONAL]; -} - -message TranslateTextResponse { - // Text translation responses with no glossary applied. - // This field has the same length as - // [`contents`][google.cloud.translation.v3.TranslateTextRequest.contents]. - repeated Translation translations = 1; - - // Text translation responses if a glossary is provided in the request. - // This can be the same as - // [`translations`][google.cloud.translation.v3.TranslateTextResponse.translations] - // if no terms apply. This field has the same length as - // [`contents`][google.cloud.translation.v3.TranslateTextRequest.contents]. - repeated Translation glossary_translations = 3; -} - -// A single translation response. -message Translation { - // Text translated into the target language. - string translated_text = 1; - - // Only present when `model` is present in the request. - // `model` here is normalized to have project number. - // - // For example: - // If the `model` requested in TranslationTextRequest is - // `projects/{project-id}/locations/{location-id}/models/general/nmt` then - // `model` here would be normalized to - // `projects/{project-number}/locations/{location-id}/models/general/nmt`. - string model = 2; - - // The BCP-47 language code of source text in the initial request, detected - // automatically, if no source language was passed within the initial - // request. If the source language was passed, auto-detection of the language - // does not occur and this field is empty. - string detected_language_code = 4; - - // The `glossary_config` used for this translation. - TranslateTextGlossaryConfig glossary_config = 3; -} - -// The request message for language detection. -message DetectLanguageRequest { - // Required. Project or location to make a call. Must refer to a caller's - // project. - // - // Format: `projects/{project-number-or-id}/locations/{location-id}` or - // `projects/{project-number-or-id}`. - // - // For global calls, use `projects/{project-number-or-id}/locations/global` or - // `projects/{project-number-or-id}`. - // - // Only models within the same region (has same location-id) can be used. - // Otherwise an INVALID_ARGUMENT (400) error is returned. - string parent = 5 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. The language detection model to be used. - // - // Format: - // `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` - // - // Only one language detection model is currently supported: - // `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. - // - // If not specified, the default model is used. - string model = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The source of the document from which to detect the language. - oneof source { - // The content of the input stored as a string. - string content = 1; - } - - // Optional. The format of the source text, for example, "text/html", - // "text/plain". If left blank, the MIME type defaults to "text/html". - string mime_type = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The labels with user-defined metadata for the request. - // - // Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/labels for more information. - map labels = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// The response message for language detection. -message DetectedLanguage { - // The BCP-47 language code of source content in the request, detected - // automatically. - string language_code = 1; - - // The confidence of the detection result for this language. - float confidence = 2; -} - -// The response message for language detection. -message DetectLanguageResponse { - // A list of detected languages sorted by detection confidence in descending - // order. The most probable language first. - repeated DetectedLanguage languages = 1; -} - -// The request message for discovering supported languages. -message GetSupportedLanguagesRequest { - // Required. Project or location to make a call. Must refer to a caller's - // project. - // - // Format: `projects/{project-number-or-id}` or - // `projects/{project-number-or-id}/locations/{location-id}`. - // - // For global calls, use `projects/{project-number-or-id}/locations/global` or - // `projects/{project-number-or-id}`. - // - // Non-global location is required for AutoML models. - // - // Only models within the same region (have same location-id) can be used, - // otherwise an INVALID_ARGUMENT (400) error is returned. - string parent = 3 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. The language to use to return localized, human readable names - // of supported languages. If missing, then display names are not returned - // in a response. - string display_language_code = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Get supported languages of this model. - // - // The format depends on model type: - // - // - AutoML Translation models: - // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - // - // - General (built-in) models: - // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` - // - // - // Returns languages supported by the specified model. - // If missing, we get supported languages of Google general base (PBMT) model. - string model = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// The response message for discovering supported languages. -message SupportedLanguages { - // A list of supported language responses. This list contains an entry - // for each language the Translation API supports. - repeated SupportedLanguage languages = 1; -} - -// A single supported language response corresponds to information related -// to one supported language. -message SupportedLanguage { - // Supported language code, generally consisting of its ISO 639-1 - // identifier, for example, 'en', 'ja'. In certain cases, BCP-47 codes - // including language and region identifiers are returned (for example, - // 'zh-TW' and 'zh-CN') - string language_code = 1; - - // Human readable name of the language localized in the display language - // specified in the request. - string display_name = 2; - - // Can be used as source language. - bool support_source = 3; - - // Can be used as target language. - bool support_target = 4; -} - -// The Google Cloud Storage location for the input content. -message GcsSource { - // Required. Source data URI. For example, `gs://my_bucket/my_object`. - string input_uri = 1; -} - -// Input configuration for BatchTranslateText request. -message InputConfig { - // Optional. Can be "text/plain" or "text/html". - // For `.tsv`, "text/html" is used if mime_type is missing. - // For `.html`, this field must be "text/html" or empty. - // For `.txt`, this field must be "text/plain" or empty. - string mime_type = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Specify the input. - oneof source { - // Required. Google Cloud Storage location for the source input. - // This can be a single file (for example, - // `gs://translation-test/input.tsv`) or a wildcard (for example, - // `gs://translation-test/*`). If a file extension is `.tsv`, it can - // contain either one or two columns. The first column (optional) is the id - // of the text request. If the first column is missing, we use the row - // number (0-based) from the input file as the ID in the output file. The - // second column is the actual text to be - // translated. We recommend each row be <= 10K Unicode codepoints, - // otherwise an error might be returned. - // Note that the input tsv must be RFC 4180 compliant. - // - // You could use https://github.com/Clever/csvlint to check potential - // formatting errors in your tsv file. - // csvlint --delimiter='\t' your_input_file.tsv - // - // The other supported file extensions are `.txt` or `.html`, which is - // treated as a single large chunk of text. - GcsSource gcs_source = 2; - } -} - -// The Google Cloud Storage location for the output content. -message GcsDestination { - // Required. There must be no files under 'output_uri_prefix'. - // 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an - // INVALID_ARGUMENT (400) error is returned. - string output_uri_prefix = 1; -} - -// Output configuration for BatchTranslateText request. -message OutputConfig { - // Required. The destination of output. - oneof destination { - // Google Cloud Storage destination for output content. - // For every single input file (for example, gs://a/b/c.[extension]), we - // generate at most 2 * n output files. (n is the # of target_language_codes - // in the BatchTranslateTextRequest). - // - // Output files (tsv) generated are compliant with RFC 4180 except that - // record delimiters are '\n' instead of '\r\n'. We don't provide any way to - // change record delimiters. - // - // While the input files are being processed, we write/update an index file - // 'index.csv' under 'output_uri_prefix' (for example, - // gs://translation-test/index.csv) The index file is generated/updated as - // new files are being translated. The format is: - // - // input_file,target_language_code,translations_file,errors_file, - // glossary_translations_file,glossary_errors_file - // - // input_file is one file we matched using gcs_source.input_uri. - // target_language_code is provided in the request. - // translations_file contains the translations. (details provided below) - // errors_file contains the errors during processing of the file. (details - // below). Both translations_file and errors_file could be empty - // strings if we have no content to output. - // glossary_translations_file and glossary_errors_file are always empty - // strings if the input_file is tsv. They could also be empty if we have no - // content to output. - // - // Once a row is present in index.csv, the input/output matching never - // changes. Callers should also expect all the content in input_file are - // processed and ready to be consumed (that is, no partial output file is - // written). - // - // The format of translations_file (for target language code 'trg') is: - // gs://translation_test/a_b_c_'trg'_translations.[extension] - // - // If the input file extension is tsv, the output has the following - // columns: - // Column 1: ID of the request provided in the input, if it's not - // provided in the input, then the input row number is used (0-based). - // Column 2: source sentence. - // Column 3: translation without applying a glossary. Empty string if there - // is an error. - // Column 4 (only present if a glossary is provided in the request): - // translation after applying the glossary. Empty string if there is an - // error applying the glossary. Could be same string as column 3 if there is - // no glossary applied. - // - // If input file extension is a txt or html, the translation is directly - // written to the output file. If glossary is requested, a separate - // glossary_translations_file has format of - // gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] - // - // The format of errors file (for target language code 'trg') is: - // gs://translation_test/a_b_c_'trg'_errors.[extension] - // - // If the input file extension is tsv, errors_file contains the following: - // Column 1: ID of the request provided in the input, if it's not - // provided in the input, then the input row number is used (0-based). - // Column 2: source sentence. - // Column 3: Error detail for the translation. Could be empty. - // Column 4 (only present if a glossary is provided in the request): - // Error when applying the glossary. - // - // If the input file extension is txt or html, glossary_error_file will be - // generated that contains error details. glossary_error_file has format of - // gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] - GcsDestination gcs_destination = 1; - } -} - -// The batch translation request. -message BatchTranslateTextRequest { - // Required. Location to make a call. Must refer to a caller's project. - // - // Format: `projects/{project-number-or-id}/locations/{location-id}`. - // - // The `global` location is not supported for batch translation. - // - // Only AutoML Translation models or glossaries within the same region (have - // the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) - // error is returned. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. Source language code. - string source_language_code = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Specify up to 10 language codes here. - repeated string target_language_codes = 3 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. The models to use for translation. Map's key is target language - // code. Map's value is model name. Value can be a built-in general model, - // or an AutoML Translation model. - // - // The value format depends on model type: - // - // - AutoML Translation models: - // `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - // - // - General (built-in) models: - // `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-number-or-id}/locations/{location-id}/models/general/base` - // - // - // If the map is empty or a specific model is - // not requested for a language pair, then default google model (nmt) is used. - map models = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Input configurations. - // The total number of files matched should be <= 1000. - // The total content size should be <= 100M Unicode codepoints. - // The files must use UTF-8 encoding. - repeated InputConfig input_configs = 5 - [(google.api.field_behavior) = REQUIRED]; - - // Required. Output configuration. - // If 2 input configs match to the same file (that is, same input path), - // we don't generate output for duplicate inputs. - OutputConfig output_config = 6 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Glossaries to be applied for translation. - // It's keyed by target language code. - map glossaries = 7 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The labels with user-defined metadata for the request. - // - // Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/labels for more information. - map labels = 9 [(google.api.field_behavior) = OPTIONAL]; -} - -// State metadata for the batch translation operation. -message BatchTranslateMetadata { - // State of the job. - enum State { - // Invalid. - STATE_UNSPECIFIED = 0; - - // Request is being processed. - RUNNING = 1; - - // The batch is processed, and at least one item was successfully - // processed. - SUCCEEDED = 2; - - // The batch is done and no item was successfully processed. - FAILED = 3; - - // Request is in the process of being canceled after caller invoked - // longrunning.Operations.CancelOperation on the request id. - CANCELLING = 4; - - // The batch is done after the user has called the - // longrunning.Operations.CancelOperation. Any records processed before the - // cancel command are output as specified in the request. - CANCELLED = 5; - } - - // The state of the operation. - State state = 1; - - // Number of successfully translated characters so far (Unicode codepoints). - int64 translated_characters = 2; - - // Number of characters that have failed to process so far (Unicode - // codepoints). - int64 failed_characters = 3; - - // Total number of characters (Unicode codepoints). - // This is the total number of codepoints from input files times the number of - // target languages and appears here shortly after the call is submitted. - int64 total_characters = 4; - - // Time when the operation was submitted. - google.protobuf.Timestamp submit_time = 5; -} - -// Stored in the -// [google.longrunning.Operation.response][google.longrunning.Operation.response] -// field returned by BatchTranslateText if at least one sentence is translated -// successfully. -message BatchTranslateResponse { - // Total number of characters (Unicode codepoints). - int64 total_characters = 1; - - // Number of successfully translated characters (Unicode codepoints). - int64 translated_characters = 2; - - // Number of characters that have failed to process (Unicode codepoints). - int64 failed_characters = 3; - - // Time when the operation was submitted. - google.protobuf.Timestamp submit_time = 4; - - // The time when the operation is finished and - // [google.longrunning.Operation.done][google.longrunning.Operation.done] is - // set to true. - google.protobuf.Timestamp end_time = 5; -} - -// Input configuration for glossaries. -message GlossaryInputConfig { - // Required. Specify the input. - oneof source { - // Required. Google Cloud Storage location of glossary data. - // File format is determined based on the filename extension. API returns - // [google.rpc.Code.INVALID_ARGUMENT] for unsupported URI-s and file - // formats. Wildcards are not allowed. This must be a single file in one of - // the following formats: - // - // For unidirectional glossaries: - // - // - TSV/CSV (`.tsv`/`.csv`): 2 column file, tab- or comma-separated. - // The first column is source text. The second column is target text. - // The file must not contain headers. That is, the first row is data, not - // column names. - // - // - TMX (`.tmx`): TMX file with parallel data defining source/target term - // pairs. - // - // For equivalent term sets glossaries: - // - // - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - // in multiple languages. The format is defined for Google Translation - // Toolkit and documented in [Use a - // glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). - GcsSource gcs_source = 1; - } -} - -// Represents a glossary built from user provided data. -message Glossary { - option (google.api.resource) = { - type: "translate.googleapis.com/Glossary" - pattern: "projects/{project}/locations/{location}/glossaries/{glossary}" - }; - - // Used with unidirectional glossaries. - message LanguageCodePair { - // Required. The BCP-47 language code of the input text, for example, - // "en-US". Expected to be an exact match for GlossaryTerm.language_code. - string source_language_code = 1; - - // Required. The BCP-47 language code for translation output, for example, - // "zh-CN". Expected to be an exact match for GlossaryTerm.language_code. - string target_language_code = 2; - } - - // Used with equivalent term set glossaries. - message LanguageCodesSet { - // The BCP-47 language code(s) for terms defined in the glossary. - // All entries are unique. The list contains at least two entries. - // Expected to be an exact match for GlossaryTerm.language_code. - repeated string language_codes = 1; - } - - // Required. The resource name of the glossary. Glossary names have the form - // `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. - string name = 1; - - // Languages supported by the glossary. - oneof languages { - // Used with unidirectional glossaries. - LanguageCodePair language_pair = 3; - - // Used with equivalent term set glossaries. - LanguageCodesSet language_codes_set = 4; - } - - // Required. Provides examples to build the glossary from. - // Total glossary must not exceed 10M Unicode codepoints. - GlossaryInputConfig input_config = 5; - - // Output only. The number of entries defined in the glossary. - int32 entry_count = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. When CreateGlossary was called. - google.protobuf.Timestamp submit_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. When the glossary creation was finished. - google.protobuf.Timestamp end_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request message for CreateGlossary. -message CreateGlossaryRequest { - // Required. The project name. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The glossary to create. - Glossary glossary = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for GetGlossary. -message GetGlossaryRequest { - // Required. The name of the glossary to retrieve. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "translate.googleapis.com/Glossary" - } - ]; -} - -// Request message for DeleteGlossary. -message DeleteGlossaryRequest { - // Required. The name of the glossary to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "translate.googleapis.com/Glossary" - } - ]; -} - -// Request message for ListGlossaries. -message ListGlossariesRequest { - // Required. The name of the project from which to list all of the glossaries. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. Requested page size. The server may return fewer glossaries than - // requested. If unspecified, the server picks an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results the server should return. - // Typically, this is the value of [ListGlossariesResponse.next_page_token] - // returned from the previous call to `ListGlossaries` method. - // The first page is returned if `page_token`is empty or missing. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filter specifying constraints of a list operation. - // Filtering is not supported yet, and the parameter currently has no effect. - // If missing, no filtering is performed. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for ListGlossaries. -message ListGlossariesResponse { - // The list of glossaries for a project. - repeated Glossary glossaries = 1; - - // A token to retrieve a page of results. Pass this value in the - // [ListGlossariesRequest.page_token] field in the subsequent call to - // `ListGlossaries` method to retrieve the next page of results. - string next_page_token = 2; -} - -// Stored in the -// [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] -// field returned by CreateGlossary. -message CreateGlossaryMetadata { - // Enumerates the possible states that the creation request can be in. - enum State { - // Invalid. - STATE_UNSPECIFIED = 0; - - // Request is being processed. - RUNNING = 1; - - // The glossary was successfully created. - SUCCEEDED = 2; - - // Failed to create the glossary. - FAILED = 3; - - // Request is in the process of being canceled after caller invoked - // longrunning.Operations.CancelOperation on the request id. - CANCELLING = 4; - - // The glossary creation request was successfully canceled. - CANCELLED = 5; - } - - // The name of the glossary that is being created. - string name = 1; - - // The current state of the glossary creation operation. - State state = 2; - - // The time when the operation was submitted to the server. - google.protobuf.Timestamp submit_time = 3; -} - -// Stored in the -// [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] -// field returned by DeleteGlossary. -message DeleteGlossaryMetadata { - // Enumerates the possible states that the creation request can be in. - enum State { - // Invalid. - STATE_UNSPECIFIED = 0; - - // Request is being processed. - RUNNING = 1; - - // The glossary was successfully deleted. - SUCCEEDED = 2; - - // Failed to delete the glossary. - FAILED = 3; - - // Request is in the process of being canceled after caller invoked - // longrunning.Operations.CancelOperation on the request id. - CANCELLING = 4; - - // The glossary deletion request was successfully canceled. - CANCELLED = 5; - } - - // The name of the glossary that is being deleted. - string name = 1; - - // The current state of the glossary deletion operation. - State state = 2; - - // The time when the operation was submitted to the server. - google.protobuf.Timestamp submit_time = 3; -} - -// Stored in the -// [google.longrunning.Operation.response][google.longrunning.Operation.response] -// field returned by DeleteGlossary. -message DeleteGlossaryResponse { - // The name of the deleted glossary. - string name = 1; - - // The time when the operation was submitted to the server. - google.protobuf.Timestamp submit_time = 2; - - // The time when the glossary deletion is finished and - // [google.longrunning.Operation.done][google.longrunning.Operation.done] is - // set to true. - google.protobuf.Timestamp end_time = 3; -} diff --git a/translate/google/cloud/translate_v3/proto/translation_service_pb2.py b/translate/google/cloud/translate_v3/proto/translation_service_pb2.py deleted file mode 100644 index deeb81ea9127..000000000000 --- a/translate/google/cloud/translate_v3/proto/translation_service_pb2.py +++ /dev/null @@ -1,3902 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/translation_v3/proto/translation_service.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/translation_v3/proto/translation_service.proto", - package="google.cloud.translation.v3", - syntax="proto3", - serialized_options=_b( - "\n\035com.google.cloud.translate.v3B\027TranslationServiceProtoP\001ZBgoogle.golang.org/genproto/googleapis/cloud/translate/v3;translate\370\001\001\252\002\031Google.Cloud.Translate.V3\312\002\031Google\\Cloud\\Translate\\V3\352\002\034Google::Cloud::Translate::V3" - ), - serialized_pb=_b( - '\n;google/cloud/translation_v3/proto/translation_service.proto\x12\x1bgoogle.cloud.translation.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto"N\n\x1bTranslateTextGlossaryConfig\x12\x15\n\x08glossary\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0bignore_case\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01"\xb5\x03\n\x14TranslateTextRequest\x12\x15\n\x08\x63ontents\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12\x16\n\tmime_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14source_language_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14target_language_code\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x06parent\x18\x08 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x12\n\x05model\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12V\n\x0fglossary_config\x18\x07 \x01(\x0b\x32\x38.google.cloud.translation.v3.TranslateTextGlossaryConfigB\x03\xe0\x41\x01\x12R\n\x06labels\x18\n \x03(\x0b\x32=.google.cloud.translation.v3.TranslateTextRequest.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\xa0\x01\n\x15TranslateTextResponse\x12>\n\x0ctranslations\x18\x01 \x03(\x0b\x32(.google.cloud.translation.v3.Translation\x12G\n\x15glossary_translations\x18\x03 \x03(\x0b\x32(.google.cloud.translation.v3.Translation"\xa8\x01\n\x0bTranslation\x12\x17\n\x0ftranslated_text\x18\x01 \x01(\t\x12\r\n\x05model\x18\x02 \x01(\t\x12\x1e\n\x16\x64\x65tected_language_code\x18\x04 \x01(\t\x12Q\n\x0fglossary_config\x18\x03 \x01(\x0b\x32\x38.google.cloud.translation.v3.TranslateTextGlossaryConfig"\x9f\x02\n\x15\x44\x65tectLanguageRequest\x12\x39\n\x06parent\x18\x05 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x12\n\x05model\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x07\x63ontent\x18\x01 \x01(\tH\x00\x12\x16\n\tmime_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12S\n\x06labels\x18\x06 \x03(\x0b\x32>.google.cloud.translation.v3.DetectLanguageRequest.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x08\n\x06source"=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02"Z\n\x16\x44\x65tectLanguageResponse\x12@\n\tlanguages\x18\x01 \x03(\x0b\x32-.google.cloud.translation.v3.DetectedLanguage"\x91\x01\n\x1cGetSupportedLanguagesRequest\x12\x39\n\x06parent\x18\x03 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12"\n\x15\x64isplay_language_code\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05model\x18\x02 \x01(\tB\x03\xe0\x41\x01"W\n\x12SupportedLanguages\x12\x41\n\tlanguages\x18\x01 \x03(\x0b\x32..google.cloud.translation.v3.SupportedLanguage"p\n\x11SupportedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x16\n\x0esupport_source\x18\x03 \x01(\x08\x12\x16\n\x0esupport_target\x18\x04 \x01(\x08"\x1e\n\tGcsSource\x12\x11\n\tinput_uri\x18\x01 \x01(\t"m\n\x0bInputConfig\x12\x16\n\tmime_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12<\n\ngcs_source\x18\x02 \x01(\x0b\x32&.google.cloud.translation.v3.GcsSourceH\x00\x42\x08\n\x06source"+\n\x0eGcsDestination\x12\x19\n\x11output_uri_prefix\x18\x01 \x01(\t"e\n\x0cOutputConfig\x12\x46\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32+.google.cloud.translation.v3.GcsDestinationH\x00\x42\r\n\x0b\x64\x65stination"\x88\x06\n\x19\x42\x61tchTranslateTextRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12!\n\x14source_language_code\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12"\n\x15target_language_codes\x18\x03 \x03(\tB\x03\xe0\x41\x02\x12W\n\x06models\x18\x04 \x03(\x0b\x32\x42.google.cloud.translation.v3.BatchTranslateTextRequest.ModelsEntryB\x03\xe0\x41\x01\x12\x44\n\rinput_configs\x18\x05 \x03(\x0b\x32(.google.cloud.translation.v3.InputConfigB\x03\xe0\x41\x02\x12\x45\n\routput_config\x18\x06 \x01(\x0b\x32).google.cloud.translation.v3.OutputConfigB\x03\xe0\x41\x02\x12_\n\nglossaries\x18\x07 \x03(\x0b\x32\x46.google.cloud.translation.v3.BatchTranslateTextRequest.GlossariesEntryB\x03\xe0\x41\x01\x12W\n\x06labels\x18\t \x03(\x0b\x32\x42.google.cloud.translation.v3.BatchTranslateTextRequest.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bModelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1ak\n\x0fGlossariesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12G\n\x05value\x18\x02 \x01(\x0b\x32\x38.google.cloud.translation.v3.TranslateTextGlossaryConfig:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\xce\x02\n\x16\x42\x61tchTranslateMetadata\x12H\n\x05state\x18\x01 \x01(\x0e\x32\x39.google.cloud.translation.v3.BatchTranslateMetadata.State\x12\x1d\n\x15translated_characters\x18\x02 \x01(\x03\x12\x19\n\x11\x66\x61iled_characters\x18\x03 \x01(\x03\x12\x18\n\x10total_characters\x18\x04 \x01(\x03\x12/\n\x0bsubmit_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05"\xcb\x01\n\x16\x42\x61tchTranslateResponse\x12\x18\n\x10total_characters\x18\x01 \x01(\x03\x12\x1d\n\x15translated_characters\x18\x02 \x01(\x03\x12\x19\n\x11\x66\x61iled_characters\x18\x03 \x01(\x03\x12/\n\x0bsubmit_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"]\n\x13GlossaryInputConfig\x12<\n\ngcs_source\x18\x01 \x01(\x0b\x32&.google.cloud.translation.v3.GcsSourceH\x00\x42\x08\n\x06source"\xfa\x04\n\x08Glossary\x12\x0c\n\x04name\x18\x01 \x01(\t\x12O\n\rlanguage_pair\x18\x03 \x01(\x0b\x32\x36.google.cloud.translation.v3.Glossary.LanguageCodePairH\x00\x12T\n\x12language_codes_set\x18\x04 \x01(\x0b\x32\x36.google.cloud.translation.v3.Glossary.LanguageCodesSetH\x00\x12\x46\n\x0cinput_config\x18\x05 \x01(\x0b\x32\x30.google.cloud.translation.v3.GlossaryInputConfig\x12\x18\n\x0b\x65ntry_count\x18\x06 \x01(\x05\x42\x03\xe0\x41\x03\x12\x34\n\x0bsubmit_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1aN\n\x10LanguageCodePair\x12\x1c\n\x14source_language_code\x18\x01 \x01(\t\x12\x1c\n\x14target_language_code\x18\x02 \x01(\t\x1a*\n\x10LanguageCodesSet\x12\x16\n\x0elanguage_codes\x18\x01 \x03(\t:e\xea\x41\x62\n!translate.googleapis.com/Glossary\x12=projects/{project}/locations/{location}/glossaries/{glossary}B\x0b\n\tlanguages"\x90\x01\n\x15\x43reateGlossaryRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12<\n\x08glossary\x18\x02 \x01(\x0b\x32%.google.cloud.translation.v3.GlossaryB\x03\xe0\x41\x02"M\n\x12GetGlossaryRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary"P\n\x15\x44\x65leteGlossaryRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary"\x98\x01\n\x15ListGlossariesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01"l\n\x16ListGlossariesResponse\x12\x39\n\nglossaries\x18\x01 \x03(\x0b\x32%.google.cloud.translation.v3.Glossary\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\x88\x02\n\x16\x43reateGlossaryMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12H\n\x05state\x18\x02 \x01(\x0e\x32\x39.google.cloud.translation.v3.CreateGlossaryMetadata.State\x12/\n\x0bsubmit_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05"\x88\x02\n\x16\x44\x65leteGlossaryMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12H\n\x05state\x18\x02 \x01(\x0e\x32\x39.google.cloud.translation.v3.DeleteGlossaryMetadata.State\x12/\n\x0bsubmit_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05"\x85\x01\n\x16\x44\x65leteGlossaryResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12/\n\x0bsubmit_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\x8e\x10\n\x12TranslationService\x12\xd4\x02\n\rTranslateText\x12\x31.google.cloud.translation.v3.TranslateTextRequest\x1a\x32.google.cloud.translation.v3.TranslateTextResponse"\xdb\x01\x82\xd3\xe4\x93\x02\x62"1/v3/{parent=projects/*/locations/*}:translateText:\x01*Z*"%/v3/{parent=projects/*}:translateText:\x01*\xda\x41$parent,target_language_code,contents\xda\x41Iparent,model,mime_type,source_language_code,target_language_code,contents\x12\x87\x02\n\x0e\x44\x65tectLanguage\x12\x32.google.cloud.translation.v3.DetectLanguageRequest\x1a\x33.google.cloud.translation.v3.DetectLanguageResponse"\x8b\x01\x82\xd3\xe4\x93\x02\x64"2/v3/{parent=projects/*/locations/*}:detectLanguage:\x01*Z+"&/v3/{parent=projects/*}:detectLanguage:\x01*\xda\x41\x1eparent,model,mime_type,content\x12\x97\x02\n\x15GetSupportedLanguages\x12\x39.google.cloud.translation.v3.GetSupportedLanguagesRequest\x1a/.google.cloud.translation.v3.SupportedLanguages"\x91\x01\x82\xd3\xe4\x93\x02\x66\x12\x36/v3/{parent=projects/*/locations/*}/supportedLanguagesZ,\x12*/v3/{parent=projects/*}/supportedLanguages\xda\x41"parent,model,display_language_code\x12\xe1\x01\n\x12\x42\x61tchTranslateText\x12\x36.google.cloud.translation.v3.BatchTranslateTextRequest\x1a\x1d.google.longrunning.Operation"t\x82\xd3\xe4\x93\x02;"6/v3/{parent=projects/*/locations/*}:batchTranslateText:\x01*\xca\x41\x30\n\x16\x42\x61tchTranslateResponse\x12\x16\x42\x61tchTranslateMetadata\x12\xdc\x01\n\x0e\x43reateGlossary\x12\x32.google.cloud.translation.v3.CreateGlossaryRequest\x1a\x1d.google.longrunning.Operation"w\x82\xd3\xe4\x93\x02:"./v3/{parent=projects/*/locations/*}/glossaries:\x08glossary\xda\x41\x0fparent,glossary\xca\x41"\n\x08Glossary\x12\x16\x43reateGlossaryMetadata\x12\xba\x01\n\x0eListGlossaries\x12\x32.google.cloud.translation.v3.ListGlossariesRequest\x1a\x33.google.cloud.translation.v3.ListGlossariesResponse"?\x82\xd3\xe4\x93\x02\x30\x12./v3/{parent=projects/*/locations/*}/glossaries\xda\x41\x06parent\x12\xa4\x01\n\x0bGetGlossary\x12/.google.cloud.translation.v3.GetGlossaryRequest\x1a%.google.cloud.translation.v3.Glossary"=\x82\xd3\xe4\x93\x02\x30\x12./v3/{name=projects/*/locations/*/glossaries/*}\xda\x41\x04name\x12\xd5\x01\n\x0e\x44\x65leteGlossary\x12\x32.google.cloud.translation.v3.DeleteGlossaryRequest\x1a\x1d.google.longrunning.Operation"p\x82\xd3\xe4\x93\x02\x30*./v3/{name=projects/*/locations/*/glossaries/*}\xda\x41\x04name\xca\x41\x30\n\x16\x44\x65leteGlossaryResponse\x12\x16\x44\x65leteGlossaryMetadata\x1a~\xca\x41\x18translate.googleapis.com\xd2\x41`https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-translationB\xd8\x01\n\x1d\x63om.google.cloud.translate.v3B\x17TranslationServiceProtoP\x01ZBgoogle.golang.org/genproto/googleapis/cloud/translate/v3;translate\xf8\x01\x01\xaa\x02\x19Google.Cloud.Translate.V3\xca\x02\x19Google\\Cloud\\Translate\\V3\xea\x02\x1cGoogle::Cloud::Translate::V3b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_BATCHTRANSLATEMETADATA_STATE = _descriptor.EnumDescriptor( - name="State", - full_name="google.cloud.translation.v3.BatchTranslateMetadata.State", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RUNNING", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SUCCEEDED", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FAILED", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLING", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLED", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3231, - serialized_end=3332, -) -_sym_db.RegisterEnumDescriptor(_BATCHTRANSLATEMETADATA_STATE) - -_CREATEGLOSSARYMETADATA_STATE = _descriptor.EnumDescriptor( - name="State", - full_name="google.cloud.translation.v3.CreateGlossaryMetadata.State", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RUNNING", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SUCCEEDED", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FAILED", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLING", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLED", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3231, - serialized_end=3332, -) -_sym_db.RegisterEnumDescriptor(_CREATEGLOSSARYMETADATA_STATE) - -_DELETEGLOSSARYMETADATA_STATE = _descriptor.EnumDescriptor( - name="State", - full_name="google.cloud.translation.v3.DeleteGlossaryMetadata.State", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RUNNING", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SUCCEEDED", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FAILED", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLING", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLED", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3231, - serialized_end=3332, -) -_sym_db.RegisterEnumDescriptor(_DELETEGLOSSARYMETADATA_STATE) - - -_TRANSLATETEXTGLOSSARYCONFIG = _descriptor.Descriptor( - name="TranslateTextGlossaryConfig", - full_name="google.cloud.translation.v3.TranslateTextGlossaryConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="glossary", - full_name="google.cloud.translation.v3.TranslateTextGlossaryConfig.glossary", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ignore_case", - full_name="google.cloud.translation.v3.TranslateTextGlossaryConfig.ignore_case", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=277, - serialized_end=355, -) - - -_TRANSLATETEXTREQUEST_LABELSENTRY = _descriptor.Descriptor( - name="LabelsEntry", - full_name="google.cloud.translation.v3.TranslateTextRequest.LabelsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.translation.v3.TranslateTextRequest.LabelsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.translation.v3.TranslateTextRequest.LabelsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=750, - serialized_end=795, -) - -_TRANSLATETEXTREQUEST = _descriptor.Descriptor( - name="TranslateTextRequest", - full_name="google.cloud.translation.v3.TranslateTextRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="contents", - full_name="google.cloud.translation.v3.TranslateTextRequest.contents", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.translation.v3.TranslateTextRequest.mime_type", - index=1, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="source_language_code", - full_name="google.cloud.translation.v3.TranslateTextRequest.source_language_code", - index=2, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="target_language_code", - full_name="google.cloud.translation.v3.TranslateTextRequest.target_language_code", - index=3, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.translation.v3.TranslateTextRequest.parent", - index=4, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.translation.v3.TranslateTextRequest.model", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="glossary_config", - full_name="google.cloud.translation.v3.TranslateTextRequest.glossary_config", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="labels", - full_name="google.cloud.translation.v3.TranslateTextRequest.labels", - index=7, - number=10, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_TRANSLATETEXTREQUEST_LABELSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=358, - serialized_end=795, -) - - -_TRANSLATETEXTRESPONSE = _descriptor.Descriptor( - name="TranslateTextResponse", - full_name="google.cloud.translation.v3.TranslateTextResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="translations", - full_name="google.cloud.translation.v3.TranslateTextResponse.translations", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="glossary_translations", - full_name="google.cloud.translation.v3.TranslateTextResponse.glossary_translations", - index=1, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=798, - serialized_end=958, -) - - -_TRANSLATION = _descriptor.Descriptor( - name="Translation", - full_name="google.cloud.translation.v3.Translation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="translated_text", - full_name="google.cloud.translation.v3.Translation.translated_text", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.translation.v3.Translation.model", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detected_language_code", - full_name="google.cloud.translation.v3.Translation.detected_language_code", - index=2, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="glossary_config", - full_name="google.cloud.translation.v3.Translation.glossary_config", - index=3, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=961, - serialized_end=1129, -) - - -_DETECTLANGUAGEREQUEST_LABELSENTRY = _descriptor.Descriptor( - name="LabelsEntry", - full_name="google.cloud.translation.v3.DetectLanguageRequest.LabelsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.translation.v3.DetectLanguageRequest.LabelsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.translation.v3.DetectLanguageRequest.LabelsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=750, - serialized_end=795, -) - -_DETECTLANGUAGEREQUEST = _descriptor.Descriptor( - name="DetectLanguageRequest", - full_name="google.cloud.translation.v3.DetectLanguageRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.translation.v3.DetectLanguageRequest.parent", - index=0, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.translation.v3.DetectLanguageRequest.model", - index=1, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="content", - full_name="google.cloud.translation.v3.DetectLanguageRequest.content", - index=2, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.translation.v3.DetectLanguageRequest.mime_type", - index=3, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="labels", - full_name="google.cloud.translation.v3.DetectLanguageRequest.labels", - index=4, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_DETECTLANGUAGEREQUEST_LABELSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="source", - full_name="google.cloud.translation.v3.DetectLanguageRequest.source", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1132, - serialized_end=1419, -) - - -_DETECTEDLANGUAGE = _descriptor.Descriptor( - name="DetectedLanguage", - full_name="google.cloud.translation.v3.DetectedLanguage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.translation.v3.DetectedLanguage.language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.translation.v3.DetectedLanguage.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1421, - serialized_end=1482, -) - - -_DETECTLANGUAGERESPONSE = _descriptor.Descriptor( - name="DetectLanguageResponse", - full_name="google.cloud.translation.v3.DetectLanguageResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="languages", - full_name="google.cloud.translation.v3.DetectLanguageResponse.languages", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1484, - serialized_end=1574, -) - - -_GETSUPPORTEDLANGUAGESREQUEST = _descriptor.Descriptor( - name="GetSupportedLanguagesRequest", - full_name="google.cloud.translation.v3.GetSupportedLanguagesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.translation.v3.GetSupportedLanguagesRequest.parent", - index=0, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_language_code", - full_name="google.cloud.translation.v3.GetSupportedLanguagesRequest.display_language_code", - index=1, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.translation.v3.GetSupportedLanguagesRequest.model", - index=2, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1577, - serialized_end=1722, -) - - -_SUPPORTEDLANGUAGES = _descriptor.Descriptor( - name="SupportedLanguages", - full_name="google.cloud.translation.v3.SupportedLanguages", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="languages", - full_name="google.cloud.translation.v3.SupportedLanguages.languages", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1724, - serialized_end=1811, -) - - -_SUPPORTEDLANGUAGE = _descriptor.Descriptor( - name="SupportedLanguage", - full_name="google.cloud.translation.v3.SupportedLanguage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.translation.v3.SupportedLanguage.language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.translation.v3.SupportedLanguage.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="support_source", - full_name="google.cloud.translation.v3.SupportedLanguage.support_source", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="support_target", - full_name="google.cloud.translation.v3.SupportedLanguage.support_target", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1813, - serialized_end=1925, -) - - -_GCSSOURCE = _descriptor.Descriptor( - name="GcsSource", - full_name="google.cloud.translation.v3.GcsSource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.translation.v3.GcsSource.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1927, - serialized_end=1957, -) - - -_INPUTCONFIG = _descriptor.Descriptor( - name="InputConfig", - full_name="google.cloud.translation.v3.InputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.translation.v3.InputConfig.mime_type", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="gcs_source", - full_name="google.cloud.translation.v3.InputConfig.gcs_source", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="source", - full_name="google.cloud.translation.v3.InputConfig.source", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1959, - serialized_end=2068, -) - - -_GCSDESTINATION = _descriptor.Descriptor( - name="GcsDestination", - full_name="google.cloud.translation.v3.GcsDestination", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="output_uri_prefix", - full_name="google.cloud.translation.v3.GcsDestination.output_uri_prefix", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2070, - serialized_end=2113, -) - - -_OUTPUTCONFIG = _descriptor.Descriptor( - name="OutputConfig", - full_name="google.cloud.translation.v3.OutputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_destination", - full_name="google.cloud.translation.v3.OutputConfig.gcs_destination", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="destination", - full_name="google.cloud.translation.v3.OutputConfig.destination", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=2115, - serialized_end=2216, -) - - -_BATCHTRANSLATETEXTREQUEST_MODELSENTRY = _descriptor.Descriptor( - name="ModelsEntry", - full_name="google.cloud.translation.v3.BatchTranslateTextRequest.ModelsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.translation.v3.BatchTranslateTextRequest.ModelsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.translation.v3.BatchTranslateTextRequest.ModelsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2794, - serialized_end=2839, -) - -_BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY = _descriptor.Descriptor( - name="GlossariesEntry", - full_name="google.cloud.translation.v3.BatchTranslateTextRequest.GlossariesEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.translation.v3.BatchTranslateTextRequest.GlossariesEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.translation.v3.BatchTranslateTextRequest.GlossariesEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2841, - serialized_end=2948, -) - -_BATCHTRANSLATETEXTREQUEST_LABELSENTRY = _descriptor.Descriptor( - name="LabelsEntry", - full_name="google.cloud.translation.v3.BatchTranslateTextRequest.LabelsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.translation.v3.BatchTranslateTextRequest.LabelsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.translation.v3.BatchTranslateTextRequest.LabelsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=750, - serialized_end=795, -) - -_BATCHTRANSLATETEXTREQUEST = _descriptor.Descriptor( - name="BatchTranslateTextRequest", - full_name="google.cloud.translation.v3.BatchTranslateTextRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.translation.v3.BatchTranslateTextRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="source_language_code", - full_name="google.cloud.translation.v3.BatchTranslateTextRequest.source_language_code", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="target_language_codes", - full_name="google.cloud.translation.v3.BatchTranslateTextRequest.target_language_codes", - index=2, - number=3, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="models", - full_name="google.cloud.translation.v3.BatchTranslateTextRequest.models", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="input_configs", - full_name="google.cloud.translation.v3.BatchTranslateTextRequest.input_configs", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="output_config", - full_name="google.cloud.translation.v3.BatchTranslateTextRequest.output_config", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="glossaries", - full_name="google.cloud.translation.v3.BatchTranslateTextRequest.glossaries", - index=6, - number=7, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="labels", - full_name="google.cloud.translation.v3.BatchTranslateTextRequest.labels", - index=7, - number=9, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[ - _BATCHTRANSLATETEXTREQUEST_MODELSENTRY, - _BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY, - _BATCHTRANSLATETEXTREQUEST_LABELSENTRY, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2219, - serialized_end=2995, -) - - -_BATCHTRANSLATEMETADATA = _descriptor.Descriptor( - name="BatchTranslateMetadata", - full_name="google.cloud.translation.v3.BatchTranslateMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="state", - full_name="google.cloud.translation.v3.BatchTranslateMetadata.state", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="translated_characters", - full_name="google.cloud.translation.v3.BatchTranslateMetadata.translated_characters", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="failed_characters", - full_name="google.cloud.translation.v3.BatchTranslateMetadata.failed_characters", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="total_characters", - full_name="google.cloud.translation.v3.BatchTranslateMetadata.total_characters", - index=3, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="submit_time", - full_name="google.cloud.translation.v3.BatchTranslateMetadata.submit_time", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_BATCHTRANSLATEMETADATA_STATE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2998, - serialized_end=3332, -) - - -_BATCHTRANSLATERESPONSE = _descriptor.Descriptor( - name="BatchTranslateResponse", - full_name="google.cloud.translation.v3.BatchTranslateResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="total_characters", - full_name="google.cloud.translation.v3.BatchTranslateResponse.total_characters", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="translated_characters", - full_name="google.cloud.translation.v3.BatchTranslateResponse.translated_characters", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="failed_characters", - full_name="google.cloud.translation.v3.BatchTranslateResponse.failed_characters", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="submit_time", - full_name="google.cloud.translation.v3.BatchTranslateResponse.submit_time", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.cloud.translation.v3.BatchTranslateResponse.end_time", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3335, - serialized_end=3538, -) - - -_GLOSSARYINPUTCONFIG = _descriptor.Descriptor( - name="GlossaryInputConfig", - full_name="google.cloud.translation.v3.GlossaryInputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_source", - full_name="google.cloud.translation.v3.GlossaryInputConfig.gcs_source", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="source", - full_name="google.cloud.translation.v3.GlossaryInputConfig.source", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=3540, - serialized_end=3633, -) - - -_GLOSSARY_LANGUAGECODEPAIR = _descriptor.Descriptor( - name="LanguageCodePair", - full_name="google.cloud.translation.v3.Glossary.LanguageCodePair", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="source_language_code", - full_name="google.cloud.translation.v3.Glossary.LanguageCodePair.source_language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="target_language_code", - full_name="google.cloud.translation.v3.Glossary.LanguageCodePair.target_language_code", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4032, - serialized_end=4110, -) - -_GLOSSARY_LANGUAGECODESSET = _descriptor.Descriptor( - name="LanguageCodesSet", - full_name="google.cloud.translation.v3.Glossary.LanguageCodesSet", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_codes", - full_name="google.cloud.translation.v3.Glossary.LanguageCodesSet.language_codes", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4112, - serialized_end=4154, -) - -_GLOSSARY = _descriptor.Descriptor( - name="Glossary", - full_name="google.cloud.translation.v3.Glossary", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.translation.v3.Glossary.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_pair", - full_name="google.cloud.translation.v3.Glossary.language_pair", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_codes_set", - full_name="google.cloud.translation.v3.Glossary.language_codes_set", - index=2, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="input_config", - full_name="google.cloud.translation.v3.Glossary.input_config", - index=3, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="entry_count", - full_name="google.cloud.translation.v3.Glossary.entry_count", - index=4, - number=6, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="submit_time", - full_name="google.cloud.translation.v3.Glossary.submit_time", - index=5, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.cloud.translation.v3.Glossary.end_time", - index=6, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_GLOSSARY_LANGUAGECODEPAIR, _GLOSSARY_LANGUAGECODESSET], - enum_types=[], - serialized_options=_b( - "\352Ab\n!translate.googleapis.com/Glossary\022=projects/{project}/locations/{location}/glossaries/{glossary}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="languages", - full_name="google.cloud.translation.v3.Glossary.languages", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=3636, - serialized_end=4270, -) - - -_CREATEGLOSSARYREQUEST = _descriptor.Descriptor( - name="CreateGlossaryRequest", - full_name="google.cloud.translation.v3.CreateGlossaryRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.translation.v3.CreateGlossaryRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="glossary", - full_name="google.cloud.translation.v3.CreateGlossaryRequest.glossary", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4273, - serialized_end=4417, -) - - -_GETGLOSSARYREQUEST = _descriptor.Descriptor( - name="GetGlossaryRequest", - full_name="google.cloud.translation.v3.GetGlossaryRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.translation.v3.GetGlossaryRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!translate.googleapis.com/Glossary" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4419, - serialized_end=4496, -) - - -_DELETEGLOSSARYREQUEST = _descriptor.Descriptor( - name="DeleteGlossaryRequest", - full_name="google.cloud.translation.v3.DeleteGlossaryRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.translation.v3.DeleteGlossaryRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!translate.googleapis.com/Glossary" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4498, - serialized_end=4578, -) - - -_LISTGLOSSARIESREQUEST = _descriptor.Descriptor( - name="ListGlossariesRequest", - full_name="google.cloud.translation.v3.ListGlossariesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.translation.v3.ListGlossariesRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.translation.v3.ListGlossariesRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.translation.v3.ListGlossariesRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.translation.v3.ListGlossariesRequest.filter", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4581, - serialized_end=4733, -) - - -_LISTGLOSSARIESRESPONSE = _descriptor.Descriptor( - name="ListGlossariesResponse", - full_name="google.cloud.translation.v3.ListGlossariesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="glossaries", - full_name="google.cloud.translation.v3.ListGlossariesResponse.glossaries", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.translation.v3.ListGlossariesResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4735, - serialized_end=4843, -) - - -_CREATEGLOSSARYMETADATA = _descriptor.Descriptor( - name="CreateGlossaryMetadata", - full_name="google.cloud.translation.v3.CreateGlossaryMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.translation.v3.CreateGlossaryMetadata.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="state", - full_name="google.cloud.translation.v3.CreateGlossaryMetadata.state", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="submit_time", - full_name="google.cloud.translation.v3.CreateGlossaryMetadata.submit_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_CREATEGLOSSARYMETADATA_STATE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4846, - serialized_end=5110, -) - - -_DELETEGLOSSARYMETADATA = _descriptor.Descriptor( - name="DeleteGlossaryMetadata", - full_name="google.cloud.translation.v3.DeleteGlossaryMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.translation.v3.DeleteGlossaryMetadata.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="state", - full_name="google.cloud.translation.v3.DeleteGlossaryMetadata.state", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="submit_time", - full_name="google.cloud.translation.v3.DeleteGlossaryMetadata.submit_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_DELETEGLOSSARYMETADATA_STATE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5113, - serialized_end=5377, -) - - -_DELETEGLOSSARYRESPONSE = _descriptor.Descriptor( - name="DeleteGlossaryResponse", - full_name="google.cloud.translation.v3.DeleteGlossaryResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.translation.v3.DeleteGlossaryResponse.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="submit_time", - full_name="google.cloud.translation.v3.DeleteGlossaryResponse.submit_time", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.cloud.translation.v3.DeleteGlossaryResponse.end_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5380, - serialized_end=5513, -) - -_TRANSLATETEXTREQUEST_LABELSENTRY.containing_type = _TRANSLATETEXTREQUEST -_TRANSLATETEXTREQUEST.fields_by_name[ - "glossary_config" -].message_type = _TRANSLATETEXTGLOSSARYCONFIG -_TRANSLATETEXTREQUEST.fields_by_name[ - "labels" -].message_type = _TRANSLATETEXTREQUEST_LABELSENTRY -_TRANSLATETEXTRESPONSE.fields_by_name["translations"].message_type = _TRANSLATION -_TRANSLATETEXTRESPONSE.fields_by_name[ - "glossary_translations" -].message_type = _TRANSLATION -_TRANSLATION.fields_by_name[ - "glossary_config" -].message_type = _TRANSLATETEXTGLOSSARYCONFIG -_DETECTLANGUAGEREQUEST_LABELSENTRY.containing_type = _DETECTLANGUAGEREQUEST -_DETECTLANGUAGEREQUEST.fields_by_name[ - "labels" -].message_type = _DETECTLANGUAGEREQUEST_LABELSENTRY -_DETECTLANGUAGEREQUEST.oneofs_by_name["source"].fields.append( - _DETECTLANGUAGEREQUEST.fields_by_name["content"] -) -_DETECTLANGUAGEREQUEST.fields_by_name[ - "content" -].containing_oneof = _DETECTLANGUAGEREQUEST.oneofs_by_name["source"] -_DETECTLANGUAGERESPONSE.fields_by_name["languages"].message_type = _DETECTEDLANGUAGE -_SUPPORTEDLANGUAGES.fields_by_name["languages"].message_type = _SUPPORTEDLANGUAGE -_INPUTCONFIG.fields_by_name["gcs_source"].message_type = _GCSSOURCE -_INPUTCONFIG.oneofs_by_name["source"].fields.append( - _INPUTCONFIG.fields_by_name["gcs_source"] -) -_INPUTCONFIG.fields_by_name[ - "gcs_source" -].containing_oneof = _INPUTCONFIG.oneofs_by_name["source"] -_OUTPUTCONFIG.fields_by_name["gcs_destination"].message_type = _GCSDESTINATION -_OUTPUTCONFIG.oneofs_by_name["destination"].fields.append( - _OUTPUTCONFIG.fields_by_name["gcs_destination"] -) -_OUTPUTCONFIG.fields_by_name[ - "gcs_destination" -].containing_oneof = _OUTPUTCONFIG.oneofs_by_name["destination"] -_BATCHTRANSLATETEXTREQUEST_MODELSENTRY.containing_type = _BATCHTRANSLATETEXTREQUEST -_BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY.fields_by_name[ - "value" -].message_type = _TRANSLATETEXTGLOSSARYCONFIG -_BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY.containing_type = _BATCHTRANSLATETEXTREQUEST -_BATCHTRANSLATETEXTREQUEST_LABELSENTRY.containing_type = _BATCHTRANSLATETEXTREQUEST -_BATCHTRANSLATETEXTREQUEST.fields_by_name[ - "models" -].message_type = _BATCHTRANSLATETEXTREQUEST_MODELSENTRY -_BATCHTRANSLATETEXTREQUEST.fields_by_name["input_configs"].message_type = _INPUTCONFIG -_BATCHTRANSLATETEXTREQUEST.fields_by_name["output_config"].message_type = _OUTPUTCONFIG -_BATCHTRANSLATETEXTREQUEST.fields_by_name[ - "glossaries" -].message_type = _BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY -_BATCHTRANSLATETEXTREQUEST.fields_by_name[ - "labels" -].message_type = _BATCHTRANSLATETEXTREQUEST_LABELSENTRY -_BATCHTRANSLATEMETADATA.fields_by_name[ - "state" -].enum_type = _BATCHTRANSLATEMETADATA_STATE -_BATCHTRANSLATEMETADATA.fields_by_name[ - "submit_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_BATCHTRANSLATEMETADATA_STATE.containing_type = _BATCHTRANSLATEMETADATA -_BATCHTRANSLATERESPONSE.fields_by_name[ - "submit_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_BATCHTRANSLATERESPONSE.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_GLOSSARYINPUTCONFIG.fields_by_name["gcs_source"].message_type = _GCSSOURCE -_GLOSSARYINPUTCONFIG.oneofs_by_name["source"].fields.append( - _GLOSSARYINPUTCONFIG.fields_by_name["gcs_source"] -) -_GLOSSARYINPUTCONFIG.fields_by_name[ - "gcs_source" -].containing_oneof = _GLOSSARYINPUTCONFIG.oneofs_by_name["source"] -_GLOSSARY_LANGUAGECODEPAIR.containing_type = _GLOSSARY -_GLOSSARY_LANGUAGECODESSET.containing_type = _GLOSSARY -_GLOSSARY.fields_by_name["language_pair"].message_type = _GLOSSARY_LANGUAGECODEPAIR -_GLOSSARY.fields_by_name["language_codes_set"].message_type = _GLOSSARY_LANGUAGECODESSET -_GLOSSARY.fields_by_name["input_config"].message_type = _GLOSSARYINPUTCONFIG -_GLOSSARY.fields_by_name[ - "submit_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_GLOSSARY.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_GLOSSARY.oneofs_by_name["languages"].fields.append( - _GLOSSARY.fields_by_name["language_pair"] -) -_GLOSSARY.fields_by_name["language_pair"].containing_oneof = _GLOSSARY.oneofs_by_name[ - "languages" -] -_GLOSSARY.oneofs_by_name["languages"].fields.append( - _GLOSSARY.fields_by_name["language_codes_set"] -) -_GLOSSARY.fields_by_name[ - "language_codes_set" -].containing_oneof = _GLOSSARY.oneofs_by_name["languages"] -_CREATEGLOSSARYREQUEST.fields_by_name["glossary"].message_type = _GLOSSARY -_LISTGLOSSARIESRESPONSE.fields_by_name["glossaries"].message_type = _GLOSSARY -_CREATEGLOSSARYMETADATA.fields_by_name[ - "state" -].enum_type = _CREATEGLOSSARYMETADATA_STATE -_CREATEGLOSSARYMETADATA.fields_by_name[ - "submit_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_CREATEGLOSSARYMETADATA_STATE.containing_type = _CREATEGLOSSARYMETADATA -_DELETEGLOSSARYMETADATA.fields_by_name[ - "state" -].enum_type = _DELETEGLOSSARYMETADATA_STATE -_DELETEGLOSSARYMETADATA.fields_by_name[ - "submit_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_DELETEGLOSSARYMETADATA_STATE.containing_type = _DELETEGLOSSARYMETADATA -_DELETEGLOSSARYRESPONSE.fields_by_name[ - "submit_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_DELETEGLOSSARYRESPONSE.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -DESCRIPTOR.message_types_by_name[ - "TranslateTextGlossaryConfig" -] = _TRANSLATETEXTGLOSSARYCONFIG -DESCRIPTOR.message_types_by_name["TranslateTextRequest"] = _TRANSLATETEXTREQUEST -DESCRIPTOR.message_types_by_name["TranslateTextResponse"] = _TRANSLATETEXTRESPONSE -DESCRIPTOR.message_types_by_name["Translation"] = _TRANSLATION -DESCRIPTOR.message_types_by_name["DetectLanguageRequest"] = _DETECTLANGUAGEREQUEST -DESCRIPTOR.message_types_by_name["DetectedLanguage"] = _DETECTEDLANGUAGE -DESCRIPTOR.message_types_by_name["DetectLanguageResponse"] = _DETECTLANGUAGERESPONSE -DESCRIPTOR.message_types_by_name[ - "GetSupportedLanguagesRequest" -] = _GETSUPPORTEDLANGUAGESREQUEST -DESCRIPTOR.message_types_by_name["SupportedLanguages"] = _SUPPORTEDLANGUAGES -DESCRIPTOR.message_types_by_name["SupportedLanguage"] = _SUPPORTEDLANGUAGE -DESCRIPTOR.message_types_by_name["GcsSource"] = _GCSSOURCE -DESCRIPTOR.message_types_by_name["InputConfig"] = _INPUTCONFIG -DESCRIPTOR.message_types_by_name["GcsDestination"] = _GCSDESTINATION -DESCRIPTOR.message_types_by_name["OutputConfig"] = _OUTPUTCONFIG -DESCRIPTOR.message_types_by_name[ - "BatchTranslateTextRequest" -] = _BATCHTRANSLATETEXTREQUEST -DESCRIPTOR.message_types_by_name["BatchTranslateMetadata"] = _BATCHTRANSLATEMETADATA -DESCRIPTOR.message_types_by_name["BatchTranslateResponse"] = _BATCHTRANSLATERESPONSE -DESCRIPTOR.message_types_by_name["GlossaryInputConfig"] = _GLOSSARYINPUTCONFIG -DESCRIPTOR.message_types_by_name["Glossary"] = _GLOSSARY -DESCRIPTOR.message_types_by_name["CreateGlossaryRequest"] = _CREATEGLOSSARYREQUEST -DESCRIPTOR.message_types_by_name["GetGlossaryRequest"] = _GETGLOSSARYREQUEST -DESCRIPTOR.message_types_by_name["DeleteGlossaryRequest"] = _DELETEGLOSSARYREQUEST -DESCRIPTOR.message_types_by_name["ListGlossariesRequest"] = _LISTGLOSSARIESREQUEST -DESCRIPTOR.message_types_by_name["ListGlossariesResponse"] = _LISTGLOSSARIESRESPONSE -DESCRIPTOR.message_types_by_name["CreateGlossaryMetadata"] = _CREATEGLOSSARYMETADATA -DESCRIPTOR.message_types_by_name["DeleteGlossaryMetadata"] = _DELETEGLOSSARYMETADATA -DESCRIPTOR.message_types_by_name["DeleteGlossaryResponse"] = _DELETEGLOSSARYRESPONSE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -TranslateTextGlossaryConfig = _reflection.GeneratedProtocolMessageType( - "TranslateTextGlossaryConfig", - (_message.Message,), - dict( - DESCRIPTOR=_TRANSLATETEXTGLOSSARYCONFIG, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""Configures which glossary should be used for a specific - target language, and defines options for applying that glossary. - - - Attributes: - glossary: - Required. Specifies the glossary used for this translation. - Use this format: projects/\ */locations/*/glossaries/\* - ignore_case: - Optional. Indicates match is case-insensitive. Default value - is false if missing. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.TranslateTextGlossaryConfig) - ), -) -_sym_db.RegisterMessage(TranslateTextGlossaryConfig) - -TranslateTextRequest = _reflection.GeneratedProtocolMessageType( - "TranslateTextRequest", - (_message.Message,), - dict( - LabelsEntry=_reflection.GeneratedProtocolMessageType( - "LabelsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_TRANSLATETEXTREQUEST_LABELSENTRY, - __module__="google.cloud.translation_v3.proto.translation_service_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.TranslateTextRequest.LabelsEntry) - ), - ), - DESCRIPTOR=_TRANSLATETEXTREQUEST, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""The request message for synchronous translation. - - - Attributes: - contents: - Required. The content of the input in string format. We - recommend the total content be less than 30k codepoints. Use - BatchTranslateText for larger text. - mime_type: - Optional. The format of the source text, for example, - "text/html", "text/plain". If left blank, the MIME type - defaults to "text/html". - source_language_code: - Optional. The BCP-47 language code of the input text if known, - for example, "en-US" or "sr-Latn". Supported language codes - are listed in Language Support. If the source language isn't - specified, the API attempts to identify the source language - automatically and returns the source language within the - response. - target_language_code: - Required. The BCP-47 language code to use for translation of - the input text, set to one of the language codes listed in - Language Support. - parent: - Required. Project or location to make a call. Must refer to a - caller's project. Format: ``projects/{project-number-or-id}`` - or ``projects/{project-number-or-id}/locations/{location- - id}``. For global calls, use ``projects/{project-number-or- - id}/locations/global`` or ``projects/{project-number-or-id}``. - Non-global location is required for requests using AutoML - models or custom glossaries. Models and glossaries must be - within the same region (have same location-id), otherwise an - INVALID\_ARGUMENT (400) error is returned. - model: - Optional. The ``model`` type requested for this translation. - The format depends on model type: - AutoML Translation - models: ``projects/{project-number-or- - id}/locations/{location-id}/models/{model-id}`` - General - (built-in) models: ``projects/{project-number-or- - id}/locations/{location-id}/models/general/nmt``, - ``projects/{project-number-or-id}/locations/{location- - id}/models/general/base`` For global (non-regionalized) - requests, use ``location-id`` ``global``. For example, - ``projects/{project-number-or- - id}/locations/global/models/general/nmt``. If missing, the - system decides which google base model to use. - glossary_config: - Optional. Glossary to be applied. The glossary must be within - the same region (have the same location-id) as the model, - otherwise an INVALID\_ARGUMENT (400) error is returned. - labels: - Optional. The labels with user-defined metadata for the - request. Label keys and values can be no longer than 63 - 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://cloud.google.com/translate/docs/labels for more - information. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.TranslateTextRequest) - ), -) -_sym_db.RegisterMessage(TranslateTextRequest) -_sym_db.RegisterMessage(TranslateTextRequest.LabelsEntry) - -TranslateTextResponse = _reflection.GeneratedProtocolMessageType( - "TranslateTextResponse", - (_message.Message,), - dict( - DESCRIPTOR=_TRANSLATETEXTRESPONSE, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__=""" - Attributes: - translations: - Text translation responses with no glossary applied. This - field has the same length as [``contents``][google.cloud.trans - lation.v3.TranslateTextRequest.contents]. - glossary_translations: - Text translation responses if a glossary is provided in the - request. This can be the same as [``translations``][google.clo - ud.translation.v3.TranslateTextResponse.translations] if no - terms apply. This field has the same length as [``contents``][ - google.cloud.translation.v3.TranslateTextRequest.contents]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.TranslateTextResponse) - ), -) -_sym_db.RegisterMessage(TranslateTextResponse) - -Translation = _reflection.GeneratedProtocolMessageType( - "Translation", - (_message.Message,), - dict( - DESCRIPTOR=_TRANSLATION, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""A single translation response. - - - Attributes: - translated_text: - Text translated into the target language. - model: - Only present when ``model`` is present in the request. - ``model`` here is normalized to have project number. For - example: If the ``model`` requested in TranslationTextRequest - is ``projects/{project-id}/locations/{location- - id}/models/general/nmt`` then ``model`` here would be - normalized to ``projects/{project-number}/locations/{location- - id}/models/general/nmt``. - detected_language_code: - The BCP-47 language code of source text in the initial - request, detected automatically, if no source language was - passed within the initial request. If the source language was - passed, auto-detection of the language does not occur and this - field is empty. - glossary_config: - The ``glossary_config`` used for this translation. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.Translation) - ), -) -_sym_db.RegisterMessage(Translation) - -DetectLanguageRequest = _reflection.GeneratedProtocolMessageType( - "DetectLanguageRequest", - (_message.Message,), - dict( - LabelsEntry=_reflection.GeneratedProtocolMessageType( - "LabelsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_DETECTLANGUAGEREQUEST_LABELSENTRY, - __module__="google.cloud.translation_v3.proto.translation_service_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.DetectLanguageRequest.LabelsEntry) - ), - ), - DESCRIPTOR=_DETECTLANGUAGEREQUEST, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""The request message for language detection. - - - Attributes: - parent: - Required. Project or location to make a call. Must refer to a - caller's project. Format: ``projects/{project-number-or- - id}/locations/{location-id}`` or ``projects/{project-number- - or-id}``. For global calls, use ``projects/{project-number- - or-id}/locations/global`` or ``projects/{project-number-or- - id}``. Only models within the same region (has same location- - id) can be used. Otherwise an INVALID\_ARGUMENT (400) error is - returned. - model: - Optional. The language detection model to be used. Format: - ``projects/{project-number-or-id}/locations/{location- - id}/models/language-detection/{model-id}`` Only one language - detection model is currently supported: ``projects/{project- - number-or-id}/locations/{location-id}/models/language- - detection/default``. If not specified, the default model is - used. - source: - Required. The source of the document from which to detect the - language. - content: - The content of the input stored as a string. - mime_type: - Optional. The format of the source text, for example, - "text/html", "text/plain". If left blank, the MIME type - defaults to "text/html". - labels: - Optional. The labels with user-defined metadata for the - request. Label keys and values can be no longer than 63 - 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://cloud.google.com/translate/docs/labels for more - information. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.DetectLanguageRequest) - ), -) -_sym_db.RegisterMessage(DetectLanguageRequest) -_sym_db.RegisterMessage(DetectLanguageRequest.LabelsEntry) - -DetectedLanguage = _reflection.GeneratedProtocolMessageType( - "DetectedLanguage", - (_message.Message,), - dict( - DESCRIPTOR=_DETECTEDLANGUAGE, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""The response message for language detection. - - - Attributes: - language_code: - The BCP-47 language code of source content in the request, - detected automatically. - confidence: - The confidence of the detection result for this language. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.DetectedLanguage) - ), -) -_sym_db.RegisterMessage(DetectedLanguage) - -DetectLanguageResponse = _reflection.GeneratedProtocolMessageType( - "DetectLanguageResponse", - (_message.Message,), - dict( - DESCRIPTOR=_DETECTLANGUAGERESPONSE, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""The response message for language detection. - - - Attributes: - languages: - A list of detected languages sorted by detection confidence in - descending order. The most probable language first. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.DetectLanguageResponse) - ), -) -_sym_db.RegisterMessage(DetectLanguageResponse) - -GetSupportedLanguagesRequest = _reflection.GeneratedProtocolMessageType( - "GetSupportedLanguagesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETSUPPORTEDLANGUAGESREQUEST, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""The request message for discovering supported languages. - - - Attributes: - parent: - Required. Project or location to make a call. Must refer to a - caller's project. Format: ``projects/{project-number-or-id}`` - or ``projects/{project-number-or-id}/locations/{location- - id}``. For global calls, use ``projects/{project-number-or- - id}/locations/global`` or ``projects/{project-number-or-id}``. - Non-global location is required for AutoML models. Only - models within the same region (have same location-id) can be - used, otherwise an INVALID\_ARGUMENT (400) error is returned. - display_language_code: - Optional. The language to use to return localized, human - readable names of supported languages. If missing, then - display names are not returned in a response. - model: - Optional. Get supported languages of this model. The format - depends on model type: - AutoML Translation models: - ``projects/{project-number-or-id}/locations/{location- - id}/models/{model-id}`` - General (built-in) models: - ``projects/{project-number-or-id}/locations/{location- - id}/models/general/nmt``, ``projects/{project-number-or- - id}/locations/{location-id}/models/general/base`` Returns - languages supported by the specified model. If missing, we get - supported languages of Google general base (PBMT) model. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.GetSupportedLanguagesRequest) - ), -) -_sym_db.RegisterMessage(GetSupportedLanguagesRequest) - -SupportedLanguages = _reflection.GeneratedProtocolMessageType( - "SupportedLanguages", - (_message.Message,), - dict( - DESCRIPTOR=_SUPPORTEDLANGUAGES, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""The response message for discovering supported languages. - - - Attributes: - languages: - A list of supported language responses. This list contains an - entry for each language the Translation API supports. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.SupportedLanguages) - ), -) -_sym_db.RegisterMessage(SupportedLanguages) - -SupportedLanguage = _reflection.GeneratedProtocolMessageType( - "SupportedLanguage", - (_message.Message,), - dict( - DESCRIPTOR=_SUPPORTEDLANGUAGE, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""A single supported language response corresponds to - information related to one supported language. - - - Attributes: - language_code: - Supported language code, generally consisting of its ISO 639-1 - identifier, for example, 'en', 'ja'. In certain cases, BCP-47 - codes including language and region identifiers are returned - (for example, 'zh-TW' and 'zh-CN') - display_name: - Human readable name of the language localized in the display - language specified in the request. - support_source: - Can be used as source language. - support_target: - Can be used as target language. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.SupportedLanguage) - ), -) -_sym_db.RegisterMessage(SupportedLanguage) - -GcsSource = _reflection.GeneratedProtocolMessageType( - "GcsSource", - (_message.Message,), - dict( - DESCRIPTOR=_GCSSOURCE, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""The Google Cloud Storage location for the input content. - - - Attributes: - input_uri: - Required. Source data URI. For example, - ``gs://my_bucket/my_object``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.GcsSource) - ), -) -_sym_db.RegisterMessage(GcsSource) - -InputConfig = _reflection.GeneratedProtocolMessageType( - "InputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_INPUTCONFIG, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""Input configuration for BatchTranslateText request. - - - Attributes: - mime_type: - Optional. Can be "text/plain" or "text/html". For ``.tsv``, - "text/html" is used if mime\_type is missing. For ``.html``, - this field must be "text/html" or empty. For ``.txt``, this - field must be "text/plain" or empty. - source: - Required. Specify the input. - gcs_source: - Required. Google Cloud Storage location for the source input. - This can be a single file (for example, ``gs://translation- - test/input.tsv``) or a wildcard (for example, - ``gs://translation-test/*``). If a file extension is ``.tsv``, - it can contain either one or two columns. The first column - (optional) is the id of the text request. If the first column - is missing, we use the row number (0-based) from the input - file as the ID in the output file. The second column is the - actual text to be translated. We recommend each row be <= 10K - Unicode codepoints, otherwise an error might be returned. Note - that the input tsv must be RFC 4180 compliant. You could use - https://github.com/Clever/csvlint to check potential - formatting errors in your tsv file. csvlint --delimiter=':raw- - latex:`\t`' your\_input\_file.tsv The other supported file - extensions are ``.txt`` or ``.html``, which is treated as a - single large chunk of text. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.InputConfig) - ), -) -_sym_db.RegisterMessage(InputConfig) - -GcsDestination = _reflection.GeneratedProtocolMessageType( - "GcsDestination", - (_message.Message,), - dict( - DESCRIPTOR=_GCSDESTINATION, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""The Google Cloud Storage location for the output content. - - - Attributes: - output_uri_prefix: - Required. There must be no files under 'output\_uri\_prefix'. - 'output\_uri\_prefix' must end with "/" and start with - "gs://", otherwise an INVALID\_ARGUMENT (400) error is - returned. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.GcsDestination) - ), -) -_sym_db.RegisterMessage(GcsDestination) - -OutputConfig = _reflection.GeneratedProtocolMessageType( - "OutputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_OUTPUTCONFIG, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""Output configuration for BatchTranslateText request. - - - Attributes: - destination: - Required. The destination of output. - gcs_destination: - Google Cloud Storage destination for output content. For every - single input file (for example, gs://a/b/c.[extension]), we - generate at most 2 \* n output files. (n is the # of - target\_language\_codes in the BatchTranslateTextRequest). - Output files (tsv) generated are compliant with RFC 4180 - except that record delimiters are ``\\\\n`` instead of - ``\\\\r\\\\n``. We don't provide any way to - change record delimiters. While the input files are being - processed, we write/update an index file 'index.csv' under - 'output\_uri\_prefix' (for example, gs://translation- - test/index.csv) The index file is generated/updated as new - files are being translated. The format is: input\_file,target - \_language\_code,translations\_file,errors\_file, - glossary\_translations\_file,glossary\_errors\_file - input\_file is one file we matched using - gcs\_source.input\_uri. target\_language\_code is provided in - the request. translations\_file contains the translations. - (details provided below) errors\_file contains the errors - during processing of the file. (details below). Both - translations\_file and errors\_file could be empty strings if - we have no content to output. glossary\_translations\_file and - glossary\_errors\_file are always empty strings if the - input\_file is tsv. They could also be empty if we have no - content to output. Once a row is present in index.csv, the - input/output matching never changes. Callers should also - expect all the content in input\_file are processed and ready - to be consumed (that is, no partial output file is written). - The format of translations\_file (for target language code - 'trg') is: gs://translation\_test/a\_b\_c\_'trg'\_translations - .[extension] If the input file extension is tsv, the output - has the following columns: Column 1: ID of the request - provided in the input, if it's not provided in the input, then - the input row number is used (0-based). Column 2: source - sentence. Column 3: translation without applying a glossary. - Empty string if there is an error. Column 4 (only present if a - glossary is provided in the request): translation after - applying the glossary. Empty string if there is an error - applying the glossary. Could be same string as column 3 if - there is no glossary applied. If input file extension is a - txt or html, the translation is directly written to the output - file. If glossary is requested, a separate - glossary\_translations\_file has format of gs://translation\_t - est/a\_b\_c\_'trg'\_glossary\_translations.[extension] The - format of errors file (for target language code 'trg') is: - gs://translation\_test/a\_b\_c\_'trg'\_errors.[extension] If - the input file extension is tsv, errors\_file contains the - following: Column 1: ID of the request provided in the input, - if it's not provided in the input, then the input row number - is used (0-based). Column 2: source sentence. Column 3: Error - detail for the translation. Could be empty. Column 4 (only - present if a glossary is provided in the request): Error when - applying the glossary. If the input file extension is txt or - html, glossary\_error\_file will be generated that contains - error details. glossary\_error\_file has format of gs://transl - ation\_test/a\_b\_c\_'trg'\_glossary\_errors.[extension] - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.OutputConfig) - ), -) -_sym_db.RegisterMessage(OutputConfig) - -BatchTranslateTextRequest = _reflection.GeneratedProtocolMessageType( - "BatchTranslateTextRequest", - (_message.Message,), - dict( - ModelsEntry=_reflection.GeneratedProtocolMessageType( - "ModelsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHTRANSLATETEXTREQUEST_MODELSENTRY, - __module__="google.cloud.translation_v3.proto.translation_service_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.BatchTranslateTextRequest.ModelsEntry) - ), - ), - GlossariesEntry=_reflection.GeneratedProtocolMessageType( - "GlossariesEntry", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY, - __module__="google.cloud.translation_v3.proto.translation_service_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.BatchTranslateTextRequest.GlossariesEntry) - ), - ), - LabelsEntry=_reflection.GeneratedProtocolMessageType( - "LabelsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHTRANSLATETEXTREQUEST_LABELSENTRY, - __module__="google.cloud.translation_v3.proto.translation_service_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.BatchTranslateTextRequest.LabelsEntry) - ), - ), - DESCRIPTOR=_BATCHTRANSLATETEXTREQUEST, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""The batch translation request. - - - Attributes: - parent: - Required. Location to make a call. Must refer to a caller's - project. Format: ``projects/{project-number-or- - id}/locations/{location-id}``. The ``global`` location is not - supported for batch translation. Only AutoML Translation - models or glossaries within the same region (have the same - location-id) can be used, otherwise an INVALID\_ARGUMENT (400) - error is returned. - source_language_code: - Required. Source language code. - target_language_codes: - Required. Specify up to 10 language codes here. - models: - Optional. The models to use for translation. Map's key is - target language code. Map's value is model name. Value can be - a built-in general model, or an AutoML Translation model. The - value format depends on model type: - AutoML Translation - models: ``projects/{project-number-or- - id}/locations/{location-id}/models/{model-id}`` - General - (built-in) models: ``projects/{project-number-or- - id}/locations/{location-id}/models/general/nmt``, - ``projects/{project-number-or-id}/locations/{location- - id}/models/general/base`` If the map is empty or a specific - model is not requested for a language pair, then default - google model (nmt) is used. - input_configs: - Required. Input configurations. The total number of files - matched should be <= 1000. The total content size should be <= - 100M Unicode codepoints. The files must use UTF-8 encoding. - output_config: - Required. Output configuration. If 2 input configs match to - the same file (that is, same input path), we don't generate - output for duplicate inputs. - glossaries: - Optional. Glossaries to be applied for translation. It's keyed - by target language code. - labels: - Optional. The labels with user-defined metadata for the - request. Label keys and values can be no longer than 63 - 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://cloud.google.com/translate/docs/labels for more - information. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.BatchTranslateTextRequest) - ), -) -_sym_db.RegisterMessage(BatchTranslateTextRequest) -_sym_db.RegisterMessage(BatchTranslateTextRequest.ModelsEntry) -_sym_db.RegisterMessage(BatchTranslateTextRequest.GlossariesEntry) -_sym_db.RegisterMessage(BatchTranslateTextRequest.LabelsEntry) - -BatchTranslateMetadata = _reflection.GeneratedProtocolMessageType( - "BatchTranslateMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHTRANSLATEMETADATA, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""State metadata for the batch translation operation. - - - Attributes: - state: - The state of the operation. - translated_characters: - Number of successfully translated characters so far (Unicode - codepoints). - failed_characters: - Number of characters that have failed to process so far - (Unicode codepoints). - total_characters: - Total number of characters (Unicode codepoints). This is the - total number of codepoints from input files times the number - of target languages and appears here shortly after the call is - submitted. - submit_time: - Time when the operation was submitted. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.BatchTranslateMetadata) - ), -) -_sym_db.RegisterMessage(BatchTranslateMetadata) - -BatchTranslateResponse = _reflection.GeneratedProtocolMessageType( - "BatchTranslateResponse", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHTRANSLATERESPONSE, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""Stored in the - [google.longrunning.Operation.response][google.longrunning.Operation.response] - field returned by BatchTranslateText if at least one sentence is - translated successfully. - - - Attributes: - total_characters: - Total number of characters (Unicode codepoints). - translated_characters: - Number of successfully translated characters (Unicode - codepoints). - failed_characters: - Number of characters that have failed to process (Unicode - codepoints). - submit_time: - Time when the operation was submitted. - end_time: - The time when the operation is finished and [google.longrunnin - g.Operation.done][google.longrunning.Operation.done] is set to - true. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.BatchTranslateResponse) - ), -) -_sym_db.RegisterMessage(BatchTranslateResponse) - -GlossaryInputConfig = _reflection.GeneratedProtocolMessageType( - "GlossaryInputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_GLOSSARYINPUTCONFIG, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""Input configuration for glossaries. - - - Attributes: - source: - Required. Specify the input. - gcs_source: - Required. Google Cloud Storage location of glossary data. File - format is determined based on the filename extension. API - returns [google.rpc.Code.INVALID\_ARGUMENT] for unsupported - URI-s and file formats. Wildcards are not allowed. This must - be a single file in one of the following formats: For - unidirectional glossaries: - TSV/CSV (``.tsv``/``.csv``): 2 - column file, tab- or comma-separated. The first column is - source text. The second column is target text. The file - must not contain headers. That is, the first row is data, - not column names. - TMX (``.tmx``): TMX file with parallel - data defining source/target term pairs. For equivalent - term sets glossaries: - CSV (``.csv``): Multi-column CSV - file defining equivalent glossary terms in multiple - languages. The format is defined for Google Translation - Toolkit and documented in `Use a glossary `__. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.GlossaryInputConfig) - ), -) -_sym_db.RegisterMessage(GlossaryInputConfig) - -Glossary = _reflection.GeneratedProtocolMessageType( - "Glossary", - (_message.Message,), - dict( - LanguageCodePair=_reflection.GeneratedProtocolMessageType( - "LanguageCodePair", - (_message.Message,), - dict( - DESCRIPTOR=_GLOSSARY_LANGUAGECODEPAIR, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""Used with unidirectional glossaries. - - - Attributes: - source_language_code: - Required. The BCP-47 language code of the input text, for - example, "en-US". Expected to be an exact match for - GlossaryTerm.language\_code. - target_language_code: - Required. The BCP-47 language code for translation output, for - example, "zh-CN". Expected to be an exact match for - GlossaryTerm.language\_code. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.Glossary.LanguageCodePair) - ), - ), - LanguageCodesSet=_reflection.GeneratedProtocolMessageType( - "LanguageCodesSet", - (_message.Message,), - dict( - DESCRIPTOR=_GLOSSARY_LANGUAGECODESSET, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""Used with equivalent term set glossaries. - - - Attributes: - language_codes: - The BCP-47 language code(s) for terms defined in the glossary. - All entries are unique. The list contains at least two - entries. Expected to be an exact match for - GlossaryTerm.language\_code. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.Glossary.LanguageCodesSet) - ), - ), - DESCRIPTOR=_GLOSSARY, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""Represents a glossary built from user provided data. - - - Attributes: - name: - Required. The resource name of the glossary. Glossary names - have the form ``projects/{project-number-or- - id}/locations/{location-id}/glossaries/{glossary-id}``. - languages: - Languages supported by the glossary. - language_pair: - Used with unidirectional glossaries. - language_codes_set: - Used with equivalent term set glossaries. - input_config: - Required. Provides examples to build the glossary from. Total - glossary must not exceed 10M Unicode codepoints. - entry_count: - Output only. The number of entries defined in the glossary. - submit_time: - Output only. When CreateGlossary was called. - end_time: - Output only. When the glossary creation was finished. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.Glossary) - ), -) -_sym_db.RegisterMessage(Glossary) -_sym_db.RegisterMessage(Glossary.LanguageCodePair) -_sym_db.RegisterMessage(Glossary.LanguageCodesSet) - -CreateGlossaryRequest = _reflection.GeneratedProtocolMessageType( - "CreateGlossaryRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEGLOSSARYREQUEST, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""Request message for CreateGlossary. - - - Attributes: - parent: - Required. The project name. - glossary: - Required. The glossary to create. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.CreateGlossaryRequest) - ), -) -_sym_db.RegisterMessage(CreateGlossaryRequest) - -GetGlossaryRequest = _reflection.GeneratedProtocolMessageType( - "GetGlossaryRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETGLOSSARYREQUEST, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""Request message for GetGlossary. - - - Attributes: - name: - Required. The name of the glossary to retrieve. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.GetGlossaryRequest) - ), -) -_sym_db.RegisterMessage(GetGlossaryRequest) - -DeleteGlossaryRequest = _reflection.GeneratedProtocolMessageType( - "DeleteGlossaryRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEGLOSSARYREQUEST, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""Request message for DeleteGlossary. - - - Attributes: - name: - Required. The name of the glossary to delete. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.DeleteGlossaryRequest) - ), -) -_sym_db.RegisterMessage(DeleteGlossaryRequest) - -ListGlossariesRequest = _reflection.GeneratedProtocolMessageType( - "ListGlossariesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTGLOSSARIESREQUEST, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""Request message for ListGlossaries. - - - Attributes: - parent: - Required. The name of the project from which to list all of - the glossaries. - page_size: - Optional. Requested page size. The server may return fewer - glossaries than requested. If unspecified, the server picks an - appropriate default. - page_token: - Optional. A token identifying a page of results the server - should return. Typically, this is the value of - [ListGlossariesResponse.next\_page\_token] returned from the - previous call to ``ListGlossaries`` method. The first page is - returned if ``page_token``\ is empty or missing. - filter: - Optional. Filter specifying constraints of a list operation. - Filtering is not supported yet, and the parameter currently - has no effect. If missing, no filtering is performed. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.ListGlossariesRequest) - ), -) -_sym_db.RegisterMessage(ListGlossariesRequest) - -ListGlossariesResponse = _reflection.GeneratedProtocolMessageType( - "ListGlossariesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTGLOSSARIESRESPONSE, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""Response message for ListGlossaries. - - - Attributes: - glossaries: - The list of glossaries for a project. - next_page_token: - A token to retrieve a page of results. Pass this value in the - [ListGlossariesRequest.page\_token] field in the subsequent - call to ``ListGlossaries`` method to retrieve the next page of - results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.ListGlossariesResponse) - ), -) -_sym_db.RegisterMessage(ListGlossariesResponse) - -CreateGlossaryMetadata = _reflection.GeneratedProtocolMessageType( - "CreateGlossaryMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEGLOSSARYMETADATA, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""Stored in the - [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] - field returned by CreateGlossary. - - - Attributes: - name: - The name of the glossary that is being created. - state: - The current state of the glossary creation operation. - submit_time: - The time when the operation was submitted to the server. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.CreateGlossaryMetadata) - ), -) -_sym_db.RegisterMessage(CreateGlossaryMetadata) - -DeleteGlossaryMetadata = _reflection.GeneratedProtocolMessageType( - "DeleteGlossaryMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEGLOSSARYMETADATA, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""Stored in the - [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] - field returned by DeleteGlossary. - - - Attributes: - name: - The name of the glossary that is being deleted. - state: - The current state of the glossary deletion operation. - submit_time: - The time when the operation was submitted to the server. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.DeleteGlossaryMetadata) - ), -) -_sym_db.RegisterMessage(DeleteGlossaryMetadata) - -DeleteGlossaryResponse = _reflection.GeneratedProtocolMessageType( - "DeleteGlossaryResponse", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEGLOSSARYRESPONSE, - __module__="google.cloud.translation_v3.proto.translation_service_pb2", - __doc__="""Stored in the - [google.longrunning.Operation.response][google.longrunning.Operation.response] - field returned by DeleteGlossary. - - - Attributes: - name: - The name of the deleted glossary. - submit_time: - The time when the operation was submitted to the server. - end_time: - The time when the glossary deletion is finished and [google.lo - ngrunning.Operation.done][google.longrunning.Operation.done] - is set to true. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3.DeleteGlossaryResponse) - ), -) -_sym_db.RegisterMessage(DeleteGlossaryResponse) - - -DESCRIPTOR._options = None -_TRANSLATETEXTGLOSSARYCONFIG.fields_by_name["glossary"]._options = None -_TRANSLATETEXTGLOSSARYCONFIG.fields_by_name["ignore_case"]._options = None -_TRANSLATETEXTREQUEST_LABELSENTRY._options = None -_TRANSLATETEXTREQUEST.fields_by_name["contents"]._options = None -_TRANSLATETEXTREQUEST.fields_by_name["mime_type"]._options = None -_TRANSLATETEXTREQUEST.fields_by_name["source_language_code"]._options = None -_TRANSLATETEXTREQUEST.fields_by_name["target_language_code"]._options = None -_TRANSLATETEXTREQUEST.fields_by_name["parent"]._options = None -_TRANSLATETEXTREQUEST.fields_by_name["model"]._options = None -_TRANSLATETEXTREQUEST.fields_by_name["glossary_config"]._options = None -_TRANSLATETEXTREQUEST.fields_by_name["labels"]._options = None -_DETECTLANGUAGEREQUEST_LABELSENTRY._options = None -_DETECTLANGUAGEREQUEST.fields_by_name["parent"]._options = None -_DETECTLANGUAGEREQUEST.fields_by_name["model"]._options = None -_DETECTLANGUAGEREQUEST.fields_by_name["mime_type"]._options = None -_DETECTLANGUAGEREQUEST.fields_by_name["labels"]._options = None -_GETSUPPORTEDLANGUAGESREQUEST.fields_by_name["parent"]._options = None -_GETSUPPORTEDLANGUAGESREQUEST.fields_by_name["display_language_code"]._options = None -_GETSUPPORTEDLANGUAGESREQUEST.fields_by_name["model"]._options = None -_INPUTCONFIG.fields_by_name["mime_type"]._options = None -_BATCHTRANSLATETEXTREQUEST_MODELSENTRY._options = None -_BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY._options = None -_BATCHTRANSLATETEXTREQUEST_LABELSENTRY._options = None -_BATCHTRANSLATETEXTREQUEST.fields_by_name["parent"]._options = None -_BATCHTRANSLATETEXTREQUEST.fields_by_name["source_language_code"]._options = None -_BATCHTRANSLATETEXTREQUEST.fields_by_name["target_language_codes"]._options = None -_BATCHTRANSLATETEXTREQUEST.fields_by_name["models"]._options = None -_BATCHTRANSLATETEXTREQUEST.fields_by_name["input_configs"]._options = None -_BATCHTRANSLATETEXTREQUEST.fields_by_name["output_config"]._options = None -_BATCHTRANSLATETEXTREQUEST.fields_by_name["glossaries"]._options = None -_BATCHTRANSLATETEXTREQUEST.fields_by_name["labels"]._options = None -_GLOSSARY.fields_by_name["entry_count"]._options = None -_GLOSSARY.fields_by_name["submit_time"]._options = None -_GLOSSARY.fields_by_name["end_time"]._options = None -_GLOSSARY._options = None -_CREATEGLOSSARYREQUEST.fields_by_name["parent"]._options = None -_CREATEGLOSSARYREQUEST.fields_by_name["glossary"]._options = None -_GETGLOSSARYREQUEST.fields_by_name["name"]._options = None -_DELETEGLOSSARYREQUEST.fields_by_name["name"]._options = None -_LISTGLOSSARIESREQUEST.fields_by_name["parent"]._options = None -_LISTGLOSSARIESREQUEST.fields_by_name["page_size"]._options = None -_LISTGLOSSARIESREQUEST.fields_by_name["page_token"]._options = None -_LISTGLOSSARIESREQUEST.fields_by_name["filter"]._options = None - -_TRANSLATIONSERVICE = _descriptor.ServiceDescriptor( - name="TranslationService", - full_name="google.cloud.translation.v3.TranslationService", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\030translate.googleapis.com\322A`https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-translation" - ), - serialized_start=5516, - serialized_end=7578, - methods=[ - _descriptor.MethodDescriptor( - name="TranslateText", - full_name="google.cloud.translation.v3.TranslationService.TranslateText", - index=0, - containing_service=None, - input_type=_TRANSLATETEXTREQUEST, - output_type=_TRANSLATETEXTRESPONSE, - serialized_options=_b( - '\202\323\344\223\002b"1/v3/{parent=projects/*/locations/*}:translateText:\001*Z*"%/v3/{parent=projects/*}:translateText:\001*\332A$parent,target_language_code,contents\332AIparent,model,mime_type,source_language_code,target_language_code,contents' - ), - ), - _descriptor.MethodDescriptor( - name="DetectLanguage", - full_name="google.cloud.translation.v3.TranslationService.DetectLanguage", - index=1, - containing_service=None, - input_type=_DETECTLANGUAGEREQUEST, - output_type=_DETECTLANGUAGERESPONSE, - serialized_options=_b( - '\202\323\344\223\002d"2/v3/{parent=projects/*/locations/*}:detectLanguage:\001*Z+"&/v3/{parent=projects/*}:detectLanguage:\001*\332A\036parent,model,mime_type,content' - ), - ), - _descriptor.MethodDescriptor( - name="GetSupportedLanguages", - full_name="google.cloud.translation.v3.TranslationService.GetSupportedLanguages", - index=2, - containing_service=None, - input_type=_GETSUPPORTEDLANGUAGESREQUEST, - output_type=_SUPPORTEDLANGUAGES, - serialized_options=_b( - '\202\323\344\223\002f\0226/v3/{parent=projects/*/locations/*}/supportedLanguagesZ,\022*/v3/{parent=projects/*}/supportedLanguages\332A"parent,model,display_language_code' - ), - ), - _descriptor.MethodDescriptor( - name="BatchTranslateText", - full_name="google.cloud.translation.v3.TranslationService.BatchTranslateText", - index=3, - containing_service=None, - input_type=_BATCHTRANSLATETEXTREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002;"6/v3/{parent=projects/*/locations/*}:batchTranslateText:\001*\312A0\n\026BatchTranslateResponse\022\026BatchTranslateMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="CreateGlossary", - full_name="google.cloud.translation.v3.TranslationService.CreateGlossary", - index=4, - containing_service=None, - input_type=_CREATEGLOSSARYREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002:"./v3/{parent=projects/*/locations/*}/glossaries:\010glossary\332A\017parent,glossary\312A"\n\010Glossary\022\026CreateGlossaryMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="ListGlossaries", - full_name="google.cloud.translation.v3.TranslationService.ListGlossaries", - index=5, - containing_service=None, - input_type=_LISTGLOSSARIESREQUEST, - output_type=_LISTGLOSSARIESRESPONSE, - serialized_options=_b( - "\202\323\344\223\0020\022./v3/{parent=projects/*/locations/*}/glossaries\332A\006parent" - ), - ), - _descriptor.MethodDescriptor( - name="GetGlossary", - full_name="google.cloud.translation.v3.TranslationService.GetGlossary", - index=6, - containing_service=None, - input_type=_GETGLOSSARYREQUEST, - output_type=_GLOSSARY, - serialized_options=_b( - "\202\323\344\223\0020\022./v3/{name=projects/*/locations/*/glossaries/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteGlossary", - full_name="google.cloud.translation.v3.TranslationService.DeleteGlossary", - index=7, - containing_service=None, - input_type=_DELETEGLOSSARYREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - "\202\323\344\223\0020*./v3/{name=projects/*/locations/*/glossaries/*}\332A\004name\312A0\n\026DeleteGlossaryResponse\022\026DeleteGlossaryMetadata" - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_TRANSLATIONSERVICE) - -DESCRIPTOR.services_by_name["TranslationService"] = _TRANSLATIONSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/translate/google/cloud/translate_v3/proto/translation_service_pb2_grpc.py b/translate/google/cloud/translate_v3/proto/translation_service_pb2_grpc.py deleted file mode 100644 index 5f7f9813ffbe..000000000000 --- a/translate/google/cloud/translate_v3/proto/translation_service_pb2_grpc.py +++ /dev/null @@ -1,186 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.translate_v3.proto import ( - translation_service_pb2 as google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -class TranslationServiceStub(object): - """Proto file for the Cloud Translation API (v3 GA). - - Provides natural language translation operations. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.TranslateText = channel.unary_unary( - "/google.cloud.translation.v3.TranslationService/TranslateText", - request_serializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.TranslateTextRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.TranslateTextResponse.FromString, - ) - self.DetectLanguage = channel.unary_unary( - "/google.cloud.translation.v3.TranslationService/DetectLanguage", - request_serializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.DetectLanguageRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.DetectLanguageResponse.FromString, - ) - self.GetSupportedLanguages = channel.unary_unary( - "/google.cloud.translation.v3.TranslationService/GetSupportedLanguages", - request_serializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.GetSupportedLanguagesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.SupportedLanguages.FromString, - ) - self.BatchTranslateText = channel.unary_unary( - "/google.cloud.translation.v3.TranslationService/BatchTranslateText", - request_serializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.BatchTranslateTextRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.CreateGlossary = channel.unary_unary( - "/google.cloud.translation.v3.TranslationService/CreateGlossary", - request_serializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.CreateGlossaryRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.ListGlossaries = channel.unary_unary( - "/google.cloud.translation.v3.TranslationService/ListGlossaries", - request_serializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.ListGlossariesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.ListGlossariesResponse.FromString, - ) - self.GetGlossary = channel.unary_unary( - "/google.cloud.translation.v3.TranslationService/GetGlossary", - request_serializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.GetGlossaryRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.Glossary.FromString, - ) - self.DeleteGlossary = channel.unary_unary( - "/google.cloud.translation.v3.TranslationService/DeleteGlossary", - request_serializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.DeleteGlossaryRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - - -class TranslationServiceServicer(object): - """Proto file for the Cloud Translation API (v3 GA). - - Provides natural language translation operations. - """ - - def TranslateText(self, request, context): - """Translates input text and returns translated text. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DetectLanguage(self, request, context): - """Detects the language of text within a request. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetSupportedLanguages(self, request, context): - """Returns a list of supported languages for translation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def BatchTranslateText(self, request, context): - """Translates a large volume of text in asynchronous batch mode. - This function provides real-time output as the inputs are being processed. - If caller cancels a request, the partial results (for an input file, it's - all or nothing) may still be available on the specified output location. - - This call returns immediately and you can - use google.longrunning.Operation.name to poll the status of the call. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateGlossary(self, request, context): - """Creates a glossary and returns the long-running operation. Returns - NOT_FOUND, if the project doesn't exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListGlossaries(self, request, context): - """Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetGlossary(self, request, context): - """Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteGlossary(self, request, context): - """Deletes a glossary, or cancels glossary construction - if the glossary isn't created yet. - Returns NOT_FOUND, if the glossary doesn't exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_TranslationServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "TranslateText": grpc.unary_unary_rpc_method_handler( - servicer.TranslateText, - request_deserializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.TranslateTextRequest.FromString, - response_serializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.TranslateTextResponse.SerializeToString, - ), - "DetectLanguage": grpc.unary_unary_rpc_method_handler( - servicer.DetectLanguage, - request_deserializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.DetectLanguageRequest.FromString, - response_serializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.DetectLanguageResponse.SerializeToString, - ), - "GetSupportedLanguages": grpc.unary_unary_rpc_method_handler( - servicer.GetSupportedLanguages, - request_deserializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.GetSupportedLanguagesRequest.FromString, - response_serializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.SupportedLanguages.SerializeToString, - ), - "BatchTranslateText": grpc.unary_unary_rpc_method_handler( - servicer.BatchTranslateText, - request_deserializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.BatchTranslateTextRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "CreateGlossary": grpc.unary_unary_rpc_method_handler( - servicer.CreateGlossary, - request_deserializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.CreateGlossaryRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "ListGlossaries": grpc.unary_unary_rpc_method_handler( - servicer.ListGlossaries, - request_deserializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.ListGlossariesRequest.FromString, - response_serializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.ListGlossariesResponse.SerializeToString, - ), - "GetGlossary": grpc.unary_unary_rpc_method_handler( - servicer.GetGlossary, - request_deserializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.GetGlossaryRequest.FromString, - response_serializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.Glossary.SerializeToString, - ), - "DeleteGlossary": grpc.unary_unary_rpc_method_handler( - servicer.DeleteGlossary, - request_deserializer=google_dot_cloud_dot_translation__v3_dot_proto_dot_translation__service__pb2.DeleteGlossaryRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.translation.v3.TranslationService", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/translate/google/cloud/translate_v3/types.py b/translate/google/cloud/translate_v3/types.py deleted file mode 100644 index b1e9aad339a4..000000000000 --- a/translate/google/cloud/translate_v3/types.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.translate_v3.proto import translation_service_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import timestamp_pb2 -from google.rpc import status_pb2 - - -_shared_modules = [operations_pb2, any_pb2, timestamp_pb2, status_pb2] - -_local_modules = [translation_service_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.translate_v3.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/translate/google/cloud/translate_v3beta1/__init__.py b/translate/google/cloud/translate_v3beta1/__init__.py deleted file mode 100644 index 7323f3e39441..000000000000 --- a/translate/google/cloud/translate_v3beta1/__init__.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.translate_v3beta1 import types -from google.cloud.translate_v3beta1.gapic import translation_service_client - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class TranslationServiceClient(translation_service_client.TranslationServiceClient): - __doc__ = translation_service_client.TranslationServiceClient.__doc__ - - -__all__ = ("types", "TranslationServiceClient") diff --git a/translate/google/cloud/translate_v3beta1/gapic/__init__.py b/translate/google/cloud/translate_v3beta1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py b/translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py deleted file mode 100644 index ed8de5d6c718..000000000000 --- a/translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py +++ /dev/null @@ -1,1096 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.cloud.translation.v3beta1 TranslationService API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.operation -import google.api_core.operations_v1 -import google.api_core.page_iterator -import google.api_core.path_template -import google.api_core.protobuf_helpers -import grpc - -from google.cloud.translate_v3beta1.gapic import translation_service_client_config -from google.cloud.translate_v3beta1.gapic.transports import ( - translation_service_grpc_transport, -) -from google.cloud.translate_v3beta1.proto import translation_service_pb2 -from google.cloud.translate_v3beta1.proto import translation_service_pb2_grpc -from google.longrunning import operations_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-translate" -).version - - -class TranslationServiceClient(object): - """Provides natural language translation operations.""" - - SERVICE_ADDRESS = "translate.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.translation.v3beta1.TranslationService" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - TranslationServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def glossary_path(cls, project, location, glossary): - """Return a fully-qualified glossary string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/glossaries/{glossary}", - project=project, - location=location, - glossary=glossary, - ) - - @classmethod - def location_path(cls, project, location): - """Return a fully-qualified location string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}", - project=project, - location=location, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.TranslationServiceGrpcTransport, - Callable[[~.Credentials, type], ~.TranslationServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = translation_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=translation_service_grpc_transport.TranslationServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = translation_service_grpc_transport.TranslationServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def translate_text( - self, - contents, - target_language_code, - parent, - mime_type=None, - source_language_code=None, - model=None, - glossary_config=None, - labels=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Translates input text and returns translated text. - - Example: - >>> from google.cloud import translate_v3beta1 - >>> - >>> client = translate_v3beta1.TranslationServiceClient() - >>> - >>> # TODO: Initialize `contents`: - >>> contents = [] - >>> - >>> # TODO: Initialize `target_language_code`: - >>> target_language_code = '' - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> response = client.translate_text(contents, target_language_code, parent) - - Args: - contents (list[str]): Required. The content of the input in string format. - We recommend the total content be less than 30k codepoints. - Use BatchTranslateText for larger text. - target_language_code (str): Required. The BCP-47 language code to use for translation of the input - text, set to one of the language codes listed in Language Support. - parent (str): Required. Project or location to make a call. Must refer to a caller's - project. - - Format: ``projects/{project-id}`` or - ``projects/{project-id}/locations/{location-id}``. - - For global calls, use ``projects/{project-id}/locations/global`` or - ``projects/{project-id}``. - - Non-global location is required for requests using AutoML models or - custom glossaries. - - Models and glossaries must be within the same region (have same - location-id), otherwise an INVALID\_ARGUMENT (400) error is returned. - mime_type (str): Optional. The format of the source text, for example, "text/html", - "text/plain". If left blank, the MIME type defaults to "text/html". - source_language_code (str): Optional. The BCP-47 language code of the input text if - known, for example, "en-US" or "sr-Latn". Supported language codes are - listed in Language Support. If the source language isn't specified, the API - attempts to identify the source language automatically and returns the - source language within the response. - model (str): Optional. The ``model`` type requested for this translation. - - The format depends on model type: - - - AutoML Translation models: - ``projects/{project-id}/locations/{location-id}/models/{model-id}`` - - - General (built-in) models: - ``projects/{project-id}/locations/{location-id}/models/general/nmt``, - ``projects/{project-id}/locations/{location-id}/models/general/base`` - - For global (non-regionalized) requests, use ``location-id`` ``global``. - For example, - ``projects/{project-id}/locations/global/models/general/nmt``. - - If missing, the system decides which google base model to use. - glossary_config (Union[dict, ~google.cloud.translate_v3beta1.types.TranslateTextGlossaryConfig]): Optional. Glossary to be applied. The glossary must be within the same - region (have the same location-id) as the model, otherwise an - INVALID\_ARGUMENT (400) error is returned. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.translate_v3beta1.types.TranslateTextGlossaryConfig` - labels (dict[str -> str]): Optional. The labels with user-defined metadata for the request. - - Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/labels for more information. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.translate_v3beta1.types.TranslateTextResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "translate_text" not in self._inner_api_calls: - self._inner_api_calls[ - "translate_text" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.translate_text, - default_retry=self._method_configs["TranslateText"].retry, - default_timeout=self._method_configs["TranslateText"].timeout, - client_info=self._client_info, - ) - - request = translation_service_pb2.TranslateTextRequest( - contents=contents, - target_language_code=target_language_code, - parent=parent, - mime_type=mime_type, - source_language_code=source_language_code, - model=model, - glossary_config=glossary_config, - labels=labels, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["translate_text"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def detect_language( - self, - parent, - model=None, - content=None, - mime_type=None, - labels=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Detects the language of text within a request. - - Example: - >>> from google.cloud import translate_v3beta1 - >>> - >>> client = translate_v3beta1.TranslationServiceClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> response = client.detect_language(parent) - - Args: - parent (str): Required. Project or location to make a call. Must refer to a caller's - project. - - Format: ``projects/{project-id}/locations/{location-id}`` or - ``projects/{project-id}``. - - For global calls, use ``projects/{project-id}/locations/global`` or - ``projects/{project-id}``. - - Only models within the same region (has same location-id) can be used. - Otherwise an INVALID\_ARGUMENT (400) error is returned. - model (str): Optional. The language detection model to be used. - - Format: - ``projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}`` - - Only one language detection model is currently supported: - ``projects/{project-id}/locations/{location-id}/models/language-detection/default``. - - If not specified, the default model is used. - content (str): The content of the input stored as a string. - mime_type (str): Optional. The format of the source text, for example, "text/html", - "text/plain". If left blank, the MIME type defaults to "text/html". - labels (dict[str -> str]): Optional. The labels with user-defined metadata for the request. - - Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/labels for more information. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.translate_v3beta1.types.DetectLanguageResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "detect_language" not in self._inner_api_calls: - self._inner_api_calls[ - "detect_language" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.detect_language, - default_retry=self._method_configs["DetectLanguage"].retry, - default_timeout=self._method_configs["DetectLanguage"].timeout, - client_info=self._client_info, - ) - - # Sanity check: We have some fields which are mutually exclusive; - # raise ValueError if more than one is sent. - google.api_core.protobuf_helpers.check_oneof(content=content) - - request = translation_service_pb2.DetectLanguageRequest( - parent=parent, - model=model, - content=content, - mime_type=mime_type, - labels=labels, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["detect_language"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_supported_languages( - self, - parent, - display_language_code=None, - model=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Returns a list of supported languages for translation. - - Example: - >>> from google.cloud import translate_v3beta1 - >>> - >>> client = translate_v3beta1.TranslationServiceClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> response = client.get_supported_languages(parent) - - Args: - parent (str): Required. Project or location to make a call. Must refer to a caller's - project. - - Format: ``projects/{project-id}`` or - ``projects/{project-id}/locations/{location-id}``. - - For global calls, use ``projects/{project-id}/locations/global`` or - ``projects/{project-id}``. - - Non-global location is required for AutoML models. - - Only models within the same region (have same location-id) can be used, - otherwise an INVALID\_ARGUMENT (400) error is returned. - display_language_code (str): Optional. The language to use to return localized, human readable names - of supported languages. If missing, then display names are not returned - in a response. - model (str): Optional. Get supported languages of this model. - - The format depends on model type: - - - AutoML Translation models: - ``projects/{project-id}/locations/{location-id}/models/{model-id}`` - - - General (built-in) models: - ``projects/{project-id}/locations/{location-id}/models/general/nmt``, - ``projects/{project-id}/locations/{location-id}/models/general/base`` - - Returns languages supported by the specified model. If missing, we get - supported languages of Google general base (PBMT) model. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.translate_v3beta1.types.SupportedLanguages` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_supported_languages" not in self._inner_api_calls: - self._inner_api_calls[ - "get_supported_languages" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_supported_languages, - default_retry=self._method_configs["GetSupportedLanguages"].retry, - default_timeout=self._method_configs["GetSupportedLanguages"].timeout, - client_info=self._client_info, - ) - - request = translation_service_pb2.GetSupportedLanguagesRequest( - parent=parent, display_language_code=display_language_code, model=model - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_supported_languages"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def batch_translate_text( - self, - parent, - source_language_code, - target_language_codes, - input_configs, - output_config, - models=None, - glossaries=None, - labels=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Translates a large volume of text in asynchronous batch mode. - This function provides real-time output as the inputs are being processed. - If caller cancels a request, the partial results (for an input file, it's - all or nothing) may still be available on the specified output location. - - This call returns immediately and you can - use google.longrunning.Operation.name to poll the status of the call. - - Example: - >>> from google.cloud import translate_v3beta1 - >>> - >>> client = translate_v3beta1.TranslationServiceClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `source_language_code`: - >>> source_language_code = '' - >>> - >>> # TODO: Initialize `target_language_codes`: - >>> target_language_codes = [] - >>> - >>> # TODO: Initialize `input_configs`: - >>> input_configs = [] - >>> - >>> # TODO: Initialize `output_config`: - >>> output_config = {} - >>> - >>> response = client.batch_translate_text(parent, source_language_code, target_language_codes, input_configs, output_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - parent (str): Required. Location to make a call. Must refer to a caller's project. - - Format: ``projects/{project-id}/locations/{location-id}``. - - The ``global`` location is not supported for batch translation. - - Only AutoML Translation models or glossaries within the same region - (have the same location-id) can be used, otherwise an INVALID\_ARGUMENT - (400) error is returned. - source_language_code (str): Required. Source language code. - target_language_codes (list[str]): Required. Specify up to 10 language codes here. - input_configs (list[Union[dict, ~google.cloud.translate_v3beta1.types.InputConfig]]): Required. Input configurations. - The total number of files matched should be <= 1000. - The total content size should be <= 100M Unicode codepoints. - The files must use UTF-8 encoding. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.translate_v3beta1.types.InputConfig` - output_config (Union[dict, ~google.cloud.translate_v3beta1.types.OutputConfig]): Required. Output configuration. - If 2 input configs match to the same file (that is, same input path), - we don't generate output for duplicate inputs. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.translate_v3beta1.types.OutputConfig` - models (dict[str -> str]): Optional. The models to use for translation. Map's key is target - language code. Map's value is model name. Value can be a built-in - general model, or an AutoML Translation model. - - The value format depends on model type: - - - AutoML Translation models: - ``projects/{project-id}/locations/{location-id}/models/{model-id}`` - - - General (built-in) models: - ``projects/{project-id}/locations/{location-id}/models/general/nmt``, - ``projects/{project-id}/locations/{location-id}/models/general/base`` - - If the map is empty or a specific model is not requested for a language - pair, then default google model (nmt) is used. - glossaries (dict[str -> Union[dict, ~google.cloud.translate_v3beta1.types.TranslateTextGlossaryConfig]]): Optional. Glossaries to be applied for translation. - It's keyed by target language code. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.translate_v3beta1.types.TranslateTextGlossaryConfig` - labels (dict[str -> str]): Optional. The labels with user-defined metadata for the request. - - Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/labels for more information. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.translate_v3beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "batch_translate_text" not in self._inner_api_calls: - self._inner_api_calls[ - "batch_translate_text" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.batch_translate_text, - default_retry=self._method_configs["BatchTranslateText"].retry, - default_timeout=self._method_configs["BatchTranslateText"].timeout, - client_info=self._client_info, - ) - - request = translation_service_pb2.BatchTranslateTextRequest( - parent=parent, - source_language_code=source_language_code, - target_language_codes=target_language_codes, - input_configs=input_configs, - output_config=output_config, - models=models, - glossaries=glossaries, - labels=labels, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["batch_translate_text"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - translation_service_pb2.BatchTranslateResponse, - metadata_type=translation_service_pb2.BatchTranslateMetadata, - ) - - def create_glossary( - self, - parent, - glossary, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a glossary and returns the long-running operation. Returns - NOT\_FOUND, if the project doesn't exist. - - Example: - >>> from google.cloud import translate_v3beta1 - >>> - >>> client = translate_v3beta1.TranslationServiceClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `glossary`: - >>> glossary = {} - >>> - >>> response = client.create_glossary(parent, glossary) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - parent (str): Required. The project name. - glossary (Union[dict, ~google.cloud.translate_v3beta1.types.Glossary]): Required. The glossary to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.translate_v3beta1.types.Glossary` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.translate_v3beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_glossary" not in self._inner_api_calls: - self._inner_api_calls[ - "create_glossary" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_glossary, - default_retry=self._method_configs["CreateGlossary"].retry, - default_timeout=self._method_configs["CreateGlossary"].timeout, - client_info=self._client_info, - ) - - request = translation_service_pb2.CreateGlossaryRequest( - parent=parent, glossary=glossary - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["create_glossary"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - translation_service_pb2.Glossary, - metadata_type=translation_service_pb2.CreateGlossaryMetadata, - ) - - def list_glossaries( - self, - parent, - page_size=None, - filter_=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists glossaries in a project. Returns NOT\_FOUND, if the project - doesn't exist. - - Example: - >>> from google.cloud import translate_v3beta1 - >>> - >>> client = translate_v3beta1.TranslationServiceClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # Iterate over all results - >>> for element in client.list_glossaries(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_glossaries(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The name of the project from which to list all of the glossaries. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - filter_ (str): Optional. Filter specifying constraints of a list operation. - Filtering is not supported yet, and the parameter currently has no effect. - If missing, no filtering is performed. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.translate_v3beta1.types.Glossary` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_glossaries" not in self._inner_api_calls: - self._inner_api_calls[ - "list_glossaries" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_glossaries, - default_retry=self._method_configs["ListGlossaries"].retry, - default_timeout=self._method_configs["ListGlossaries"].timeout, - client_info=self._client_info, - ) - - request = translation_service_pb2.ListGlossariesRequest( - parent=parent, page_size=page_size, filter=filter_ - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_glossaries"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="glossaries", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_glossary( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a glossary. Returns NOT\_FOUND, if the glossary doesn't exist. - - Example: - >>> from google.cloud import translate_v3beta1 - >>> - >>> client = translate_v3beta1.TranslationServiceClient() - >>> - >>> name = client.glossary_path('[PROJECT]', '[LOCATION]', '[GLOSSARY]') - >>> - >>> response = client.get_glossary(name) - - Args: - name (str): Required. The name of the glossary to retrieve. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.translate_v3beta1.types.Glossary` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_glossary" not in self._inner_api_calls: - self._inner_api_calls[ - "get_glossary" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_glossary, - default_retry=self._method_configs["GetGlossary"].retry, - default_timeout=self._method_configs["GetGlossary"].timeout, - client_info=self._client_info, - ) - - request = translation_service_pb2.GetGlossaryRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_glossary"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_glossary( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a glossary, or cancels glossary construction if the glossary - isn't created yet. Returns NOT\_FOUND, if the glossary doesn't exist. - - Example: - >>> from google.cloud import translate_v3beta1 - >>> - >>> client = translate_v3beta1.TranslationServiceClient() - >>> - >>> name = client.glossary_path('[PROJECT]', '[LOCATION]', '[GLOSSARY]') - >>> - >>> response = client.delete_glossary(name) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. The name of the glossary to delete. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.translate_v3beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_glossary" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_glossary" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_glossary, - default_retry=self._method_configs["DeleteGlossary"].retry, - default_timeout=self._method_configs["DeleteGlossary"].timeout, - client_info=self._client_info, - ) - - request = translation_service_pb2.DeleteGlossaryRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["delete_glossary"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - translation_service_pb2.DeleteGlossaryResponse, - metadata_type=translation_service_pb2.DeleteGlossaryMetadata, - ) diff --git a/translate/google/cloud/translate_v3beta1/gapic/translation_service_client_config.py b/translate/google/cloud/translate_v3beta1/gapic/translation_service_client_config.py deleted file mode 100644 index af45b10d95d6..000000000000 --- a/translate/google/cloud/translate_v3beta1/gapic/translation_service_client_config.py +++ /dev/null @@ -1,63 +0,0 @@ -config = { - "interfaces": { - "google.cloud.translation.v3beta1.TranslationService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "TranslateText": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DetectLanguage": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetSupportedLanguages": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "BatchTranslateText": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "CreateGlossary": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListGlossaries": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetGlossary": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteGlossary": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/translate/google/cloud/translate_v3beta1/gapic/transports/__init__.py b/translate/google/cloud/translate_v3beta1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/translate/google/cloud/translate_v3beta1/gapic/transports/translation_service_grpc_transport.py b/translate/google/cloud/translate_v3beta1/gapic/transports/translation_service_grpc_transport.py deleted file mode 100644 index d3aeadc91763..000000000000 --- a/translate/google/cloud/translate_v3beta1/gapic/transports/translation_service_grpc_transport.py +++ /dev/null @@ -1,234 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers -import google.api_core.operations_v1 - -from google.cloud.translate_v3beta1.proto import translation_service_pb2_grpc - - -class TranslationServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.translation.v3beta1 TranslationService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-translation", - ) - - def __init__( - self, channel=None, credentials=None, address="translate.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "translation_service_stub": translation_service_pb2_grpc.TranslationServiceStub( - channel - ) - } - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="translate.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def translate_text(self): - """Return the gRPC stub for :meth:`TranslationServiceClient.translate_text`. - - Translates input text and returns translated text. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["translation_service_stub"].TranslateText - - @property - def detect_language(self): - """Return the gRPC stub for :meth:`TranslationServiceClient.detect_language`. - - Detects the language of text within a request. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["translation_service_stub"].DetectLanguage - - @property - def get_supported_languages(self): - """Return the gRPC stub for :meth:`TranslationServiceClient.get_supported_languages`. - - Returns a list of supported languages for translation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["translation_service_stub"].GetSupportedLanguages - - @property - def batch_translate_text(self): - """Return the gRPC stub for :meth:`TranslationServiceClient.batch_translate_text`. - - Translates a large volume of text in asynchronous batch mode. - This function provides real-time output as the inputs are being processed. - If caller cancels a request, the partial results (for an input file, it's - all or nothing) may still be available on the specified output location. - - This call returns immediately and you can - use google.longrunning.Operation.name to poll the status of the call. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["translation_service_stub"].BatchTranslateText - - @property - def create_glossary(self): - """Return the gRPC stub for :meth:`TranslationServiceClient.create_glossary`. - - Creates a glossary and returns the long-running operation. Returns - NOT\_FOUND, if the project doesn't exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["translation_service_stub"].CreateGlossary - - @property - def list_glossaries(self): - """Return the gRPC stub for :meth:`TranslationServiceClient.list_glossaries`. - - Lists glossaries in a project. Returns NOT\_FOUND, if the project - doesn't exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["translation_service_stub"].ListGlossaries - - @property - def get_glossary(self): - """Return the gRPC stub for :meth:`TranslationServiceClient.get_glossary`. - - Gets a glossary. Returns NOT\_FOUND, if the glossary doesn't exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["translation_service_stub"].GetGlossary - - @property - def delete_glossary(self): - """Return the gRPC stub for :meth:`TranslationServiceClient.delete_glossary`. - - Deletes a glossary, or cancels glossary construction if the glossary - isn't created yet. Returns NOT\_FOUND, if the glossary doesn't exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["translation_service_stub"].DeleteGlossary diff --git a/translate/google/cloud/translate_v3beta1/proto/__init__.py b/translate/google/cloud/translate_v3beta1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/translate/google/cloud/translate_v3beta1/proto/translation_service.proto b/translate/google/cloud/translate_v3beta1/proto/translation_service.proto deleted file mode 100644 index e62a50883822..000000000000 --- a/translate/google/cloud/translate_v3beta1/proto/translation_service.proto +++ /dev/null @@ -1,902 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.translation.v3beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/timestamp.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.Translate.V3Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/translate/v3beta1;translate"; -option java_multiple_files = true; -option java_outer_classname = "TranslationServiceProto"; -option java_package = "com.google.cloud.translate.v3beta1"; -option php_namespace = "Google\\Cloud\\Translate\\V3beta1"; -option ruby_package = "Google::Cloud::Translate::V3beta1"; - -// Proto file for the Cloud Translation API (v3beta1). - -// Provides natural language translation operations. -service TranslationService { - option (google.api.default_host) = "translate.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/cloud-translation"; - - // Translates input text and returns translated text. - rpc TranslateText(TranslateTextRequest) returns (TranslateTextResponse) { - option (google.api.http) = { - post: "/v3beta1/{parent=projects/*/locations/*}:translateText" - body: "*" - additional_bindings { - post: "/v3beta1/{parent=projects/*}:translateText" - body: "*" - } - }; - } - - // Detects the language of text within a request. - rpc DetectLanguage(DetectLanguageRequest) returns (DetectLanguageResponse) { - option (google.api.http) = { - post: "/v3beta1/{parent=projects/*/locations/*}:detectLanguage" - body: "*" - additional_bindings { - post: "/v3beta1/{parent=projects/*}:detectLanguage" - body: "*" - } - }; - option (google.api.method_signature) = "parent,model,mime_type"; - } - - // Returns a list of supported languages for translation. - rpc GetSupportedLanguages(GetSupportedLanguagesRequest) returns (SupportedLanguages) { - option (google.api.http) = { - get: "/v3beta1/{parent=projects/*/locations/*}/supportedLanguages" - additional_bindings { - get: "/v3beta1/{parent=projects/*}/supportedLanguages" - } - }; - option (google.api.method_signature) = "parent,display_language_code,model"; - } - - // Translates a large volume of text in asynchronous batch mode. - // This function provides real-time output as the inputs are being processed. - // If caller cancels a request, the partial results (for an input file, it's - // all or nothing) may still be available on the specified output location. - // - // This call returns immediately and you can - // use google.longrunning.Operation.name to poll the status of the call. - rpc BatchTranslateText(BatchTranslateTextRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v3beta1/{parent=projects/*/locations/*}:batchTranslateText" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "BatchTranslateResponse" - metadata_type: "BatchTranslateMetadata" - }; - } - - // Creates a glossary and returns the long-running operation. Returns - // NOT_FOUND, if the project doesn't exist. - rpc CreateGlossary(CreateGlossaryRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v3beta1/{parent=projects/*/locations/*}/glossaries" - body: "glossary" - }; - option (google.api.method_signature) = "parent,glossary"; - option (google.longrunning.operation_info) = { - response_type: "Glossary" - metadata_type: "CreateGlossaryMetadata" - }; - } - - // Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - // exist. - rpc ListGlossaries(ListGlossariesRequest) returns (ListGlossariesResponse) { - option (google.api.http) = { - get: "/v3beta1/{parent=projects/*/locations/*}/glossaries" - }; - option (google.api.method_signature) = "parent"; - option (google.api.method_signature) = "parent,filter"; - } - - // Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - // exist. - rpc GetGlossary(GetGlossaryRequest) returns (Glossary) { - option (google.api.http) = { - get: "/v3beta1/{name=projects/*/locations/*/glossaries/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Deletes a glossary, or cancels glossary construction - // if the glossary isn't created yet. - // Returns NOT_FOUND, if the glossary doesn't exist. - rpc DeleteGlossary(DeleteGlossaryRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v3beta1/{name=projects/*/locations/*/glossaries/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "DeleteGlossaryResponse" - metadata_type: "DeleteGlossaryMetadata" - }; - } -} - -// Configures which glossary should be used for a specific target language, -// and defines options for applying that glossary. -message TranslateTextGlossaryConfig { - // Required. Specifies the glossary used for this translation. Use - // this format: projects/*/locations/*/glossaries/* - string glossary = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Indicates match is case-insensitive. - // Default value is false if missing. - bool ignore_case = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// The request message for synchronous translation. -message TranslateTextRequest { - // Required. The content of the input in string format. - // We recommend the total content be less than 30k codepoints. - // Use BatchTranslateText for larger text. - repeated string contents = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The format of the source text, for example, "text/html", - // "text/plain". If left blank, the MIME type defaults to "text/html". - string mime_type = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The BCP-47 language code of the input text if - // known, for example, "en-US" or "sr-Latn". Supported language codes are - // listed in Language Support. If the source language isn't specified, the API - // attempts to identify the source language automatically and returns the - // source language within the response. - string source_language_code = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The BCP-47 language code to use for translation of the input - // text, set to one of the language codes listed in Language Support. - string target_language_code = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. Project or location to make a call. Must refer to a caller's - // project. - // - // Format: `projects/{project-id}` or - // `projects/{project-id}/locations/{location-id}`. - // - // For global calls, use `projects/{project-id}/locations/global` or - // `projects/{project-id}`. - // - // Non-global location is required for requests using AutoML models or - // custom glossaries. - // - // Models and glossaries must be within the same region (have same - // location-id), otherwise an INVALID_ARGUMENT (400) error is returned. - string parent = 8 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. The `model` type requested for this translation. - // - // The format depends on model type: - // - // - AutoML Translation models: - // `projects/{project-id}/locations/{location-id}/models/{model-id}` - // - // - General (built-in) models: - // `projects/{project-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-id}/locations/{location-id}/models/general/base` - // - // - // For global (non-regionalized) requests, use `location-id` `global`. - // For example, - // `projects/{project-id}/locations/global/models/general/nmt`. - // - // If missing, the system decides which google base model to use. - string model = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Glossary to be applied. The glossary must be - // within the same region (have the same location-id) as the model, otherwise - // an INVALID_ARGUMENT (400) error is returned. - TranslateTextGlossaryConfig glossary_config = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The labels with user-defined metadata for the request. - // - // Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/labels for more information. - map labels = 10 [(google.api.field_behavior) = OPTIONAL]; -} - -message TranslateTextResponse { - // Text translation responses with no glossary applied. - // This field has the same length as - // [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents]. - repeated Translation translations = 1; - - // Text translation responses if a glossary is provided in the request. - // This can be the same as - // [`translations`][google.cloud.translation.v3beta1.TranslateTextResponse.translations] if no terms apply. - // This field has the same length as - // [`contents`][google.cloud.translation.v3beta1.TranslateTextRequest.contents]. - repeated Translation glossary_translations = 3; -} - -// A single translation response. -message Translation { - // Text translated into the target language. - string translated_text = 1; - - // Only present when `model` is present in the request. - // This is same as `model` provided in the request. - string model = 2; - - // The BCP-47 language code of source text in the initial request, detected - // automatically, if no source language was passed within the initial - // request. If the source language was passed, auto-detection of the language - // does not occur and this field is empty. - string detected_language_code = 4; - - // The `glossary_config` used for this translation. - TranslateTextGlossaryConfig glossary_config = 3; -} - -// The request message for language detection. -message DetectLanguageRequest { - // Required. Project or location to make a call. Must refer to a caller's - // project. - // - // Format: `projects/{project-id}/locations/{location-id}` or - // `projects/{project-id}`. - // - // For global calls, use `projects/{project-id}/locations/global` or - // `projects/{project-id}`. - // - // Only models within the same region (has same location-id) can be used. - // Otherwise an INVALID_ARGUMENT (400) error is returned. - string parent = 5 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. The language detection model to be used. - // - // Format: - // `projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}` - // - // Only one language detection model is currently supported: - // `projects/{project-id}/locations/{location-id}/models/language-detection/default`. - // - // If not specified, the default model is used. - string model = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The source of the document from which to detect the language. - oneof source { - // The content of the input stored as a string. - string content = 1; - } - - // Optional. The format of the source text, for example, "text/html", - // "text/plain". If left blank, the MIME type defaults to "text/html". - string mime_type = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The labels with user-defined metadata for the request. - // - // Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/labels for more information. - map labels = 6; -} - -// The response message for language detection. -message DetectedLanguage { - // The BCP-47 language code of source content in the request, detected - // automatically. - string language_code = 1; - - // The confidence of the detection result for this language. - float confidence = 2; -} - -// The response message for language detection. -message DetectLanguageResponse { - // A list of detected languages sorted by detection confidence in descending - // order. The most probable language first. - repeated DetectedLanguage languages = 1; -} - -// The request message for discovering supported languages. -message GetSupportedLanguagesRequest { - // Required. Project or location to make a call. Must refer to a caller's - // project. - // - // Format: `projects/{project-id}` or - // `projects/{project-id}/locations/{location-id}`. - // - // For global calls, use `projects/{project-id}/locations/global` or - // `projects/{project-id}`. - // - // Non-global location is required for AutoML models. - // - // Only models within the same region (have same location-id) can be used, - // otherwise an INVALID_ARGUMENT (400) error is returned. - string parent = 3 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. The language to use to return localized, human readable names - // of supported languages. If missing, then display names are not returned - // in a response. - string display_language_code = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Get supported languages of this model. - // - // The format depends on model type: - // - // - AutoML Translation models: - // `projects/{project-id}/locations/{location-id}/models/{model-id}` - // - // - General (built-in) models: - // `projects/{project-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-id}/locations/{location-id}/models/general/base` - // - // - // Returns languages supported by the specified model. - // If missing, we get supported languages of Google general base (PBMT) model. - string model = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// The response message for discovering supported languages. -message SupportedLanguages { - // A list of supported language responses. This list contains an entry - // for each language the Translation API supports. - repeated SupportedLanguage languages = 1; -} - -// A single supported language response corresponds to information related -// to one supported language. -message SupportedLanguage { - // Supported language code, generally consisting of its ISO 639-1 - // identifier, for example, 'en', 'ja'. In certain cases, BCP-47 codes - // including language and region identifiers are returned (for example, - // 'zh-TW' and 'zh-CN') - string language_code = 1; - - // Human readable name of the language localized in the display language - // specified in the request. - string display_name = 2; - - // Can be used as source language. - bool support_source = 3; - - // Can be used as target language. - bool support_target = 4; -} - -// The Google Cloud Storage location for the input content. -message GcsSource { - // Required. Source data URI. For example, `gs://my_bucket/my_object`. - string input_uri = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Input configuration for BatchTranslateText request. -message InputConfig { - // Optional. Can be "text/plain" or "text/html". - // For `.tsv`, "text/html" is used if mime_type is missing. - // For `.html`, this field must be "text/html" or empty. - // For `.txt`, this field must be "text/plain" or empty. - string mime_type = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Specify the input. - oneof source { - // Required. Google Cloud Storage location for the source input. - // This can be a single file (for example, - // `gs://translation-test/input.tsv`) or a wildcard (for example, - // `gs://translation-test/*`). If a file extension is `.tsv`, it can - // contain either one or two columns. The first column (optional) is the id - // of the text request. If the first column is missing, we use the row - // number (0-based) from the input file as the ID in the output file. The - // second column is the actual text to be - // translated. We recommend each row be <= 10K Unicode codepoints, - // otherwise an error might be returned. - // Note that the input tsv must be RFC 4180 compliant. - // - // You could use https://github.com/Clever/csvlint to check potential - // formatting errors in your tsv file. - // csvlint --delimiter='\t' your_input_file.tsv - // - // The other supported file extensions are `.txt` or `.html`, which is - // treated as a single large chunk of text. - GcsSource gcs_source = 2; - } -} - -// The Google Cloud Storage location for the output content. -message GcsDestination { - // Required. There must be no files under 'output_uri_prefix'. - // 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an - // INVALID_ARGUMENT (400) error is returned. - string output_uri_prefix = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Output configuration for BatchTranslateText request. -message OutputConfig { - // Required. The destination of output. - oneof destination { - // Google Cloud Storage destination for output content. - // For every single input file (for example, gs://a/b/c.[extension]), we - // generate at most 2 * n output files. (n is the # of target_language_codes - // in the BatchTranslateTextRequest). - // - // Output files (tsv) generated are compliant with RFC 4180 except that - // record delimiters are '\n' instead of '\r\n'. We don't provide any way to - // change record delimiters. - // - // While the input files are being processed, we write/update an index file - // 'index.csv' under 'output_uri_prefix' (for example, - // gs://translation-test/index.csv) The index file is generated/updated as - // new files are being translated. The format is: - // - // input_file,target_language_code,translations_file,errors_file, - // glossary_translations_file,glossary_errors_file - // - // input_file is one file we matched using gcs_source.input_uri. - // target_language_code is provided in the request. - // translations_file contains the translations. (details provided below) - // errors_file contains the errors during processing of the file. (details - // below). Both translations_file and errors_file could be empty - // strings if we have no content to output. - // glossary_translations_file and glossary_errors_file are always empty - // strings if the input_file is tsv. They could also be empty if we have no - // content to output. - // - // Once a row is present in index.csv, the input/output matching never - // changes. Callers should also expect all the content in input_file are - // processed and ready to be consumed (that is, no partial output file is - // written). - // - // The format of translations_file (for target language code 'trg') is: - // gs://translation_test/a_b_c_'trg'_translations.[extension] - // - // If the input file extension is tsv, the output has the following - // columns: - // Column 1: ID of the request provided in the input, if it's not - // provided in the input, then the input row number is used (0-based). - // Column 2: source sentence. - // Column 3: translation without applying a glossary. Empty string if there - // is an error. - // Column 4 (only present if a glossary is provided in the request): - // translation after applying the glossary. Empty string if there is an - // error applying the glossary. Could be same string as column 3 if there is - // no glossary applied. - // - // If input file extension is a txt or html, the translation is directly - // written to the output file. If glossary is requested, a separate - // glossary_translations_file has format of - // gs://translation_test/a_b_c_'trg'_glossary_translations.[extension] - // - // The format of errors file (for target language code 'trg') is: - // gs://translation_test/a_b_c_'trg'_errors.[extension] - // - // If the input file extension is tsv, errors_file contains the following: - // Column 1: ID of the request provided in the input, if it's not - // provided in the input, then the input row number is used (0-based). - // Column 2: source sentence. - // Column 3: Error detail for the translation. Could be empty. - // Column 4 (only present if a glossary is provided in the request): - // Error when applying the glossary. - // - // If the input file extension is txt or html, glossary_error_file will be - // generated that contains error details. glossary_error_file has format of - // gs://translation_test/a_b_c_'trg'_glossary_errors.[extension] - GcsDestination gcs_destination = 1; - } -} - -// The batch translation request. -message BatchTranslateTextRequest { - // Required. Location to make a call. Must refer to a caller's project. - // - // Format: `projects/{project-id}/locations/{location-id}`. - // - // The `global` location is not supported for batch translation. - // - // Only AutoML Translation models or glossaries within the same region (have - // the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) - // error is returned. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. Source language code. - string source_language_code = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Specify up to 10 language codes here. - repeated string target_language_codes = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The models to use for translation. Map's key is target language - // code. Map's value is model name. Value can be a built-in general model, - // or an AutoML Translation model. - // - // The value format depends on model type: - // - // - AutoML Translation models: - // `projects/{project-id}/locations/{location-id}/models/{model-id}` - // - // - General (built-in) models: - // `projects/{project-id}/locations/{location-id}/models/general/nmt`, - // `projects/{project-id}/locations/{location-id}/models/general/base` - // - // - // If the map is empty or a specific model is - // not requested for a language pair, then default google model (nmt) is used. - map models = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Input configurations. - // The total number of files matched should be <= 1000. - // The total content size should be <= 100M Unicode codepoints. - // The files must use UTF-8 encoding. - repeated InputConfig input_configs = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. Output configuration. - // If 2 input configs match to the same file (that is, same input path), - // we don't generate output for duplicate inputs. - OutputConfig output_config = 6 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Glossaries to be applied for translation. - // It's keyed by target language code. - map glossaries = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The labels with user-defined metadata for the request. - // - // Label keys and values can be no longer than 63 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://cloud.google.com/translate/docs/labels for more information. - map labels = 9 [(google.api.field_behavior) = OPTIONAL]; -} - -// State metadata for the batch translation operation. -message BatchTranslateMetadata { - // State of the job. - enum State { - // Invalid. - STATE_UNSPECIFIED = 0; - - // Request is being processed. - RUNNING = 1; - - // The batch is processed, and at least one item was successfully - // processed. - SUCCEEDED = 2; - - // The batch is done and no item was successfully processed. - FAILED = 3; - - // Request is in the process of being canceled after caller invoked - // longrunning.Operations.CancelOperation on the request id. - CANCELLING = 4; - - // The batch is done after the user has called the - // longrunning.Operations.CancelOperation. Any records processed before the - // cancel command are output as specified in the request. - CANCELLED = 5; - } - - // The state of the operation. - State state = 1; - - // Number of successfully translated characters so far (Unicode codepoints). - int64 translated_characters = 2; - - // Number of characters that have failed to process so far (Unicode - // codepoints). - int64 failed_characters = 3; - - // Total number of characters (Unicode codepoints). - // This is the total number of codepoints from input files times the number of - // target languages and appears here shortly after the call is submitted. - int64 total_characters = 4; - - // Time when the operation was submitted. - google.protobuf.Timestamp submit_time = 5; -} - -// Stored in the [google.longrunning.Operation.response][google.longrunning.Operation.response] field returned by -// BatchTranslateText if at least one sentence is translated successfully. -message BatchTranslateResponse { - // Total number of characters (Unicode codepoints). - int64 total_characters = 1; - - // Number of successfully translated characters (Unicode codepoints). - int64 translated_characters = 2; - - // Number of characters that have failed to process (Unicode codepoints). - int64 failed_characters = 3; - - // Time when the operation was submitted. - google.protobuf.Timestamp submit_time = 4; - - // The time when the operation is finished and - // [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true. - google.protobuf.Timestamp end_time = 5; -} - -// Input configuration for glossaries. -message GlossaryInputConfig { - // Required. Specify the input. - oneof source { - // Required. Google Cloud Storage location of glossary data. - // File format is determined based on the filename extension. API returns - // [google.rpc.Code.INVALID_ARGUMENT] for unsupported URI-s and file - // formats. Wildcards are not allowed. This must be a single file in one of - // the following formats: - // - // For unidirectional glossaries: - // - // - TSV/CSV (`.tsv`/`.csv`): 2 column file, tab- or comma-separated. - // The first column is source text. The second column is target text. - // The file must not contain headers. That is, the first row is data, not - // column names. - // - // - TMX (`.tmx`): TMX file with parallel data defining source/target term - // pairs. - // - // For equivalent term sets glossaries: - // - // - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - // in multiple languages. The format is defined for Google Translation - // Toolkit and documented in [Use a - // glossary](https://support.google.com/translatortoolkit/answer/6306379?hl=en). - GcsSource gcs_source = 1; - } -} - -// Represents a glossary built from user provided data. -message Glossary { - option (google.api.resource) = { - type: "translate.googleapis.com/Glossary" - pattern: "projects/{project}/locations/{location}/glossaries/{glossary}" - }; - - // Used with unidirectional glossaries. - message LanguageCodePair { - // Required. The BCP-47 language code of the input text, for example, - // "en-US". Expected to be an exact match for GlossaryTerm.language_code. - string source_language_code = 1; - - // Required. The BCP-47 language code for translation output, for example, - // "zh-CN". Expected to be an exact match for GlossaryTerm.language_code. - string target_language_code = 2; - } - - // Used with equivalent term set glossaries. - message LanguageCodesSet { - // The BCP-47 language code(s) for terms defined in the glossary. - // All entries are unique. The list contains at least two entries. - // Expected to be an exact match for GlossaryTerm.language_code. - repeated string language_codes = 1; - } - - // Required. The resource name of the glossary. Glossary names have the form - // `projects/{project-id}/locations/{location-id}/glossaries/{glossary-id}`. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Languages supported by the glossary. - oneof languages { - // Used with unidirectional glossaries. - LanguageCodePair language_pair = 3; - - // Used with equivalent term set glossaries. - LanguageCodesSet language_codes_set = 4; - } - - // Required. Provides examples to build the glossary from. - // Total glossary must not exceed 10M Unicode codepoints. - GlossaryInputConfig input_config = 5; - - // Output only. The number of entries defined in the glossary. - int32 entry_count = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. When CreateGlossary was called. - google.protobuf.Timestamp submit_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. When the glossary creation was finished. - google.protobuf.Timestamp end_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request message for CreateGlossary. -message CreateGlossaryRequest { - // Required. The project name. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The glossary to create. - Glossary glossary = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for GetGlossary. -message GetGlossaryRequest { - // Required. The name of the glossary to retrieve. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "translate.googleapis.com/Glossary" - } - ]; -} - -// Request message for DeleteGlossary. -message DeleteGlossaryRequest { - // Required. The name of the glossary to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "translate.googleapis.com/Glossary" - } - ]; -} - -// Request message for ListGlossaries. -message ListGlossariesRequest { - // Required. The name of the project from which to list all of the glossaries. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. Requested page size. The server may return fewer glossaries than - // requested. If unspecified, the server picks an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results the server should return. - // Typically, this is the value of [ListGlossariesResponse.next_page_token] - // returned from the previous call to `ListGlossaries` method. - // The first page is returned if `page_token`is empty or missing. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filter specifying constraints of a list operation. - // Filtering is not supported yet, and the parameter currently has no effect. - // If missing, no filtering is performed. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for ListGlossaries. -message ListGlossariesResponse { - // The list of glossaries for a project. - repeated Glossary glossaries = 1; - - // A token to retrieve a page of results. Pass this value in the - // [ListGlossariesRequest.page_token] field in the subsequent call to - // `ListGlossaries` method to retrieve the next page of results. - string next_page_token = 2; -} - -// Stored in the [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] field returned by -// CreateGlossary. -message CreateGlossaryMetadata { - // Enumerates the possible states that the creation request can be in. - enum State { - // Invalid. - STATE_UNSPECIFIED = 0; - - // Request is being processed. - RUNNING = 1; - - // The glossary was successfully created. - SUCCEEDED = 2; - - // Failed to create the glossary. - FAILED = 3; - - // Request is in the process of being canceled after caller invoked - // longrunning.Operations.CancelOperation on the request id. - CANCELLING = 4; - - // The glossary creation request was successfully canceled. - CANCELLED = 5; - } - - // The name of the glossary that is being created. - string name = 1; - - // The current state of the glossary creation operation. - State state = 2; - - // The time when the operation was submitted to the server. - google.protobuf.Timestamp submit_time = 3; -} - -// Stored in the [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] field returned by -// DeleteGlossary. -message DeleteGlossaryMetadata { - // Enumerates the possible states that the creation request can be in. - enum State { - // Invalid. - STATE_UNSPECIFIED = 0; - - // Request is being processed. - RUNNING = 1; - - // The glossary was successfully deleted. - SUCCEEDED = 2; - - // Failed to delete the glossary. - FAILED = 3; - - // Request is in the process of being canceled after caller invoked - // longrunning.Operations.CancelOperation on the request id. - CANCELLING = 4; - - // The glossary deletion request was successfully canceled. - CANCELLED = 5; - } - - // The name of the glossary that is being deleted. - string name = 1; - - // The current state of the glossary deletion operation. - State state = 2; - - // The time when the operation was submitted to the server. - google.protobuf.Timestamp submit_time = 3; -} - -// Stored in the [google.longrunning.Operation.response][google.longrunning.Operation.response] field returned by -// DeleteGlossary. -message DeleteGlossaryResponse { - // The name of the deleted glossary. - string name = 1; - - // The time when the operation was submitted to the server. - google.protobuf.Timestamp submit_time = 2; - - // The time when the glossary deletion is finished and - // [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true. - google.protobuf.Timestamp end_time = 3; -} diff --git a/translate/google/cloud/translate_v3beta1/proto/translation_service_pb2.py b/translate/google/cloud/translate_v3beta1/proto/translation_service_pb2.py deleted file mode 100644 index b58cc60089ea..000000000000 --- a/translate/google/cloud/translate_v3beta1/proto/translation_service_pb2.py +++ /dev/null @@ -1,3894 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/translation_v3beta1/proto/translation_service.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/translation_v3beta1/proto/translation_service.proto", - package="google.cloud.translation.v3beta1", - syntax="proto3", - serialized_options=_b( - '\n"com.google.cloud.translate.v3beta1B\027TranslationServiceProtoP\001ZGgoogle.golang.org/genproto/googleapis/cloud/translate/v3beta1;translate\370\001\001\252\002\036Google.Cloud.Translate.V3Beta1\312\002\036Google\\Cloud\\Translate\\V3beta1\352\002!Google::Cloud::Translate::V3beta1' - ), - serialized_pb=_b( - '\n@google/cloud/translation_v3beta1/proto/translation_service.proto\x12 google.cloud.translation.v3beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto"N\n\x1bTranslateTextGlossaryConfig\x12\x15\n\x08glossary\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0bignore_case\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01"\xbf\x03\n\x14TranslateTextRequest\x12\x15\n\x08\x63ontents\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12\x16\n\tmime_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14source_language_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14target_language_code\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x06parent\x18\x08 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x12\n\x05model\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12[\n\x0fglossary_config\x18\x07 \x01(\x0b\x32=.google.cloud.translation.v3beta1.TranslateTextGlossaryConfigB\x03\xe0\x41\x01\x12W\n\x06labels\x18\n \x03(\x0b\x32\x42.google.cloud.translation.v3beta1.TranslateTextRequest.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\xaa\x01\n\x15TranslateTextResponse\x12\x43\n\x0ctranslations\x18\x01 \x03(\x0b\x32-.google.cloud.translation.v3beta1.Translation\x12L\n\x15glossary_translations\x18\x03 \x03(\x0b\x32-.google.cloud.translation.v3beta1.Translation"\xad\x01\n\x0bTranslation\x12\x17\n\x0ftranslated_text\x18\x01 \x01(\t\x12\r\n\x05model\x18\x02 \x01(\t\x12\x1e\n\x16\x64\x65tected_language_code\x18\x04 \x01(\t\x12V\n\x0fglossary_config\x18\x03 \x01(\x0b\x32=.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig"\x9f\x02\n\x15\x44\x65tectLanguageRequest\x12\x39\n\x06parent\x18\x05 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x12\n\x05model\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x07\x63ontent\x18\x01 \x01(\tH\x00\x12\x16\n\tmime_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12S\n\x06labels\x18\x06 \x03(\x0b\x32\x43.google.cloud.translation.v3beta1.DetectLanguageRequest.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x08\n\x06source"=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02"_\n\x16\x44\x65tectLanguageResponse\x12\x45\n\tlanguages\x18\x01 \x03(\x0b\x32\x32.google.cloud.translation.v3beta1.DetectedLanguage"\x91\x01\n\x1cGetSupportedLanguagesRequest\x12\x39\n\x06parent\x18\x03 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12"\n\x15\x64isplay_language_code\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05model\x18\x02 \x01(\tB\x03\xe0\x41\x01"\\\n\x12SupportedLanguages\x12\x46\n\tlanguages\x18\x01 \x03(\x0b\x32\x33.google.cloud.translation.v3beta1.SupportedLanguage"p\n\x11SupportedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x16\n\x0esupport_source\x18\x03 \x01(\x08\x12\x16\n\x0esupport_target\x18\x04 \x01(\x08"#\n\tGcsSource\x12\x16\n\tinput_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02"r\n\x0bInputConfig\x12\x16\n\tmime_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x41\n\ngcs_source\x18\x02 \x01(\x0b\x32+.google.cloud.translation.v3beta1.GcsSourceH\x00\x42\x08\n\x06source"0\n\x0eGcsDestination\x12\x1e\n\x11output_uri_prefix\x18\x01 \x01(\tB\x03\xe0\x41\x02"j\n\x0cOutputConfig\x12K\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32\x30.google.cloud.translation.v3beta1.GcsDestinationH\x00\x42\r\n\x0b\x64\x65stination"\xa6\x06\n\x19\x42\x61tchTranslateTextRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12!\n\x14source_language_code\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12"\n\x15target_language_codes\x18\x03 \x03(\tB\x03\xe0\x41\x02\x12\\\n\x06models\x18\x04 \x03(\x0b\x32G.google.cloud.translation.v3beta1.BatchTranslateTextRequest.ModelsEntryB\x03\xe0\x41\x01\x12I\n\rinput_configs\x18\x05 \x03(\x0b\x32-.google.cloud.translation.v3beta1.InputConfigB\x03\xe0\x41\x02\x12J\n\routput_config\x18\x06 \x01(\x0b\x32..google.cloud.translation.v3beta1.OutputConfigB\x03\xe0\x41\x02\x12\x64\n\nglossaries\x18\x07 \x03(\x0b\x32K.google.cloud.translation.v3beta1.BatchTranslateTextRequest.GlossariesEntryB\x03\xe0\x41\x01\x12\\\n\x06labels\x18\t \x03(\x0b\x32G.google.cloud.translation.v3beta1.BatchTranslateTextRequest.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bModelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1ap\n\x0fGlossariesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12L\n\x05value\x18\x02 \x01(\x0b\x32=.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\xd3\x02\n\x16\x42\x61tchTranslateMetadata\x12M\n\x05state\x18\x01 \x01(\x0e\x32>.google.cloud.translation.v3beta1.BatchTranslateMetadata.State\x12\x1d\n\x15translated_characters\x18\x02 \x01(\x03\x12\x19\n\x11\x66\x61iled_characters\x18\x03 \x01(\x03\x12\x18\n\x10total_characters\x18\x04 \x01(\x03\x12/\n\x0bsubmit_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05"\xcb\x01\n\x16\x42\x61tchTranslateResponse\x12\x18\n\x10total_characters\x18\x01 \x01(\x03\x12\x1d\n\x15translated_characters\x18\x02 \x01(\x03\x12\x19\n\x11\x66\x61iled_characters\x18\x03 \x01(\x03\x12/\n\x0bsubmit_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"b\n\x13GlossaryInputConfig\x12\x41\n\ngcs_source\x18\x01 \x01(\x0b\x32+.google.cloud.translation.v3beta1.GcsSourceH\x00\x42\x08\n\x06source"\x8e\x05\n\x08Glossary\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12T\n\rlanguage_pair\x18\x03 \x01(\x0b\x32;.google.cloud.translation.v3beta1.Glossary.LanguageCodePairH\x00\x12Y\n\x12language_codes_set\x18\x04 \x01(\x0b\x32;.google.cloud.translation.v3beta1.Glossary.LanguageCodesSetH\x00\x12K\n\x0cinput_config\x18\x05 \x01(\x0b\x32\x35.google.cloud.translation.v3beta1.GlossaryInputConfig\x12\x18\n\x0b\x65ntry_count\x18\x06 \x01(\x05\x42\x03\xe0\x41\x03\x12\x34\n\x0bsubmit_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1aN\n\x10LanguageCodePair\x12\x1c\n\x14source_language_code\x18\x01 \x01(\t\x12\x1c\n\x14target_language_code\x18\x02 \x01(\t\x1a*\n\x10LanguageCodesSet\x12\x16\n\x0elanguage_codes\x18\x01 \x03(\t:e\xea\x41\x62\n!translate.googleapis.com/Glossary\x12=projects/{project}/locations/{location}/glossaries/{glossary}B\x0b\n\tlanguages"\x95\x01\n\x15\x43reateGlossaryRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x41\n\x08glossary\x18\x02 \x01(\x0b\x32*.google.cloud.translation.v3beta1.GlossaryB\x03\xe0\x41\x02"M\n\x12GetGlossaryRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary"P\n\x15\x44\x65leteGlossaryRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary"\x98\x01\n\x15ListGlossariesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01"q\n\x16ListGlossariesResponse\x12>\n\nglossaries\x18\x01 \x03(\x0b\x32*.google.cloud.translation.v3beta1.Glossary\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\x8d\x02\n\x16\x43reateGlossaryMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\x05state\x18\x02 \x01(\x0e\x32>.google.cloud.translation.v3beta1.CreateGlossaryMetadata.State\x12/\n\x0bsubmit_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05"\x8d\x02\n\x16\x44\x65leteGlossaryMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\x05state\x18\x02 \x01(\x0e\x32>.google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State\x12/\n\x0bsubmit_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05"\x85\x01\n\x16\x44\x65leteGlossaryResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12/\n\x0bsubmit_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\x9a\x10\n\x12TranslationService\x12\xf4\x01\n\rTranslateText\x12\x36.google.cloud.translation.v3beta1.TranslateTextRequest\x1a\x37.google.cloud.translation.v3beta1.TranslateTextResponse"r\x82\xd3\xe4\x93\x02l"6/v3beta1/{parent=projects/*/locations/*}:translateText:\x01*Z/"*/v3beta1/{parent=projects/*}:translateText:\x01*\x12\x93\x02\n\x0e\x44\x65tectLanguage\x12\x37.google.cloud.translation.v3beta1.DetectLanguageRequest\x1a\x38.google.cloud.translation.v3beta1.DetectLanguageResponse"\x8d\x01\x82\xd3\xe4\x93\x02n"7/v3beta1/{parent=projects/*/locations/*}:detectLanguage:\x01*Z0"+/v3beta1/{parent=projects/*}:detectLanguage:\x01*\xda\x41\x16parent,model,mime_type\x12\xab\x02\n\x15GetSupportedLanguages\x12>.google.cloud.translation.v3beta1.GetSupportedLanguagesRequest\x1a\x34.google.cloud.translation.v3beta1.SupportedLanguages"\x9b\x01\x82\xd3\xe4\x93\x02p\x12;/v3beta1/{parent=projects/*/locations/*}/supportedLanguagesZ1\x12//v3beta1/{parent=projects/*}/supportedLanguages\xda\x41"parent,display_language_code,model\x12\xeb\x01\n\x12\x42\x61tchTranslateText\x12;.google.cloud.translation.v3beta1.BatchTranslateTextRequest\x1a\x1d.google.longrunning.Operation"y\x82\xd3\xe4\x93\x02@";/v3beta1/{parent=projects/*/locations/*}:batchTranslateText:\x01*\xca\x41\x30\n\x16\x42\x61tchTranslateResponse\x12\x16\x42\x61tchTranslateMetadata\x12\xe6\x01\n\x0e\x43reateGlossary\x12\x37.google.cloud.translation.v3beta1.CreateGlossaryRequest\x1a\x1d.google.longrunning.Operation"|\x82\xd3\xe4\x93\x02?"3/v3beta1/{parent=projects/*/locations/*}/glossaries:\x08glossary\xda\x41\x0fparent,glossary\xca\x41"\n\x08Glossary\x12\x16\x43reateGlossaryMetadata\x12\xd9\x01\n\x0eListGlossaries\x12\x37.google.cloud.translation.v3beta1.ListGlossariesRequest\x1a\x38.google.cloud.translation.v3beta1.ListGlossariesResponse"T\x82\xd3\xe4\x93\x02\x35\x12\x33/v3beta1/{parent=projects/*/locations/*}/glossaries\xda\x41\x06parent\xda\x41\rparent,filter\x12\xb3\x01\n\x0bGetGlossary\x12\x34.google.cloud.translation.v3beta1.GetGlossaryRequest\x1a*.google.cloud.translation.v3beta1.Glossary"B\x82\xd3\xe4\x93\x02\x35\x12\x33/v3beta1/{name=projects/*/locations/*/glossaries/*}\xda\x41\x04name\x12\xdf\x01\n\x0e\x44\x65leteGlossary\x12\x37.google.cloud.translation.v3beta1.DeleteGlossaryRequest\x1a\x1d.google.longrunning.Operation"u\x82\xd3\xe4\x93\x02\x35*3/v3beta1/{name=projects/*/locations/*/glossaries/*}\xda\x41\x04name\xca\x41\x30\n\x16\x44\x65leteGlossaryResponse\x12\x16\x44\x65leteGlossaryMetadata\x1a~\xca\x41\x18translate.googleapis.com\xd2\x41`https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-translationB\xf1\x01\n"com.google.cloud.translate.v3beta1B\x17TranslationServiceProtoP\x01ZGgoogle.golang.org/genproto/googleapis/cloud/translate/v3beta1;translate\xf8\x01\x01\xaa\x02\x1eGoogle.Cloud.Translate.V3Beta1\xca\x02\x1eGoogle\\Cloud\\Translate\\V3beta1\xea\x02!Google::Cloud::Translate::V3beta1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_BATCHTRANSLATEMETADATA_STATE = _descriptor.EnumDescriptor( - name="State", - full_name="google.cloud.translation.v3beta1.BatchTranslateMetadata.State", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RUNNING", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SUCCEEDED", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FAILED", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLING", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLED", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3331, - serialized_end=3432, -) -_sym_db.RegisterEnumDescriptor(_BATCHTRANSLATEMETADATA_STATE) - -_CREATEGLOSSARYMETADATA_STATE = _descriptor.EnumDescriptor( - name="State", - full_name="google.cloud.translation.v3beta1.CreateGlossaryMetadata.State", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RUNNING", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SUCCEEDED", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FAILED", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLING", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLED", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3331, - serialized_end=3432, -) -_sym_db.RegisterEnumDescriptor(_CREATEGLOSSARYMETADATA_STATE) - -_DELETEGLOSSARYMETADATA_STATE = _descriptor.EnumDescriptor( - name="State", - full_name="google.cloud.translation.v3beta1.DeleteGlossaryMetadata.State", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RUNNING", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SUCCEEDED", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FAILED", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLING", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLED", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3331, - serialized_end=3432, -) -_sym_db.RegisterEnumDescriptor(_DELETEGLOSSARYMETADATA_STATE) - - -_TRANSLATETEXTGLOSSARYCONFIG = _descriptor.Descriptor( - name="TranslateTextGlossaryConfig", - full_name="google.cloud.translation.v3beta1.TranslateTextGlossaryConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="glossary", - full_name="google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.glossary", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ignore_case", - full_name="google.cloud.translation.v3beta1.TranslateTextGlossaryConfig.ignore_case", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=287, - serialized_end=365, -) - - -_TRANSLATETEXTREQUEST_LABELSENTRY = _descriptor.Descriptor( - name="LabelsEntry", - full_name="google.cloud.translation.v3beta1.TranslateTextRequest.LabelsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.translation.v3beta1.TranslateTextRequest.LabelsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.translation.v3beta1.TranslateTextRequest.LabelsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=770, - serialized_end=815, -) - -_TRANSLATETEXTREQUEST = _descriptor.Descriptor( - name="TranslateTextRequest", - full_name="google.cloud.translation.v3beta1.TranslateTextRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="contents", - full_name="google.cloud.translation.v3beta1.TranslateTextRequest.contents", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.translation.v3beta1.TranslateTextRequest.mime_type", - index=1, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="source_language_code", - full_name="google.cloud.translation.v3beta1.TranslateTextRequest.source_language_code", - index=2, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="target_language_code", - full_name="google.cloud.translation.v3beta1.TranslateTextRequest.target_language_code", - index=3, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.translation.v3beta1.TranslateTextRequest.parent", - index=4, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.translation.v3beta1.TranslateTextRequest.model", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="glossary_config", - full_name="google.cloud.translation.v3beta1.TranslateTextRequest.glossary_config", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="labels", - full_name="google.cloud.translation.v3beta1.TranslateTextRequest.labels", - index=7, - number=10, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_TRANSLATETEXTREQUEST_LABELSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=368, - serialized_end=815, -) - - -_TRANSLATETEXTRESPONSE = _descriptor.Descriptor( - name="TranslateTextResponse", - full_name="google.cloud.translation.v3beta1.TranslateTextResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="translations", - full_name="google.cloud.translation.v3beta1.TranslateTextResponse.translations", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="glossary_translations", - full_name="google.cloud.translation.v3beta1.TranslateTextResponse.glossary_translations", - index=1, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=818, - serialized_end=988, -) - - -_TRANSLATION = _descriptor.Descriptor( - name="Translation", - full_name="google.cloud.translation.v3beta1.Translation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="translated_text", - full_name="google.cloud.translation.v3beta1.Translation.translated_text", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.translation.v3beta1.Translation.model", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detected_language_code", - full_name="google.cloud.translation.v3beta1.Translation.detected_language_code", - index=2, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="glossary_config", - full_name="google.cloud.translation.v3beta1.Translation.glossary_config", - index=3, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=991, - serialized_end=1164, -) - - -_DETECTLANGUAGEREQUEST_LABELSENTRY = _descriptor.Descriptor( - name="LabelsEntry", - full_name="google.cloud.translation.v3beta1.DetectLanguageRequest.LabelsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.translation.v3beta1.DetectLanguageRequest.LabelsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.translation.v3beta1.DetectLanguageRequest.LabelsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=770, - serialized_end=815, -) - -_DETECTLANGUAGEREQUEST = _descriptor.Descriptor( - name="DetectLanguageRequest", - full_name="google.cloud.translation.v3beta1.DetectLanguageRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.translation.v3beta1.DetectLanguageRequest.parent", - index=0, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.translation.v3beta1.DetectLanguageRequest.model", - index=1, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="content", - full_name="google.cloud.translation.v3beta1.DetectLanguageRequest.content", - index=2, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.translation.v3beta1.DetectLanguageRequest.mime_type", - index=3, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="labels", - full_name="google.cloud.translation.v3beta1.DetectLanguageRequest.labels", - index=4, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_DETECTLANGUAGEREQUEST_LABELSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="source", - full_name="google.cloud.translation.v3beta1.DetectLanguageRequest.source", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1167, - serialized_end=1454, -) - - -_DETECTEDLANGUAGE = _descriptor.Descriptor( - name="DetectedLanguage", - full_name="google.cloud.translation.v3beta1.DetectedLanguage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.translation.v3beta1.DetectedLanguage.language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.translation.v3beta1.DetectedLanguage.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1456, - serialized_end=1517, -) - - -_DETECTLANGUAGERESPONSE = _descriptor.Descriptor( - name="DetectLanguageResponse", - full_name="google.cloud.translation.v3beta1.DetectLanguageResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="languages", - full_name="google.cloud.translation.v3beta1.DetectLanguageResponse.languages", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1519, - serialized_end=1614, -) - - -_GETSUPPORTEDLANGUAGESREQUEST = _descriptor.Descriptor( - name="GetSupportedLanguagesRequest", - full_name="google.cloud.translation.v3beta1.GetSupportedLanguagesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.translation.v3beta1.GetSupportedLanguagesRequest.parent", - index=0, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_language_code", - full_name="google.cloud.translation.v3beta1.GetSupportedLanguagesRequest.display_language_code", - index=1, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.translation.v3beta1.GetSupportedLanguagesRequest.model", - index=2, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1617, - serialized_end=1762, -) - - -_SUPPORTEDLANGUAGES = _descriptor.Descriptor( - name="SupportedLanguages", - full_name="google.cloud.translation.v3beta1.SupportedLanguages", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="languages", - full_name="google.cloud.translation.v3beta1.SupportedLanguages.languages", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1764, - serialized_end=1856, -) - - -_SUPPORTEDLANGUAGE = _descriptor.Descriptor( - name="SupportedLanguage", - full_name="google.cloud.translation.v3beta1.SupportedLanguage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.translation.v3beta1.SupportedLanguage.language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.translation.v3beta1.SupportedLanguage.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="support_source", - full_name="google.cloud.translation.v3beta1.SupportedLanguage.support_source", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="support_target", - full_name="google.cloud.translation.v3beta1.SupportedLanguage.support_target", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1858, - serialized_end=1970, -) - - -_GCSSOURCE = _descriptor.Descriptor( - name="GcsSource", - full_name="google.cloud.translation.v3beta1.GcsSource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.translation.v3beta1.GcsSource.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1972, - serialized_end=2007, -) - - -_INPUTCONFIG = _descriptor.Descriptor( - name="InputConfig", - full_name="google.cloud.translation.v3beta1.InputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.translation.v3beta1.InputConfig.mime_type", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="gcs_source", - full_name="google.cloud.translation.v3beta1.InputConfig.gcs_source", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="source", - full_name="google.cloud.translation.v3beta1.InputConfig.source", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=2009, - serialized_end=2123, -) - - -_GCSDESTINATION = _descriptor.Descriptor( - name="GcsDestination", - full_name="google.cloud.translation.v3beta1.GcsDestination", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="output_uri_prefix", - full_name="google.cloud.translation.v3beta1.GcsDestination.output_uri_prefix", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2125, - serialized_end=2173, -) - - -_OUTPUTCONFIG = _descriptor.Descriptor( - name="OutputConfig", - full_name="google.cloud.translation.v3beta1.OutputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_destination", - full_name="google.cloud.translation.v3beta1.OutputConfig.gcs_destination", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="destination", - full_name="google.cloud.translation.v3beta1.OutputConfig.destination", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=2175, - serialized_end=2281, -) - - -_BATCHTRANSLATETEXTREQUEST_MODELSENTRY = _descriptor.Descriptor( - name="ModelsEntry", - full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.ModelsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.ModelsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.ModelsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2884, - serialized_end=2929, -) - -_BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY = _descriptor.Descriptor( - name="GlossariesEntry", - full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.GlossariesEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.GlossariesEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.GlossariesEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2931, - serialized_end=3043, -) - -_BATCHTRANSLATETEXTREQUEST_LABELSENTRY = _descriptor.Descriptor( - name="LabelsEntry", - full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.LabelsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.LabelsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.LabelsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=770, - serialized_end=815, -) - -_BATCHTRANSLATETEXTREQUEST = _descriptor.Descriptor( - name="BatchTranslateTextRequest", - full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="source_language_code", - full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.source_language_code", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="target_language_codes", - full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.target_language_codes", - index=2, - number=3, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="models", - full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.models", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="input_configs", - full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.input_configs", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="output_config", - full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.output_config", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="glossaries", - full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.glossaries", - index=6, - number=7, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="labels", - full_name="google.cloud.translation.v3beta1.BatchTranslateTextRequest.labels", - index=7, - number=9, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[ - _BATCHTRANSLATETEXTREQUEST_MODELSENTRY, - _BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY, - _BATCHTRANSLATETEXTREQUEST_LABELSENTRY, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2284, - serialized_end=3090, -) - - -_BATCHTRANSLATEMETADATA = _descriptor.Descriptor( - name="BatchTranslateMetadata", - full_name="google.cloud.translation.v3beta1.BatchTranslateMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="state", - full_name="google.cloud.translation.v3beta1.BatchTranslateMetadata.state", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="translated_characters", - full_name="google.cloud.translation.v3beta1.BatchTranslateMetadata.translated_characters", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="failed_characters", - full_name="google.cloud.translation.v3beta1.BatchTranslateMetadata.failed_characters", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="total_characters", - full_name="google.cloud.translation.v3beta1.BatchTranslateMetadata.total_characters", - index=3, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="submit_time", - full_name="google.cloud.translation.v3beta1.BatchTranslateMetadata.submit_time", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_BATCHTRANSLATEMETADATA_STATE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3093, - serialized_end=3432, -) - - -_BATCHTRANSLATERESPONSE = _descriptor.Descriptor( - name="BatchTranslateResponse", - full_name="google.cloud.translation.v3beta1.BatchTranslateResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="total_characters", - full_name="google.cloud.translation.v3beta1.BatchTranslateResponse.total_characters", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="translated_characters", - full_name="google.cloud.translation.v3beta1.BatchTranslateResponse.translated_characters", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="failed_characters", - full_name="google.cloud.translation.v3beta1.BatchTranslateResponse.failed_characters", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="submit_time", - full_name="google.cloud.translation.v3beta1.BatchTranslateResponse.submit_time", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.cloud.translation.v3beta1.BatchTranslateResponse.end_time", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3435, - serialized_end=3638, -) - - -_GLOSSARYINPUTCONFIG = _descriptor.Descriptor( - name="GlossaryInputConfig", - full_name="google.cloud.translation.v3beta1.GlossaryInputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_source", - full_name="google.cloud.translation.v3beta1.GlossaryInputConfig.gcs_source", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="source", - full_name="google.cloud.translation.v3beta1.GlossaryInputConfig.source", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=3640, - serialized_end=3738, -) - - -_GLOSSARY_LANGUAGECODEPAIR = _descriptor.Descriptor( - name="LanguageCodePair", - full_name="google.cloud.translation.v3beta1.Glossary.LanguageCodePair", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="source_language_code", - full_name="google.cloud.translation.v3beta1.Glossary.LanguageCodePair.source_language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="target_language_code", - full_name="google.cloud.translation.v3beta1.Glossary.LanguageCodePair.target_language_code", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4157, - serialized_end=4235, -) - -_GLOSSARY_LANGUAGECODESSET = _descriptor.Descriptor( - name="LanguageCodesSet", - full_name="google.cloud.translation.v3beta1.Glossary.LanguageCodesSet", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_codes", - full_name="google.cloud.translation.v3beta1.Glossary.LanguageCodesSet.language_codes", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4237, - serialized_end=4279, -) - -_GLOSSARY = _descriptor.Descriptor( - name="Glossary", - full_name="google.cloud.translation.v3beta1.Glossary", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.translation.v3beta1.Glossary.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_pair", - full_name="google.cloud.translation.v3beta1.Glossary.language_pair", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_codes_set", - full_name="google.cloud.translation.v3beta1.Glossary.language_codes_set", - index=2, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="input_config", - full_name="google.cloud.translation.v3beta1.Glossary.input_config", - index=3, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="entry_count", - full_name="google.cloud.translation.v3beta1.Glossary.entry_count", - index=4, - number=6, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="submit_time", - full_name="google.cloud.translation.v3beta1.Glossary.submit_time", - index=5, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.cloud.translation.v3beta1.Glossary.end_time", - index=6, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_GLOSSARY_LANGUAGECODEPAIR, _GLOSSARY_LANGUAGECODESSET], - enum_types=[], - serialized_options=_b( - "\352Ab\n!translate.googleapis.com/Glossary\022=projects/{project}/locations/{location}/glossaries/{glossary}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="languages", - full_name="google.cloud.translation.v3beta1.Glossary.languages", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=3741, - serialized_end=4395, -) - - -_CREATEGLOSSARYREQUEST = _descriptor.Descriptor( - name="CreateGlossaryRequest", - full_name="google.cloud.translation.v3beta1.CreateGlossaryRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.translation.v3beta1.CreateGlossaryRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="glossary", - full_name="google.cloud.translation.v3beta1.CreateGlossaryRequest.glossary", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4398, - serialized_end=4547, -) - - -_GETGLOSSARYREQUEST = _descriptor.Descriptor( - name="GetGlossaryRequest", - full_name="google.cloud.translation.v3beta1.GetGlossaryRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.translation.v3beta1.GetGlossaryRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!translate.googleapis.com/Glossary" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4549, - serialized_end=4626, -) - - -_DELETEGLOSSARYREQUEST = _descriptor.Descriptor( - name="DeleteGlossaryRequest", - full_name="google.cloud.translation.v3beta1.DeleteGlossaryRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.translation.v3beta1.DeleteGlossaryRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!translate.googleapis.com/Glossary" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4628, - serialized_end=4708, -) - - -_LISTGLOSSARIESREQUEST = _descriptor.Descriptor( - name="ListGlossariesRequest", - full_name="google.cloud.translation.v3beta1.ListGlossariesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.translation.v3beta1.ListGlossariesRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.translation.v3beta1.ListGlossariesRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.translation.v3beta1.ListGlossariesRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.translation.v3beta1.ListGlossariesRequest.filter", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4711, - serialized_end=4863, -) - - -_LISTGLOSSARIESRESPONSE = _descriptor.Descriptor( - name="ListGlossariesResponse", - full_name="google.cloud.translation.v3beta1.ListGlossariesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="glossaries", - full_name="google.cloud.translation.v3beta1.ListGlossariesResponse.glossaries", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.translation.v3beta1.ListGlossariesResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4865, - serialized_end=4978, -) - - -_CREATEGLOSSARYMETADATA = _descriptor.Descriptor( - name="CreateGlossaryMetadata", - full_name="google.cloud.translation.v3beta1.CreateGlossaryMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.translation.v3beta1.CreateGlossaryMetadata.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="state", - full_name="google.cloud.translation.v3beta1.CreateGlossaryMetadata.state", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="submit_time", - full_name="google.cloud.translation.v3beta1.CreateGlossaryMetadata.submit_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_CREATEGLOSSARYMETADATA_STATE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4981, - serialized_end=5250, -) - - -_DELETEGLOSSARYMETADATA = _descriptor.Descriptor( - name="DeleteGlossaryMetadata", - full_name="google.cloud.translation.v3beta1.DeleteGlossaryMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.translation.v3beta1.DeleteGlossaryMetadata.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="state", - full_name="google.cloud.translation.v3beta1.DeleteGlossaryMetadata.state", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="submit_time", - full_name="google.cloud.translation.v3beta1.DeleteGlossaryMetadata.submit_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_DELETEGLOSSARYMETADATA_STATE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5253, - serialized_end=5522, -) - - -_DELETEGLOSSARYRESPONSE = _descriptor.Descriptor( - name="DeleteGlossaryResponse", - full_name="google.cloud.translation.v3beta1.DeleteGlossaryResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.translation.v3beta1.DeleteGlossaryResponse.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="submit_time", - full_name="google.cloud.translation.v3beta1.DeleteGlossaryResponse.submit_time", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.cloud.translation.v3beta1.DeleteGlossaryResponse.end_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5525, - serialized_end=5658, -) - -_TRANSLATETEXTREQUEST_LABELSENTRY.containing_type = _TRANSLATETEXTREQUEST -_TRANSLATETEXTREQUEST.fields_by_name[ - "glossary_config" -].message_type = _TRANSLATETEXTGLOSSARYCONFIG -_TRANSLATETEXTREQUEST.fields_by_name[ - "labels" -].message_type = _TRANSLATETEXTREQUEST_LABELSENTRY -_TRANSLATETEXTRESPONSE.fields_by_name["translations"].message_type = _TRANSLATION -_TRANSLATETEXTRESPONSE.fields_by_name[ - "glossary_translations" -].message_type = _TRANSLATION -_TRANSLATION.fields_by_name[ - "glossary_config" -].message_type = _TRANSLATETEXTGLOSSARYCONFIG -_DETECTLANGUAGEREQUEST_LABELSENTRY.containing_type = _DETECTLANGUAGEREQUEST -_DETECTLANGUAGEREQUEST.fields_by_name[ - "labels" -].message_type = _DETECTLANGUAGEREQUEST_LABELSENTRY -_DETECTLANGUAGEREQUEST.oneofs_by_name["source"].fields.append( - _DETECTLANGUAGEREQUEST.fields_by_name["content"] -) -_DETECTLANGUAGEREQUEST.fields_by_name[ - "content" -].containing_oneof = _DETECTLANGUAGEREQUEST.oneofs_by_name["source"] -_DETECTLANGUAGERESPONSE.fields_by_name["languages"].message_type = _DETECTEDLANGUAGE -_SUPPORTEDLANGUAGES.fields_by_name["languages"].message_type = _SUPPORTEDLANGUAGE -_INPUTCONFIG.fields_by_name["gcs_source"].message_type = _GCSSOURCE -_INPUTCONFIG.oneofs_by_name["source"].fields.append( - _INPUTCONFIG.fields_by_name["gcs_source"] -) -_INPUTCONFIG.fields_by_name[ - "gcs_source" -].containing_oneof = _INPUTCONFIG.oneofs_by_name["source"] -_OUTPUTCONFIG.fields_by_name["gcs_destination"].message_type = _GCSDESTINATION -_OUTPUTCONFIG.oneofs_by_name["destination"].fields.append( - _OUTPUTCONFIG.fields_by_name["gcs_destination"] -) -_OUTPUTCONFIG.fields_by_name[ - "gcs_destination" -].containing_oneof = _OUTPUTCONFIG.oneofs_by_name["destination"] -_BATCHTRANSLATETEXTREQUEST_MODELSENTRY.containing_type = _BATCHTRANSLATETEXTREQUEST -_BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY.fields_by_name[ - "value" -].message_type = _TRANSLATETEXTGLOSSARYCONFIG -_BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY.containing_type = _BATCHTRANSLATETEXTREQUEST -_BATCHTRANSLATETEXTREQUEST_LABELSENTRY.containing_type = _BATCHTRANSLATETEXTREQUEST -_BATCHTRANSLATETEXTREQUEST.fields_by_name[ - "models" -].message_type = _BATCHTRANSLATETEXTREQUEST_MODELSENTRY -_BATCHTRANSLATETEXTREQUEST.fields_by_name["input_configs"].message_type = _INPUTCONFIG -_BATCHTRANSLATETEXTREQUEST.fields_by_name["output_config"].message_type = _OUTPUTCONFIG -_BATCHTRANSLATETEXTREQUEST.fields_by_name[ - "glossaries" -].message_type = _BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY -_BATCHTRANSLATETEXTREQUEST.fields_by_name[ - "labels" -].message_type = _BATCHTRANSLATETEXTREQUEST_LABELSENTRY -_BATCHTRANSLATEMETADATA.fields_by_name[ - "state" -].enum_type = _BATCHTRANSLATEMETADATA_STATE -_BATCHTRANSLATEMETADATA.fields_by_name[ - "submit_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_BATCHTRANSLATEMETADATA_STATE.containing_type = _BATCHTRANSLATEMETADATA -_BATCHTRANSLATERESPONSE.fields_by_name[ - "submit_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_BATCHTRANSLATERESPONSE.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_GLOSSARYINPUTCONFIG.fields_by_name["gcs_source"].message_type = _GCSSOURCE -_GLOSSARYINPUTCONFIG.oneofs_by_name["source"].fields.append( - _GLOSSARYINPUTCONFIG.fields_by_name["gcs_source"] -) -_GLOSSARYINPUTCONFIG.fields_by_name[ - "gcs_source" -].containing_oneof = _GLOSSARYINPUTCONFIG.oneofs_by_name["source"] -_GLOSSARY_LANGUAGECODEPAIR.containing_type = _GLOSSARY -_GLOSSARY_LANGUAGECODESSET.containing_type = _GLOSSARY -_GLOSSARY.fields_by_name["language_pair"].message_type = _GLOSSARY_LANGUAGECODEPAIR -_GLOSSARY.fields_by_name["language_codes_set"].message_type = _GLOSSARY_LANGUAGECODESSET -_GLOSSARY.fields_by_name["input_config"].message_type = _GLOSSARYINPUTCONFIG -_GLOSSARY.fields_by_name[ - "submit_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_GLOSSARY.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_GLOSSARY.oneofs_by_name["languages"].fields.append( - _GLOSSARY.fields_by_name["language_pair"] -) -_GLOSSARY.fields_by_name["language_pair"].containing_oneof = _GLOSSARY.oneofs_by_name[ - "languages" -] -_GLOSSARY.oneofs_by_name["languages"].fields.append( - _GLOSSARY.fields_by_name["language_codes_set"] -) -_GLOSSARY.fields_by_name[ - "language_codes_set" -].containing_oneof = _GLOSSARY.oneofs_by_name["languages"] -_CREATEGLOSSARYREQUEST.fields_by_name["glossary"].message_type = _GLOSSARY -_LISTGLOSSARIESRESPONSE.fields_by_name["glossaries"].message_type = _GLOSSARY -_CREATEGLOSSARYMETADATA.fields_by_name[ - "state" -].enum_type = _CREATEGLOSSARYMETADATA_STATE -_CREATEGLOSSARYMETADATA.fields_by_name[ - "submit_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_CREATEGLOSSARYMETADATA_STATE.containing_type = _CREATEGLOSSARYMETADATA -_DELETEGLOSSARYMETADATA.fields_by_name[ - "state" -].enum_type = _DELETEGLOSSARYMETADATA_STATE -_DELETEGLOSSARYMETADATA.fields_by_name[ - "submit_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_DELETEGLOSSARYMETADATA_STATE.containing_type = _DELETEGLOSSARYMETADATA -_DELETEGLOSSARYRESPONSE.fields_by_name[ - "submit_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_DELETEGLOSSARYRESPONSE.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -DESCRIPTOR.message_types_by_name[ - "TranslateTextGlossaryConfig" -] = _TRANSLATETEXTGLOSSARYCONFIG -DESCRIPTOR.message_types_by_name["TranslateTextRequest"] = _TRANSLATETEXTREQUEST -DESCRIPTOR.message_types_by_name["TranslateTextResponse"] = _TRANSLATETEXTRESPONSE -DESCRIPTOR.message_types_by_name["Translation"] = _TRANSLATION -DESCRIPTOR.message_types_by_name["DetectLanguageRequest"] = _DETECTLANGUAGEREQUEST -DESCRIPTOR.message_types_by_name["DetectedLanguage"] = _DETECTEDLANGUAGE -DESCRIPTOR.message_types_by_name["DetectLanguageResponse"] = _DETECTLANGUAGERESPONSE -DESCRIPTOR.message_types_by_name[ - "GetSupportedLanguagesRequest" -] = _GETSUPPORTEDLANGUAGESREQUEST -DESCRIPTOR.message_types_by_name["SupportedLanguages"] = _SUPPORTEDLANGUAGES -DESCRIPTOR.message_types_by_name["SupportedLanguage"] = _SUPPORTEDLANGUAGE -DESCRIPTOR.message_types_by_name["GcsSource"] = _GCSSOURCE -DESCRIPTOR.message_types_by_name["InputConfig"] = _INPUTCONFIG -DESCRIPTOR.message_types_by_name["GcsDestination"] = _GCSDESTINATION -DESCRIPTOR.message_types_by_name["OutputConfig"] = _OUTPUTCONFIG -DESCRIPTOR.message_types_by_name[ - "BatchTranslateTextRequest" -] = _BATCHTRANSLATETEXTREQUEST -DESCRIPTOR.message_types_by_name["BatchTranslateMetadata"] = _BATCHTRANSLATEMETADATA -DESCRIPTOR.message_types_by_name["BatchTranslateResponse"] = _BATCHTRANSLATERESPONSE -DESCRIPTOR.message_types_by_name["GlossaryInputConfig"] = _GLOSSARYINPUTCONFIG -DESCRIPTOR.message_types_by_name["Glossary"] = _GLOSSARY -DESCRIPTOR.message_types_by_name["CreateGlossaryRequest"] = _CREATEGLOSSARYREQUEST -DESCRIPTOR.message_types_by_name["GetGlossaryRequest"] = _GETGLOSSARYREQUEST -DESCRIPTOR.message_types_by_name["DeleteGlossaryRequest"] = _DELETEGLOSSARYREQUEST -DESCRIPTOR.message_types_by_name["ListGlossariesRequest"] = _LISTGLOSSARIESREQUEST -DESCRIPTOR.message_types_by_name["ListGlossariesResponse"] = _LISTGLOSSARIESRESPONSE -DESCRIPTOR.message_types_by_name["CreateGlossaryMetadata"] = _CREATEGLOSSARYMETADATA -DESCRIPTOR.message_types_by_name["DeleteGlossaryMetadata"] = _DELETEGLOSSARYMETADATA -DESCRIPTOR.message_types_by_name["DeleteGlossaryResponse"] = _DELETEGLOSSARYRESPONSE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -TranslateTextGlossaryConfig = _reflection.GeneratedProtocolMessageType( - "TranslateTextGlossaryConfig", - (_message.Message,), - dict( - DESCRIPTOR=_TRANSLATETEXTGLOSSARYCONFIG, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Configures which glossary should be used for a specific - target language, and defines options for applying that glossary. - - - Attributes: - glossary: - Required. Specifies the glossary used for this translation. - Use this format: projects/\ */locations/*/glossaries/\* - ignore_case: - Optional. Indicates match is case-insensitive. Default value - is false if missing. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.TranslateTextGlossaryConfig) - ), -) -_sym_db.RegisterMessage(TranslateTextGlossaryConfig) - -TranslateTextRequest = _reflection.GeneratedProtocolMessageType( - "TranslateTextRequest", - (_message.Message,), - dict( - LabelsEntry=_reflection.GeneratedProtocolMessageType( - "LabelsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_TRANSLATETEXTREQUEST_LABELSENTRY, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.TranslateTextRequest.LabelsEntry) - ), - ), - DESCRIPTOR=_TRANSLATETEXTREQUEST, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""The request message for synchronous translation. - - - Attributes: - contents: - Required. The content of the input in string format. We - recommend the total content be less than 30k codepoints. Use - BatchTranslateText for larger text. - mime_type: - Optional. The format of the source text, for example, - "text/html", "text/plain". If left blank, the MIME type - defaults to "text/html". - source_language_code: - Optional. The BCP-47 language code of the input text if known, - for example, "en-US" or "sr-Latn". Supported language codes - are listed in Language Support. If the source language isn't - specified, the API attempts to identify the source language - automatically and returns the source language within the - response. - target_language_code: - Required. The BCP-47 language code to use for translation of - the input text, set to one of the language codes listed in - Language Support. - parent: - Required. Project or location to make a call. Must refer to a - caller's project. Format: ``projects/{project-id}`` or - ``projects/{project-id}/locations/{location-id}``. For global - calls, use ``projects/{project-id}/locations/global`` or - ``projects/{project-id}``. Non-global location is required - for requests using AutoML models or custom glossaries. Models - and glossaries must be within the same region (have same - location-id), otherwise an INVALID\_ARGUMENT (400) error is - returned. - model: - Optional. The ``model`` type requested for this translation. - The format depends on model type: - AutoML Translation - models: ``projects/{project-id}/locations/{location- - id}/models/{model-id}`` - General (built-in) models: - ``projects/{project-id}/locations/{location- - id}/models/general/nmt``, ``projects/{project- - id}/locations/{location-id}/models/general/base`` For global - (non-regionalized) requests, use ``location-id`` ``global``. - For example, ``projects/{project- - id}/locations/global/models/general/nmt``. If missing, the - system decides which google base model to use. - glossary_config: - Optional. Glossary to be applied. The glossary must be within - the same region (have the same location-id) as the model, - otherwise an INVALID\_ARGUMENT (400) error is returned. - labels: - Optional. The labels with user-defined metadata for the - request. Label keys and values can be no longer than 63 - 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://cloud.google.com/translate/docs/labels for more - information. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.TranslateTextRequest) - ), -) -_sym_db.RegisterMessage(TranslateTextRequest) -_sym_db.RegisterMessage(TranslateTextRequest.LabelsEntry) - -TranslateTextResponse = _reflection.GeneratedProtocolMessageType( - "TranslateTextResponse", - (_message.Message,), - dict( - DESCRIPTOR=_TRANSLATETEXTRESPONSE, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__=""" - Attributes: - translations: - Text translation responses with no glossary applied. This - field has the same length as [``contents``][google.cloud.trans - lation.v3beta1.TranslateTextRequest.contents]. - glossary_translations: - Text translation responses if a glossary is provided in the - request. This can be the same as [``translations``][google.clo - ud.translation.v3beta1.TranslateTextResponse.translations] if - no terms apply. This field has the same length as [``contents``][google.cloud.translation.v3beta1.TranslateTextRequest.contents]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.TranslateTextResponse) - ), -) -_sym_db.RegisterMessage(TranslateTextResponse) - -Translation = _reflection.GeneratedProtocolMessageType( - "Translation", - (_message.Message,), - dict( - DESCRIPTOR=_TRANSLATION, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""A single translation response. - - - Attributes: - translated_text: - Text translated into the target language. - model: - Only present when ``model`` is present in the request. This is - same as ``model`` provided in the request. - detected_language_code: - The BCP-47 language code of source text in the initial - request, detected automatically, if no source language was - passed within the initial request. If the source language was - passed, auto-detection of the language does not occur and this - field is empty. - glossary_config: - The ``glossary_config`` used for this translation. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.Translation) - ), -) -_sym_db.RegisterMessage(Translation) - -DetectLanguageRequest = _reflection.GeneratedProtocolMessageType( - "DetectLanguageRequest", - (_message.Message,), - dict( - LabelsEntry=_reflection.GeneratedProtocolMessageType( - "LabelsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_DETECTLANGUAGEREQUEST_LABELSENTRY, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.DetectLanguageRequest.LabelsEntry) - ), - ), - DESCRIPTOR=_DETECTLANGUAGEREQUEST, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""The request message for language detection. - - - Attributes: - parent: - Required. Project or location to make a call. Must refer to a - caller's project. Format: ``projects/{project- - id}/locations/{location-id}`` or ``projects/{project-id}``. - For global calls, use ``projects/{project- - id}/locations/global`` or ``projects/{project-id}``. Only - models within the same region (has same location-id) can be - used. Otherwise an INVALID\_ARGUMENT (400) error is returned. - model: - Optional. The language detection model to be used. Format: - ``projects/{project-id}/locations/{location- - id}/models/language-detection/{model-id}`` Only one language - detection model is currently supported: ``projects/{project- - id}/locations/{location-id}/models/language- - detection/default``. If not specified, the default model is - used. - source: - Required. The source of the document from which to detect the - language. - content: - The content of the input stored as a string. - mime_type: - Optional. The format of the source text, for example, - "text/html", "text/plain". If left blank, the MIME type - defaults to "text/html". - labels: - Optional. The labels with user-defined metadata for the - request. Label keys and values can be no longer than 63 - 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://cloud.google.com/translate/docs/labels for more - information. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.DetectLanguageRequest) - ), -) -_sym_db.RegisterMessage(DetectLanguageRequest) -_sym_db.RegisterMessage(DetectLanguageRequest.LabelsEntry) - -DetectedLanguage = _reflection.GeneratedProtocolMessageType( - "DetectedLanguage", - (_message.Message,), - dict( - DESCRIPTOR=_DETECTEDLANGUAGE, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""The response message for language detection. - - - Attributes: - language_code: - The BCP-47 language code of source content in the request, - detected automatically. - confidence: - The confidence of the detection result for this language. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.DetectedLanguage) - ), -) -_sym_db.RegisterMessage(DetectedLanguage) - -DetectLanguageResponse = _reflection.GeneratedProtocolMessageType( - "DetectLanguageResponse", - (_message.Message,), - dict( - DESCRIPTOR=_DETECTLANGUAGERESPONSE, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""The response message for language detection. - - - Attributes: - languages: - A list of detected languages sorted by detection confidence in - descending order. The most probable language first. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.DetectLanguageResponse) - ), -) -_sym_db.RegisterMessage(DetectLanguageResponse) - -GetSupportedLanguagesRequest = _reflection.GeneratedProtocolMessageType( - "GetSupportedLanguagesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETSUPPORTEDLANGUAGESREQUEST, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""The request message for discovering supported languages. - - - Attributes: - parent: - Required. Project or location to make a call. Must refer to a - caller's project. Format: ``projects/{project-id}`` or - ``projects/{project-id}/locations/{location-id}``. For global - calls, use ``projects/{project-id}/locations/global`` or - ``projects/{project-id}``. Non-global location is required - for AutoML models. Only models within the same region (have - same location-id) can be used, otherwise an INVALID\_ARGUMENT - (400) error is returned. - display_language_code: - Optional. The language to use to return localized, human - readable names of supported languages. If missing, then - display names are not returned in a response. - model: - Optional. Get supported languages of this model. The format - depends on model type: - AutoML Translation models: - ``projects/{project-id}/locations/{location-id}/models/{model- - id}`` - General (built-in) models: ``projects/{project- - id}/locations/{location-id}/models/general/nmt``, - ``projects/{project-id}/locations/{location- - id}/models/general/base`` Returns languages supported by the - specified model. If missing, we get supported languages of - Google general base (PBMT) model. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.GetSupportedLanguagesRequest) - ), -) -_sym_db.RegisterMessage(GetSupportedLanguagesRequest) - -SupportedLanguages = _reflection.GeneratedProtocolMessageType( - "SupportedLanguages", - (_message.Message,), - dict( - DESCRIPTOR=_SUPPORTEDLANGUAGES, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""The response message for discovering supported languages. - - - Attributes: - languages: - A list of supported language responses. This list contains an - entry for each language the Translation API supports. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.SupportedLanguages) - ), -) -_sym_db.RegisterMessage(SupportedLanguages) - -SupportedLanguage = _reflection.GeneratedProtocolMessageType( - "SupportedLanguage", - (_message.Message,), - dict( - DESCRIPTOR=_SUPPORTEDLANGUAGE, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""A single supported language response corresponds to - information related to one supported language. - - - Attributes: - language_code: - Supported language code, generally consisting of its ISO 639-1 - identifier, for example, 'en', 'ja'. In certain cases, BCP-47 - codes including language and region identifiers are returned - (for example, 'zh-TW' and 'zh-CN') - display_name: - Human readable name of the language localized in the display - language specified in the request. - support_source: - Can be used as source language. - support_target: - Can be used as target language. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.SupportedLanguage) - ), -) -_sym_db.RegisterMessage(SupportedLanguage) - -GcsSource = _reflection.GeneratedProtocolMessageType( - "GcsSource", - (_message.Message,), - dict( - DESCRIPTOR=_GCSSOURCE, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""The Google Cloud Storage location for the input content. - - - Attributes: - input_uri: - Required. Source data URI. For example, - ``gs://my_bucket/my_object``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.GcsSource) - ), -) -_sym_db.RegisterMessage(GcsSource) - -InputConfig = _reflection.GeneratedProtocolMessageType( - "InputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_INPUTCONFIG, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Input configuration for BatchTranslateText request. - - - Attributes: - mime_type: - Optional. Can be "text/plain" or "text/html". For ``.tsv``, - "text/html" is used if mime\_type is missing. For ``.html``, - this field must be "text/html" or empty. For ``.txt``, this - field must be "text/plain" or empty. - source: - Required. Specify the input. - gcs_source: - Required. Google Cloud Storage location for the source input. - This can be a single file (for example, ``gs://translation- - test/input.tsv``) or a wildcard (for example, - ``gs://translation-test/*``). If a file extension is ``.tsv``, - it can contain either one or two columns. The first column - (optional) is the id of the text request. If the first column - is missing, we use the row number (0-based) from the input - file as the ID in the output file. The second column is the - actual text to be translated. We recommend each row be <= 10K - Unicode codepoints, otherwise an error might be returned. Note - that the input tsv must be RFC 4180 compliant. You could use - https://github.com/Clever/csvlint to check potential - formatting errors in your tsv file. csvlint --delimiter=':raw- - latex:`\t`' your\_input\_file.tsv The other supported file - extensions are ``.txt`` or ``.html``, which is treated as a - single large chunk of text. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.InputConfig) - ), -) -_sym_db.RegisterMessage(InputConfig) - -GcsDestination = _reflection.GeneratedProtocolMessageType( - "GcsDestination", - (_message.Message,), - dict( - DESCRIPTOR=_GCSDESTINATION, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""The Google Cloud Storage location for the output content. - - - Attributes: - output_uri_prefix: - Required. There must be no files under 'output\_uri\_prefix'. - 'output\_uri\_prefix' must end with "/" and start with - "gs://", otherwise an INVALID\_ARGUMENT (400) error is - returned. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.GcsDestination) - ), -) -_sym_db.RegisterMessage(GcsDestination) - -OutputConfig = _reflection.GeneratedProtocolMessageType( - "OutputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_OUTPUTCONFIG, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Output configuration for BatchTranslateText request. - - - Attributes: - destination: - Required. The destination of output. - gcs_destination: - Google Cloud Storage destination for output content. For every - single input file (for example, gs://a/b/c.[extension]), we - generate at most 2 \* n output files. (n is the # of - target\_language\_codes in the BatchTranslateTextRequest). - Output files (tsv) generated are compliant with RFC 4180 - except that record delimiters are ``\\\\n`` instead of - ``\\\\r\\\\n``. We don't provide any way to - change record delimiters. While the input files are being - processed, we write/update an index file 'index.csv' under - 'output\_uri\_prefix' (for example, gs://translation- - test/index.csv) The index file is generated/updated as new - files are being translated. The format is: input\_file,target - \_language\_code,translations\_file,errors\_file, - glossary\_translations\_file,glossary\_errors\_file - input\_file is one file we matched using - gcs\_source.input\_uri. target\_language\_code is provided in - the request. translations\_file contains the translations. - (details provided below) errors\_file contains the errors - during processing of the file. (details below). Both - translations\_file and errors\_file could be empty strings if - we have no content to output. glossary\_translations\_file and - glossary\_errors\_file are always empty strings if the - input\_file is tsv. They could also be empty if we have no - content to output. Once a row is present in index.csv, the - input/output matching never changes. Callers should also - expect all the content in input\_file are processed and ready - to be consumed (that is, no partial output file is written). - The format of translations\_file (for target language code - 'trg') is: gs://translation\_test/a\_b\_c\_'trg'\_translations - .[extension] If the input file extension is tsv, the output - has the following columns: Column 1: ID of the request - provided in the input, if it's not provided in the input, then - the input row number is used (0-based). Column 2: source - sentence. Column 3: translation without applying a glossary. - Empty string if there is an error. Column 4 (only present if a - glossary is provided in the request): translation after - applying the glossary. Empty string if there is an error - applying the glossary. Could be same string as column 3 if - there is no glossary applied. If input file extension is a - txt or html, the translation is directly written to the output - file. If glossary is requested, a separate - glossary\_translations\_file has format of gs://translation\_t - est/a\_b\_c\_'trg'\_glossary\_translations.[extension] The - format of errors file (for target language code 'trg') is: - gs://translation\_test/a\_b\_c\_'trg'\_errors.[extension] If - the input file extension is tsv, errors\_file contains the - following: Column 1: ID of the request provided in the input, - if it's not provided in the input, then the input row number - is used (0-based). Column 2: source sentence. Column 3: Error - detail for the translation. Could be empty. Column 4 (only - present if a glossary is provided in the request): Error when - applying the glossary. If the input file extension is txt or - html, glossary\_error\_file will be generated that contains - error details. glossary\_error\_file has format of gs://transl - ation\_test/a\_b\_c\_'trg'\_glossary\_errors.[extension] - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.OutputConfig) - ), -) -_sym_db.RegisterMessage(OutputConfig) - -BatchTranslateTextRequest = _reflection.GeneratedProtocolMessageType( - "BatchTranslateTextRequest", - (_message.Message,), - dict( - ModelsEntry=_reflection.GeneratedProtocolMessageType( - "ModelsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHTRANSLATETEXTREQUEST_MODELSENTRY, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.BatchTranslateTextRequest.ModelsEntry) - ), - ), - GlossariesEntry=_reflection.GeneratedProtocolMessageType( - "GlossariesEntry", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.BatchTranslateTextRequest.GlossariesEntry) - ), - ), - LabelsEntry=_reflection.GeneratedProtocolMessageType( - "LabelsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHTRANSLATETEXTREQUEST_LABELSENTRY, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.BatchTranslateTextRequest.LabelsEntry) - ), - ), - DESCRIPTOR=_BATCHTRANSLATETEXTREQUEST, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""The batch translation request. - - - Attributes: - parent: - Required. Location to make a call. Must refer to a caller's - project. Format: ``projects/{project-id}/locations/{location- - id}``. The ``global`` location is not supported for batch - translation. Only AutoML Translation models or glossaries - within the same region (have the same location-id) can be - used, otherwise an INVALID\_ARGUMENT (400) error is returned. - source_language_code: - Required. Source language code. - target_language_codes: - Required. Specify up to 10 language codes here. - models: - Optional. The models to use for translation. Map's key is - target language code. Map's value is model name. Value can be - a built-in general model, or an AutoML Translation model. The - value format depends on model type: - AutoML Translation - models: ``projects/{project-id}/locations/{location- - id}/models/{model-id}`` - General (built-in) models: - ``projects/{project-id}/locations/{location- - id}/models/general/nmt``, ``projects/{project- - id}/locations/{location-id}/models/general/base`` If the map - is empty or a specific model is not requested for a language - pair, then default google model (nmt) is used. - input_configs: - Required. Input configurations. The total number of files - matched should be <= 1000. The total content size should be <= - 100M Unicode codepoints. The files must use UTF-8 encoding. - output_config: - Required. Output configuration. If 2 input configs match to - the same file (that is, same input path), we don't generate - output for duplicate inputs. - glossaries: - Optional. Glossaries to be applied for translation. It's keyed - by target language code. - labels: - Optional. The labels with user-defined metadata for the - request. Label keys and values can be no longer than 63 - 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://cloud.google.com/translate/docs/labels for more - information. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.BatchTranslateTextRequest) - ), -) -_sym_db.RegisterMessage(BatchTranslateTextRequest) -_sym_db.RegisterMessage(BatchTranslateTextRequest.ModelsEntry) -_sym_db.RegisterMessage(BatchTranslateTextRequest.GlossariesEntry) -_sym_db.RegisterMessage(BatchTranslateTextRequest.LabelsEntry) - -BatchTranslateMetadata = _reflection.GeneratedProtocolMessageType( - "BatchTranslateMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHTRANSLATEMETADATA, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""State metadata for the batch translation operation. - - - Attributes: - state: - The state of the operation. - translated_characters: - Number of successfully translated characters so far (Unicode - codepoints). - failed_characters: - Number of characters that have failed to process so far - (Unicode codepoints). - total_characters: - Total number of characters (Unicode codepoints). This is the - total number of codepoints from input files times the number - of target languages and appears here shortly after the call is - submitted. - submit_time: - Time when the operation was submitted. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.BatchTranslateMetadata) - ), -) -_sym_db.RegisterMessage(BatchTranslateMetadata) - -BatchTranslateResponse = _reflection.GeneratedProtocolMessageType( - "BatchTranslateResponse", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHTRANSLATERESPONSE, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Stored in the - [google.longrunning.Operation.response][google.longrunning.Operation.response] - field returned by BatchTranslateText if at least one sentence is - translated successfully. - - - Attributes: - total_characters: - Total number of characters (Unicode codepoints). - translated_characters: - Number of successfully translated characters (Unicode - codepoints). - failed_characters: - Number of characters that have failed to process (Unicode - codepoints). - submit_time: - Time when the operation was submitted. - end_time: - The time when the operation is finished and [google.longrunnin - g.Operation.done][google.longrunning.Operation.done] is set to - true. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.BatchTranslateResponse) - ), -) -_sym_db.RegisterMessage(BatchTranslateResponse) - -GlossaryInputConfig = _reflection.GeneratedProtocolMessageType( - "GlossaryInputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_GLOSSARYINPUTCONFIG, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Input configuration for glossaries. - - - Attributes: - source: - Required. Specify the input. - gcs_source: - Required. Google Cloud Storage location of glossary data. File - format is determined based on the filename extension. API - returns [google.rpc.Code.INVALID\_ARGUMENT] for unsupported - URI-s and file formats. Wildcards are not allowed. This must - be a single file in one of the following formats: For - unidirectional glossaries: - TSV/CSV (``.tsv``/``.csv``): 2 - column file, tab- or comma-separated. The first column is - source text. The second column is target text. The file - must not contain headers. That is, the first row is data, - not column names. - TMX (``.tmx``): TMX file with parallel - data defining source/target term pairs. For equivalent - term sets glossaries: - CSV (``.csv``): Multi-column CSV - file defining equivalent glossary terms in multiple - languages. The format is defined for Google Translation - Toolkit and documented in `Use a glossary `__. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.GlossaryInputConfig) - ), -) -_sym_db.RegisterMessage(GlossaryInputConfig) - -Glossary = _reflection.GeneratedProtocolMessageType( - "Glossary", - (_message.Message,), - dict( - LanguageCodePair=_reflection.GeneratedProtocolMessageType( - "LanguageCodePair", - (_message.Message,), - dict( - DESCRIPTOR=_GLOSSARY_LANGUAGECODEPAIR, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Used with unidirectional glossaries. - - - Attributes: - source_language_code: - Required. The BCP-47 language code of the input text, for - example, "en-US". Expected to be an exact match for - GlossaryTerm.language\_code. - target_language_code: - Required. The BCP-47 language code for translation output, for - example, "zh-CN". Expected to be an exact match for - GlossaryTerm.language\_code. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.Glossary.LanguageCodePair) - ), - ), - LanguageCodesSet=_reflection.GeneratedProtocolMessageType( - "LanguageCodesSet", - (_message.Message,), - dict( - DESCRIPTOR=_GLOSSARY_LANGUAGECODESSET, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Used with equivalent term set glossaries. - - - Attributes: - language_codes: - The BCP-47 language code(s) for terms defined in the glossary. - All entries are unique. The list contains at least two - entries. Expected to be an exact match for - GlossaryTerm.language\_code. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.Glossary.LanguageCodesSet) - ), - ), - DESCRIPTOR=_GLOSSARY, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Represents a glossary built from user provided data. - - - Attributes: - name: - Required. The resource name of the glossary. Glossary names - have the form ``projects/{project-id}/locations/{location- - id}/glossaries/{glossary-id}``. - languages: - Languages supported by the glossary. - language_pair: - Used with unidirectional glossaries. - language_codes_set: - Used with equivalent term set glossaries. - input_config: - Required. Provides examples to build the glossary from. Total - glossary must not exceed 10M Unicode codepoints. - entry_count: - Output only. The number of entries defined in the glossary. - submit_time: - Output only. When CreateGlossary was called. - end_time: - Output only. When the glossary creation was finished. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.Glossary) - ), -) -_sym_db.RegisterMessage(Glossary) -_sym_db.RegisterMessage(Glossary.LanguageCodePair) -_sym_db.RegisterMessage(Glossary.LanguageCodesSet) - -CreateGlossaryRequest = _reflection.GeneratedProtocolMessageType( - "CreateGlossaryRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEGLOSSARYREQUEST, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Request message for CreateGlossary. - - - Attributes: - parent: - Required. The project name. - glossary: - Required. The glossary to create. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.CreateGlossaryRequest) - ), -) -_sym_db.RegisterMessage(CreateGlossaryRequest) - -GetGlossaryRequest = _reflection.GeneratedProtocolMessageType( - "GetGlossaryRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETGLOSSARYREQUEST, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Request message for GetGlossary. - - - Attributes: - name: - Required. The name of the glossary to retrieve. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.GetGlossaryRequest) - ), -) -_sym_db.RegisterMessage(GetGlossaryRequest) - -DeleteGlossaryRequest = _reflection.GeneratedProtocolMessageType( - "DeleteGlossaryRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEGLOSSARYREQUEST, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Request message for DeleteGlossary. - - - Attributes: - name: - Required. The name of the glossary to delete. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.DeleteGlossaryRequest) - ), -) -_sym_db.RegisterMessage(DeleteGlossaryRequest) - -ListGlossariesRequest = _reflection.GeneratedProtocolMessageType( - "ListGlossariesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTGLOSSARIESREQUEST, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Request message for ListGlossaries. - - - Attributes: - parent: - Required. The name of the project from which to list all of - the glossaries. - page_size: - Optional. Requested page size. The server may return fewer - glossaries than requested. If unspecified, the server picks an - appropriate default. - page_token: - Optional. A token identifying a page of results the server - should return. Typically, this is the value of - [ListGlossariesResponse.next\_page\_token] returned from the - previous call to ``ListGlossaries`` method. The first page is - returned if ``page_token``\ is empty or missing. - filter: - Optional. Filter specifying constraints of a list operation. - Filtering is not supported yet, and the parameter currently - has no effect. If missing, no filtering is performed. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.ListGlossariesRequest) - ), -) -_sym_db.RegisterMessage(ListGlossariesRequest) - -ListGlossariesResponse = _reflection.GeneratedProtocolMessageType( - "ListGlossariesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTGLOSSARIESRESPONSE, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Response message for ListGlossaries. - - - Attributes: - glossaries: - The list of glossaries for a project. - next_page_token: - A token to retrieve a page of results. Pass this value in the - [ListGlossariesRequest.page\_token] field in the subsequent - call to ``ListGlossaries`` method to retrieve the next page of - results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.ListGlossariesResponse) - ), -) -_sym_db.RegisterMessage(ListGlossariesResponse) - -CreateGlossaryMetadata = _reflection.GeneratedProtocolMessageType( - "CreateGlossaryMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEGLOSSARYMETADATA, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Stored in the - [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] - field returned by CreateGlossary. - - - Attributes: - name: - The name of the glossary that is being created. - state: - The current state of the glossary creation operation. - submit_time: - The time when the operation was submitted to the server. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.CreateGlossaryMetadata) - ), -) -_sym_db.RegisterMessage(CreateGlossaryMetadata) - -DeleteGlossaryMetadata = _reflection.GeneratedProtocolMessageType( - "DeleteGlossaryMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEGLOSSARYMETADATA, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Stored in the - [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata] - field returned by DeleteGlossary. - - - Attributes: - name: - The name of the glossary that is being deleted. - state: - The current state of the glossary deletion operation. - submit_time: - The time when the operation was submitted to the server. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.DeleteGlossaryMetadata) - ), -) -_sym_db.RegisterMessage(DeleteGlossaryMetadata) - -DeleteGlossaryResponse = _reflection.GeneratedProtocolMessageType( - "DeleteGlossaryResponse", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEGLOSSARYRESPONSE, - __module__="google.cloud.translation_v3beta1.proto.translation_service_pb2", - __doc__="""Stored in the - [google.longrunning.Operation.response][google.longrunning.Operation.response] - field returned by DeleteGlossary. - - - Attributes: - name: - The name of the deleted glossary. - submit_time: - The time when the operation was submitted to the server. - end_time: - The time when the glossary deletion is finished and [google.lo - ngrunning.Operation.done][google.longrunning.Operation.done] - is set to true. - """, - # @@protoc_insertion_point(class_scope:google.cloud.translation.v3beta1.DeleteGlossaryResponse) - ), -) -_sym_db.RegisterMessage(DeleteGlossaryResponse) - - -DESCRIPTOR._options = None -_TRANSLATETEXTGLOSSARYCONFIG.fields_by_name["glossary"]._options = None -_TRANSLATETEXTGLOSSARYCONFIG.fields_by_name["ignore_case"]._options = None -_TRANSLATETEXTREQUEST_LABELSENTRY._options = None -_TRANSLATETEXTREQUEST.fields_by_name["contents"]._options = None -_TRANSLATETEXTREQUEST.fields_by_name["mime_type"]._options = None -_TRANSLATETEXTREQUEST.fields_by_name["source_language_code"]._options = None -_TRANSLATETEXTREQUEST.fields_by_name["target_language_code"]._options = None -_TRANSLATETEXTREQUEST.fields_by_name["parent"]._options = None -_TRANSLATETEXTREQUEST.fields_by_name["model"]._options = None -_TRANSLATETEXTREQUEST.fields_by_name["glossary_config"]._options = None -_TRANSLATETEXTREQUEST.fields_by_name["labels"]._options = None -_DETECTLANGUAGEREQUEST_LABELSENTRY._options = None -_DETECTLANGUAGEREQUEST.fields_by_name["parent"]._options = None -_DETECTLANGUAGEREQUEST.fields_by_name["model"]._options = None -_DETECTLANGUAGEREQUEST.fields_by_name["mime_type"]._options = None -_GETSUPPORTEDLANGUAGESREQUEST.fields_by_name["parent"]._options = None -_GETSUPPORTEDLANGUAGESREQUEST.fields_by_name["display_language_code"]._options = None -_GETSUPPORTEDLANGUAGESREQUEST.fields_by_name["model"]._options = None -_GCSSOURCE.fields_by_name["input_uri"]._options = None -_INPUTCONFIG.fields_by_name["mime_type"]._options = None -_GCSDESTINATION.fields_by_name["output_uri_prefix"]._options = None -_BATCHTRANSLATETEXTREQUEST_MODELSENTRY._options = None -_BATCHTRANSLATETEXTREQUEST_GLOSSARIESENTRY._options = None -_BATCHTRANSLATETEXTREQUEST_LABELSENTRY._options = None -_BATCHTRANSLATETEXTREQUEST.fields_by_name["parent"]._options = None -_BATCHTRANSLATETEXTREQUEST.fields_by_name["source_language_code"]._options = None -_BATCHTRANSLATETEXTREQUEST.fields_by_name["target_language_codes"]._options = None -_BATCHTRANSLATETEXTREQUEST.fields_by_name["models"]._options = None -_BATCHTRANSLATETEXTREQUEST.fields_by_name["input_configs"]._options = None -_BATCHTRANSLATETEXTREQUEST.fields_by_name["output_config"]._options = None -_BATCHTRANSLATETEXTREQUEST.fields_by_name["glossaries"]._options = None -_BATCHTRANSLATETEXTREQUEST.fields_by_name["labels"]._options = None -_GLOSSARY.fields_by_name["name"]._options = None -_GLOSSARY.fields_by_name["entry_count"]._options = None -_GLOSSARY.fields_by_name["submit_time"]._options = None -_GLOSSARY.fields_by_name["end_time"]._options = None -_GLOSSARY._options = None -_CREATEGLOSSARYREQUEST.fields_by_name["parent"]._options = None -_CREATEGLOSSARYREQUEST.fields_by_name["glossary"]._options = None -_GETGLOSSARYREQUEST.fields_by_name["name"]._options = None -_DELETEGLOSSARYREQUEST.fields_by_name["name"]._options = None -_LISTGLOSSARIESREQUEST.fields_by_name["parent"]._options = None -_LISTGLOSSARIESREQUEST.fields_by_name["page_size"]._options = None -_LISTGLOSSARIESREQUEST.fields_by_name["page_token"]._options = None -_LISTGLOSSARIESREQUEST.fields_by_name["filter"]._options = None - -_TRANSLATIONSERVICE = _descriptor.ServiceDescriptor( - name="TranslationService", - full_name="google.cloud.translation.v3beta1.TranslationService", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\030translate.googleapis.com\322A`https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-translation" - ), - serialized_start=5661, - serialized_end=7735, - methods=[ - _descriptor.MethodDescriptor( - name="TranslateText", - full_name="google.cloud.translation.v3beta1.TranslationService.TranslateText", - index=0, - containing_service=None, - input_type=_TRANSLATETEXTREQUEST, - output_type=_TRANSLATETEXTRESPONSE, - serialized_options=_b( - '\202\323\344\223\002l"6/v3beta1/{parent=projects/*/locations/*}:translateText:\001*Z/"*/v3beta1/{parent=projects/*}:translateText:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="DetectLanguage", - full_name="google.cloud.translation.v3beta1.TranslationService.DetectLanguage", - index=1, - containing_service=None, - input_type=_DETECTLANGUAGEREQUEST, - output_type=_DETECTLANGUAGERESPONSE, - serialized_options=_b( - '\202\323\344\223\002n"7/v3beta1/{parent=projects/*/locations/*}:detectLanguage:\001*Z0"+/v3beta1/{parent=projects/*}:detectLanguage:\001*\332A\026parent,model,mime_type' - ), - ), - _descriptor.MethodDescriptor( - name="GetSupportedLanguages", - full_name="google.cloud.translation.v3beta1.TranslationService.GetSupportedLanguages", - index=2, - containing_service=None, - input_type=_GETSUPPORTEDLANGUAGESREQUEST, - output_type=_SUPPORTEDLANGUAGES, - serialized_options=_b( - '\202\323\344\223\002p\022;/v3beta1/{parent=projects/*/locations/*}/supportedLanguagesZ1\022//v3beta1/{parent=projects/*}/supportedLanguages\332A"parent,display_language_code,model' - ), - ), - _descriptor.MethodDescriptor( - name="BatchTranslateText", - full_name="google.cloud.translation.v3beta1.TranslationService.BatchTranslateText", - index=3, - containing_service=None, - input_type=_BATCHTRANSLATETEXTREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002@";/v3beta1/{parent=projects/*/locations/*}:batchTranslateText:\001*\312A0\n\026BatchTranslateResponse\022\026BatchTranslateMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="CreateGlossary", - full_name="google.cloud.translation.v3beta1.TranslationService.CreateGlossary", - index=4, - containing_service=None, - input_type=_CREATEGLOSSARYREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002?"3/v3beta1/{parent=projects/*/locations/*}/glossaries:\010glossary\332A\017parent,glossary\312A"\n\010Glossary\022\026CreateGlossaryMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="ListGlossaries", - full_name="google.cloud.translation.v3beta1.TranslationService.ListGlossaries", - index=5, - containing_service=None, - input_type=_LISTGLOSSARIESREQUEST, - output_type=_LISTGLOSSARIESRESPONSE, - serialized_options=_b( - "\202\323\344\223\0025\0223/v3beta1/{parent=projects/*/locations/*}/glossaries\332A\006parent\332A\rparent,filter" - ), - ), - _descriptor.MethodDescriptor( - name="GetGlossary", - full_name="google.cloud.translation.v3beta1.TranslationService.GetGlossary", - index=6, - containing_service=None, - input_type=_GETGLOSSARYREQUEST, - output_type=_GLOSSARY, - serialized_options=_b( - "\202\323\344\223\0025\0223/v3beta1/{name=projects/*/locations/*/glossaries/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteGlossary", - full_name="google.cloud.translation.v3beta1.TranslationService.DeleteGlossary", - index=7, - containing_service=None, - input_type=_DELETEGLOSSARYREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - "\202\323\344\223\0025*3/v3beta1/{name=projects/*/locations/*/glossaries/*}\332A\004name\312A0\n\026DeleteGlossaryResponse\022\026DeleteGlossaryMetadata" - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_TRANSLATIONSERVICE) - -DESCRIPTOR.services_by_name["TranslationService"] = _TRANSLATIONSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/translate/google/cloud/translate_v3beta1/proto/translation_service_pb2_grpc.py b/translate/google/cloud/translate_v3beta1/proto/translation_service_pb2_grpc.py deleted file mode 100644 index 695f79923a4a..000000000000 --- a/translate/google/cloud/translate_v3beta1/proto/translation_service_pb2_grpc.py +++ /dev/null @@ -1,186 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.translate_v3beta1.proto import ( - translation_service_pb2 as google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -class TranslationServiceStub(object): - """Proto file for the Cloud Translation API (v3beta1). - - Provides natural language translation operations. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.TranslateText = channel.unary_unary( - "/google.cloud.translation.v3beta1.TranslationService/TranslateText", - request_serializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.TranslateTextRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.TranslateTextResponse.FromString, - ) - self.DetectLanguage = channel.unary_unary( - "/google.cloud.translation.v3beta1.TranslationService/DetectLanguage", - request_serializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.DetectLanguageRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.DetectLanguageResponse.FromString, - ) - self.GetSupportedLanguages = channel.unary_unary( - "/google.cloud.translation.v3beta1.TranslationService/GetSupportedLanguages", - request_serializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.GetSupportedLanguagesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.SupportedLanguages.FromString, - ) - self.BatchTranslateText = channel.unary_unary( - "/google.cloud.translation.v3beta1.TranslationService/BatchTranslateText", - request_serializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.BatchTranslateTextRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.CreateGlossary = channel.unary_unary( - "/google.cloud.translation.v3beta1.TranslationService/CreateGlossary", - request_serializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.CreateGlossaryRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.ListGlossaries = channel.unary_unary( - "/google.cloud.translation.v3beta1.TranslationService/ListGlossaries", - request_serializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.ListGlossariesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.ListGlossariesResponse.FromString, - ) - self.GetGlossary = channel.unary_unary( - "/google.cloud.translation.v3beta1.TranslationService/GetGlossary", - request_serializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.GetGlossaryRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.Glossary.FromString, - ) - self.DeleteGlossary = channel.unary_unary( - "/google.cloud.translation.v3beta1.TranslationService/DeleteGlossary", - request_serializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.DeleteGlossaryRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - - -class TranslationServiceServicer(object): - """Proto file for the Cloud Translation API (v3beta1). - - Provides natural language translation operations. - """ - - def TranslateText(self, request, context): - """Translates input text and returns translated text. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DetectLanguage(self, request, context): - """Detects the language of text within a request. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetSupportedLanguages(self, request, context): - """Returns a list of supported languages for translation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def BatchTranslateText(self, request, context): - """Translates a large volume of text in asynchronous batch mode. - This function provides real-time output as the inputs are being processed. - If caller cancels a request, the partial results (for an input file, it's - all or nothing) may still be available on the specified output location. - - This call returns immediately and you can - use google.longrunning.Operation.name to poll the status of the call. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateGlossary(self, request, context): - """Creates a glossary and returns the long-running operation. Returns - NOT_FOUND, if the project doesn't exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListGlossaries(self, request, context): - """Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetGlossary(self, request, context): - """Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteGlossary(self, request, context): - """Deletes a glossary, or cancels glossary construction - if the glossary isn't created yet. - Returns NOT_FOUND, if the glossary doesn't exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_TranslationServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "TranslateText": grpc.unary_unary_rpc_method_handler( - servicer.TranslateText, - request_deserializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.TranslateTextRequest.FromString, - response_serializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.TranslateTextResponse.SerializeToString, - ), - "DetectLanguage": grpc.unary_unary_rpc_method_handler( - servicer.DetectLanguage, - request_deserializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.DetectLanguageRequest.FromString, - response_serializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.DetectLanguageResponse.SerializeToString, - ), - "GetSupportedLanguages": grpc.unary_unary_rpc_method_handler( - servicer.GetSupportedLanguages, - request_deserializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.GetSupportedLanguagesRequest.FromString, - response_serializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.SupportedLanguages.SerializeToString, - ), - "BatchTranslateText": grpc.unary_unary_rpc_method_handler( - servicer.BatchTranslateText, - request_deserializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.BatchTranslateTextRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "CreateGlossary": grpc.unary_unary_rpc_method_handler( - servicer.CreateGlossary, - request_deserializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.CreateGlossaryRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "ListGlossaries": grpc.unary_unary_rpc_method_handler( - servicer.ListGlossaries, - request_deserializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.ListGlossariesRequest.FromString, - response_serializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.ListGlossariesResponse.SerializeToString, - ), - "GetGlossary": grpc.unary_unary_rpc_method_handler( - servicer.GetGlossary, - request_deserializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.GetGlossaryRequest.FromString, - response_serializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.Glossary.SerializeToString, - ), - "DeleteGlossary": grpc.unary_unary_rpc_method_handler( - servicer.DeleteGlossary, - request_deserializer=google_dot_cloud_dot_translation__v3beta1_dot_proto_dot_translation__service__pb2.DeleteGlossaryRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.translation.v3beta1.TranslationService", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/translate/google/cloud/translate_v3beta1/types.py b/translate/google/cloud/translate_v3beta1/types.py deleted file mode 100644 index 335149a637ac..000000000000 --- a/translate/google/cloud/translate_v3beta1/types.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.translate_v3beta1.proto import translation_service_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import timestamp_pb2 -from google.rpc import status_pb2 - - -_shared_modules = [operations_pb2, any_pb2, timestamp_pb2, status_pb2] - -_local_modules = [translation_service_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.translate_v3beta1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/translate/noxfile.py b/translate/noxfile.py deleted file mode 100644 index 7949a4e3925a..000000000000 --- a/translate/noxfile.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/translate/pylint.config.py b/translate/pylint.config.py deleted file mode 100644 index 5d64b9d2f256..000000000000 --- a/translate/pylint.config.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This module is used to configure gcp-devrel-py-tools run-pylint.""" - -# Library configuration - -# library_additions = {} -# library_replacements = {} - -# Test configuration - -# test_additions = copy.deepcopy(library_additions) -# test_replacements = copy.deepcopy(library_replacements) diff --git a/translate/setup.cfg b/translate/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/translate/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/translate/setup.py b/translate/setup.py deleted file mode 100644 index db6939ca2082..000000000000 --- a/translate/setup.py +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import io -import os - -import setuptools - - -# Package metadata. - -name = "google-cloud-translate" -description = "Google Cloud Translation API client library" -version = "2.0.0" -# Should be one of: -# 'Development Status :: 3 - Alpha' -# 'Development Status :: 4 - Beta' -# 'Development Status :: 5 - Production/Stable' -release_status = "Development Status :: 5 - Production/Stable" -dependencies = [ - "google-api-core[grpc] >= 1.15.0, < 2.0.0dev", - "google-cloud-core >= 1.1.0, < 2.0dev", -] -extras = {} - - -# Setup boilerplate below this line. - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -# Only include packages under the 'google' namespace. Do not include tests, -# benchmarks, etc. -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -# Determine which namespaces are needed. -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") - - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/GoogleCloudPlatform/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - extras_require=extras, - python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", - include_package_data=True, - zip_safe=False, -) diff --git a/translate/synth.metadata b/translate/synth.metadata deleted file mode 100644 index 02c58128c72e..000000000000 --- a/translate/synth.metadata +++ /dev/null @@ -1,244 +0,0 @@ -{ - "updateTime": "2020-01-30T13:43:27.800148Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c1246a29e22b0f98e800a536b5b0da2d933a55f2", - "internalRef": "292310790", - "log": "c1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\ncf3b61102ed5f36b827bc82ec39be09525f018c8\n Fix to protos for v1p1beta1 release of Cloud Security Command Center\n\nPiperOrigin-RevId: 292034635\n\n4e1cfaa7c0fede9e65d64213ca3da1b1255816c0\nUpdate the public proto to support UTF-8 encoded id for CatalogService API, increase the ListCatalogItems deadline to 300s and some minor documentation change\n\nPiperOrigin-RevId: 292030970\n\n9c483584f8fd5a1b862ae07973f4cc7bb3e46648\nasset: add annotations to v1p1beta1\n\nPiperOrigin-RevId: 292009868\n\ne19209fac29731d0baf6d9ac23da1164f7bdca24\nAdd the google.rpc.context.AttributeContext message to the open source\ndirectories.\n\nPiperOrigin-RevId: 291999930\n\nae5662960573f279502bf98a108a35ba1175e782\noslogin API: move file level option on top of the file to avoid protobuf.js bug.\n\nPiperOrigin-RevId: 291990506\n\neba3897fff7c49ed85d3c47fc96fe96e47f6f684\nAdd cc_proto_library and cc_grpc_library targets for Spanner and IAM protos.\n\nPiperOrigin-RevId: 291988651\n\n8e981acfd9b97ea2f312f11bbaa7b6c16e412dea\nBeta launch for PersonDetection and FaceDetection features.\n\nPiperOrigin-RevId: 291821782\n\n994e067fae3b21e195f7da932b08fff806d70b5d\nasset: add annotations to v1p2beta1\n\nPiperOrigin-RevId: 291815259\n\n244e1d2c89346ca2e0701b39e65552330d68545a\nAdd Playable Locations service\n\nPiperOrigin-RevId: 291806349\n\n909f8f67963daf45dd88d020877fb9029b76788d\nasset: add annotations to v1beta2\n\nPiperOrigin-RevId: 291805301\n\n3c39a1d6e23c1ef63c7fba4019c25e76c40dfe19\nKMS: add file-level message for CryptoKeyPath, it is defined in gapic yaml but not\nin proto files.\n\nPiperOrigin-RevId: 291420695\n\nc6f3f350b8387f8d1b85ed4506f30187ebaaddc3\ncontaineranalysis: update v1beta1 and bazel build with annotations\n\nPiperOrigin-RevId: 291401900\n\n92887d74b44e4e636252b7b8477d0d2570cd82db\nfix: fix the location of grpc config file.\n\nPiperOrigin-RevId: 291396015\n\ne26cab8afd19d396b929039dac5d874cf0b5336c\nexpr: add default_host and method_signature annotations to CelService\n\nPiperOrigin-RevId: 291240093\n\n06093ae3952441c34ec176d1f7431b8765cec0be\nirm: fix v1alpha2 bazel build by adding missing proto imports\n\nPiperOrigin-RevId: 291227940\n\na8a2514af326e4673063f9a3c9d0ef1091c87e6c\nAdd proto annotation for cloud/irm API\n\nPiperOrigin-RevId: 291217859\n\n8d16f76de065f530d395a4c7eabbf766d6a120fd\nGenerate Memcache v1beta2 API protos and gRPC ServiceConfig files\n\nPiperOrigin-RevId: 291008516\n\n3af1dabd93df9a9f17bf3624d3b875c11235360b\ngrafeas: Add containeranalysis default_host to Grafeas service\n\nPiperOrigin-RevId: 290965849\n\nbe2663fa95e31cba67d0cd62611a6674db9f74b7\nfix(google/maps/roads): add missing opening bracket\n\nPiperOrigin-RevId: 290964086\n\nfacc26550a0af0696e0534bc9cae9df14275aa7c\nUpdating v2 protos with the latest inline documentation (in comments) and adding a per-service .yaml file.\n\nPiperOrigin-RevId: 290952261\n\ncda99c1f7dc5e4ca9b1caeae1dc330838cbc1461\nChange api_name to 'asset' for v1p1beta1\n\nPiperOrigin-RevId: 290800639\n\n94e9e90c303a820ce40643d9129e7f0d2054e8a1\nAdds Google Maps Road service\n\nPiperOrigin-RevId: 290795667\n\na3b23dcb2eaecce98c600c7d009451bdec52dbda\nrpc: new message ErrorInfo, other comment updates\n\nPiperOrigin-RevId: 290781668\n\n26420ef4e46c37f193c0fbe53d6ebac481de460e\nAdd proto definition for Org Policy v1.\n\nPiperOrigin-RevId: 290771923\n\n7f0dab8177cf371ae019a082e2512de7ac102888\nPublish Routes Preferred API v1 service definitions.\n\nPiperOrigin-RevId: 290326986\n\nad6e508d0728e1d1bca6e3f328cd562718cb772d\nFix: Qualify resource type references with \"jobs.googleapis.com/\"\n\nPiperOrigin-RevId: 290285762\n\n58e770d568a2b78168ddc19a874178fee8265a9d\ncts client library\n\nPiperOrigin-RevId: 290146169\n\naf9daa4c3b4c4a8b7133b81588dd9ffd37270af2\nAdd more programming language options to public proto\n\nPiperOrigin-RevId: 290144091\n\nd9f2bbf2df301ef84641d4cec7c828736a0bd907\ntalent: add missing resource.proto dep to Bazel build target\n\nPiperOrigin-RevId: 290143164\n\n3b3968237451d027b42471cd28884a5a1faed6c7\nAnnotate Talent API.\nAdd gRPC service config for retry.\nUpdate bazel file with google.api.resource dependency.\n\nPiperOrigin-RevId: 290125172\n\n0735b4b096872960568d1f366bfa75b7b0e1f1a3\nWeekly library update.\n\nPiperOrigin-RevId: 289939042\n\n8760d3d9a4543d7f9c0d1c7870aca08b116e4095\nWeekly library update.\n\nPiperOrigin-RevId: 289939020\n\n8607df842f782a901805187e02fff598145b0b0e\nChange Talent API timeout to 30s.\n\nPiperOrigin-RevId: 289912621\n\n908155991fe32570653bcb72ecfdcfc896642f41\nAdd Recommendations AI V1Beta1\n\nPiperOrigin-RevId: 289901914\n\n5c9a8c2bebd8b71aa66d1cc473edfaac837a2c78\nAdding no-arg method signatures for ListBillingAccounts and ListServices\n\nPiperOrigin-RevId: 289891136\n\n50b0e8286ac988b0593bd890eb31fef6ea2f5767\nlongrunning: add grpc service config and default_host annotation to operations.proto\n\nPiperOrigin-RevId: 289876944\n\n6cac27dabe51c54807b0401698c32d34998948a9\n Updating default deadline for Cloud Security Command Center's v1 APIs.\n\nPiperOrigin-RevId: 289875412\n\nd99df0d67057a233c711187e0689baa4f8e6333d\nFix: Correct spelling in C# namespace option\n\nPiperOrigin-RevId: 289709813\n\n2fa8d48165cc48e35b0c62e6f7bdade12229326c\nfeat: Publish Recommender v1 to GitHub.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289619243\n\n9118db63d1ab493a2e44a3b4973fde810a835c49\nfirestore: don't retry reads that fail with Aborted\n\nFor transaction reads that fail with ABORTED, we need to rollback and start a new transaction. Our current configuration makes it so that GAPIC retries ABORTED reads multiple times without making any progress. Instead, we should retry at the transaction level.\n\nPiperOrigin-RevId: 289532382\n\n1dbfd3fe4330790b1e99c0bb20beb692f1e20b8a\nFix bazel build\nAdd other langauges (Java was already there) for bigquery/storage/v1alpha2 api.\n\nPiperOrigin-RevId: 289519766\n\nc06599cdd7d11f8d3fd25f8d3249e5bb1a3d5d73\nInitial commit of google.cloud.policytroubleshooter API, The API helps in troubleshooting GCP policies. Refer https://cloud.google.com/iam/docs/troubleshooting-access for more information\n\nPiperOrigin-RevId: 289491444\n\nfce7d80fa16ea241e87f7bc33d68595422e94ecd\nDo not pass samples option for Artman config of recommender v1 API.\n\nPiperOrigin-RevId: 289477403\n\nef179e8c61436297e6bb124352e47e45c8c80cb1\nfix: Address missing Bazel dependency.\n\nBazel builds stopped working in 06ec6d5 because\nthe google/longrunning/operations.proto file took\nan import from google/api/client.proto, but that\nimport was not added to BUILD.bazel.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289446074\n\n8841655b242c84fd691d77d7bcf21b61044f01ff\nMigrate Data Labeling v1beta1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289446026\n\n06ec6d5d053fff299eaa6eaa38afdd36c5e2fc68\nAdd annotations to google.longrunning.v1\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289413169\n\n0480cf40be1d3cc231f4268a2fdb36a8dd60e641\nMigrate IAM Admin v1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289411084\n\n1017173e9adeb858587639af61889ad970c728b1\nSpecify a C# namespace for BigQuery Connection v1beta1\n\nPiperOrigin-RevId: 289396763\n\nb08714b378e8e5b0c4ecdde73f92c36d6303b4b6\nfix: Integrate latest proto-docs-plugin fix.\nFixes dialogflow v2\n\nPiperOrigin-RevId: 289189004\n\n51217a67e79255ee1f2e70a6a3919df082513327\nCreate BUILD file for recommender v1\n\nPiperOrigin-RevId: 289183234\n\nacacd87263c0a60e458561b8b8ce9f67c760552a\nGenerate recommender v1 API protos and gRPC ServiceConfig files\n\nPiperOrigin-RevId: 289177510\n\n9d2f7133b97720b1fa3601f6dcd30760ba6d8a1e\nFix kokoro build script\n\nPiperOrigin-RevId: 289166315\n\nc43a67530d2a47a0220cad20ca8de39b3fbaf2c5\ncloudtasks: replace missing RPC timeout config for v2beta2 and v2beta3\n\nPiperOrigin-RevId: 289162391\n\n4cefc229a9197236fc0adf02d69b71c0c5cf59de\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 289158456\n\n56f263fe959c50786dab42e3c61402d32d1417bd\nCatalog API: Adding config necessary to build client libraries\n\nPiperOrigin-RevId: 289149879\n\n4543762b23a57fc3c53d409efc3a9affd47b6ab3\nFix Bazel build\nbilling/v1 and dialogflow/v2 remain broken (not bazel-related issues).\nBilling has wrong configuration, dialogflow failure is caused by a bug in documentation plugin.\n\nPiperOrigin-RevId: 289140194\n\nc9dce519127b97e866ca133a01157f4ce27dcceb\nUpdate Bigtable docs\n\nPiperOrigin-RevId: 289114419\n\n802c5c5f2bf94c3facb011267d04e71942e0d09f\nMigrate DLP to proto annotations (but not GAPIC v2).\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289102579\n\n6357f30f2ec3cff1d8239d18b707ff9d438ea5da\nRemove gRPC configuration file that was in the wrong place.\n\nPiperOrigin-RevId: 289096111\n\n360a8792ed62f944109d7e22d613a04a010665b4\n Protos for v1p1beta1 release of Cloud Security Command Center\n\nPiperOrigin-RevId: 289011995\n\na79211c20c4f2807eec524d00123bf7c06ad3d6e\nRoll back containeranalysis v1 to GAPIC v1.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288999068\n\n9e60345ba603e03484a8aaa33ce5ffa19c1c652b\nPublish Routes Preferred API v1 proto definitions.\n\nPiperOrigin-RevId: 288941399\n\nd52885b642ad2aa1f42b132ee62dbf49a73e1e24\nMigrate the service management API to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288909426\n\n6ace586805c08896fef43e28a261337fcf3f022b\ncloudtasks: replace missing RPC timeout config\n\nPiperOrigin-RevId: 288783603\n\n51d906cabee4876b12497054b15b05d4a50ad027\nImport of Grafeas from Github.\n\nUpdate BUILD.bazel accordingly.\n\nPiperOrigin-RevId: 288783426\n\n5ef42bcd363ba0440f0ee65b3c80b499e9067ede\nMigrate Recommender v1beta1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288713066\n\n94f986afd365b7d7e132315ddcd43d7af0e652fb\nMigrate Container Analysis v1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288708382\n\n7a751a279184970d3b6ba90e4dd4d22a382a0747\nRemove Container Analysis v1alpha1 (nobody publishes it).\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288707473\n\n3c0d9c71242e70474b2b640e15bb0a435fd06ff0\nRemove specious annotation from BigQuery Data Transfer before\nanyone accidentally does anything that uses it.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288701604\n\n1af307a4764bd415ef942ac5187fa1def043006f\nMigrate BigQuery Connection to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288698681\n\n08b488e0660c59842a7dee0e3e2b65d9e3a514a9\nExposing cloud_catalog.proto (This API is already available through REST)\n\nPiperOrigin-RevId: 288625007\n\na613482977e11ac09fa47687a5d1b5a01efcf794\nUpdate the OS Login v1beta API description to render better in the UI.\n\nPiperOrigin-RevId: 288547940\n\n5e182b8d9943f1b17008d69d4c7e865dc83641a7\nUpdate the OS Login API description to render better in the UI.\n\nPiperOrigin-RevId: 288546443\n\ncb79155f596e0396dd900da93872be7066f6340d\nFix: Add a resource annotation for Agent\nFix: Correct the service name in annotations for Intent and SessionEntityType\n\nPiperOrigin-RevId: 288441307\n\nf7f6e9daec3315fd47cb638789bd8415bf4a27cc\nAdded cloud asset api v1p1beta1\n\nPiperOrigin-RevId: 288427239\n\nf2880f5b342c6345f3dcaad24fcb3c6ca9483654\nBilling account API: Adding config necessary to build client libraries\n\nPiperOrigin-RevId: 288351810\n\ndc250ffe071729f8f8bef9d6fd0fbbeb0254c666\nFix: Remove incorrect resource annotations in requests\n\nPiperOrigin-RevId: 288321208\n\n91ef2d9dd69807b0b79555f22566fb2d81e49ff9\nAdd GAPIC annotations to Cloud KMS (but do not migrate the GAPIC config yet).\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 287999179\n\n4d45a6399e9444fbddaeb1c86aabfde210723714\nRefreshing Cloud Billing API protos.\n\nThis exposes the following API methods:\n- UpdateBillingAccount\n- CreateBillingAccount\n- GetIamPolicy\n- SetIamPolicy\n- TestIamPermissions\n\nThere are also some new fields to support the management of sub-accounts.\n\nPiperOrigin-RevId: 287908369\n\nec285d3d230810147ebbf8d5b691ee90320c6d2d\nHide not yet implemented update_transforms message\n\nPiperOrigin-RevId: 287608953\n\na202fb3b91cd0e4231be878b0348afd17067cbe2\nBigQuery Storage Write API v1alpha2 clients. The service is enabled by whitelist only.\n\nPiperOrigin-RevId: 287379998\n\n650d7f1f8adb0cfaf37b3ce2241c3168f24efd4d\nUpdate Readme.md to match latest Bazel updates\n090d98aea20270e3be4b64240775588f7ce50ff8\ndocs(bigtable): Fix library release level listed in generated documentation\n\nPiperOrigin-RevId: 287308849\n\n2c28f646ca77b1d57550368be22aa388adde2e66\nfirestore: retry reads that fail with contention\n\nPiperOrigin-RevId: 287250665\n\nfd3091fbe9b2083cabc53dc50c78035658bfc4eb\nSync timeout in grpc config back to 10s for tasks API with github googelapis gapic config.\n\nPiperOrigin-RevId: 287207067\n\n49dd7d856a6f77c0cf7e5cb3334423e5089a9e8a\nbazel: Integrate bazel-2.0.0 compatibility fixes\n\nPiperOrigin-RevId: 287205644\n\n46e52fd64973e815cae61e78b14608fe7aa7b1df\nbazel: Integrate bazel build file generator\n\nTo generate/update BUILD.bazel files for any particular client or a batch of clients:\n```\nbazel run //:build_gen -- --src=google/example/library\n```\n\nPiperOrigin-RevId: 286958627\n\n1a380ea21dea9b6ac6ad28c60ad96d9d73574e19\nBigQuery Storage Read API v1beta2 clients.\n\nPiperOrigin-RevId: 286616241\n\n5f3f1d0f1c06b6475a17d995e4f7a436ca67ec9e\nAdd Artman config for secretmanager.\n\nPiperOrigin-RevId: 286598440\n\n50af0530730348f1e3697bf3c70261f7daaf2981\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 286491002\n\n91818800384f4ed26961aea268910b1a2ec58cc8\nFor Data Catalog API,\n1. Add support for marking a tag template field as required when creating a new tag template.\n2. Add support for updating a tag template field from required to optional.\n\nPiperOrigin-RevId: 286490262\n\nff4a2047b3d66f38c9b22197c370ed0d02fc0238\nWeekly library update.\n\nPiperOrigin-RevId: 286484215\n\n192c14029861752a911ed434fd6ee5b850517cd9\nWeekly library update.\n\nPiperOrigin-RevId: 286484165\n\nd9e328eaf790d4e4346fbbf32858160f497a03e0\nFix bazel build (versions 1.x)\n\nBump gapic-generator and resource names plugins to the latest version.\n\nPiperOrigin-RevId: 286469287\n\n0ca305403dcc50e31ad9477c9b6241ddfd2056af\nsecretmanager client package name option updates for java and go\n\nPiperOrigin-RevId: 286439553\n\nade4803e8a1a9e3efd249c8c86895d2f12eb2aaa\niam credentials: publish v1 protos containing annotations\n\nPiperOrigin-RevId: 286418383\n\n03e5708e5f8d1909dcb74b25520309e59ebf24be\nsecuritycenter: add missing proto deps for Bazel build\n\nPiperOrigin-RevId: 286417075\n\n8b991eb3eb82483b0ca1f1361a9c8e5b375c4747\nAdd secretmanager client package name options.\n\nPiperOrigin-RevId: 286415883\n\nd400cb8d45df5b2ae796b909f098a215b2275c1d\ndialogflow: add operation_info annotations to BatchUpdateEntities and BatchDeleteEntities.\n\nPiperOrigin-RevId: 286312673\n\nf2b25232db397ebd4f67eb901a2a4bc99f7cc4c6\nIncreased the default timeout time for all the Cloud Security Command Center client libraries.\n\nPiperOrigin-RevId: 286263771\n\ncb2f1eefd684c7efd56fd375cde8d4084a20439e\nExposing new Resource fields in the SecurityCenterProperties proto, added more comments to the filter logic for these Resource fields, and updated the response proto for the ListFindings API with the new Resource fields.\n\nPiperOrigin-RevId: 286263092\n\n73cebb20432b387c3d8879bb161b517d60cf2552\nUpdate v1beta2 clusters and jobs to include resource ids in GRPC header.\n\nPiperOrigin-RevId: 286261392\n\n1b4e453d51c0bd77e7b73896cdd8357d62768d83\nsecuritycenter: publish v1beta1 protos with annotations\n\nPiperOrigin-RevId: 286228860\n\na985eeda90ae98e8519d2320bee4dec148eb8ccb\nAdd default retry configurations for speech_v1p1beta1.\n\nSettings are copied from speech_gapic.legacy.yaml. The Python client library is being generated with timeouts that are too low. See https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2578\n\nPiperOrigin-RevId: 286191318\n\n3352100a15ede383f5ab3c34599f7a10a3d066fe\nMake importing rule with the same name (but different aliases) from different repositories possible.\n\nThis is needed to allow monolitic gapic-generator and microgenerators coexist during transition period.\n\nTo plug a microgenerator:\n\n1) Add corresponding rules bidnings under `switched_rules_by_language` in repository_rules.bzl:\n rules[\"go_gapic_library2\"] = _switch(\n go and grpc and gapic,\n \"@gapic_generator_go//rules_go_gapic/go_gapic.bzl\",\n \"go_gapic_library\",\n )\n\n2) Import microgenerator in WORKSPACE (the above example assumes that the generator was imported under name \"gapic_generator_go\").\n\n3) To migrate an API from monolith to micro generator (this is done per API and per language) modify the corresponding load statement in the API's BUILD.bazel file. For example, for the example above, to migrate to go microgenerator modify the go-specific load statement in BUILD.bazel file of a specific API (which you want to migrate) to the following:\n\nload(\n \"@com_google_googleapis_imports//:imports.bzl\",\n \"go_gapic_assembly_pkg\",\n go_gapic_library = \"go_gapic_library2\",\n \"go_proto_library\",\n \"go_test\",\n)\n\nPiperOrigin-RevId: 286065440\n\n6ad2bb13bc4b0f3f785517f0563118f6ca52ddfd\nUpdated v1beta1 protos for the client:\n- added support for GenericSignedAttestation which has a generic Signature\n- added support for CVSSv3 and WindowsDetail in Vulnerability\n- documentation updates\n\nPiperOrigin-RevId: 286008145\n\nfe1962e49999a832eed8162c45f23096336a9ced\nAdMob API v1 20191210\n\nBasic account info, mediation and network report available. See https://developers.google.com/admob/api/release-notes for more details.\n\nPiperOrigin-RevId: 285894502\n\n41fc1403738b61427f3a798ca9750ef47eb9c0f2\nAnnotate the required fields for the Monitoring Dashboards API\n\nPiperOrigin-RevId: 285824386\n\n27d0e0f202cbe91bf155fcf36824a87a5764ef1e\nRemove inappropriate resource_reference annotations for UpdateWorkflowTemplateRequest.template.\n\nPiperOrigin-RevId: 285802643\n\ne5c4d3a2b5b5bef0a30df39ebb27711dc98dee64\nAdd Artman BUILD.bazel file for the Monitoring Dashboards API\n\nPiperOrigin-RevId: 285445602\n\n2085a0d3c76180ee843cf2ecef2b94ca5266be31\nFix path in the artman config for Monitoring Dashboard API.\n\nPiperOrigin-RevId: 285233245\n\n2da72dfe71e4cca80902f9e3e125c40f02c2925b\nAdd Artman and GAPIC configs for the Monitoring Dashboards API.\n\nPiperOrigin-RevId: 285211544\n\n9f6eeebf1f30f51ffa02acea5a71680fe592348e\nAdd annotations to Dataproc v1. (Also forwarding comment changes from internal source control.)\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 285197557\n\n19c4589a3cb44b3679f7b3fba88365b3d055d5f8\noslogin: fix v1beta retry configuration\n\nPiperOrigin-RevId: 285013366\n\nee3f02926d0f8a0bc13f8d716581aad20f575751\nAdd Monitoring Dashboards API protocol buffers to Google Cloud Monitoring API.\n\nPiperOrigin-RevId: 284982647\n\ne47fdd266542386e5e7346697f90476e96dc7ee8\nbigquery datatransfer: Remove non-publicly available DataSourceService.\n\nPiperOrigin-RevId: 284822593\n\n6156f433fd1d9d5e4a448d6c6da7f637921d92ea\nAdds OSConfig v1beta protos and initial client library config\n\nPiperOrigin-RevId: 284799663\n\n6cc9499e225a4f6a5e34fe07e390f67055d7991c\nAdd datetime.proto to google/type/BUILD.bazel\n\nPiperOrigin-RevId: 284643689\n\nfe7dd5277e39ffe0075729c61e8d118d7527946d\nCosmetic changes to proto comment as part of testing internal release instructions.\n\nPiperOrigin-RevId: 284608712\n\n68d109adad726b89f74276d2f4b2ba6aac6ec04a\nAdd annotations to securitycenter v1, but leave GAPIC v1 in place.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 284580511\n\ndf8a1707a910fc17c71407a75547992fd1864c51\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 284568564\n\na69a974976221ce3bb944901b739418b85d6408c\nclient library update\n\nPiperOrigin-RevId: 284463979\n\n" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "translate", - "apiVersion": "v3beta1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/translate/artman_translate_v3beta1.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "translate", - "apiVersion": "v3", - "language": "python", - "generator": "gapic", - "config": "google/cloud/translate/artman_translate_v3.yaml" - } - } - ], - "newFiles": [ - { - "path": ".coveragerc" - }, - { - "path": ".flake8" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "LICENSE" - }, - { - "path": "MANIFEST.in" - }, - { - "path": "README.rst" - }, - { - "path": "docs/README.rst" - }, - { - "path": "docs/_static/custom.css" - }, - { - "path": "docs/_templates/layout.html" - }, - { - "path": "docs/changelog.md" - }, - { - "path": "docs/client.rst" - }, - { - "path": "docs/conf.py" - }, - { - "path": "docs/gapic/v3/api.rst" - }, - { - "path": "docs/gapic/v3/types.rst" - }, - { - "path": "docs/gapic/v3beta1/api.rst" - }, - { - "path": "docs/gapic/v3beta1/types.rst" - }, - { - "path": "docs/index.rst" - }, - { - "path": "docs/usage.rst" - }, - { - "path": "docs/v2.rst" - }, - { - "path": "docs/v3.rst" - }, - { - "path": "docs/v3beta1.rst" - }, - { - "path": "google/__init__.py" - }, - { - "path": "google/cloud/__init__.py" - }, - { - "path": "google/cloud/translate.py" - }, - { - "path": "google/cloud/translate_v2/__init__.py" - }, - { - "path": "google/cloud/translate_v2/_http.py" - }, - { - "path": "google/cloud/translate_v2/client.py" - }, - { - "path": "google/cloud/translate_v3/__init__.py" - }, - { - "path": "google/cloud/translate_v3/gapic/__init__.py" - }, - { - "path": "google/cloud/translate_v3/gapic/enums.py" - }, - { - "path": "google/cloud/translate_v3/gapic/translation_service_client.py" - }, - { - "path": "google/cloud/translate_v3/gapic/translation_service_client_config.py" - }, - { - "path": "google/cloud/translate_v3/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/translate_v3/gapic/transports/translation_service_grpc_transport.py" - }, - { - "path": "google/cloud/translate_v3/proto/__init__.py" - }, - { - "path": "google/cloud/translate_v3/proto/translation_service.proto" - }, - { - "path": "google/cloud/translate_v3/proto/translation_service_pb2.py" - }, - { - "path": "google/cloud/translate_v3/proto/translation_service_pb2_grpc.py" - }, - { - "path": "google/cloud/translate_v3/types.py" - }, - { - "path": "google/cloud/translate_v3beta1/__init__.py" - }, - { - "path": "google/cloud/translate_v3beta1/gapic/__init__.py" - }, - { - "path": "google/cloud/translate_v3beta1/gapic/translation_service_client.py" - }, - { - "path": "google/cloud/translate_v3beta1/gapic/translation_service_client_config.py" - }, - { - "path": "google/cloud/translate_v3beta1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/translate_v3beta1/gapic/transports/translation_service_grpc_transport.py" - }, - { - "path": "google/cloud/translate_v3beta1/proto/__init__.py" - }, - { - "path": "google/cloud/translate_v3beta1/proto/translation_service.proto" - }, - { - "path": "google/cloud/translate_v3beta1/proto/translation_service_pb2.py" - }, - { - "path": "google/cloud/translate_v3beta1/proto/translation_service_pb2_grpc.py" - }, - { - "path": "google/cloud/translate_v3beta1/types.py" - }, - { - "path": "noxfile.py" - }, - { - "path": "pylint.config.py" - }, - { - "path": "setup.cfg" - }, - { - "path": "setup.py" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "tests/__init__.py" - }, - { - "path": "tests/system.py" - }, - { - "path": "tests/system/test_vpcsc.py" - }, - { - "path": "tests/unit/gapic/v3/test_translation_service_client_v3.py" - }, - { - "path": "tests/unit/gapic/v3beta1/test_translation_service_client_v3beta1.py" - }, - { - "path": "tests/unit/v2/test__http.py" - }, - { - "path": "tests/unit/v2/test_client.py" - } - ] -} \ No newline at end of file diff --git a/translate/synth.py b/translate/synth.py deleted file mode 100644 index 14a2ad464c37..000000000000 --- a/translate/synth.py +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -from synthtool import gcp - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() -versions = ["v3beta1", "v3"] - -excludes = [ - "setup.py", - "nox*.py", - "README.rst", - "docs/conf.py", - "docs/index.rst", - "translation.py", -] - -# ---------------------------------------------------------------------------- -# Generate asset GAPIC layer -# ---------------------------------------------------------------------------- -for version in versions: - library = gapic.py_library("translate", version, include_protos=True) - - # s.move(library / f'google/cloud/translation_{version}', f'google/cloud/translate_{version}', excludes=excludes) - s.move(library / f"google/cloud/translate_{version}", excludes=excludes) - s.move(library / "tests") - s.move(library / f"docs/gapic/{version}") - - # translation -> translate - s.replace( - "google/**/translation_service_pb2_grpc.py", - f"google.cloud.translation_{version}.proto", - f"google.cloud.translate_{version}.proto", - ) - -# Use the highest version library to generate documentation import alias. -s.move(library / "google/cloud/translate.py") - -s.replace( - "google/cloud/**/translation_service_pb2.py", - r"""record delimiters are ':raw-latex:`\\n`' instead of - ':raw-latex:`\\r`:raw-latex:`\\n`'.""", - r"""record delimiters are ``\\\\\\\\n`` instead of - ``\\\\\\\\r\\\\\\\\n``.""", -) - -# Fix docstring issue for classes with no summary line -s.replace( - "google/cloud/**/proto/*_pb2.py", - '''__doc__ = """Attributes:''', - '''__doc__ = """ - Attributes:''', -) - -# Fix wrapping for literal string -s.replace( - "google/cloud/**/translation_service_pb2.py", - r"""This field has the same length as \[``contents` -\s+`\]\[google\.cloud\.translation\.v3beta1\.TranslateTextRequest\.conte -\s+nts\]\.""", - """This field has the same length as [``contents``][google.cloud.translation.v3beta1.TranslateTextRequest.contents].""", -) - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = gcp.CommonTemplates().py_library(unit_cov_level=100, cov_level=100) -s.move(templated_files) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/translate/tests/__init__.py b/translate/tests/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/translate/tests/system.py b/translate/tests/system.py deleted file mode 100644 index b92ead125acf..000000000000 --- a/translate/tests/system.py +++ /dev/null @@ -1,75 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import unittest - -from google.cloud import translate_v2 - - -class Config(object): - """Run-time configuration to be modified at set-up. - - This is a mutable stand-in to allow test set-up to modify - global state. - """ - - CLIENT = None - - -def setUpModule(): - Config.CLIENT = translate_v2.Client() - - -class TestTranslate(unittest.TestCase): - def test_get_languages(self): - result = Config.CLIENT.get_languages() - # There are **many** more than 10 languages. - self.assertGreater(len(result), 10) - - lang_map = {val["language"]: val["name"] for val in result} - self.assertEqual(lang_map["en"], "English") - self.assertEqual(lang_map["ja"], "Japanese") - self.assertEqual(lang_map["lv"], "Latvian") - self.assertEqual(lang_map["zu"], "Zulu") - - def test_detect_language(self): - values = ["takoy", u"fa\xe7ade", "s'il vous plait"] - detections = Config.CLIENT.detect_language(values) - self.assertEqual(len(values), len(detections)) - self.assertEqual(detections[0]["language"], "ru") - self.assertEqual(detections[1]["language"], "fr") - self.assertEqual(detections[2]["language"], "fr") - - def test_translate(self): - values = ["petnaest", "dek kvin", "Me llamo Jeff", "My name is Jeff"] - translations = Config.CLIENT.translate( - values, target_language="de", model="nmt" - ) - self.assertEqual(len(values), len(translations)) - - self.assertEqual(translations[0]["detectedSourceLanguage"].lower(), "hr") - self.assertEqual(translations[0]["translatedText"].lower(), u"fünfzehn") - - self.assertEqual(translations[1]["detectedSourceLanguage"], "eo") - self.assertEqual(translations[1]["translatedText"].lower(), u"fünfzehn") - - self.assertEqual(translations[2]["detectedSourceLanguage"], "es") - self.assertEqual(translations[2]["translatedText"].lower(), u"ich heiße jeff") - - self.assertEqual(translations[3]["detectedSourceLanguage"], "en") - self.assertEqual( - translations[3]["translatedText"].lower(), "mein name ist jeff" - ) diff --git a/translate/tests/system/test_vpcsc.py b/translate/tests/system/test_vpcsc.py deleted file mode 100644 index 814ab8759c13..000000000000 --- a/translate/tests/system/test_vpcsc.py +++ /dev/null @@ -1,168 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Unit tests for VPC-SC.""" - -import pytest - -from google.api_core import exceptions -from google.cloud import translate_v3beta1 -from test_utils.vpcsc_config import vpcsc_config - -_VPCSC_PROHIBITED_MESSAGE = "Request is prohibited by organization's policy" - - -@pytest.fixture(scope="module") -def client(): - return translate_v3beta1.TranslationServiceClient() - - -@pytest.fixture(scope="module") -def parent_inside(client): - return client.location_path(vpcsc_config.project_inside, "us-central1") - - -@pytest.fixture(scope="module") -def parent_outside(client): - return client.location_path(vpcsc_config.project_outside, "us-central1") - - -@pytest.fixture(scope="module") -def glossary_name_inside(client): - return client.glossary_path( - vpcsc_config.project_inside, "us-central1", "fake_glossary" - ) - - -@pytest.fixture(scope="module") -def glossary_name_outside(client): - return client.glossary_path( - vpcsc_config.project_outside, "us-central1", "fake_glossary" - ) - - -def _make_glossary(name): - return { - "name": name, - "language_codes_set": {"language_codes": ["en", "ja"]}, - "input_config": { - "gcs_source": {"input_uri": "gs://fake-bucket/fake_glossary.csv"} - }, - } - - -@pytest.fixture(scope="module") -def glossary_inside(glossary_name_inside): - return _make_glossary(glossary_name_inside) - - -@pytest.fixture(scope="module") -def glossary_outside(glossary_name_outside): - return _make_glossary(glossary_name_outside) - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_create_glossary_w_inside(client, parent_inside, glossary_inside): - client.create_glossary(parent_inside, glossary_inside) - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_create_glossary_w_outside(client, parent_outside, glossary_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.create_glossary(parent_outside, glossary_outside) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_list_glossaries_w_inside(client, parent_inside): - list(client.list_glossaries(parent_inside)) - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_list_glossaries_w_outside(client, parent_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - list(client.list_glossaries(parent_outside)) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_get_glossary_w_inside(client, glossary_name_inside): - try: - client.get_glossary(glossary_name_inside) - except exceptions.NotFound: # no perms issue - pass - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_get_glossary_w_outside(client, glossary_name_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.get_glossary(glossary_name_outside) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_delete_glossary_w_inside(client, glossary_name_inside): - try: - client.delete_glossary(glossary_name_inside) - except exceptions.NotFound: # no perms issue - pass - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_delete_glossary_w_outside(client, glossary_name_outside): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.delete_glossary(glossary_name_outside) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_batch_translate_text_w_inside(client, parent_inside): - source_language_code = "en" - target_language_codes = ["es"] - input_configs = [{"gcs_source": {"input_uri": "gs://fake-bucket/*"}}] - output_config = { - "gcs_destination": {"output_uri_prefix": "gs://fake-bucket/output/"} - } - client.batch_translate_text( # no perms issue - parent_inside, - source_language_code, - target_language_codes, - input_configs, - output_config, - ) - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_batch_translate_text_w_outside(client, parent_outside): - source_language_code = "en" - target_language_codes = ["es"] - input_configs = [{"gcs_source": {"input_uri": "gs://fake-bucket/*"}}] - output_config = { - "gcs_destination": {"output_uri_prefix": "gs://fake-bucket/output/"} - } - with pytest.raises(exceptions.PermissionDenied) as exc: - client.batch_translate_text( - parent_outside, - source_language_code, - target_language_codes, - input_configs, - output_config, - ) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) diff --git a/translate/tests/unit/gapic/v3/test_translation_service_client_v3.py b/translate/tests/unit/gapic/v3/test_translation_service_client_v3.py deleted file mode 100644 index 65b0d020f60d..000000000000 --- a/translate/tests/unit/gapic/v3/test_translation_service_client_v3.py +++ /dev/null @@ -1,470 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import translate_v3 -from google.cloud.translate_v3.proto import translation_service_pb2 -from google.longrunning import operations_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestTranslationServiceClient(object): - def test_translate_text(self): - # Setup Expected Response - expected_response = {} - expected_response = translation_service_pb2.TranslateTextResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3.TranslationServiceClient() - - # Setup Request - contents = [] - target_language_code = "targetLanguageCode1323228230" - parent = client.location_path("[PROJECT]", "[LOCATION]") - - response = client.translate_text(contents, target_language_code, parent) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = translation_service_pb2.TranslateTextRequest( - contents=contents, target_language_code=target_language_code, parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_translate_text_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3.TranslationServiceClient() - - # Setup request - contents = [] - target_language_code = "targetLanguageCode1323228230" - parent = client.location_path("[PROJECT]", "[LOCATION]") - - with pytest.raises(CustomException): - client.translate_text(contents, target_language_code, parent) - - def test_detect_language(self): - # Setup Expected Response - expected_response = {} - expected_response = translation_service_pb2.DetectLanguageResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3.TranslationServiceClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - response = client.detect_language(parent) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = translation_service_pb2.DetectLanguageRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_detect_language_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3.TranslationServiceClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - with pytest.raises(CustomException): - client.detect_language(parent) - - def test_get_supported_languages(self): - # Setup Expected Response - expected_response = {} - expected_response = translation_service_pb2.SupportedLanguages( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3.TranslationServiceClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - response = client.get_supported_languages(parent) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = translation_service_pb2.GetSupportedLanguagesRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_supported_languages_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3.TranslationServiceClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - with pytest.raises(CustomException): - client.get_supported_languages(parent) - - def test_batch_translate_text(self): - # Setup Expected Response - total_characters = 1368640955 - translated_characters = 1337326221 - failed_characters = 1723028396 - expected_response = { - "total_characters": total_characters, - "translated_characters": translated_characters, - "failed_characters": failed_characters, - } - expected_response = translation_service_pb2.BatchTranslateResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_batch_translate_text", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3.TranslationServiceClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - source_language_code = "sourceLanguageCode1687263568" - target_language_codes = [] - input_configs = [] - output_config = {} - - response = client.batch_translate_text( - parent, - source_language_code, - target_language_codes, - input_configs, - output_config, - ) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = translation_service_pb2.BatchTranslateTextRequest( - parent=parent, - source_language_code=source_language_code, - target_language_codes=target_language_codes, - input_configs=input_configs, - output_config=output_config, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_batch_translate_text_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_batch_translate_text_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3.TranslationServiceClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - source_language_code = "sourceLanguageCode1687263568" - target_language_codes = [] - input_configs = [] - output_config = {} - - response = client.batch_translate_text( - parent, - source_language_code, - target_language_codes, - input_configs, - output_config, - ) - exception = response.exception() - assert exception.errors[0] == error - - def test_create_glossary(self): - # Setup Expected Response - name = "name3373707" - entry_count = 811131134 - expected_response = {"name": name, "entry_count": entry_count} - expected_response = translation_service_pb2.Glossary(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_create_glossary", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3.TranslationServiceClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - glossary = {} - - response = client.create_glossary(parent, glossary) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = translation_service_pb2.CreateGlossaryRequest( - parent=parent, glossary=glossary - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_glossary_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_create_glossary_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3.TranslationServiceClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - glossary = {} - - response = client.create_glossary(parent, glossary) - exception = response.exception() - assert exception.errors[0] == error - - def test_list_glossaries(self): - # Setup Expected Response - next_page_token = "" - glossaries_element = {} - glossaries = [glossaries_element] - expected_response = { - "next_page_token": next_page_token, - "glossaries": glossaries, - } - expected_response = translation_service_pb2.ListGlossariesResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3.TranslationServiceClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_glossaries(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.glossaries[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = translation_service_pb2.ListGlossariesRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_glossaries_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3.TranslationServiceClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_glossaries(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_glossary(self): - # Setup Expected Response - name_2 = "name2-1052831874" - entry_count = 811131134 - expected_response = {"name": name_2, "entry_count": entry_count} - expected_response = translation_service_pb2.Glossary(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3.TranslationServiceClient() - - # Setup Request - name = client.glossary_path("[PROJECT]", "[LOCATION]", "[GLOSSARY]") - - response = client.get_glossary(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = translation_service_pb2.GetGlossaryRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_glossary_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3.TranslationServiceClient() - - # Setup request - name = client.glossary_path("[PROJECT]", "[LOCATION]", "[GLOSSARY]") - - with pytest.raises(CustomException): - client.get_glossary(name) - - def test_delete_glossary(self): - # Setup Expected Response - name_2 = "name2-1052831874" - expected_response = {"name": name_2} - expected_response = translation_service_pb2.DeleteGlossaryResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_delete_glossary", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3.TranslationServiceClient() - - # Setup Request - name = client.glossary_path("[PROJECT]", "[LOCATION]", "[GLOSSARY]") - - response = client.delete_glossary(name) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = translation_service_pb2.DeleteGlossaryRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_glossary_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_delete_glossary_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3.TranslationServiceClient() - - # Setup Request - name = client.glossary_path("[PROJECT]", "[LOCATION]", "[GLOSSARY]") - - response = client.delete_glossary(name) - exception = response.exception() - assert exception.errors[0] == error diff --git a/translate/tests/unit/gapic/v3beta1/test_translation_service_client_v3beta1.py b/translate/tests/unit/gapic/v3beta1/test_translation_service_client_v3beta1.py deleted file mode 100644 index fa2bccc23c79..000000000000 --- a/translate/tests/unit/gapic/v3beta1/test_translation_service_client_v3beta1.py +++ /dev/null @@ -1,470 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import translate_v3beta1 -from google.cloud.translate_v3beta1.proto import translation_service_pb2 -from google.longrunning import operations_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestTranslationServiceClient(object): - def test_translate_text(self): - # Setup Expected Response - expected_response = {} - expected_response = translation_service_pb2.TranslateTextResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3beta1.TranslationServiceClient() - - # Setup Request - contents = [] - target_language_code = "targetLanguageCode1323228230" - parent = client.location_path("[PROJECT]", "[LOCATION]") - - response = client.translate_text(contents, target_language_code, parent) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = translation_service_pb2.TranslateTextRequest( - contents=contents, target_language_code=target_language_code, parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_translate_text_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3beta1.TranslationServiceClient() - - # Setup request - contents = [] - target_language_code = "targetLanguageCode1323228230" - parent = client.location_path("[PROJECT]", "[LOCATION]") - - with pytest.raises(CustomException): - client.translate_text(contents, target_language_code, parent) - - def test_detect_language(self): - # Setup Expected Response - expected_response = {} - expected_response = translation_service_pb2.DetectLanguageResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3beta1.TranslationServiceClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - response = client.detect_language(parent) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = translation_service_pb2.DetectLanguageRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_detect_language_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3beta1.TranslationServiceClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - with pytest.raises(CustomException): - client.detect_language(parent) - - def test_get_supported_languages(self): - # Setup Expected Response - expected_response = {} - expected_response = translation_service_pb2.SupportedLanguages( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3beta1.TranslationServiceClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - response = client.get_supported_languages(parent) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = translation_service_pb2.GetSupportedLanguagesRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_supported_languages_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3beta1.TranslationServiceClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - with pytest.raises(CustomException): - client.get_supported_languages(parent) - - def test_batch_translate_text(self): - # Setup Expected Response - total_characters = 1368640955 - translated_characters = 1337326221 - failed_characters = 1723028396 - expected_response = { - "total_characters": total_characters, - "translated_characters": translated_characters, - "failed_characters": failed_characters, - } - expected_response = translation_service_pb2.BatchTranslateResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_batch_translate_text", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3beta1.TranslationServiceClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - source_language_code = "sourceLanguageCode1687263568" - target_language_codes = [] - input_configs = [] - output_config = {} - - response = client.batch_translate_text( - parent, - source_language_code, - target_language_codes, - input_configs, - output_config, - ) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = translation_service_pb2.BatchTranslateTextRequest( - parent=parent, - source_language_code=source_language_code, - target_language_codes=target_language_codes, - input_configs=input_configs, - output_config=output_config, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_batch_translate_text_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_batch_translate_text_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3beta1.TranslationServiceClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - source_language_code = "sourceLanguageCode1687263568" - target_language_codes = [] - input_configs = [] - output_config = {} - - response = client.batch_translate_text( - parent, - source_language_code, - target_language_codes, - input_configs, - output_config, - ) - exception = response.exception() - assert exception.errors[0] == error - - def test_create_glossary(self): - # Setup Expected Response - name = "name3373707" - entry_count = 811131134 - expected_response = {"name": name, "entry_count": entry_count} - expected_response = translation_service_pb2.Glossary(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_create_glossary", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3beta1.TranslationServiceClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - glossary = {} - - response = client.create_glossary(parent, glossary) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = translation_service_pb2.CreateGlossaryRequest( - parent=parent, glossary=glossary - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_glossary_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_create_glossary_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3beta1.TranslationServiceClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - glossary = {} - - response = client.create_glossary(parent, glossary) - exception = response.exception() - assert exception.errors[0] == error - - def test_list_glossaries(self): - # Setup Expected Response - next_page_token = "" - glossaries_element = {} - glossaries = [glossaries_element] - expected_response = { - "next_page_token": next_page_token, - "glossaries": glossaries, - } - expected_response = translation_service_pb2.ListGlossariesResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3beta1.TranslationServiceClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_glossaries(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.glossaries[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = translation_service_pb2.ListGlossariesRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_glossaries_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3beta1.TranslationServiceClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_glossaries(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_glossary(self): - # Setup Expected Response - name_2 = "name2-1052831874" - entry_count = 811131134 - expected_response = {"name": name_2, "entry_count": entry_count} - expected_response = translation_service_pb2.Glossary(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3beta1.TranslationServiceClient() - - # Setup Request - name = client.glossary_path("[PROJECT]", "[LOCATION]", "[GLOSSARY]") - - response = client.get_glossary(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = translation_service_pb2.GetGlossaryRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_glossary_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3beta1.TranslationServiceClient() - - # Setup request - name = client.glossary_path("[PROJECT]", "[LOCATION]", "[GLOSSARY]") - - with pytest.raises(CustomException): - client.get_glossary(name) - - def test_delete_glossary(self): - # Setup Expected Response - name_2 = "name2-1052831874" - expected_response = {"name": name_2} - expected_response = translation_service_pb2.DeleteGlossaryResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_delete_glossary", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3beta1.TranslationServiceClient() - - # Setup Request - name = client.glossary_path("[PROJECT]", "[LOCATION]", "[GLOSSARY]") - - response = client.delete_glossary(name) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = translation_service_pb2.DeleteGlossaryRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_glossary_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_delete_glossary_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = translate_v3beta1.TranslationServiceClient() - - # Setup Request - name = client.glossary_path("[PROJECT]", "[LOCATION]", "[GLOSSARY]") - - response = client.delete_glossary(name) - exception = response.exception() - assert exception.errors[0] == error diff --git a/translate/tests/unit/v2/test__http.py b/translate/tests/unit/v2/test__http.py deleted file mode 100644 index d2c3b9b69fab..000000000000 --- a/translate/tests/unit/v2/test__http.py +++ /dev/null @@ -1,94 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import unittest - -import mock - - -class TestConnection(unittest.TestCase): - @staticmethod - def _get_target_class(): - from google.cloud.translate_v2._http import Connection - - return Connection - - def _make_one(self, *args, **kw): - return self._get_target_class()(*args, **kw) - - def test_build_api_url_no_extra_query_params(self): - conn = self._make_one(object()) - URI = "/".join( - [ - conn.DEFAULT_API_ENDPOINT, - "language", - "translate", - conn.API_VERSION, - "foo", - ] - ) - self.assertEqual(conn.build_api_url("/foo"), URI) - - def test_build_api_url_w_custom_endpoint(self): - custom_endpoint = "https://foo-translation.googleapis.com" - conn = self._make_one(object(), api_endpoint=custom_endpoint) - URI = "/".join( - [custom_endpoint, "language", "translate", conn.API_VERSION, "foo"] - ) - self.assertEqual(conn.build_api_url("/foo"), URI) - - def test_build_api_url_w_extra_query_params(self): - from six.moves.urllib.parse import parse_qsl - from six.moves.urllib.parse import urlsplit - - conn = self._make_one(object()) - query_params = [("q", "val1"), ("q", "val2")] - uri = conn.build_api_url("/foo", query_params=query_params) - scheme, netloc, path, qs, _ = urlsplit(uri) - self.assertEqual("%s://%s" % (scheme, netloc), conn.API_BASE_URL) - expected_path = "/".join(["", "language", "translate", conn.API_VERSION, "foo"]) - self.assertEqual(path, expected_path) - params = parse_qsl(qs) - self.assertEqual(params, query_params) - - def test_extra_headers(self): - import requests - from google.cloud import _http as base_http - - http = mock.create_autospec(requests.Session, instance=True) - response = requests.Response() - response.status_code = 200 - data = b"brent-spiner" - response._content = data - http.request.return_value = response - client = mock.Mock(_http=http, spec=["_http"]) - - conn = self._make_one(client) - req_data = "req-data-boring" - result = conn.api_request("GET", "/rainbow", data=req_data, expect_json=False) - self.assertEqual(result, data) - - expected_headers = { - base_http.CLIENT_INFO_HEADER: conn.user_agent, - "User-Agent": conn.user_agent, - "Accept-Encoding": "gzip", - } - expected_uri = conn.build_api_url("/rainbow") - http.request.assert_called_once_with( - data=req_data, - headers=expected_headers, - method="GET", - url=expected_uri, - timeout=60, - ) diff --git a/translate/tests/unit/v2/test_client.py b/translate/tests/unit/v2/test_client.py deleted file mode 100644 index 2c0f72b1a1e5..000000000000 --- a/translate/tests/unit/v2/test_client.py +++ /dev/null @@ -1,387 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import unittest - - -class TestClient(unittest.TestCase): - @staticmethod - def _get_target_class(): - from google.cloud.translate_v2 import Client - - return Client - - def _make_one(self, *args, **kw): - return self._get_target_class()(*args, **kw) - - def test_constructor_defaults(self): - from google.cloud._http import ClientInfo - from google.cloud.translate_v2._http import Connection - from google.cloud.translate_v2.client import ENGLISH_ISO_639 - - http = object() - client = self._make_one(_http=http) - self.assertIsInstance(client._connection, Connection) - self.assertIsNone(client._connection.credentials) - self.assertIs(client._connection.http, http) - self.assertEqual(client.target_language, ENGLISH_ISO_639) - self.assertIsInstance(client._connection._client_info, ClientInfo) - - def test_constructor_explicit(self): - from google.cloud._http import ClientInfo - from google.cloud.translate_v2._http import Connection - - http = object() - target = "es" - client_info = ClientInfo() - client = self._make_one( - target_language=target, - _http=http, - client_info=client_info, - client_options={"api_endpoint": "https://foo-translation.googleapis.com"}, - ) - self.assertIsInstance(client._connection, Connection) - self.assertIsNone(client._connection.credentials) - self.assertIs(client._connection.http, http) - self.assertEqual(client.target_language, target) - self.assertIs(client._connection._client_info, client_info) - self.assertEqual( - client._connection.API_BASE_URL, "https://foo-translation.googleapis.com" - ) - - def test_constructor_w_empty_client_options(self): - from google.cloud._http import ClientInfo - from google.api_core.client_options import ClientOptions - - http = object() - target = "es" - client_info = ClientInfo() - client_options = ClientOptions() - client = self._make_one( - target_language=target, - _http=http, - client_info=client_info, - client_options=client_options, - ) - self.assertEqual( - client._connection.API_BASE_URL, client._connection.DEFAULT_API_ENDPOINT - ) - - def test_constructor_w_client_options_object(self): - from google.cloud._http import ClientInfo - from google.api_core.client_options import ClientOptions - - http = object() - target = "es" - client_info = ClientInfo() - client_options = ClientOptions( - api_endpoint="https://foo-translation.googleapis.com" - ) - client = self._make_one( - target_language=target, - _http=http, - client_info=client_info, - client_options=client_options, - ) - self.assertEqual( - client._connection.API_BASE_URL, "https://foo-translation.googleapis.com" - ) - - def test_get_languages(self): - from google.cloud.translate_v2.client import ENGLISH_ISO_639 - - client = self._make_one(_http=object()) - supported = [ - {"language": "en", "name": "English"}, - {"language": "af", "name": "Afrikaans"}, - {"language": "am", "name": "Amharic"}, - ] - data = {"data": {"languages": supported}} - conn = client._connection = _Connection(data) - - result = client.get_languages() - self.assertEqual(result, supported) - - # Verify requested. - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "GET") - self.assertEqual(req["path"], "/languages") - self.assertEqual(req["query_params"], {"target": ENGLISH_ISO_639}) - - def test_get_languages_no_target(self): - client = self._make_one(target_language=None, _http=object()) - supported = [{"language": "en"}, {"language": "af"}, {"language": "am"}] - data = {"data": {"languages": supported}} - conn = client._connection = _Connection(data) - - result = client.get_languages() - self.assertEqual(result, supported) - - # Verify requested. - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(len(req), 3) - self.assertEqual(req["method"], "GET") - self.assertEqual(req["path"], "/languages") - self.assertEqual(req["query_params"], {}) - - def test_get_languages_explicit_target(self): - client = self._make_one(_http=object()) - target_language = "en" - supported = [ - {"language": "en", "name": "Spanish"}, - {"language": "af", "name": "Afrikaans"}, - {"language": "am", "name": "Amharic"}, - ] - data = {"data": {"languages": supported}} - conn = client._connection = _Connection(data) - - result = client.get_languages(target_language) - self.assertEqual(result, supported) - - # Verify requested. - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "GET") - self.assertEqual(req["path"], "/languages") - self.assertEqual(req["query_params"], {"target": target_language}) - - def test_detect_language_bad_result(self): - client = self._make_one(_http=object()) - value = "takoy" - conn = client._connection = _Connection({}) - - with self.assertRaises(ValueError): - client.detect_language(value) - - # Verify requested. - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "POST") - self.assertEqual(req["path"], "/detect") - expected_data = {"q": [value]} - self.assertEqual(req["data"], expected_data) - - def test_detect_language_single_value(self): - client = self._make_one(_http=object()) - value = "takoy" - detection = { - "confidence": 1.0, - "input": value, - "language": "ru", - "isReliable": False, - } - data = {"data": {"detections": [[detection]]}} - conn = client._connection = _Connection(data) - - result = client.detect_language(value) - self.assertEqual(result, detection) - - # Verify requested. - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "POST") - self.assertEqual(req["path"], "/detect") - expected_data = {"q": [value]} - self.assertEqual(req["data"], expected_data) - - def test_detect_language_multiple_values(self): - client = self._make_one(_http=object()) - value1 = u"fa\xe7ade" # facade (with a cedilla) - detection1 = { - "confidence": 0.6166008, - "input": value1, - "isReliable": False, - "language": "en", - } - value2 = "s'il vous plait" - detection2 = { - "confidence": 0.29728225, - "input": value2, - "isReliable": False, - "language": "fr", - } - data = {"data": {"detections": [[detection1], [detection2]]}} - conn = client._connection = _Connection(data) - - result = client.detect_language([value1, value2]) - self.assertEqual(result, [detection1, detection2]) - - # Verify requested. - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "POST") - self.assertEqual(req["path"], "/detect") - expected_data = {"q": [value1, value2]} - self.assertEqual(req["data"], expected_data) - - def test_detect_language_multiple_results(self): - client = self._make_one(_http=object()) - value = "soy" - detection1 = { - "confidence": 0.81496066, - "input": value, - "language": "es", - "isReliable": False, - } - detection2 = { - "confidence": 0.222, - "input": value, - "language": "en", - "isReliable": False, - } - data = {"data": {"detections": [[detection1, detection2]]}} - client._connection = _Connection(data) - - with self.assertRaises(ValueError): - client.detect_language(value) - - def test_translate_bad_result(self): - client = self._make_one(_http=object()) - value = "hvala ti" - conn = client._connection = _Connection({}) - - with self.assertRaises(ValueError): - client.translate(value) - - # Verify requested. - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "POST") - self.assertEqual(req["path"], "") - expected_data = { - "target": "en", - "q": [value], - "cid": (), - "source": None, - "model": None, - "format": None, - } - self.assertEqual(req["data"], expected_data) - - def test_translate_defaults(self): - client = self._make_one(_http=object()) - value = "hvala ti" - translation = { - "detectedSourceLanguage": "hr", - "translatedText": "thank you", - "input": value, - } - data = {"data": {"translations": [translation]}} - conn = client._connection = _Connection(data) - - result = client.translate(value) - self.assertEqual(result, translation) - - # Verify requested. - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "POST") - self.assertEqual(req["path"], "") - - expected_data = { - "target": "en", - "q": [value], - "cid": (), - "source": None, - "model": None, - "format": None, - } - self.assertEqual(req["data"], expected_data) - - def test_translate_multiple(self): - client = self._make_one(_http=object()) - value1 = "hvala ti" - translation1 = { - "detectedSourceLanguage": "hr", - "translatedText": "thank you", - "input": value1, - } - value2 = "Dankon" - translation2 = { - "detectedSourceLanguage": "eo", - "translatedText": "thank you", - "input": value2, - } - data = {"data": {"translations": [translation1, translation2]}} - conn = client._connection = _Connection(data) - - result = client.translate([value1, value2]) - self.assertEqual(result, [translation1, translation2]) - - # Verify requested. - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "POST") - self.assertEqual(req["path"], "") - - expected_data = { - "target": "en", - "q": [value1, value2], - "cid": (), - "source": None, - "model": None, - "format": None, - } - self.assertEqual(req["data"], expected_data) - - def test_translate_explicit(self): - client = self._make_one(_http=object()) - value = "thank you" - target_language = "eo" - source_language = "en" - translation = {"translatedText": "Dankon", "input": value} - data = {"data": {"translations": [translation]}} - conn = client._connection = _Connection(data) - - cid = "123" - format_ = "text" - model = "nmt" - result = client.translate( - value, - target_language=target_language, - source_language=source_language, - format_=format_, - customization_ids=cid, - model=model, - ) - self.assertEqual(result, translation) - - # Verify requested. - self.assertEqual(len(conn._requested), 1) - req = conn._requested[0] - self.assertEqual(req["method"], "POST") - self.assertEqual(req["path"], "") - - expected_data = { - "target": target_language, - "q": [value], - "cid": [cid], - "source": source_language, - "model": model, - "format": format_, - } - self.assertEqual(req["data"], expected_data) - - -class _Connection(object): - def __init__(self, *responses): - self._responses = responses - self._requested = [] - - def api_request(self, **kw): - self._requested.append(kw) - response, self._responses = self._responses[0], self._responses[1:] - return response diff --git a/webrisk/.coveragerc b/webrisk/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/webrisk/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/webrisk/.flake8 b/webrisk/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/webrisk/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/webrisk/.repo-metadata.json b/webrisk/.repo-metadata.json deleted file mode 100644 index f240f01bfb68..000000000000 --- a/webrisk/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "webrisk", - "name_pretty": "Web Risk", - "product_documentation": "https://cloud.google.com/web-risk/docs/", - "client_documentation": "https://googleapis.dev/python/webrisk/latest", - "issue_tracker": "", - "release_level": "alpha", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-webrisk", - "api_id": "webrisk.googleapis.com", - "requires_billing": true -} \ No newline at end of file diff --git a/webrisk/CHANGELOG.md b/webrisk/CHANGELOG.md deleted file mode 100644 index c7e7c14b5c76..000000000000 --- a/webrisk/CHANGELOG.md +++ /dev/null @@ -1,41 +0,0 @@ -# Changelog - -[PyPI History][1] - -[1]: https://pypi.org/project/google-cloud-webrisk/#history -## 0.2.0 - -07-24-2019 17:55 PDT - - -### Implementation Changes -- Allow kwargs to be passed to create_channel (via synth). ([#8412](https://github.com/googleapis/google-cloud-python/pull/8412)) - -### New Features -- Add 'client_options' support, update list method docstrings (via synth). ([#8530](https://github.com/googleapis/google-cloud-python/pull/8530)) - -### Dependencies -- Bump minimum version for google-api-core to 1.14.0. ([#8709](https://github.com/googleapis/google-cloud-python/pull/8709)) - -### Documentation -- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705)) -- Add compatibility check badges to READMEs. ([#8288](https://github.com/googleapis/google-cloud-python/pull/8288)) - -### Internal / Testing Changes -- Add docs job to publish to googleapis.dev. ([#8464](https://github.com/googleapis/google-cloud-python/pull/8464)) -- Declare encoding as utf-8 in pb2 files (via synth). ([#8372](https://github.com/googleapis/google-cloud-python/pull/8372)) -- Add disclaimer to auto-generated template files. ([#8336](https://github.com/googleapis/google-cloud-python/pull/8336)) -- Fix coverage in 'types.py' (via synth). ([#8171](https://github.com/googleapis/google-cloud-python/pull/8171)) -- Add empty lines (via synth). ([#8078](https://github.com/googleapis/google-cloud-python/pull/8078)) - -## 0.1.0 - -04-16-2019 17:09 PDT - - -### New Features -- Initial release of Web Risk. ([#7651](https://github.com/googleapis/google-cloud-python/pull/7651)) - -### Documentation -- Add whitelist info to README. ([#7717](https://github.com/googleapis/google-cloud-python/pull/7717)) - diff --git a/webrisk/LICENSE b/webrisk/LICENSE deleted file mode 100644 index a8ee855de2aa..000000000000 --- a/webrisk/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/webrisk/MANIFEST.in b/webrisk/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/webrisk/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/webrisk/README.rst b/webrisk/README.rst deleted file mode 100644 index e0e2bdca54f1..000000000000 --- a/webrisk/README.rst +++ /dev/null @@ -1,81 +0,0 @@ -Python Client for Web Risk API (`Alpha`_) -========================================= - - - -**Note:** Cloud Web Risk is not yet publicly available. You must be whitelisted in order to gain access. See `Setting up the Web Risk API`_ in the product documentation for a link to the sign-up form. - -.. _Setting up the Web Risk API: - -`Web Risk API`: https://cloud.google.com/web-risk/docs/quickstart - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. _Alpha: https://github.com/googleapis/google-cloud-python/blob/master/README.rst -.. _Web Risk API: https://cloud.google.com/web-risk -.. _Client Library Documentation: https://googleapis.dev/python/webrisk/latest -.. _Product Documentation: https://cloud.google.com/web-risk - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the Web Risk API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Web Risk API.: https://cloud.google.com/web-risk -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-webrisk - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-webrisk - -Next Steps -~~~~~~~~~~ - -- Read the `Client Library Documentation`_ for Web Risk API - API to see other available methods on the client. -- Read the `Web Risk API Product documentation`_ to learn - more about the product and see How-to Guides. -- View this `repository’s main README`_ to see the full list of Cloud - APIs that we cover. - -.. _Web Risk API Product documentation: https://cloud.google.com/web-risk -.. _repository’s main README: https://github.com/googleapis/google-cloud-python/blob/master/README.rst diff --git a/webrisk/docs/README.rst b/webrisk/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/webrisk/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/webrisk/docs/_static/custom.css b/webrisk/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/webrisk/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/webrisk/docs/_templates/layout.html b/webrisk/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/webrisk/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/webrisk/docs/changelog.md b/webrisk/docs/changelog.md deleted file mode 120000 index 04c99a55caae..000000000000 --- a/webrisk/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../CHANGELOG.md \ No newline at end of file diff --git a/webrisk/docs/conf.py b/webrisk/docs/conf.py deleted file mode 100644 index 5a30b7a826c3..000000000000 --- a/webrisk/docs/conf.py +++ /dev/null @@ -1,363 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-webrisk documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-webrisk" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-webrisk-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-webrisk.tex", - u"google-cloud-webrisk Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - master_doc, - "google-cloud-webrisk", - u"google-cloud-webrisk Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-webrisk", - u"google-cloud-webrisk Documentation", - author, - "google-cloud-webrisk", - "GAPIC library for the {metadata.shortName} v1beta1 service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/master/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/webrisk/docs/gapic/v1beta1/api.rst b/webrisk/docs/gapic/v1beta1/api.rst deleted file mode 100644 index d939a64ab665..000000000000 --- a/webrisk/docs/gapic/v1beta1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Web Risk API -======================= - -.. automodule:: google.cloud.webrisk_v1beta1 - :members: - :inherited-members: \ No newline at end of file diff --git a/webrisk/docs/gapic/v1beta1/types.rst b/webrisk/docs/gapic/v1beta1/types.rst deleted file mode 100644 index e3d2bc86bb51..000000000000 --- a/webrisk/docs/gapic/v1beta1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Web Risk API Client -============================= - -.. automodule:: google.cloud.webrisk_v1beta1.types - :members: \ No newline at end of file diff --git a/webrisk/docs/index.rst b/webrisk/docs/index.rst deleted file mode 100644 index 0df8ada047ca..000000000000 --- a/webrisk/docs/index.rst +++ /dev/null @@ -1,10 +0,0 @@ -.. include:: README.rst - -Api Reference -------------- -.. toctree:: - :maxdepth: 2 - - gapic/v1beta1/api - gapic/v1beta1/types - changelog \ No newline at end of file diff --git a/webrisk/google/__init__.py b/webrisk/google/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/webrisk/google/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/webrisk/google/cloud/__init__.py b/webrisk/google/cloud/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/webrisk/google/cloud/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/webrisk/google/cloud/webrisk.py b/webrisk/google/cloud/webrisk.py deleted file mode 100644 index e2971fdc4af6..000000000000 --- a/webrisk/google/cloud/webrisk.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import - -from google.cloud.webrisk_v1beta1 import WebRiskServiceV1Beta1Client -from google.cloud.webrisk_v1beta1 import enums -from google.cloud.webrisk_v1beta1 import types - - -__all__ = ("enums", "types", "WebRiskServiceV1Beta1Client") diff --git a/webrisk/google/cloud/webrisk_v1beta1/__init__.py b/webrisk/google/cloud/webrisk_v1beta1/__init__.py deleted file mode 100644 index bf228d20b05b..000000000000 --- a/webrisk/google/cloud/webrisk_v1beta1/__init__.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.webrisk_v1beta1 import types -from google.cloud.webrisk_v1beta1.gapic import enums -from google.cloud.webrisk_v1beta1.gapic import web_risk_service_v1_beta1_client - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class WebRiskServiceV1Beta1Client( - web_risk_service_v1_beta1_client.WebRiskServiceV1Beta1Client -): - __doc__ = web_risk_service_v1_beta1_client.WebRiskServiceV1Beta1Client.__doc__ - enums = enums - - -__all__ = ("enums", "types", "WebRiskServiceV1Beta1Client") diff --git a/webrisk/google/cloud/webrisk_v1beta1/gapic/__init__.py b/webrisk/google/cloud/webrisk_v1beta1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/webrisk/google/cloud/webrisk_v1beta1/gapic/enums.py b/webrisk/google/cloud/webrisk_v1beta1/gapic/enums.py deleted file mode 100644 index 42fad3e37ef3..000000000000 --- a/webrisk/google/cloud/webrisk_v1beta1/gapic/enums.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class CompressionType(enum.IntEnum): - """ - The ways in which threat entry sets can be compressed. - - Attributes: - COMPRESSION_TYPE_UNSPECIFIED (int): Unknown. - RAW (int): Raw, uncompressed data. - RICE (int): Rice-Golomb encoded data. - """ - - COMPRESSION_TYPE_UNSPECIFIED = 0 - RAW = 1 - RICE = 2 - - -class ThreatType(enum.IntEnum): - """ - The type of threat. This maps dirrectly to the threat list a threat may - belong to. - - Attributes: - THREAT_TYPE_UNSPECIFIED (int): Unknown. - MALWARE (int): Malware targeting any platform. - SOCIAL_ENGINEERING (int): Social engineering targeting any platform. - UNWANTED_SOFTWARE (int): Unwanted software targeting any platform. - """ - - THREAT_TYPE_UNSPECIFIED = 0 - MALWARE = 1 - SOCIAL_ENGINEERING = 2 - UNWANTED_SOFTWARE = 3 - - -class ComputeThreatListDiffResponse(object): - class ResponseType(enum.IntEnum): - """ - The type of response sent to the client. - - Attributes: - RESPONSE_TYPE_UNSPECIFIED (int): Unknown. - DIFF (int): Partial updates are applied to the client's existing local database. - RESET (int): Full updates resets the client's entire local database. This means - that either the client had no state, was seriously out-of-date, - or the client is believed to be corrupt. - """ - - RESPONSE_TYPE_UNSPECIFIED = 0 - DIFF = 1 - RESET = 2 diff --git a/webrisk/google/cloud/webrisk_v1beta1/gapic/transports/__init__.py b/webrisk/google/cloud/webrisk_v1beta1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/webrisk/google/cloud/webrisk_v1beta1/gapic/transports/web_risk_service_v1_beta1_grpc_transport.py b/webrisk/google/cloud/webrisk_v1beta1/gapic/transports/web_risk_service_v1_beta1_grpc_transport.py deleted file mode 100644 index cd461a8ac098..000000000000 --- a/webrisk/google/cloud/webrisk_v1beta1/gapic/transports/web_risk_service_v1_beta1_grpc_transport.py +++ /dev/null @@ -1,153 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers - -from google.cloud.webrisk_v1beta1.proto import webrisk_pb2_grpc - - -class WebRiskServiceV1Beta1GrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.webrisk.v1beta1 WebRiskServiceV1Beta1 API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="webrisk.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "web_risk_service_v1_beta1_stub": webrisk_pb2_grpc.WebRiskServiceV1Beta1Stub( - channel - ) - } - - @classmethod - def create_channel( - cls, address="webrisk.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def compute_threat_list_diff(self): - """Return the gRPC stub for :meth:`WebRiskServiceV1Beta1Client.compute_threat_list_diff`. - - Gets the most recent threat list diffs. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_risk_service_v1_beta1_stub"].ComputeThreatListDiff - - @property - def search_uris(self): - """Return the gRPC stub for :meth:`WebRiskServiceV1Beta1Client.search_uris`. - - This method is used to check whether a URI is on a given threatList. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_risk_service_v1_beta1_stub"].SearchUris - - @property - def search_hashes(self): - """Return the gRPC stub for :meth:`WebRiskServiceV1Beta1Client.search_hashes`. - - Gets the full hashes that match the requested hash prefix. - This is used after a hash prefix is looked up in a threatList - and there is a match. The client side threatList only holds partial hashes - so the client must query this method to determine if there is a full - hash match of a threat. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_risk_service_v1_beta1_stub"].SearchHashes diff --git a/webrisk/google/cloud/webrisk_v1beta1/gapic/web_risk_service_v1_beta1_client.py b/webrisk/google/cloud/webrisk_v1beta1/gapic/web_risk_service_v1_beta1_client.py deleted file mode 100644 index 73c30ef47930..000000000000 --- a/webrisk/google/cloud/webrisk_v1beta1/gapic/web_risk_service_v1_beta1_client.py +++ /dev/null @@ -1,389 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.cloud.webrisk.v1beta1 WebRiskServiceV1Beta1 API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.grpc_helpers -import grpc - -from google.cloud.webrisk_v1beta1.gapic import enums -from google.cloud.webrisk_v1beta1.gapic import web_risk_service_v1_beta1_client_config -from google.cloud.webrisk_v1beta1.gapic.transports import ( - web_risk_service_v1_beta1_grpc_transport, -) -from google.cloud.webrisk_v1beta1.proto import webrisk_pb2 -from google.cloud.webrisk_v1beta1.proto import webrisk_pb2_grpc - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-webrisk").version - - -class WebRiskServiceV1Beta1Client(object): - """ - Web Risk v1beta1 API defines an interface to detect malicious URLs on your - website and in client applications. - """ - - SERVICE_ADDRESS = "webrisk.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - WebRiskServiceV1Beta1Client: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.WebRiskServiceV1Beta1GrpcTransport, - Callable[[~.Credentials, type], ~.WebRiskServiceV1Beta1GrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = web_risk_service_v1_beta1_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=web_risk_service_v1_beta1_grpc_transport.WebRiskServiceV1Beta1GrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = web_risk_service_v1_beta1_grpc_transport.WebRiskServiceV1Beta1GrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def compute_threat_list_diff( - self, - threat_type, - constraints, - version_token=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets the most recent threat list diffs. - - Example: - >>> from google.cloud import webrisk_v1beta1 - >>> from google.cloud.webrisk_v1beta1 import enums - >>> - >>> client = webrisk_v1beta1.WebRiskServiceV1Beta1Client() - >>> - >>> # TODO: Initialize `threat_type`: - >>> threat_type = enums.ThreatType.THREAT_TYPE_UNSPECIFIED - >>> - >>> # TODO: Initialize `constraints`: - >>> constraints = {} - >>> - >>> response = client.compute_threat_list_diff(threat_type, constraints) - - Args: - threat_type (~google.cloud.webrisk_v1beta1.types.ThreatType): The ThreatList to update. - constraints (Union[dict, ~google.cloud.webrisk_v1beta1.types.Constraints]): Required. The constraints associated with this request. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.webrisk_v1beta1.types.Constraints` - version_token (bytes): The current version token of the client for the requested list (the - client version that was received from the last successful diff). - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.webrisk_v1beta1.types.ComputeThreatListDiffResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "compute_threat_list_diff" not in self._inner_api_calls: - self._inner_api_calls[ - "compute_threat_list_diff" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.compute_threat_list_diff, - default_retry=self._method_configs["ComputeThreatListDiff"].retry, - default_timeout=self._method_configs["ComputeThreatListDiff"].timeout, - client_info=self._client_info, - ) - - request = webrisk_pb2.ComputeThreatListDiffRequest( - threat_type=threat_type, - constraints=constraints, - version_token=version_token, - ) - return self._inner_api_calls["compute_threat_list_diff"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def search_uris( - self, - uri, - threat_types, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - This method is used to check whether a URI is on a given threatList. - - Example: - >>> from google.cloud import webrisk_v1beta1 - >>> from google.cloud.webrisk_v1beta1 import enums - >>> - >>> client = webrisk_v1beta1.WebRiskServiceV1Beta1Client() - >>> - >>> # TODO: Initialize `uri`: - >>> uri = '' - >>> - >>> # TODO: Initialize `threat_types`: - >>> threat_types = [] - >>> - >>> response = client.search_uris(uri, threat_types) - - Args: - uri (str): Required. The URI to be checked for matches. - threat_types (list[~google.cloud.webrisk_v1beta1.types.ThreatType]): Required. The ThreatLists to search in. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.webrisk_v1beta1.types.SearchUrisResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "search_uris" not in self._inner_api_calls: - self._inner_api_calls[ - "search_uris" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.search_uris, - default_retry=self._method_configs["SearchUris"].retry, - default_timeout=self._method_configs["SearchUris"].timeout, - client_info=self._client_info, - ) - - request = webrisk_pb2.SearchUrisRequest(uri=uri, threat_types=threat_types) - return self._inner_api_calls["search_uris"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def search_hashes( - self, - threat_types, - hash_prefix=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets the full hashes that match the requested hash prefix. - This is used after a hash prefix is looked up in a threatList - and there is a match. The client side threatList only holds partial hashes - so the client must query this method to determine if there is a full - hash match of a threat. - - Example: - >>> from google.cloud import webrisk_v1beta1 - >>> from google.cloud.webrisk_v1beta1 import enums - >>> - >>> client = webrisk_v1beta1.WebRiskServiceV1Beta1Client() - >>> - >>> # TODO: Initialize `threat_types`: - >>> threat_types = [] - >>> - >>> response = client.search_hashes(threat_types) - - Args: - threat_types (list[~google.cloud.webrisk_v1beta1.types.ThreatType]): Required. The ThreatLists to search in. - hash_prefix (bytes): A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 - hash. For JSON requests, this field is base64-encoded. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.webrisk_v1beta1.types.SearchHashesResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "search_hashes" not in self._inner_api_calls: - self._inner_api_calls[ - "search_hashes" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.search_hashes, - default_retry=self._method_configs["SearchHashes"].retry, - default_timeout=self._method_configs["SearchHashes"].timeout, - client_info=self._client_info, - ) - - request = webrisk_pb2.SearchHashesRequest( - threat_types=threat_types, hash_prefix=hash_prefix - ) - return self._inner_api_calls["search_hashes"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/webrisk/google/cloud/webrisk_v1beta1/gapic/web_risk_service_v1_beta1_client_config.py b/webrisk/google/cloud/webrisk_v1beta1/gapic/web_risk_service_v1_beta1_client_config.py deleted file mode 100644 index dd153e419c12..000000000000 --- a/webrisk/google/cloud/webrisk_v1beta1/gapic/web_risk_service_v1_beta1_client_config.py +++ /dev/null @@ -1,38 +0,0 @@ -config = { - "interfaces": { - "google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "ComputeThreatListDiff": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "SearchUris": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "SearchHashes": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/webrisk/google/cloud/webrisk_v1beta1/proto/__init__.py b/webrisk/google/cloud/webrisk_v1beta1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/webrisk/google/cloud/webrisk_v1beta1/proto/webrisk.proto b/webrisk/google/cloud/webrisk_v1beta1/proto/webrisk.proto deleted file mode 100644 index 7f8021d16b3e..000000000000 --- a/webrisk/google/cloud/webrisk_v1beta1/proto/webrisk.proto +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.webrisk.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.WebRisk.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/webrisk/v1beta1;webrisk"; -option java_multiple_files = true; -option java_outer_classname = "WebRiskProto"; -option java_package = "com.google.webrisk.v1beta1"; -option objc_class_prefix = "GCWR"; -option php_namespace = "Google\\Cloud\\WebRisk\\V1beta1"; - -// Web Risk v1beta1 API defines an interface to detect malicious URLs on your -// website and in client applications. -service WebRiskServiceV1Beta1 { - option (google.api.default_host) = "webrisk.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Gets the most recent threat list diffs. - rpc ComputeThreatListDiff(ComputeThreatListDiffRequest) returns (ComputeThreatListDiffResponse) { - option (google.api.http) = { - get: "/v1beta1/threatLists:computeDiff" - }; - option (google.api.method_signature) = "threat_type,version_token,constraints"; - } - - // This method is used to check whether a URI is on a given threatList. - rpc SearchUris(SearchUrisRequest) returns (SearchUrisResponse) { - option (google.api.http) = { - get: "/v1beta1/uris:search" - }; - option (google.api.method_signature) = "uri,threat_types"; - } - - // Gets the full hashes that match the requested hash prefix. - // This is used after a hash prefix is looked up in a threatList - // and there is a match. The client side threatList only holds partial hashes - // so the client must query this method to determine if there is a full - // hash match of a threat. - rpc SearchHashes(SearchHashesRequest) returns (SearchHashesResponse) { - option (google.api.http) = { - get: "/v1beta1/hashes:search" - }; - option (google.api.method_signature) = "hash_prefix,threat_types"; - } -} - -// Describes an API diff request. -message ComputeThreatListDiffRequest { - // The constraints for this diff. - message Constraints { - // The maximum size in number of entries. The diff will not contain more - // entries than this value. This should be a power of 2 between 2**10 and - // 2**20. If zero, no diff size limit is set. - int32 max_diff_entries = 1; - - // Sets the maximum number of entries that the client is willing to have - // in the local database. This should be a power of 2 between 2**10 and - // 2**20. If zero, no database size limit is set. - int32 max_database_entries = 2; - - // The compression types supported by the client. - repeated CompressionType supported_compressions = 3; - } - - // The ThreatList to update. - ThreatType threat_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // The current version token of the client for the requested list (the - // client version that was received from the last successful diff). - bytes version_token = 2; - - // Required. The constraints associated with this request. - Constraints constraints = 3 [(google.api.field_behavior) = REQUIRED]; -} - -message ComputeThreatListDiffResponse { - // The expected state of a client's local database. - message Checksum { - // The SHA256 hash of the client state; that is, of the sorted list of all - // hashes present in the database. - bytes sha256 = 1; - } - - // The type of response sent to the client. - enum ResponseType { - // Unknown. - RESPONSE_TYPE_UNSPECIFIED = 0; - - // Partial updates are applied to the client's existing local database. - DIFF = 1; - - // Full updates resets the client's entire local database. This means - // that either the client had no state, was seriously out-of-date, - // or the client is believed to be corrupt. - RESET = 2; - } - - // The type of response. This may indicate that an action must be taken by the - // client when the response is received. - ResponseType response_type = 4; - - // A set of entries to add to a local threat type's list. - ThreatEntryAdditions additions = 5; - - // A set of entries to remove from a local threat type's list. - // This field may be empty. - ThreatEntryRemovals removals = 6; - - // The new opaque client version token. - bytes new_version_token = 7; - - // The expected SHA256 hash of the client state; that is, of the sorted list - // of all hashes present in the database after applying the provided diff. - // If the client state doesn't match the expected state, the client must - // disregard this diff and retry later. - Checksum checksum = 8; - - // The soonest the client should wait before issuing any diff - // request. Querying sooner is unlikely to produce a meaningful diff. - // Waiting longer is acceptable considering the use case. - // If this field is not set clients may update as soon as they want. - google.protobuf.Timestamp recommended_next_diff = 2; -} - -// Request to check URI entries against threatLists. -message SearchUrisRequest { - // Required. The URI to be checked for matches. - string uri = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ThreatLists to search in. - repeated ThreatType threat_types = 2 [(google.api.field_behavior) = REQUIRED]; -} - -message SearchUrisResponse { - // Contains threat information on a matching uri. - message ThreatUri { - // The ThreatList this threat belongs to. - repeated ThreatType threat_types = 1; - - // The cache lifetime for the returned match. Clients must not cache this - // response past this timestamp to avoid false positives. - google.protobuf.Timestamp expire_time = 2; - } - - // The threat list matches. This may be empty if the URI is on no list. - ThreatUri threat = 1; -} - -// Request to return full hashes matched by the provided hash prefixes. -message SearchHashesRequest { - // A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 - // hash. For JSON requests, this field is base64-encoded. - bytes hash_prefix = 1; - - // Required. The ThreatLists to search in. - repeated ThreatType threat_types = 2 [(google.api.field_behavior) = REQUIRED]; -} - -message SearchHashesResponse { - // Contains threat information on a matching hash. - message ThreatHash { - // The ThreatList this threat belongs to. - // This must contain at least one entry. - repeated ThreatType threat_types = 1; - - // A 32 byte SHA256 hash. This field is in binary format. For JSON - // requests, hashes are base64-encoded. - bytes hash = 2; - - // The cache lifetime for the returned match. Clients must not cache this - // response past this timestamp to avoid false positives. - google.protobuf.Timestamp expire_time = 3; - } - - // The full hashes that matched the requested prefixes. - // The hash will be populated in the key. - repeated ThreatHash threats = 1; - - // For requested entities that did not match the threat list, how long to - // cache the response until. - google.protobuf.Timestamp negative_expire_time = 2; -} - -// Contains the set of entries to add to a local database. -// May contain a combination of compressed and raw data in a single response. -message ThreatEntryAdditions { - // The raw SHA256-formatted entries. - // Repeated to allow returning sets of hashes with different prefix sizes. - repeated RawHashes raw_hashes = 1; - - // The encoded 4-byte prefixes of SHA256-formatted entries, using a - // Golomb-Rice encoding. The hashes are converted to uint32, sorted in - // ascending order, then delta encoded and stored as encoded_data. - RiceDeltaEncoding rice_hashes = 2; -} - -// Contains the set of entries to remove from a local database. -message ThreatEntryRemovals { - // The raw removal indices for a local list. - RawIndices raw_indices = 1; - - // The encoded local, lexicographically-sorted list indices, using a - // Golomb-Rice encoding. Used for sending compressed removal indices. The - // removal indices (uint32) are sorted in ascending order, then delta encoded - // and stored as encoded_data. - RiceDeltaEncoding rice_indices = 2; -} - -// The type of threat. This maps dirrectly to the threat list a threat may -// belong to. -enum ThreatType { - // Unknown. - THREAT_TYPE_UNSPECIFIED = 0; - - // Malware targeting any platform. - MALWARE = 1; - - // Social engineering targeting any platform. - SOCIAL_ENGINEERING = 2; - - // Unwanted software targeting any platform. - UNWANTED_SOFTWARE = 3; -} - -// The ways in which threat entry sets can be compressed. -enum CompressionType { - // Unknown. - COMPRESSION_TYPE_UNSPECIFIED = 0; - - // Raw, uncompressed data. - RAW = 1; - - // Rice-Golomb encoded data. - RICE = 2; -} - -// A set of raw indices to remove from a local list. -message RawIndices { - // The indices to remove from a lexicographically-sorted local list. - repeated int32 indices = 1; -} - -// The uncompressed threat entries in hash format. -// Hashes can be anywhere from 4 to 32 bytes in size. A large majority are 4 -// bytes, but some hashes are lengthened if they collide with the hash of a -// popular URI. -// -// Used for sending ThreatEntryAdditons to clients that do not support -// compression, or when sending non-4-byte hashes to clients that do support -// compression. -message RawHashes { - // The number of bytes for each prefix encoded below. This field can be - // anywhere from 4 (shortest prefix) to 32 (full SHA256 hash). - int32 prefix_size = 1; - - // The hashes, in binary format, concatenated into one long string. Hashes are - // sorted in lexicographic order. For JSON API users, hashes are - // base64-encoded. - bytes raw_hashes = 2; -} - -// The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or -// compressed removal indices. -message RiceDeltaEncoding { - // The offset of the first entry in the encoded data, or, if only a single - // integer was encoded, that single integer's value. If the field is empty or - // missing, assume zero. - int64 first_value = 1; - - // The Golomb-Rice parameter, which is a number between 2 and 28. This field - // is missing (that is, zero) if `num_entries` is zero. - int32 rice_parameter = 2; - - // The number of entries that are delta encoded in the encoded data. If only a - // single integer was encoded, this will be zero and the single value will be - // stored in `first_value`. - int32 entry_count = 3; - - // The encoded deltas that are encoded using the Golomb-Rice coder. - bytes encoded_data = 4; -} diff --git a/webrisk/google/cloud/webrisk_v1beta1/proto/webrisk_pb2.py b/webrisk/google/cloud/webrisk_v1beta1/proto/webrisk_pb2.py deleted file mode 100644 index 60a8fb3a8fb3..000000000000 --- a/webrisk/google/cloud/webrisk_v1beta1/proto/webrisk_pb2.py +++ /dev/null @@ -1,1599 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/webrisk_v1beta1/proto/webrisk.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/webrisk_v1beta1/proto/webrisk.proto", - package="google.cloud.webrisk.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\032com.google.webrisk.v1beta1B\014WebRiskProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/webrisk/v1beta1;webrisk\242\002\004GCWR\252\002\034Google.Cloud.WebRisk.V1Beta1\312\002\034Google\\Cloud\\WebRisk\\V1beta1" - ), - serialized_pb=_b( - '\n0google/cloud/webrisk_v1beta1/proto/webrisk.proto\x12\x1cgoogle.cloud.webrisk.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xf2\x02\n\x1c\x43omputeThreatListDiffRequest\x12\x42\n\x0bthreat_type\x18\x01 \x01(\x0e\x32(.google.cloud.webrisk.v1beta1.ThreatTypeB\x03\xe0\x41\x02\x12\x15\n\rversion_token\x18\x02 \x01(\x0c\x12`\n\x0b\x63onstraints\x18\x03 \x01(\x0b\x32\x46.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.ConstraintsB\x03\xe0\x41\x02\x1a\x94\x01\n\x0b\x43onstraints\x12\x18\n\x10max_diff_entries\x18\x01 \x01(\x05\x12\x1c\n\x14max_database_entries\x18\x02 \x01(\x05\x12M\n\x16supported_compressions\x18\x03 \x03(\x0e\x32-.google.cloud.webrisk.v1beta1.CompressionType"\x9a\x04\n\x1d\x43omputeThreatListDiffResponse\x12_\n\rresponse_type\x18\x04 \x01(\x0e\x32H.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.ResponseType\x12\x45\n\tadditions\x18\x05 \x01(\x0b\x32\x32.google.cloud.webrisk.v1beta1.ThreatEntryAdditions\x12\x43\n\x08removals\x18\x06 \x01(\x0b\x32\x31.google.cloud.webrisk.v1beta1.ThreatEntryRemovals\x12\x19\n\x11new_version_token\x18\x07 \x01(\x0c\x12V\n\x08\x63hecksum\x18\x08 \x01(\x0b\x32\x44.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum\x12\x39\n\x15recommended_next_diff\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x1a\n\x08\x43hecksum\x12\x0e\n\x06sha256\x18\x01 \x01(\x0c"B\n\x0cResponseType\x12\x1d\n\x19RESPONSE_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x44IFF\x10\x01\x12\t\n\x05RESET\x10\x02"j\n\x11SearchUrisRequest\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x43\n\x0cthreat_types\x18\x02 \x03(\x0e\x32(.google.cloud.webrisk.v1beta1.ThreatTypeB\x03\xe0\x41\x02"\xde\x01\n\x12SearchUrisResponse\x12J\n\x06threat\x18\x01 \x01(\x0b\x32:.google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri\x1a|\n\tThreatUri\x12>\n\x0cthreat_types\x18\x01 \x03(\x0e\x32(.google.cloud.webrisk.v1beta1.ThreatType\x12/\n\x0b\x65xpire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"o\n\x13SearchHashesRequest\x12\x13\n\x0bhash_prefix\x18\x01 \x01(\x0c\x12\x43\n\x0cthreat_types\x18\x02 \x03(\x0e\x32(.google.cloud.webrisk.v1beta1.ThreatTypeB\x03\xe0\x41\x02"\xae\x02\n\x14SearchHashesResponse\x12N\n\x07threats\x18\x01 \x03(\x0b\x32=.google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash\x12\x38\n\x14negative_expire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x8b\x01\n\nThreatHash\x12>\n\x0cthreat_types\x18\x01 \x03(\x0e\x32(.google.cloud.webrisk.v1beta1.ThreatType\x12\x0c\n\x04hash\x18\x02 \x01(\x0c\x12/\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"\x99\x01\n\x14ThreatEntryAdditions\x12;\n\nraw_hashes\x18\x01 \x03(\x0b\x32\'.google.cloud.webrisk.v1beta1.RawHashes\x12\x44\n\x0brice_hashes\x18\x02 \x01(\x0b\x32/.google.cloud.webrisk.v1beta1.RiceDeltaEncoding"\x9b\x01\n\x13ThreatEntryRemovals\x12=\n\x0braw_indices\x18\x01 \x01(\x0b\x32(.google.cloud.webrisk.v1beta1.RawIndices\x12\x45\n\x0crice_indices\x18\x02 \x01(\x0b\x32/.google.cloud.webrisk.v1beta1.RiceDeltaEncoding"\x1d\n\nRawIndices\x12\x0f\n\x07indices\x18\x01 \x03(\x05"4\n\tRawHashes\x12\x13\n\x0bprefix_size\x18\x01 \x01(\x05\x12\x12\n\nraw_hashes\x18\x02 \x01(\x0c"k\n\x11RiceDeltaEncoding\x12\x13\n\x0b\x66irst_value\x18\x01 \x01(\x03\x12\x16\n\x0erice_parameter\x18\x02 \x01(\x05\x12\x13\n\x0b\x65ntry_count\x18\x03 \x01(\x05\x12\x14\n\x0c\x65ncoded_data\x18\x04 \x01(\x0c*e\n\nThreatType\x12\x1b\n\x17THREAT_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07MALWARE\x10\x01\x12\x16\n\x12SOCIAL_ENGINEERING\x10\x02\x12\x15\n\x11UNWANTED_SOFTWARE\x10\x03*F\n\x0f\x43ompressionType\x12 \n\x1c\x43OMPRESSION_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03RAW\x10\x01\x12\x08\n\x04RICE\x10\x02\x32\x9e\x05\n\x15WebRiskServiceV1Beta1\x12\xe2\x01\n\x15\x43omputeThreatListDiff\x12:.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest\x1a;.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse"P\x82\xd3\xe4\x93\x02"\x12 /v1beta1/threatLists:computeDiff\xda\x41%threat_type,version_token,constraints\x12\xa0\x01\n\nSearchUris\x12/.google.cloud.webrisk.v1beta1.SearchUrisRequest\x1a\x30.google.cloud.webrisk.v1beta1.SearchUrisResponse"/\x82\xd3\xe4\x93\x02\x16\x12\x14/v1beta1/uris:search\xda\x41\x10uri,threat_types\x12\xb0\x01\n\x0cSearchHashes\x12\x31.google.cloud.webrisk.v1beta1.SearchHashesRequest\x1a\x32.google.cloud.webrisk.v1beta1.SearchHashesResponse"9\x82\xd3\xe4\x93\x02\x18\x12\x16/v1beta1/hashes:search\xda\x41\x18hash_prefix,threat_types\x1aJ\xca\x41\x16webrisk.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb6\x01\n\x1a\x63om.google.webrisk.v1beta1B\x0cWebRiskProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/webrisk/v1beta1;webrisk\xa2\x02\x04GCWR\xaa\x02\x1cGoogle.Cloud.WebRisk.V1Beta1\xca\x02\x1cGoogle\\Cloud\\WebRisk\\V1beta1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - -_THREATTYPE = _descriptor.EnumDescriptor( - name="ThreatType", - full_name="google.cloud.webrisk.v1beta1.ThreatType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="THREAT_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="MALWARE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SOCIAL_ENGINEERING", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="UNWANTED_SOFTWARE", - index=3, - number=3, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2376, - serialized_end=2477, -) -_sym_db.RegisterEnumDescriptor(_THREATTYPE) - -ThreatType = enum_type_wrapper.EnumTypeWrapper(_THREATTYPE) -_COMPRESSIONTYPE = _descriptor.EnumDescriptor( - name="CompressionType", - full_name="google.cloud.webrisk.v1beta1.CompressionType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="COMPRESSION_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RAW", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RICE", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2479, - serialized_end=2549, -) -_sym_db.RegisterEnumDescriptor(_COMPRESSIONTYPE) - -CompressionType = enum_type_wrapper.EnumTypeWrapper(_COMPRESSIONTYPE) -THREAT_TYPE_UNSPECIFIED = 0 -MALWARE = 1 -SOCIAL_ENGINEERING = 2 -UNWANTED_SOFTWARE = 3 -COMPRESSION_TYPE_UNSPECIFIED = 0 -RAW = 1 -RICE = 2 - - -_COMPUTETHREATLISTDIFFRESPONSE_RESPONSETYPE = _descriptor.EnumDescriptor( - name="ResponseType", - full_name="google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.ResponseType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="RESPONSE_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="DIFF", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RESET", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1049, - serialized_end=1115, -) -_sym_db.RegisterEnumDescriptor(_COMPUTETHREATLISTDIFFRESPONSE_RESPONSETYPE) - - -_COMPUTETHREATLISTDIFFREQUEST_CONSTRAINTS = _descriptor.Descriptor( - name="Constraints", - full_name="google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="max_diff_entries", - full_name="google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints.max_diff_entries", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_database_entries", - full_name="google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints.max_database_entries", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="supported_compressions", - full_name="google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints.supported_compressions", - index=2, - number=3, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=426, - serialized_end=574, -) - -_COMPUTETHREATLISTDIFFREQUEST = _descriptor.Descriptor( - name="ComputeThreatListDiffRequest", - full_name="google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="threat_type", - full_name="google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.threat_type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="version_token", - full_name="google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.version_token", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="constraints", - full_name="google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.constraints", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_COMPUTETHREATLISTDIFFREQUEST_CONSTRAINTS], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=204, - serialized_end=574, -) - - -_COMPUTETHREATLISTDIFFRESPONSE_CHECKSUM = _descriptor.Descriptor( - name="Checksum", - full_name="google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="sha256", - full_name="google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum.sha256", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1021, - serialized_end=1047, -) - -_COMPUTETHREATLISTDIFFRESPONSE = _descriptor.Descriptor( - name="ComputeThreatListDiffResponse", - full_name="google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="response_type", - full_name="google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.response_type", - index=0, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="additions", - full_name="google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.additions", - index=1, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="removals", - full_name="google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.removals", - index=2, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="new_version_token", - full_name="google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.new_version_token", - index=3, - number=7, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="checksum", - full_name="google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.checksum", - index=4, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="recommended_next_diff", - full_name="google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.recommended_next_diff", - index=5, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_COMPUTETHREATLISTDIFFRESPONSE_CHECKSUM], - enum_types=[_COMPUTETHREATLISTDIFFRESPONSE_RESPONSETYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=577, - serialized_end=1115, -) - - -_SEARCHURISREQUEST = _descriptor.Descriptor( - name="SearchUrisRequest", - full_name="google.cloud.webrisk.v1beta1.SearchUrisRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.webrisk.v1beta1.SearchUrisRequest.uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="threat_types", - full_name="google.cloud.webrisk.v1beta1.SearchUrisRequest.threat_types", - index=1, - number=2, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1117, - serialized_end=1223, -) - - -_SEARCHURISRESPONSE_THREATURI = _descriptor.Descriptor( - name="ThreatUri", - full_name="google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="threat_types", - full_name="google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.threat_types", - index=0, - number=1, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="expire_time", - full_name="google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri.expire_time", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1324, - serialized_end=1448, -) - -_SEARCHURISRESPONSE = _descriptor.Descriptor( - name="SearchUrisResponse", - full_name="google.cloud.webrisk.v1beta1.SearchUrisResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="threat", - full_name="google.cloud.webrisk.v1beta1.SearchUrisResponse.threat", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[_SEARCHURISRESPONSE_THREATURI], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1226, - serialized_end=1448, -) - - -_SEARCHHASHESREQUEST = _descriptor.Descriptor( - name="SearchHashesRequest", - full_name="google.cloud.webrisk.v1beta1.SearchHashesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="hash_prefix", - full_name="google.cloud.webrisk.v1beta1.SearchHashesRequest.hash_prefix", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="threat_types", - full_name="google.cloud.webrisk.v1beta1.SearchHashesRequest.threat_types", - index=1, - number=2, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1450, - serialized_end=1561, -) - - -_SEARCHHASHESRESPONSE_THREATHASH = _descriptor.Descriptor( - name="ThreatHash", - full_name="google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="threat_types", - full_name="google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.threat_types", - index=0, - number=1, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="hash", - full_name="google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.hash", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="expire_time", - full_name="google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash.expire_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1727, - serialized_end=1866, -) - -_SEARCHHASHESRESPONSE = _descriptor.Descriptor( - name="SearchHashesResponse", - full_name="google.cloud.webrisk.v1beta1.SearchHashesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="threats", - full_name="google.cloud.webrisk.v1beta1.SearchHashesResponse.threats", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="negative_expire_time", - full_name="google.cloud.webrisk.v1beta1.SearchHashesResponse.negative_expire_time", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_SEARCHHASHESRESPONSE_THREATHASH], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1564, - serialized_end=1866, -) - - -_THREATENTRYADDITIONS = _descriptor.Descriptor( - name="ThreatEntryAdditions", - full_name="google.cloud.webrisk.v1beta1.ThreatEntryAdditions", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="raw_hashes", - full_name="google.cloud.webrisk.v1beta1.ThreatEntryAdditions.raw_hashes", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="rice_hashes", - full_name="google.cloud.webrisk.v1beta1.ThreatEntryAdditions.rice_hashes", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1869, - serialized_end=2022, -) - - -_THREATENTRYREMOVALS = _descriptor.Descriptor( - name="ThreatEntryRemovals", - full_name="google.cloud.webrisk.v1beta1.ThreatEntryRemovals", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="raw_indices", - full_name="google.cloud.webrisk.v1beta1.ThreatEntryRemovals.raw_indices", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="rice_indices", - full_name="google.cloud.webrisk.v1beta1.ThreatEntryRemovals.rice_indices", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2025, - serialized_end=2180, -) - - -_RAWINDICES = _descriptor.Descriptor( - name="RawIndices", - full_name="google.cloud.webrisk.v1beta1.RawIndices", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="indices", - full_name="google.cloud.webrisk.v1beta1.RawIndices.indices", - index=0, - number=1, - type=5, - cpp_type=1, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2182, - serialized_end=2211, -) - - -_RAWHASHES = _descriptor.Descriptor( - name="RawHashes", - full_name="google.cloud.webrisk.v1beta1.RawHashes", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="prefix_size", - full_name="google.cloud.webrisk.v1beta1.RawHashes.prefix_size", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="raw_hashes", - full_name="google.cloud.webrisk.v1beta1.RawHashes.raw_hashes", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2213, - serialized_end=2265, -) - - -_RICEDELTAENCODING = _descriptor.Descriptor( - name="RiceDeltaEncoding", - full_name="google.cloud.webrisk.v1beta1.RiceDeltaEncoding", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="first_value", - full_name="google.cloud.webrisk.v1beta1.RiceDeltaEncoding.first_value", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="rice_parameter", - full_name="google.cloud.webrisk.v1beta1.RiceDeltaEncoding.rice_parameter", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="entry_count", - full_name="google.cloud.webrisk.v1beta1.RiceDeltaEncoding.entry_count", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="encoded_data", - full_name="google.cloud.webrisk.v1beta1.RiceDeltaEncoding.encoded_data", - index=3, - number=4, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2267, - serialized_end=2374, -) - -_COMPUTETHREATLISTDIFFREQUEST_CONSTRAINTS.fields_by_name[ - "supported_compressions" -].enum_type = _COMPRESSIONTYPE -_COMPUTETHREATLISTDIFFREQUEST_CONSTRAINTS.containing_type = ( - _COMPUTETHREATLISTDIFFREQUEST -) -_COMPUTETHREATLISTDIFFREQUEST.fields_by_name["threat_type"].enum_type = _THREATTYPE -_COMPUTETHREATLISTDIFFREQUEST.fields_by_name[ - "constraints" -].message_type = _COMPUTETHREATLISTDIFFREQUEST_CONSTRAINTS -_COMPUTETHREATLISTDIFFRESPONSE_CHECKSUM.containing_type = _COMPUTETHREATLISTDIFFRESPONSE -_COMPUTETHREATLISTDIFFRESPONSE.fields_by_name[ - "response_type" -].enum_type = _COMPUTETHREATLISTDIFFRESPONSE_RESPONSETYPE -_COMPUTETHREATLISTDIFFRESPONSE.fields_by_name[ - "additions" -].message_type = _THREATENTRYADDITIONS -_COMPUTETHREATLISTDIFFRESPONSE.fields_by_name[ - "removals" -].message_type = _THREATENTRYREMOVALS -_COMPUTETHREATLISTDIFFRESPONSE.fields_by_name[ - "checksum" -].message_type = _COMPUTETHREATLISTDIFFRESPONSE_CHECKSUM -_COMPUTETHREATLISTDIFFRESPONSE.fields_by_name[ - "recommended_next_diff" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_COMPUTETHREATLISTDIFFRESPONSE_RESPONSETYPE.containing_type = ( - _COMPUTETHREATLISTDIFFRESPONSE -) -_SEARCHURISREQUEST.fields_by_name["threat_types"].enum_type = _THREATTYPE -_SEARCHURISRESPONSE_THREATURI.fields_by_name["threat_types"].enum_type = _THREATTYPE -_SEARCHURISRESPONSE_THREATURI.fields_by_name[ - "expire_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_SEARCHURISRESPONSE_THREATURI.containing_type = _SEARCHURISRESPONSE -_SEARCHURISRESPONSE.fields_by_name[ - "threat" -].message_type = _SEARCHURISRESPONSE_THREATURI -_SEARCHHASHESREQUEST.fields_by_name["threat_types"].enum_type = _THREATTYPE -_SEARCHHASHESRESPONSE_THREATHASH.fields_by_name["threat_types"].enum_type = _THREATTYPE -_SEARCHHASHESRESPONSE_THREATHASH.fields_by_name[ - "expire_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_SEARCHHASHESRESPONSE_THREATHASH.containing_type = _SEARCHHASHESRESPONSE -_SEARCHHASHESRESPONSE.fields_by_name[ - "threats" -].message_type = _SEARCHHASHESRESPONSE_THREATHASH -_SEARCHHASHESRESPONSE.fields_by_name[ - "negative_expire_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_THREATENTRYADDITIONS.fields_by_name["raw_hashes"].message_type = _RAWHASHES -_THREATENTRYADDITIONS.fields_by_name["rice_hashes"].message_type = _RICEDELTAENCODING -_THREATENTRYREMOVALS.fields_by_name["raw_indices"].message_type = _RAWINDICES -_THREATENTRYREMOVALS.fields_by_name["rice_indices"].message_type = _RICEDELTAENCODING -DESCRIPTOR.message_types_by_name[ - "ComputeThreatListDiffRequest" -] = _COMPUTETHREATLISTDIFFREQUEST -DESCRIPTOR.message_types_by_name[ - "ComputeThreatListDiffResponse" -] = _COMPUTETHREATLISTDIFFRESPONSE -DESCRIPTOR.message_types_by_name["SearchUrisRequest"] = _SEARCHURISREQUEST -DESCRIPTOR.message_types_by_name["SearchUrisResponse"] = _SEARCHURISRESPONSE -DESCRIPTOR.message_types_by_name["SearchHashesRequest"] = _SEARCHHASHESREQUEST -DESCRIPTOR.message_types_by_name["SearchHashesResponse"] = _SEARCHHASHESRESPONSE -DESCRIPTOR.message_types_by_name["ThreatEntryAdditions"] = _THREATENTRYADDITIONS -DESCRIPTOR.message_types_by_name["ThreatEntryRemovals"] = _THREATENTRYREMOVALS -DESCRIPTOR.message_types_by_name["RawIndices"] = _RAWINDICES -DESCRIPTOR.message_types_by_name["RawHashes"] = _RAWHASHES -DESCRIPTOR.message_types_by_name["RiceDeltaEncoding"] = _RICEDELTAENCODING -DESCRIPTOR.enum_types_by_name["ThreatType"] = _THREATTYPE -DESCRIPTOR.enum_types_by_name["CompressionType"] = _COMPRESSIONTYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ComputeThreatListDiffRequest = _reflection.GeneratedProtocolMessageType( - "ComputeThreatListDiffRequest", - (_message.Message,), - dict( - Constraints=_reflection.GeneratedProtocolMessageType( - "Constraints", - (_message.Message,), - dict( - DESCRIPTOR=_COMPUTETHREATLISTDIFFREQUEST_CONSTRAINTS, - __module__="google.cloud.webrisk_v1beta1.proto.webrisk_pb2", - __doc__="""The constraints for this diff. - - - Attributes: - max_diff_entries: - The maximum size in number of entries. The diff will not - contain more entries than this value. This should be a power - of 2 between 2\ **10 and 2**\ 20. If zero, no diff size limit - is set. - max_database_entries: - Sets the maximum number of entries that the client is willing - to have in the local database. This should be a power of 2 - between 2\ **10 and 2**\ 20. If zero, no database size limit - is set. - supported_compressions: - The compression types supported by the client. - """, - # @@protoc_insertion_point(class_scope:google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints) - ), - ), - DESCRIPTOR=_COMPUTETHREATLISTDIFFREQUEST, - __module__="google.cloud.webrisk_v1beta1.proto.webrisk_pb2", - __doc__="""Describes an API diff request. - - - Attributes: - threat_type: - The ThreatList to update. - version_token: - The current version token of the client for the requested list - (the client version that was received from the last successful - diff). - constraints: - Required. The constraints associated with this request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest) - ), -) -_sym_db.RegisterMessage(ComputeThreatListDiffRequest) -_sym_db.RegisterMessage(ComputeThreatListDiffRequest.Constraints) - -ComputeThreatListDiffResponse = _reflection.GeneratedProtocolMessageType( - "ComputeThreatListDiffResponse", - (_message.Message,), - dict( - Checksum=_reflection.GeneratedProtocolMessageType( - "Checksum", - (_message.Message,), - dict( - DESCRIPTOR=_COMPUTETHREATLISTDIFFRESPONSE_CHECKSUM, - __module__="google.cloud.webrisk_v1beta1.proto.webrisk_pb2", - __doc__="""The expected state of a client's local database. - - - Attributes: - sha256: - The SHA256 hash of the client state; that is, of the sorted - list of all hashes present in the database. - """, - # @@protoc_insertion_point(class_scope:google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum) - ), - ), - DESCRIPTOR=_COMPUTETHREATLISTDIFFRESPONSE, - __module__="google.cloud.webrisk_v1beta1.proto.webrisk_pb2", - __doc__=""" - Attributes: - response_type: - The type of response. This may indicate that an action must be - taken by the client when the response is received. - additions: - A set of entries to add to a local threat type's list. - removals: - A set of entries to remove from a local threat type's list. - This field may be empty. - new_version_token: - The new opaque client version token. - checksum: - The expected SHA256 hash of the client state; that is, of the - sorted list of all hashes present in the database after - applying the provided diff. If the client state doesn't match - the expected state, the client must disregard this diff and - retry later. - recommended_next_diff: - The soonest the client should wait before issuing any diff - request. Querying sooner is unlikely to produce a meaningful - diff. Waiting longer is acceptable considering the use case. - If this field is not set clients may update as soon as they - want. - """, - # @@protoc_insertion_point(class_scope:google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse) - ), -) -_sym_db.RegisterMessage(ComputeThreatListDiffResponse) -_sym_db.RegisterMessage(ComputeThreatListDiffResponse.Checksum) - -SearchUrisRequest = _reflection.GeneratedProtocolMessageType( - "SearchUrisRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SEARCHURISREQUEST, - __module__="google.cloud.webrisk_v1beta1.proto.webrisk_pb2", - __doc__="""Request to check URI entries against threatLists. - - - Attributes: - uri: - Required. The URI to be checked for matches. - threat_types: - Required. The ThreatLists to search in. - """, - # @@protoc_insertion_point(class_scope:google.cloud.webrisk.v1beta1.SearchUrisRequest) - ), -) -_sym_db.RegisterMessage(SearchUrisRequest) - -SearchUrisResponse = _reflection.GeneratedProtocolMessageType( - "SearchUrisResponse", - (_message.Message,), - dict( - ThreatUri=_reflection.GeneratedProtocolMessageType( - "ThreatUri", - (_message.Message,), - dict( - DESCRIPTOR=_SEARCHURISRESPONSE_THREATURI, - __module__="google.cloud.webrisk_v1beta1.proto.webrisk_pb2", - __doc__="""Contains threat information on a matching uri. - - - Attributes: - threat_types: - The ThreatList this threat belongs to. - expire_time: - The cache lifetime for the returned match. Clients must not - cache this response past this timestamp to avoid false - positives. - """, - # @@protoc_insertion_point(class_scope:google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri) - ), - ), - DESCRIPTOR=_SEARCHURISRESPONSE, - __module__="google.cloud.webrisk_v1beta1.proto.webrisk_pb2", - __doc__=""" - Attributes: - threat: - The threat list matches. This may be empty if the URI is on no - list. - """, - # @@protoc_insertion_point(class_scope:google.cloud.webrisk.v1beta1.SearchUrisResponse) - ), -) -_sym_db.RegisterMessage(SearchUrisResponse) -_sym_db.RegisterMessage(SearchUrisResponse.ThreatUri) - -SearchHashesRequest = _reflection.GeneratedProtocolMessageType( - "SearchHashesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SEARCHHASHESREQUEST, - __module__="google.cloud.webrisk_v1beta1.proto.webrisk_pb2", - __doc__="""Request to return full hashes matched by the provided hash - prefixes. - - - Attributes: - hash_prefix: - A hash prefix, consisting of the most significant 4-32 bytes - of a SHA256 hash. For JSON requests, this field is - base64-encoded. - threat_types: - Required. The ThreatLists to search in. - """, - # @@protoc_insertion_point(class_scope:google.cloud.webrisk.v1beta1.SearchHashesRequest) - ), -) -_sym_db.RegisterMessage(SearchHashesRequest) - -SearchHashesResponse = _reflection.GeneratedProtocolMessageType( - "SearchHashesResponse", - (_message.Message,), - dict( - ThreatHash=_reflection.GeneratedProtocolMessageType( - "ThreatHash", - (_message.Message,), - dict( - DESCRIPTOR=_SEARCHHASHESRESPONSE_THREATHASH, - __module__="google.cloud.webrisk_v1beta1.proto.webrisk_pb2", - __doc__="""Contains threat information on a matching hash. - - - Attributes: - threat_types: - The ThreatList this threat belongs to. This must contain at - least one entry. - hash: - A 32 byte SHA256 hash. This field is in binary format. For - JSON requests, hashes are base64-encoded. - expire_time: - The cache lifetime for the returned match. Clients must not - cache this response past this timestamp to avoid false - positives. - """, - # @@protoc_insertion_point(class_scope:google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash) - ), - ), - DESCRIPTOR=_SEARCHHASHESRESPONSE, - __module__="google.cloud.webrisk_v1beta1.proto.webrisk_pb2", - __doc__=""" - Attributes: - threats: - The full hashes that matched the requested prefixes. The hash - will be populated in the key. - negative_expire_time: - For requested entities that did not match the threat list, how - long to cache the response until. - """, - # @@protoc_insertion_point(class_scope:google.cloud.webrisk.v1beta1.SearchHashesResponse) - ), -) -_sym_db.RegisterMessage(SearchHashesResponse) -_sym_db.RegisterMessage(SearchHashesResponse.ThreatHash) - -ThreatEntryAdditions = _reflection.GeneratedProtocolMessageType( - "ThreatEntryAdditions", - (_message.Message,), - dict( - DESCRIPTOR=_THREATENTRYADDITIONS, - __module__="google.cloud.webrisk_v1beta1.proto.webrisk_pb2", - __doc__="""Contains the set of entries to add to a local database. - May contain a combination of compressed and raw data in a single - response. - - - Attributes: - raw_hashes: - The raw SHA256-formatted entries. Repeated to allow returning - sets of hashes with different prefix sizes. - rice_hashes: - The encoded 4-byte prefixes of SHA256-formatted entries, using - a Golomb-Rice encoding. The hashes are converted to uint32, - sorted in ascending order, then delta encoded and stored as - encoded\_data. - """, - # @@protoc_insertion_point(class_scope:google.cloud.webrisk.v1beta1.ThreatEntryAdditions) - ), -) -_sym_db.RegisterMessage(ThreatEntryAdditions) - -ThreatEntryRemovals = _reflection.GeneratedProtocolMessageType( - "ThreatEntryRemovals", - (_message.Message,), - dict( - DESCRIPTOR=_THREATENTRYREMOVALS, - __module__="google.cloud.webrisk_v1beta1.proto.webrisk_pb2", - __doc__="""Contains the set of entries to remove from a local - database. - - - Attributes: - raw_indices: - The raw removal indices for a local list. - rice_indices: - The encoded local, lexicographically-sorted list indices, - using a Golomb-Rice encoding. Used for sending compressed - removal indices. The removal indices (uint32) are sorted in - ascending order, then delta encoded and stored as - encoded\_data. - """, - # @@protoc_insertion_point(class_scope:google.cloud.webrisk.v1beta1.ThreatEntryRemovals) - ), -) -_sym_db.RegisterMessage(ThreatEntryRemovals) - -RawIndices = _reflection.GeneratedProtocolMessageType( - "RawIndices", - (_message.Message,), - dict( - DESCRIPTOR=_RAWINDICES, - __module__="google.cloud.webrisk_v1beta1.proto.webrisk_pb2", - __doc__="""A set of raw indices to remove from a local list. - - - Attributes: - indices: - The indices to remove from a lexicographically-sorted local - list. - """, - # @@protoc_insertion_point(class_scope:google.cloud.webrisk.v1beta1.RawIndices) - ), -) -_sym_db.RegisterMessage(RawIndices) - -RawHashes = _reflection.GeneratedProtocolMessageType( - "RawHashes", - (_message.Message,), - dict( - DESCRIPTOR=_RAWHASHES, - __module__="google.cloud.webrisk_v1beta1.proto.webrisk_pb2", - __doc__="""The uncompressed threat entries in hash format. Hashes can be anywhere - from 4 to 32 bytes in size. A large majority are 4 bytes, but some - hashes are lengthened if they collide with the hash of a popular URI. - - Used for sending ThreatEntryAdditons to clients that do not support - compression, or when sending non-4-byte hashes to clients that do - support compression. - - - Attributes: - prefix_size: - The number of bytes for each prefix encoded below. This field - can be anywhere from 4 (shortest prefix) to 32 (full SHA256 - hash). - raw_hashes: - The hashes, in binary format, concatenated into one long - string. Hashes are sorted in lexicographic order. For JSON API - users, hashes are base64-encoded. - """, - # @@protoc_insertion_point(class_scope:google.cloud.webrisk.v1beta1.RawHashes) - ), -) -_sym_db.RegisterMessage(RawHashes) - -RiceDeltaEncoding = _reflection.GeneratedProtocolMessageType( - "RiceDeltaEncoding", - (_message.Message,), - dict( - DESCRIPTOR=_RICEDELTAENCODING, - __module__="google.cloud.webrisk_v1beta1.proto.webrisk_pb2", - __doc__="""The Rice-Golomb encoded data. Used for sending compressed - 4-byte hashes or compressed removal indices. - - - Attributes: - first_value: - The offset of the first entry in the encoded data, or, if only - a single integer was encoded, that single integer's value. If - the field is empty or missing, assume zero. - rice_parameter: - The Golomb-Rice parameter, which is a number between 2 and 28. - This field is missing (that is, zero) if ``num_entries`` is - zero. - entry_count: - The number of entries that are delta encoded in the encoded - data. If only a single integer was encoded, this will be zero - and the single value will be stored in ``first_value``. - encoded_data: - The encoded deltas that are encoded using the Golomb-Rice - coder. - """, - # @@protoc_insertion_point(class_scope:google.cloud.webrisk.v1beta1.RiceDeltaEncoding) - ), -) -_sym_db.RegisterMessage(RiceDeltaEncoding) - - -DESCRIPTOR._options = None -_COMPUTETHREATLISTDIFFREQUEST.fields_by_name["threat_type"]._options = None -_COMPUTETHREATLISTDIFFREQUEST.fields_by_name["constraints"]._options = None -_SEARCHURISREQUEST.fields_by_name["uri"]._options = None -_SEARCHURISREQUEST.fields_by_name["threat_types"]._options = None -_SEARCHHASHESREQUEST.fields_by_name["threat_types"]._options = None - -_WEBRISKSERVICEV1BETA1 = _descriptor.ServiceDescriptor( - name="WebRiskServiceV1Beta1", - full_name="google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\026webrisk.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=2552, - serialized_end=3222, - methods=[ - _descriptor.MethodDescriptor( - name="ComputeThreatListDiff", - full_name="google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1.ComputeThreatListDiff", - index=0, - containing_service=None, - input_type=_COMPUTETHREATLISTDIFFREQUEST, - output_type=_COMPUTETHREATLISTDIFFRESPONSE, - serialized_options=_b( - '\202\323\344\223\002"\022 /v1beta1/threatLists:computeDiff\332A%threat_type,version_token,constraints' - ), - ), - _descriptor.MethodDescriptor( - name="SearchUris", - full_name="google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1.SearchUris", - index=1, - containing_service=None, - input_type=_SEARCHURISREQUEST, - output_type=_SEARCHURISRESPONSE, - serialized_options=_b( - "\202\323\344\223\002\026\022\024/v1beta1/uris:search\332A\020uri,threat_types" - ), - ), - _descriptor.MethodDescriptor( - name="SearchHashes", - full_name="google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1.SearchHashes", - index=2, - containing_service=None, - input_type=_SEARCHHASHESREQUEST, - output_type=_SEARCHHASHESRESPONSE, - serialized_options=_b( - "\202\323\344\223\002\030\022\026/v1beta1/hashes:search\332A\030hash_prefix,threat_types" - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_WEBRISKSERVICEV1BETA1) - -DESCRIPTOR.services_by_name["WebRiskServiceV1Beta1"] = _WEBRISKSERVICEV1BETA1 - -# @@protoc_insertion_point(module_scope) diff --git a/webrisk/google/cloud/webrisk_v1beta1/proto/webrisk_pb2_grpc.py b/webrisk/google/cloud/webrisk_v1beta1/proto/webrisk_pb2_grpc.py deleted file mode 100644 index be5a84477268..000000000000 --- a/webrisk/google/cloud/webrisk_v1beta1/proto/webrisk_pb2_grpc.py +++ /dev/null @@ -1,89 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.webrisk_v1beta1.proto import ( - webrisk_pb2 as google_dot_cloud_dot_webrisk__v1beta1_dot_proto_dot_webrisk__pb2, -) - - -class WebRiskServiceV1Beta1Stub(object): - """Web Risk v1beta1 API defines an interface to detect malicious URLs on your - website and in client applications. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ComputeThreatListDiff = channel.unary_unary( - "/google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1/ComputeThreatListDiff", - request_serializer=google_dot_cloud_dot_webrisk__v1beta1_dot_proto_dot_webrisk__pb2.ComputeThreatListDiffRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_webrisk__v1beta1_dot_proto_dot_webrisk__pb2.ComputeThreatListDiffResponse.FromString, - ) - self.SearchUris = channel.unary_unary( - "/google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1/SearchUris", - request_serializer=google_dot_cloud_dot_webrisk__v1beta1_dot_proto_dot_webrisk__pb2.SearchUrisRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_webrisk__v1beta1_dot_proto_dot_webrisk__pb2.SearchUrisResponse.FromString, - ) - self.SearchHashes = channel.unary_unary( - "/google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1/SearchHashes", - request_serializer=google_dot_cloud_dot_webrisk__v1beta1_dot_proto_dot_webrisk__pb2.SearchHashesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_webrisk__v1beta1_dot_proto_dot_webrisk__pb2.SearchHashesResponse.FromString, - ) - - -class WebRiskServiceV1Beta1Servicer(object): - """Web Risk v1beta1 API defines an interface to detect malicious URLs on your - website and in client applications. - """ - - def ComputeThreatListDiff(self, request, context): - """Gets the most recent threat list diffs. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SearchUris(self, request, context): - """This method is used to check whether a URI is on a given threatList. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SearchHashes(self, request, context): - """Gets the full hashes that match the requested hash prefix. - This is used after a hash prefix is looked up in a threatList - and there is a match. The client side threatList only holds partial hashes - so the client must query this method to determine if there is a full - hash match of a threat. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_WebRiskServiceV1Beta1Servicer_to_server(servicer, server): - rpc_method_handlers = { - "ComputeThreatListDiff": grpc.unary_unary_rpc_method_handler( - servicer.ComputeThreatListDiff, - request_deserializer=google_dot_cloud_dot_webrisk__v1beta1_dot_proto_dot_webrisk__pb2.ComputeThreatListDiffRequest.FromString, - response_serializer=google_dot_cloud_dot_webrisk__v1beta1_dot_proto_dot_webrisk__pb2.ComputeThreatListDiffResponse.SerializeToString, - ), - "SearchUris": grpc.unary_unary_rpc_method_handler( - servicer.SearchUris, - request_deserializer=google_dot_cloud_dot_webrisk__v1beta1_dot_proto_dot_webrisk__pb2.SearchUrisRequest.FromString, - response_serializer=google_dot_cloud_dot_webrisk__v1beta1_dot_proto_dot_webrisk__pb2.SearchUrisResponse.SerializeToString, - ), - "SearchHashes": grpc.unary_unary_rpc_method_handler( - servicer.SearchHashes, - request_deserializer=google_dot_cloud_dot_webrisk__v1beta1_dot_proto_dot_webrisk__pb2.SearchHashesRequest.FromString, - response_serializer=google_dot_cloud_dot_webrisk__v1beta1_dot_proto_dot_webrisk__pb2.SearchHashesResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/webrisk/google/cloud/webrisk_v1beta1/types.py b/webrisk/google/cloud/webrisk_v1beta1/types.py deleted file mode 100644 index 17bf6f0e06ba..000000000000 --- a/webrisk/google/cloud/webrisk_v1beta1/types.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.webrisk_v1beta1.proto import webrisk_pb2 -from google.protobuf import timestamp_pb2 - - -_shared_modules = [timestamp_pb2] - -_local_modules = [webrisk_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.webrisk_v1beta1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/webrisk/noxfile.py b/webrisk/noxfile.py deleted file mode 100644 index 7949a4e3925a..000000000000 --- a/webrisk/noxfile.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/webrisk/setup.cfg b/webrisk/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/webrisk/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/webrisk/setup.py b/webrisk/setup.py deleted file mode 100644 index e8bf140f22b8..000000000000 --- a/webrisk/setup.py +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import io -import os - -import setuptools - - -# Package metadata. - -name = "google-cloud-webrisk" -description = "Google Cloud Web Risk API client library" -version = "0.2.0" -# Should be one of: -# 'Development Status :: 3 - Alpha' -# 'Development Status :: 4 - Beta' -# 'Development Status :: 5 - Production/Stable' -release_status = "Development Status :: 3 - Alpha" -dependencies = ["google-api-core[grpc] >= 1.14.0, < 2.0.0dev"] -extras = {} - - -# Setup boilerplate below this line. - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -# Only include packages under the 'google' namespace. Do not include tests, -# benchmarks, etc. -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -# Determine which namespaces are needed. -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") - - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/GoogleCloudPlatform/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - extras_require=extras, - python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", - include_package_data=True, - zip_safe=False, -) diff --git a/webrisk/synth.metadata b/webrisk/synth.metadata deleted file mode 100644 index 0fbe855c39ec..000000000000 --- a/webrisk/synth.metadata +++ /dev/null @@ -1,150 +0,0 @@ -{ - "updateTime": "2020-01-30T13:46:17.950128Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c1246a29e22b0f98e800a536b5b0da2d933a55f2", - "internalRef": "292310790", - "log": "c1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\n" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "webrisk", - "apiVersion": "v1beta1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/webrisk/artman_webrisk_v1beta1.yaml" - } - } - ], - "newFiles": [ - { - "path": ".coveragerc" - }, - { - "path": ".flake8" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "LICENSE" - }, - { - "path": "MANIFEST.in" - }, - { - "path": "README.rst" - }, - { - "path": "docs/README.rst" - }, - { - "path": "docs/_static/custom.css" - }, - { - "path": "docs/_templates/layout.html" - }, - { - "path": "docs/changelog.md" - }, - { - "path": "docs/conf.py" - }, - { - "path": "docs/gapic/v1beta1/api.rst" - }, - { - "path": "docs/gapic/v1beta1/types.rst" - }, - { - "path": "docs/index.rst" - }, - { - "path": "google/__init__.py" - }, - { - "path": "google/cloud/__init__.py" - }, - { - "path": "google/cloud/webrisk.py" - }, - { - "path": "google/cloud/webrisk_v1beta1/__init__.py" - }, - { - "path": "google/cloud/webrisk_v1beta1/gapic/__init__.py" - }, - { - "path": "google/cloud/webrisk_v1beta1/gapic/enums.py" - }, - { - "path": "google/cloud/webrisk_v1beta1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/webrisk_v1beta1/gapic/transports/web_risk_service_v1_beta1_grpc_transport.py" - }, - { - "path": "google/cloud/webrisk_v1beta1/gapic/web_risk_service_v1_beta1_client.py" - }, - { - "path": "google/cloud/webrisk_v1beta1/gapic/web_risk_service_v1_beta1_client_config.py" - }, - { - "path": "google/cloud/webrisk_v1beta1/proto/__init__.py" - }, - { - "path": "google/cloud/webrisk_v1beta1/proto/webrisk.proto" - }, - { - "path": "google/cloud/webrisk_v1beta1/proto/webrisk_pb2.py" - }, - { - "path": "google/cloud/webrisk_v1beta1/proto/webrisk_pb2_grpc.py" - }, - { - "path": "google/cloud/webrisk_v1beta1/types.py" - }, - { - "path": "noxfile.py" - }, - { - "path": "setup.cfg" - }, - { - "path": "setup.py" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "tests/unit/gapic/v1beta1/test_web_risk_service_v1_beta1_client_v1beta1.py" - } - ] -} \ No newline at end of file diff --git a/webrisk/synth.py b/webrisk/synth.py deleted file mode 100644 index 0c1db20420ea..000000000000 --- a/webrisk/synth.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated parts of this library.""" - -import re - -import synthtool as s -from synthtool import gcp - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() -versions = ["v1beta1"] - -# ---------------------------------------------------------------------------- -# Generate webrisk GAPIC layer -# ---------------------------------------------------------------------------- -for version in versions: - library = gapic.py_library("webrisk", version, include_protos=True) - s.copy(library, excludes=["docs/index.rst", "nox.py", "README.rst", "setup.py"]) - - -# Fix docstring issue for classes with no summary line -s.replace( - "google/cloud/**/proto/webrisk_pb2.py", - '''__doc__ = """Attributes:''', - '''__doc__ = """ - Attributes:''', -) - - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = common.py_library(cov_level=100) -s.move(templated_files) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/webrisk/tests/unit/gapic/v1beta1/test_web_risk_service_v1_beta1_client_v1beta1.py b/webrisk/tests/unit/gapic/v1beta1/test_web_risk_service_v1_beta1_client_v1beta1.py deleted file mode 100644 index 3e8ec687dae4..000000000000 --- a/webrisk/tests/unit/gapic/v1beta1/test_web_risk_service_v1_beta1_client_v1beta1.py +++ /dev/null @@ -1,184 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import webrisk_v1beta1 -from google.cloud.webrisk_v1beta1 import enums -from google.cloud.webrisk_v1beta1.proto import webrisk_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestWebRiskServiceV1Beta1Client(object): - def test_compute_threat_list_diff(self): - # Setup Expected Response - new_version_token = b"115" - expected_response = {"new_version_token": new_version_token} - expected_response = webrisk_pb2.ComputeThreatListDiffResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = webrisk_v1beta1.WebRiskServiceV1Beta1Client() - - # Setup Request - threat_type = enums.ThreatType.THREAT_TYPE_UNSPECIFIED - constraints = {} - - response = client.compute_threat_list_diff(threat_type, constraints) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = webrisk_pb2.ComputeThreatListDiffRequest( - threat_type=threat_type, constraints=constraints - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_compute_threat_list_diff_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = webrisk_v1beta1.WebRiskServiceV1Beta1Client() - - # Setup request - threat_type = enums.ThreatType.THREAT_TYPE_UNSPECIFIED - constraints = {} - - with pytest.raises(CustomException): - client.compute_threat_list_diff(threat_type, constraints) - - def test_search_uris(self): - # Setup Expected Response - expected_response = {} - expected_response = webrisk_pb2.SearchUrisResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = webrisk_v1beta1.WebRiskServiceV1Beta1Client() - - # Setup Request - uri = "uri116076" - threat_types = [] - - response = client.search_uris(uri, threat_types) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = webrisk_pb2.SearchUrisRequest( - uri=uri, threat_types=threat_types - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_search_uris_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = webrisk_v1beta1.WebRiskServiceV1Beta1Client() - - # Setup request - uri = "uri116076" - threat_types = [] - - with pytest.raises(CustomException): - client.search_uris(uri, threat_types) - - def test_search_hashes(self): - # Setup Expected Response - expected_response = {} - expected_response = webrisk_pb2.SearchHashesResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = webrisk_v1beta1.WebRiskServiceV1Beta1Client() - - # Setup Request - threat_types = [] - - response = client.search_hashes(threat_types) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = webrisk_pb2.SearchHashesRequest(threat_types=threat_types) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_search_hashes_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = webrisk_v1beta1.WebRiskServiceV1Beta1Client() - - # Setup request - threat_types = [] - - with pytest.raises(CustomException): - client.search_hashes(threat_types) diff --git a/websecurityscanner/.coveragerc b/websecurityscanner/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/websecurityscanner/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/websecurityscanner/.flake8 b/websecurityscanner/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/websecurityscanner/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/websecurityscanner/.repo-metadata.json b/websecurityscanner/.repo-metadata.json deleted file mode 100644 index faf8a58cda54..000000000000 --- a/websecurityscanner/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "websecurityscanner", - "name_pretty": "Cloud Security Scanner", - "product_documentation": "https://cloud.google.com/security-scanner/docs/", - "client_documentation": "https://googleapis.dev/python/websecurityscanner/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559748", - "release_level": "alpha", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-websecurityscanner", - "api_id": "websecurityscanner.googleapis.com", - "requires_billing": true -} \ No newline at end of file diff --git a/websecurityscanner/CHANGELOG.md b/websecurityscanner/CHANGELOG.md deleted file mode 100644 index 689540703819..000000000000 --- a/websecurityscanner/CHANGELOG.md +++ /dev/null @@ -1,94 +0,0 @@ -# Changelog - -[PyPI History][1] - -[1]: https://pypi.org/project/google-cloud-websecurityscanner/#history - -## 0.3.0 - -07-24-2019 17:56 PDT - - -### Implementation Changes -- Allow kwargs to be passed to create_channel (via synth). ([#8413](https://github.com/googleapis/google-cloud-python/pull/8413)) -- Retry code 'idempotent' for ListCrawledUrls, add empty lines (via synth). ([#8079](https://github.com/googleapis/google-cloud-python/pull/8079)) - -### New Features -- Add 'client_options' support, update list method docstrings (via synth). ([#8531](https://github.com/googleapis/google-cloud-python/pull/8531)) - -### Dependencies -- Bump minimum version for google-api-core to 1.14.0. ([#8709](https://github.com/googleapis/google-cloud-python/pull/8709)) - -### Documentation -- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705)) -- Add compatibility check badges to READMEs. ([#8288](https://github.com/googleapis/google-cloud-python/pull/8288)) - -### Internal / Testing Changes -- Pin black version (via synth). ([#8603](https://github.com/googleapis/google-cloud-python/pull/8603)) -- Add docs job to publish to googleapis.dev. ([#8464](https://github.com/googleapis/google-cloud-python/pull/8464)) -- Declare encoding as utf-8 in pb2 files (via synth). ([#8373](https://github.com/googleapis/google-cloud-python/pull/8373)) -- Add disclaimer to auto-generated template files. ([#8337](https://github.com/googleapis/google-cloud-python/pull/8337)) -- Suppress checking 'cov-fail-under' in nox default session (via synth). ([#8258](https://github.com/googleapis/google-cloud-python/pull/8258)) -- Fix coverage in 'types.py' (via synth). ([#8172](https://github.com/googleapis/google-cloud-python/pull/8172)) - -## 0.2.0 - -05-15-2019 15:20 PDT - - -### Implementation Changes -- Add routing header to method metadata (via synth). ([#7605](https://github.com/googleapis/google-cloud-python/pull/7605)) -- Remove classifier for Python 3.4 for end-of-life. ([#7535](https://github.com/googleapis/google-cloud-python/pull/7535)) -- Protoc-generated serialization update. ([#7101](https://github.com/googleapis/google-cloud-python/pull/7101)) -- GAPIC generation fixes. ([#7059](https://github.com/googleapis/google-cloud-python/pull/7059)) -- Pick up order-of-enum fix from GAPIC generator. ([#6882](https://github.com/googleapis/google-cloud-python/pull/6882)) - -### New Features -- Generate v1beta. ([#7992](https://github.com/googleapis/google-cloud-python/pull/7992)) - -### Documentation -- Updated client library documentation URLs. ([#7307](https://github.com/googleapis/google-cloud-python/pull/7307)) -- Update copyright headers - -### Internal / Testing Changes -- Update noxfile (via synth). ([#7803](https://github.com/googleapis/google-cloud-python/pull/7803)) -- Fix 'docs' session in nox. ([#7788](https://github.com/googleapis/google-cloud-python/pull/7788)) -- Add nox session 'docs' (via synth). ([#7747](https://github.com/googleapis/google-cloud-python/pull/7747)) -- Copy lintified proto files (via synth). ([#7474](https://github.com/googleapis/google-cloud-python/pull/7474)) -- Add clarifying comment to blacken nox target. ([#7409](https://github.com/googleapis/google-cloud-python/pull/7409)) -- Add protos as an artifact to library ([#7205](https://github.com/googleapis/google-cloud-python/pull/7205)) - -## 0.1.1 - -12-18-2018 10:45 PST - - -### Implementation Changes -- Import `iam.policy` from `google.api_core`. ([#6741](https://github.com/googleapis/google-cloud-python/pull/6741)) -- Avoid overwriting `__module__` of messages from shared modules. ([#5364](https://github.com/googleapis/google-cloud-python/pull/5364)) - -### Dependencies -- Bump minimum `api_core` version for all GAPIC libs to 1.4.1. ([#6391](https://github.com/googleapis/google-cloud-python/pull/6391)) - -### Documentation -- Document Python 2 deprecation ([#6910](https://github.com/googleapis/google-cloud-python/pull/6910)) -- Normalize use of support level badges ([#6159](https://github.com/googleapis/google-cloud-python/pull/6159)) -- Replace links to `/stable/` with `/latest/`. ([#5901](https://github.com/googleapis/google-cloud-python/pull/5901)) - -### Internal / Testing Changes -- Blacken all gen'd libs ([#6792](https://github.com/googleapis/google-cloud-python/pull/6792)) -- Omit local deps ([#6701](https://github.com/googleapis/google-cloud-python/pull/6701)) -- Run black at end of synth.py ([#6698](https://github.com/googleapis/google-cloud-python/pull/6698)) -- Run Black on Generated libraries ([#6666](https://github.com/googleapis/google-cloud-python/pull/6666)) -- Add templates for flake8, coveragerc, noxfile, and black. ([#6642](https://github.com/googleapis/google-cloud-python/pull/6642)) -- Add / fix badges for PyPI / versions. ([#6158](https://github.com/googleapis/google-cloud-python/pull/6158)) -- Use new Nox ([#6175](https://github.com/googleapis/google-cloud-python/pull/6175)) -- Add 'synth.py'. ([#6087](https://github.com/googleapis/google-cloud-python/pull/6087)) -- Use inplace nox installs ([#5865](https://github.com/googleapis/google-cloud-python/pull/5865)) -- Add Test runs for Python 3.7 and remove 3.4 ([#5295](https://github.com/googleapis/google-cloud-python/pull/5295)) -- Add dot files for websecurityscanner ([#5286](https://github.com/googleapis/google-cloud-python/pull/5286)) - -## 0.1.0 - -### New Features -- Add v1alpha1 websecurityscanner endpoint diff --git a/websecurityscanner/LICENSE b/websecurityscanner/LICENSE deleted file mode 100644 index a8ee855de2aa..000000000000 --- a/websecurityscanner/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/websecurityscanner/MANIFEST.in b/websecurityscanner/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/websecurityscanner/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/websecurityscanner/README.rst b/websecurityscanner/README.rst deleted file mode 100644 index 63868b85244f..000000000000 --- a/websecurityscanner/README.rst +++ /dev/null @@ -1,86 +0,0 @@ -Python Client for Web Security Scanner API -========================================== - -|alpha| |pypi| |versions| - -`Web Security Scanner API`_: Web Security Scanner API (under development). - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. |alpha| image:: https://img.shields.io/badge/support-alpha-orange.svg - :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#alpha-support -.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-websecurityscanner.svg - :target: https://pypi.org/project/google-cloud-websecurityscanner/ -.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-websecurityscanner.svg - :target: https://pypi.org/project/google-cloud-websecurityscanner/ -.. _Web Security Scanner API: https://cloud.google.com/security-scanner -.. _Client Library Documentation: https://googleapis.dev/python/websecurityscanner/latest -.. _Product Documentation: https://cloud.google.com/security-scanner - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the Web Security Scanner API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Web Security Scanner API.: https://cloud.google.com/security-scanner -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Supported Python Versions -~~~~~~~~~~~~~~~~~~~~~~~~~ -Python >= 3.5 - -Deprecated Python Versions -~~~~~~~~~~~~~~~~~~~~~~~~~~ -Python == 2.7. Python 2.7 support will be removed on January 1, 2020. - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-websecurityscanner - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-websecurityscanner - -Next Steps -~~~~~~~~~~ - -- Read the `Client Library Documentation`_ for Web Security Scanner API - API to see other available methods on the client. -- Read the `Product documentation`_ to learn - more about the product and see How-to Guides. diff --git a/websecurityscanner/docs/README.rst b/websecurityscanner/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/websecurityscanner/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/websecurityscanner/docs/_static/custom.css b/websecurityscanner/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/websecurityscanner/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/websecurityscanner/docs/_templates/layout.html b/websecurityscanner/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/websecurityscanner/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/websecurityscanner/docs/changelog.md b/websecurityscanner/docs/changelog.md deleted file mode 120000 index 04c99a55caae..000000000000 --- a/websecurityscanner/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../CHANGELOG.md \ No newline at end of file diff --git a/websecurityscanner/docs/conf.py b/websecurityscanner/docs/conf.py deleted file mode 100644 index 9fba4f529212..000000000000 --- a/websecurityscanner/docs/conf.py +++ /dev/null @@ -1,356 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-websecurityscanner documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-websecurityscanner" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-websecurityscanner-doc" - -# -- Options for warnings ------------------------------------------------------ - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-websecurityscanner.tex", - u"google-cloud-websecurityscanner Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - master_doc, - "google-cloud-websecurityscanner", - u"google-cloud-websecurityscanner Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-websecurityscanner", - u"google-cloud-websecurityscanner Documentation", - author, - "google-cloud-websecurityscanner", - "GAPIC library for the {metadata.shortName} v1alpha service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/stable/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/websecurityscanner/docs/gapic/v1alpha/api.rst b/websecurityscanner/docs/gapic/v1alpha/api.rst deleted file mode 100644 index fd817f98c216..000000000000 --- a/websecurityscanner/docs/gapic/v1alpha/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Web Security Scanner API -=================================== - -.. automodule:: google.cloud.websecurityscanner_v1alpha - :members: - :inherited-members: \ No newline at end of file diff --git a/websecurityscanner/docs/gapic/v1alpha/types.rst b/websecurityscanner/docs/gapic/v1alpha/types.rst deleted file mode 100644 index 47a13937375a..000000000000 --- a/websecurityscanner/docs/gapic/v1alpha/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Web Security Scanner API Client -========================================= - -.. automodule:: google.cloud.websecurityscanner_v1alpha.types - :members: \ No newline at end of file diff --git a/websecurityscanner/docs/gapic/v1beta/api.rst b/websecurityscanner/docs/gapic/v1beta/api.rst deleted file mode 100644 index 68a9c24f712b..000000000000 --- a/websecurityscanner/docs/gapic/v1beta/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Web Security Scanner API -=================================== - -.. automodule:: google.cloud.websecurityscanner_v1beta - :members: - :inherited-members: \ No newline at end of file diff --git a/websecurityscanner/docs/gapic/v1beta/types.rst b/websecurityscanner/docs/gapic/v1beta/types.rst deleted file mode 100644 index f0f68e067fa1..000000000000 --- a/websecurityscanner/docs/gapic/v1beta/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Web Security Scanner API Client -========================================= - -.. automodule:: google.cloud.websecurityscanner_v1beta.types - :members: \ No newline at end of file diff --git a/websecurityscanner/docs/index.rst b/websecurityscanner/docs/index.rst deleted file mode 100644 index 980ca1ff82ac..000000000000 --- a/websecurityscanner/docs/index.rst +++ /dev/null @@ -1,32 +0,0 @@ -.. include:: README.rst - -Api Reference -------------- -This package includes clients for multiple versions of the Web Security Scanner API. By default, you will get ``v1beta``, the latest version. - -.. toctree:: - :maxdepth: 2 - - gapic/v1beta/api - gapic/v1beta/types - -The previous alpha release, spelled ``v1alpha`` is provided to continue to support code previously written against it. In order to use it, you will want to import from it e.g., ``google.cloud.websecurityscanner_v1alpha`` in lieu of ``google.cloud.websecurityscanner`` (or the equivalent ``google.cloud.websecurityscanner_v1beta``). - -v1alpha -~~~~~~~ -.. toctree:: - :maxdepth: 2 - - gapic/v1alpha/api - gapic/v1alpha/types - - -Changelog ---------- - -For a list of all ``google-cloud-websecurityscanner`` releases. - -.. toctree:: - :maxdepth: 2 - - changelog \ No newline at end of file diff --git a/websecurityscanner/google/__init__.py b/websecurityscanner/google/__init__.py deleted file mode 100644 index dd3a9f485275..000000000000 --- a/websecurityscanner/google/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/websecurityscanner/google/cloud/__init__.py b/websecurityscanner/google/cloud/__init__.py deleted file mode 100644 index dd3a9f485275..000000000000 --- a/websecurityscanner/google/cloud/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/websecurityscanner/google/cloud/websecurityscanner.py b/websecurityscanner/google/cloud/websecurityscanner.py deleted file mode 100644 index c6c74f79c3a1..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import - -from google.cloud.websecurityscanner_v1beta import WebSecurityScannerClient -from google.cloud.websecurityscanner_v1beta import enums -from google.cloud.websecurityscanner_v1beta import types - - -__all__ = ("enums", "types", "WebSecurityScannerClient") diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/__init__.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/__init__.py deleted file mode 100644 index dd5836397c6c..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/__init__.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.websecurityscanner_v1alpha import types -from google.cloud.websecurityscanner_v1alpha.gapic import enums -from google.cloud.websecurityscanner_v1alpha.gapic import web_security_scanner_client - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class WebSecurityScannerClient(web_security_scanner_client.WebSecurityScannerClient): - __doc__ = web_security_scanner_client.WebSecurityScannerClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "WebSecurityScannerClient") diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/__init__.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/enums.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/enums.py deleted file mode 100644 index eb85ac6cdc77..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/enums.py +++ /dev/null @@ -1,146 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class Finding(object): - class FindingType(enum.IntEnum): - """ - Types of Findings. - - Attributes: - FINDING_TYPE_UNSPECIFIED (int): The invalid finding type. - MIXED_CONTENT (int): A page that was served over HTTPS also resources over HTTP. A - man-in-the-middle attacker could tamper with the HTTP resource and gain - full access to the website that loads the resource or to monitor the - actions taken by the user. - OUTDATED_LIBRARY (int): The version of an included library is known to contain a security issue. - The scanner checks the version of library in use against a known list of - vulnerable libraries. False positives are possible if the version - detection fails or if the library has been manually patched. - ROSETTA_FLASH (int): This type of vulnerability occurs when the value of a request parameter - is reflected at the beginning of the response, for example, in requests - using JSONP. Under certain circumstances, an attacker may be able to - supply an alphanumeric-only Flash file in the vulnerable parameter - causing the browser to execute the Flash file as if it originated on the - vulnerable server. - XSS_CALLBACK (int): A cross-site scripting (XSS) bug is found via JavaScript callback. For - detailed explanations on XSS, see - https://www.google.com/about/appsecurity/learning/xss/. - XSS_ERROR (int): A potential cross-site scripting (XSS) bug due to JavaScript breakage. - In some circumstances, the application under test might modify the test - string before it is parsed by the browser. When the browser attempts to - runs this modified test string, it will likely break and throw a - JavaScript execution error, thus an injection issue is occurring. - However, it may not be exploitable. Manual verification is needed to see - if the test string modifications can be evaded and confirm that the issue - is in fact an XSS vulnerability. For detailed explanations on XSS, see - https://www.google.com/about/appsecurity/learning/xss/. - CLEAR_TEXT_PASSWORD (int): An application appears to be transmitting a password field in clear text. - An attacker can eavesdrop network traffic and sniff the password field. - INVALID_CONTENT_TYPE (int): An application returns sensitive content with an invalid content type, - or without an 'X-Content-Type-Options: nosniff' header. - XSS_ANGULAR_CALLBACK (int): A cross-site scripting (XSS) vulnerability in AngularJS module that - occurs when a user-provided string is interpolated by Angular. - INVALID_HEADER (int): A malformed or invalid valued header. - MISSPELLED_SECURITY_HEADER_NAME (int): Misspelled security header name. - MISMATCHING_SECURITY_HEADER_VALUES (int): Mismatching values in a duplicate security header. - """ - - FINDING_TYPE_UNSPECIFIED = 0 - MIXED_CONTENT = 1 - OUTDATED_LIBRARY = 2 - ROSETTA_FLASH = 5 - XSS_CALLBACK = 3 - XSS_ERROR = 4 - CLEAR_TEXT_PASSWORD = 6 - INVALID_CONTENT_TYPE = 7 - XSS_ANGULAR_CALLBACK = 8 - INVALID_HEADER = 9 - MISSPELLED_SECURITY_HEADER_NAME = 10 - MISMATCHING_SECURITY_HEADER_VALUES = 11 - - -class ScanConfig(object): - class TargetPlatform(enum.IntEnum): - """ - Cloud platforms supported by Cloud Web Security Scanner. - - Attributes: - TARGET_PLATFORM_UNSPECIFIED (int): The target platform is unknown. Requests with this enum value will be - rejected with INVALID\_ARGUMENT error. - APP_ENGINE (int): Google App Engine service. - COMPUTE (int): Google Compute Engine service. - """ - - TARGET_PLATFORM_UNSPECIFIED = 0 - APP_ENGINE = 1 - COMPUTE = 2 - - class UserAgent(enum.IntEnum): - """ - Type of user agents used for scanning. - - Attributes: - USER_AGENT_UNSPECIFIED (int): The user agent is unknown. Service will default to CHROME\_LINUX. - CHROME_LINUX (int): Chrome on Linux. This is the service default if unspecified. - CHROME_ANDROID (int): Chrome on Android. - SAFARI_IPHONE (int): Safari on IPhone. - """ - - USER_AGENT_UNSPECIFIED = 0 - CHROME_LINUX = 1 - CHROME_ANDROID = 2 - SAFARI_IPHONE = 3 - - -class ScanRun(object): - class ExecutionState(enum.IntEnum): - """ - Types of ScanRun execution state. - - Attributes: - EXECUTION_STATE_UNSPECIFIED (int): Represents an invalid state caused by internal server error. This value - should never be returned. - QUEUED (int): The scan is waiting in the queue. - SCANNING (int): The scan is in progress. - FINISHED (int): The scan is either finished or stopped by user. - """ - - EXECUTION_STATE_UNSPECIFIED = 0 - QUEUED = 1 - SCANNING = 2 - FINISHED = 3 - - class ResultState(enum.IntEnum): - """ - Types of ScanRun result state. - - Attributes: - RESULT_STATE_UNSPECIFIED (int): Default value. This value is returned when the ScanRun is not yet - finished. - SUCCESS (int): The scan finished without errors. - ERROR (int): The scan finished with errors. - KILLED (int): The scan was terminated by user. - """ - - RESULT_STATE_UNSPECIFIED = 0 - SUCCESS = 1 - ERROR = 2 - KILLED = 3 diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/transports/__init__.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/transports/web_security_scanner_grpc_transport.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/transports/web_security_scanner_grpc_transport.py deleted file mode 100644 index 05a7d16438c1..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/transports/web_security_scanner_grpc_transport.py +++ /dev/null @@ -1,283 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers - -from google.cloud.websecurityscanner_v1alpha.proto import web_security_scanner_pb2_grpc - - -class WebSecurityScannerGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.websecurityscanner.v1alpha WebSecurityScanner API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, - channel=None, - credentials=None, - address="websecurityscanner.googleapis.com:443", - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "web_security_scanner_stub": web_security_scanner_pb2_grpc.WebSecurityScannerStub( - channel - ) - } - - @classmethod - def create_channel( - cls, address="websecurityscanner.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def create_scan_config(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.create_scan_config`. - - Creates a new ScanConfig. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].CreateScanConfig - - @property - def delete_scan_config(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.delete_scan_config`. - - Deletes an existing ScanConfig and its child resources. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].DeleteScanConfig - - @property - def get_scan_config(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.get_scan_config`. - - Gets a ScanConfig. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].GetScanConfig - - @property - def list_scan_configs(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.list_scan_configs`. - - Lists ScanConfigs under a given project. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].ListScanConfigs - - @property - def update_scan_config(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.update_scan_config`. - - Updates a ScanConfig. This method support partial update of a ScanConfig. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].UpdateScanConfig - - @property - def start_scan_run(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.start_scan_run`. - - Start a ScanRun according to the given ScanConfig. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].StartScanRun - - @property - def get_scan_run(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.get_scan_run`. - - Gets a ScanRun. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].GetScanRun - - @property - def list_scan_runs(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.list_scan_runs`. - - Lists ScanRuns under a given ScanConfig, in descending order of ScanRun - stop time. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].ListScanRuns - - @property - def stop_scan_run(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.stop_scan_run`. - - Stops a ScanRun. The stopped ScanRun is returned. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].StopScanRun - - @property - def list_crawled_urls(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.list_crawled_urls`. - - List CrawledUrls under a given ScanRun. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].ListCrawledUrls - - @property - def get_finding(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.get_finding`. - - Gets a Finding. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].GetFinding - - @property - def list_findings(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.list_findings`. - - List Findings under a given ScanRun. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].ListFindings - - @property - def list_finding_type_stats(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.list_finding_type_stats`. - - List all FindingTypeStats under a given ScanRun. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].ListFindingTypeStats diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client.py deleted file mode 100644 index 6ab946b3574d..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client.py +++ /dev/null @@ -1,1320 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.cloud.websecurityscanner.v1alpha WebSecurityScanner API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.page_iterator -import google.api_core.path_template -import grpc - -from google.cloud.websecurityscanner_v1alpha.gapic import enums -from google.cloud.websecurityscanner_v1alpha.gapic import ( - web_security_scanner_client_config, -) -from google.cloud.websecurityscanner_v1alpha.gapic.transports import ( - web_security_scanner_grpc_transport, -) -from google.cloud.websecurityscanner_v1alpha.proto import finding_pb2 -from google.cloud.websecurityscanner_v1alpha.proto import scan_config_pb2 -from google.cloud.websecurityscanner_v1alpha.proto import scan_run_pb2 -from google.cloud.websecurityscanner_v1alpha.proto import web_security_scanner_pb2 -from google.cloud.websecurityscanner_v1alpha.proto import web_security_scanner_pb2_grpc -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-websecurityscanner" -).version - - -class WebSecurityScannerClient(object): - """ - Cloud Web Security Scanner Service identifies security vulnerabilities in web - applications hosted on Google Cloud Platform. It crawls your application, and - attempts to exercise as many user inputs and event handlers as possible. - """ - - SERVICE_ADDRESS = "websecurityscanner.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - WebSecurityScannerClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def finding_path(cls, project, scan_config, scan_run, finding): - """Return a fully-qualified finding string.""" - return google.api_core.path_template.expand( - "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}", - project=project, - scan_config=scan_config, - scan_run=scan_run, - finding=finding, - ) - - @classmethod - def project_path(cls, project): - """Return a fully-qualified project string.""" - return google.api_core.path_template.expand( - "projects/{project}", project=project - ) - - @classmethod - def scan_config_path(cls, project, scan_config): - """Return a fully-qualified scan_config string.""" - return google.api_core.path_template.expand( - "projects/{project}/scanConfigs/{scan_config}", - project=project, - scan_config=scan_config, - ) - - @classmethod - def scan_run_path(cls, project, scan_config, scan_run): - """Return a fully-qualified scan_run string.""" - return google.api_core.path_template.expand( - "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}", - project=project, - scan_config=scan_config, - scan_run=scan_run, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.WebSecurityScannerGrpcTransport, - Callable[[~.Credentials, type], ~.WebSecurityScannerGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = web_security_scanner_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=web_security_scanner_grpc_transport.WebSecurityScannerGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = web_security_scanner_grpc_transport.WebSecurityScannerGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def create_scan_config( - self, - parent, - scan_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a new ScanConfig. - - Example: - >>> from google.cloud import websecurityscanner_v1alpha - >>> - >>> client = websecurityscanner_v1alpha.WebSecurityScannerClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> # TODO: Initialize `scan_config`: - >>> scan_config = {} - >>> - >>> response = client.create_scan_config(parent, scan_config) - - Args: - parent (str): Required. The parent resource name where the scan is created, which should be a - project resource name in the format 'projects/{projectId}'. - scan_config (Union[dict, ~google.cloud.websecurityscanner_v1alpha.types.ScanConfig]): Required. The ScanConfig to be created. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.websecurityscanner_v1alpha.types.ScanConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.websecurityscanner_v1alpha.types.ScanConfig` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_scan_config" not in self._inner_api_calls: - self._inner_api_calls[ - "create_scan_config" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_scan_config, - default_retry=self._method_configs["CreateScanConfig"].retry, - default_timeout=self._method_configs["CreateScanConfig"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.CreateScanConfigRequest( - parent=parent, scan_config=scan_config - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_scan_config"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_scan_config( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes an existing ScanConfig and its child resources. - - Example: - >>> from google.cloud import websecurityscanner_v1alpha - >>> - >>> client = websecurityscanner_v1alpha.WebSecurityScannerClient() - >>> - >>> name = client.scan_config_path('[PROJECT]', '[SCAN_CONFIG]') - >>> - >>> client.delete_scan_config(name) - - Args: - name (str): Required. The resource name of the ScanConfig to be deleted. The name follows the - format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_scan_config" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_scan_config" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_scan_config, - default_retry=self._method_configs["DeleteScanConfig"].retry, - default_timeout=self._method_configs["DeleteScanConfig"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.DeleteScanConfigRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_scan_config"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_scan_config( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a ScanConfig. - - Example: - >>> from google.cloud import websecurityscanner_v1alpha - >>> - >>> client = websecurityscanner_v1alpha.WebSecurityScannerClient() - >>> - >>> name = client.scan_config_path('[PROJECT]', '[SCAN_CONFIG]') - >>> - >>> response = client.get_scan_config(name) - - Args: - name (str): Required. The resource name of the ScanConfig to be returned. The name follows the - format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.websecurityscanner_v1alpha.types.ScanConfig` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_scan_config" not in self._inner_api_calls: - self._inner_api_calls[ - "get_scan_config" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_scan_config, - default_retry=self._method_configs["GetScanConfig"].retry, - default_timeout=self._method_configs["GetScanConfig"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.GetScanConfigRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_scan_config"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_scan_configs( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists ScanConfigs under a given project. - - Example: - >>> from google.cloud import websecurityscanner_v1alpha - >>> - >>> client = websecurityscanner_v1alpha.WebSecurityScannerClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> # Iterate over all results - >>> for element in client.list_scan_configs(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_scan_configs(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The parent resource name, which should be a project resource name in the - format 'projects/{projectId}'. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.websecurityscanner_v1alpha.types.ScanConfig` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_scan_configs" not in self._inner_api_calls: - self._inner_api_calls[ - "list_scan_configs" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_scan_configs, - default_retry=self._method_configs["ListScanConfigs"].retry, - default_timeout=self._method_configs["ListScanConfigs"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.ListScanConfigsRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_scan_configs"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="scan_configs", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def update_scan_config( - self, - scan_config, - update_mask, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates a ScanConfig. This method support partial update of a ScanConfig. - - Example: - >>> from google.cloud import websecurityscanner_v1alpha - >>> - >>> client = websecurityscanner_v1alpha.WebSecurityScannerClient() - >>> - >>> # TODO: Initialize `scan_config`: - >>> scan_config = {} - >>> - >>> # TODO: Initialize `update_mask`: - >>> update_mask = {} - >>> - >>> response = client.update_scan_config(scan_config, update_mask) - - Args: - scan_config (Union[dict, ~google.cloud.websecurityscanner_v1alpha.types.ScanConfig]): Required. The ScanConfig to be updated. The name field must be set to identify the - resource to be updated. The values of fields not covered by the mask - will be ignored. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.websecurityscanner_v1alpha.types.ScanConfig` - update_mask (Union[dict, ~google.cloud.websecurityscanner_v1alpha.types.FieldMask]): Required. The update mask applies to the resource. For the ``FieldMask`` - definition, see - https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.websecurityscanner_v1alpha.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.websecurityscanner_v1alpha.types.ScanConfig` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_scan_config" not in self._inner_api_calls: - self._inner_api_calls[ - "update_scan_config" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_scan_config, - default_retry=self._method_configs["UpdateScanConfig"].retry, - default_timeout=self._method_configs["UpdateScanConfig"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.UpdateScanConfigRequest( - scan_config=scan_config, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("scan_config.name", scan_config.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_scan_config"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def start_scan_run( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Start a ScanRun according to the given ScanConfig. - - Example: - >>> from google.cloud import websecurityscanner_v1alpha - >>> - >>> client = websecurityscanner_v1alpha.WebSecurityScannerClient() - >>> - >>> name = client.scan_config_path('[PROJECT]', '[SCAN_CONFIG]') - >>> - >>> response = client.start_scan_run(name) - - Args: - name (str): Required. The resource name of the ScanConfig to be used. The name follows the - format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.websecurityscanner_v1alpha.types.ScanRun` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "start_scan_run" not in self._inner_api_calls: - self._inner_api_calls[ - "start_scan_run" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.start_scan_run, - default_retry=self._method_configs["StartScanRun"].retry, - default_timeout=self._method_configs["StartScanRun"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.StartScanRunRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["start_scan_run"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_scan_run( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a ScanRun. - - Example: - >>> from google.cloud import websecurityscanner_v1alpha - >>> - >>> client = websecurityscanner_v1alpha.WebSecurityScannerClient() - >>> - >>> name = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]') - >>> - >>> response = client.get_scan_run(name) - - Args: - name (str): Required. The resource name of the ScanRun to be returned. The name follows the - format of - 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.websecurityscanner_v1alpha.types.ScanRun` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_scan_run" not in self._inner_api_calls: - self._inner_api_calls[ - "get_scan_run" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_scan_run, - default_retry=self._method_configs["GetScanRun"].retry, - default_timeout=self._method_configs["GetScanRun"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.GetScanRunRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_scan_run"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_scan_runs( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists ScanRuns under a given ScanConfig, in descending order of ScanRun - stop time. - - Example: - >>> from google.cloud import websecurityscanner_v1alpha - >>> - >>> client = websecurityscanner_v1alpha.WebSecurityScannerClient() - >>> - >>> parent = client.scan_config_path('[PROJECT]', '[SCAN_CONFIG]') - >>> - >>> # Iterate over all results - >>> for element in client.list_scan_runs(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_scan_runs(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The parent resource name, which should be a scan resource name in the - format 'projects/{projectId}/scanConfigs/{scanConfigId}'. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.websecurityscanner_v1alpha.types.ScanRun` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_scan_runs" not in self._inner_api_calls: - self._inner_api_calls[ - "list_scan_runs" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_scan_runs, - default_retry=self._method_configs["ListScanRuns"].retry, - default_timeout=self._method_configs["ListScanRuns"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.ListScanRunsRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_scan_runs"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="scan_runs", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def stop_scan_run( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Stops a ScanRun. The stopped ScanRun is returned. - - Example: - >>> from google.cloud import websecurityscanner_v1alpha - >>> - >>> client = websecurityscanner_v1alpha.WebSecurityScannerClient() - >>> - >>> name = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]') - >>> - >>> response = client.stop_scan_run(name) - - Args: - name (str): Required. The resource name of the ScanRun to be stopped. The name follows the - format of - 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.websecurityscanner_v1alpha.types.ScanRun` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "stop_scan_run" not in self._inner_api_calls: - self._inner_api_calls[ - "stop_scan_run" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.stop_scan_run, - default_retry=self._method_configs["StopScanRun"].retry, - default_timeout=self._method_configs["StopScanRun"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.StopScanRunRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["stop_scan_run"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_crawled_urls( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - List CrawledUrls under a given ScanRun. - - Example: - >>> from google.cloud import websecurityscanner_v1alpha - >>> - >>> client = websecurityscanner_v1alpha.WebSecurityScannerClient() - >>> - >>> parent = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]') - >>> - >>> # Iterate over all results - >>> for element in client.list_crawled_urls(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_crawled_urls(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The parent resource name, which should be a scan run resource name in the - format - 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.websecurityscanner_v1alpha.types.CrawledUrl` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_crawled_urls" not in self._inner_api_calls: - self._inner_api_calls[ - "list_crawled_urls" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_crawled_urls, - default_retry=self._method_configs["ListCrawledUrls"].retry, - default_timeout=self._method_configs["ListCrawledUrls"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.ListCrawledUrlsRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_crawled_urls"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="crawled_urls", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_finding( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a Finding. - - Example: - >>> from google.cloud import websecurityscanner_v1alpha - >>> - >>> client = websecurityscanner_v1alpha.WebSecurityScannerClient() - >>> - >>> name = client.finding_path('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]', '[FINDING]') - >>> - >>> response = client.get_finding(name) - - Args: - name (str): Required. The resource name of the Finding to be returned. The name follows the - format of - 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.websecurityscanner_v1alpha.types.Finding` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_finding" not in self._inner_api_calls: - self._inner_api_calls[ - "get_finding" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_finding, - default_retry=self._method_configs["GetFinding"].retry, - default_timeout=self._method_configs["GetFinding"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.GetFindingRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_finding"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_findings( - self, - parent, - filter_, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - List Findings under a given ScanRun. - - Example: - >>> from google.cloud import websecurityscanner_v1alpha - >>> - >>> client = websecurityscanner_v1alpha.WebSecurityScannerClient() - >>> - >>> parent = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]') - >>> - >>> # TODO: Initialize `filter_`: - >>> filter_ = '' - >>> - >>> # Iterate over all results - >>> for element in client.list_findings(parent, filter_): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_findings(parent, filter_).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The parent resource name, which should be a scan run resource name in the - format - 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - filter_ (str): Required. The filter expression. The expression must be in the format: . - Supported field: 'finding\_type'. Supported operator: '='. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.websecurityscanner_v1alpha.types.Finding` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_findings" not in self._inner_api_calls: - self._inner_api_calls[ - "list_findings" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_findings, - default_retry=self._method_configs["ListFindings"].retry, - default_timeout=self._method_configs["ListFindings"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.ListFindingsRequest( - parent=parent, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_findings"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="findings", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def list_finding_type_stats( - self, - parent, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - List all FindingTypeStats under a given ScanRun. - - Example: - >>> from google.cloud import websecurityscanner_v1alpha - >>> - >>> client = websecurityscanner_v1alpha.WebSecurityScannerClient() - >>> - >>> parent = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]') - >>> - >>> response = client.list_finding_type_stats(parent) - - Args: - parent (str): Required. The parent resource name, which should be a scan run resource name in the - format - 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.websecurityscanner_v1alpha.types.ListFindingTypeStatsResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_finding_type_stats" not in self._inner_api_calls: - self._inner_api_calls[ - "list_finding_type_stats" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_finding_type_stats, - default_retry=self._method_configs["ListFindingTypeStats"].retry, - default_timeout=self._method_configs["ListFindingTypeStats"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.ListFindingTypeStatsRequest(parent=parent) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["list_finding_type_stats"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client_config.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client_config.py deleted file mode 100644 index e1550155721e..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client_config.py +++ /dev/null @@ -1,88 +0,0 @@ -config = { - "interfaces": { - "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "CreateScanConfig": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteScanConfig": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetScanConfig": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListScanConfigs": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateScanConfig": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "StartScanRun": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetScanRun": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListScanRuns": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "StopScanRun": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListCrawledUrls": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetFinding": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListFindings": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListFindingTypeStats": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/__init__.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/crawled_url.proto b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/crawled_url.proto deleted file mode 100644 index c22f4272f167..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/crawled_url.proto +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.websecurityscanner.v1alpha; - -option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner"; -option java_multiple_files = true; -option java_outer_classname = "CrawledUrlProto"; -option java_package = "com.google.cloud.websecurityscanner.v1alpha"; - -// A CrawledUrl resource represents a URL that was crawled during a ScanRun. Web -// Security Scanner Service crawls the web applications, following all links -// within the scope of sites, to find the URLs to test against. -message CrawledUrl { - // Output only. The http method of the request that was used to visit the URL, in - // uppercase. - string http_method = 1; - - // Output only. The URL that was crawled. - string url = 2; - - // Output only. The body of the request that was used to visit the URL. - string body = 3; -} diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/crawled_url_pb2.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/crawled_url_pb2.py deleted file mode 100644 index 10e8680b348a..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/crawled_url_pb2.py +++ /dev/null @@ -1,137 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner_v1alpha/proto/crawled_url.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/websecurityscanner_v1alpha/proto/crawled_url.proto", - package="google.cloud.websecurityscanner.v1alpha", - syntax="proto3", - serialized_options=_b( - "\n+com.google.cloud.websecurityscanner.v1alphaB\017CrawledUrlProtoP\001ZYgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner" - ), - serialized_pb=_b( - "\n?google/cloud/websecurityscanner_v1alpha/proto/crawled_url.proto\x12'google.cloud.websecurityscanner.v1alpha\"<\n\nCrawledUrl\x12\x13\n\x0bhttp_method\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\x0c\n\x04\x62ody\x18\x03 \x01(\tB\x9b\x01\n+com.google.cloud.websecurityscanner.v1alphaB\x0f\x43rawledUrlProtoP\x01ZYgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscannerb\x06proto3" - ), -) - - -_CRAWLEDURL = _descriptor.Descriptor( - name="CrawledUrl", - full_name="google.cloud.websecurityscanner.v1alpha.CrawledUrl", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="http_method", - full_name="google.cloud.websecurityscanner.v1alpha.CrawledUrl.http_method", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="url", - full_name="google.cloud.websecurityscanner.v1alpha.CrawledUrl.url", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="body", - full_name="google.cloud.websecurityscanner.v1alpha.CrawledUrl.body", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=108, - serialized_end=168, -) - -DESCRIPTOR.message_types_by_name["CrawledUrl"] = _CRAWLEDURL -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -CrawledUrl = _reflection.GeneratedProtocolMessageType( - "CrawledUrl", - (_message.Message,), - dict( - DESCRIPTOR=_CRAWLEDURL, - __module__="google.cloud.websecurityscanner_v1alpha.proto.crawled_url_pb2", - __doc__="""A CrawledUrl resource represents a URL that was crawled - during a ScanRun. Web Security Scanner Service crawls the web - applications, following all links within the scope of sites, to find the - URLs to test against. - - - Attributes: - http_method: - Output only. The http method of the request that was used to - visit the URL, in uppercase. - url: - Output only. The URL that was crawled. - body: - Output only. The body of the request that was used to visit - the URL. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.CrawledUrl) - ), -) -_sym_db.RegisterMessage(CrawledUrl) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/crawled_url_pb2_grpc.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/crawled_url_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/crawled_url_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding.proto b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding.proto deleted file mode 100644 index c02020f34319..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding.proto +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.websecurityscanner.v1alpha; - -import "google/api/resource.proto"; -import "google/cloud/websecurityscanner/v1alpha/finding_addon.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner"; -option java_multiple_files = true; -option java_outer_classname = "FindingProto"; -option java_package = "com.google.cloud.websecurityscanner.v1alpha"; - -// A Finding resource represents a vulnerability instance identified during a -// ScanRun. -message Finding { - option (google.api.resource) = { - type: "websecurityscanner.googleapis.com/Finding" - pattern: "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}" - }; - - // Types of Findings. - enum FindingType { - // The invalid finding type. - FINDING_TYPE_UNSPECIFIED = 0; - - // A page that was served over HTTPS also resources over HTTP. A - // man-in-the-middle attacker could tamper with the HTTP resource and gain - // full access to the website that loads the resource or to monitor the - // actions taken by the user. - MIXED_CONTENT = 1; - - // The version of an included library is known to contain a security issue. - // The scanner checks the version of library in use against a known list of - // vulnerable libraries. False positives are possible if the version - // detection fails or if the library has been manually patched. - OUTDATED_LIBRARY = 2; - - // This type of vulnerability occurs when the value of a request parameter - // is reflected at the beginning of the response, for example, in requests - // using JSONP. Under certain circumstances, an attacker may be able to - // supply an alphanumeric-only Flash file in the vulnerable parameter - // causing the browser to execute the Flash file as if it originated on the - // vulnerable server. - ROSETTA_FLASH = 5; - - // A cross-site scripting (XSS) bug is found via JavaScript callback. For - // detailed explanations on XSS, see - // https://www.google.com/about/appsecurity/learning/xss/. - XSS_CALLBACK = 3; - - // A potential cross-site scripting (XSS) bug due to JavaScript breakage. - // In some circumstances, the application under test might modify the test - // string before it is parsed by the browser. When the browser attempts to - // runs this modified test string, it will likely break and throw a - // JavaScript execution error, thus an injection issue is occurring. - // However, it may not be exploitable. Manual verification is needed to see - // if the test string modifications can be evaded and confirm that the issue - // is in fact an XSS vulnerability. For detailed explanations on XSS, see - // https://www.google.com/about/appsecurity/learning/xss/. - XSS_ERROR = 4; - - // An application appears to be transmitting a password field in clear text. - // An attacker can eavesdrop network traffic and sniff the password field. - CLEAR_TEXT_PASSWORD = 6; - - // An application returns sensitive content with an invalid content type, - // or without an 'X-Content-Type-Options: nosniff' header. - INVALID_CONTENT_TYPE = 7; - - // A cross-site scripting (XSS) vulnerability in AngularJS module that - // occurs when a user-provided string is interpolated by Angular. - XSS_ANGULAR_CALLBACK = 8; - - // A malformed or invalid valued header. - INVALID_HEADER = 9; - - // Misspelled security header name. - MISSPELLED_SECURITY_HEADER_NAME = 10; - - // Mismatching values in a duplicate security header. - MISMATCHING_SECURITY_HEADER_VALUES = 11; - } - - // The resource name of the Finding. The name follows the format of - // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'. - // The finding IDs are generated by the system. - string name = 1; - - // The type of the Finding. - FindingType finding_type = 2; - - // The http method of the request that triggered the vulnerability, in - // uppercase. - string http_method = 3; - - // The URL produced by the server-side fuzzer and used in the request that - // triggered the vulnerability. - string fuzzed_url = 4; - - // The body of the request that triggered the vulnerability. - string body = 5; - - // The description of the vulnerability. - string description = 6; - - // The URL containing human-readable payload that user can leverage to - // reproduce the vulnerability. - string reproduction_url = 7; - - // If the vulnerability was originated from nested IFrame, the immediate - // parent IFrame is reported. - string frame_url = 8; - - // The URL where the browser lands when the vulnerability is detected. - string final_url = 9; - - // The tracking ID uniquely identifies a vulnerability instance across - // multiple ScanRuns. - string tracking_id = 10; - - // An addon containing information about outdated libraries. - OutdatedLibrary outdated_library = 11; - - // An addon containing detailed information regarding any resource causing the - // vulnerability such as JavaScript sources, image, audio files, etc. - ViolatingResource violating_resource = 12; - - // An addon containing information about vulnerable or missing HTTP headers. - VulnerableHeaders vulnerable_headers = 15; - - // An addon containing information about request parameters which were found - // to be vulnerable. - VulnerableParameters vulnerable_parameters = 13; - - // An addon containing information reported for an XSS, if any. - Xss xss = 14; -} diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_addon.proto b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_addon.proto deleted file mode 100644 index 3fafdb40206a..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_addon.proto +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.websecurityscanner.v1alpha; - -option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner"; -option java_multiple_files = true; -option java_outer_classname = "FindingAddonProto"; -option java_package = "com.google.cloud.websecurityscanner.v1alpha"; - -// Information reported for an outdated library. -message OutdatedLibrary { - // The name of the outdated library. - string library_name = 1; - - // The version number. - string version = 2; - - // URLs to learn more information about the vulnerabilities in the library. - repeated string learn_more_urls = 3; -} - -// Information regarding any resource causing the vulnerability such -// as JavaScript sources, image, audio files, etc. -message ViolatingResource { - // The MIME type of this resource. - string content_type = 1; - - // URL of this violating resource. - string resource_url = 2; -} - -// Information about vulnerable request parameters. -message VulnerableParameters { - // The vulnerable parameter names. - repeated string parameter_names = 1; -} - -// Information about vulnerable or missing HTTP Headers. -message VulnerableHeaders { - // Describes a HTTP Header. - message Header { - // Header name. - string name = 1; - - // Header value. - string value = 2; - } - - // List of vulnerable headers. - repeated Header headers = 1; - - // List of missing headers. - repeated Header missing_headers = 2; -} - -// Information reported for an XSS. -message Xss { - // Stack traces leading to the point where the XSS occurred. - repeated string stack_traces = 1; - - // An error message generated by a javascript breakage. - string error_message = 2; -} diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_addon_pb2.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_addon_pb2.py deleted file mode 100644 index e74e0c874bac..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_addon_pb2.py +++ /dev/null @@ -1,506 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner_v1alpha/proto/finding_addon.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/websecurityscanner_v1alpha/proto/finding_addon.proto", - package="google.cloud.websecurityscanner.v1alpha", - syntax="proto3", - serialized_options=_b( - "\n+com.google.cloud.websecurityscanner.v1alphaB\021FindingAddonProtoP\001ZYgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner" - ), - serialized_pb=_b( - '\nAgoogle/cloud/websecurityscanner_v1alpha/proto/finding_addon.proto\x12\'google.cloud.websecurityscanner.v1alpha"Q\n\x0fOutdatedLibrary\x12\x14\n\x0clibrary_name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x17\n\x0flearn_more_urls\x18\x03 \x03(\t"?\n\x11ViolatingResource\x12\x14\n\x0c\x63ontent_type\x18\x01 \x01(\t\x12\x14\n\x0cresource_url\x18\x02 \x01(\t"/\n\x14VulnerableParameters\x12\x17\n\x0fparameter_names\x18\x01 \x03(\t"\xea\x01\n\x11VulnerableHeaders\x12R\n\x07headers\x18\x01 \x03(\x0b\x32\x41.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header\x12Z\n\x0fmissing_headers\x18\x02 \x03(\x0b\x32\x41.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header\x1a%\n\x06Header\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t"2\n\x03Xss\x12\x14\n\x0cstack_traces\x18\x01 \x03(\t\x12\x15\n\rerror_message\x18\x02 \x01(\tB\x9d\x01\n+com.google.cloud.websecurityscanner.v1alphaB\x11\x46indingAddonProtoP\x01ZYgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscannerb\x06proto3' - ), -) - - -_OUTDATEDLIBRARY = _descriptor.Descriptor( - name="OutdatedLibrary", - full_name="google.cloud.websecurityscanner.v1alpha.OutdatedLibrary", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="library_name", - full_name="google.cloud.websecurityscanner.v1alpha.OutdatedLibrary.library_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="version", - full_name="google.cloud.websecurityscanner.v1alpha.OutdatedLibrary.version", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="learn_more_urls", - full_name="google.cloud.websecurityscanner.v1alpha.OutdatedLibrary.learn_more_urls", - index=2, - number=3, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=110, - serialized_end=191, -) - - -_VIOLATINGRESOURCE = _descriptor.Descriptor( - name="ViolatingResource", - full_name="google.cloud.websecurityscanner.v1alpha.ViolatingResource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="content_type", - full_name="google.cloud.websecurityscanner.v1alpha.ViolatingResource.content_type", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="resource_url", - full_name="google.cloud.websecurityscanner.v1alpha.ViolatingResource.resource_url", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=193, - serialized_end=256, -) - - -_VULNERABLEPARAMETERS = _descriptor.Descriptor( - name="VulnerableParameters", - full_name="google.cloud.websecurityscanner.v1alpha.VulnerableParameters", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parameter_names", - full_name="google.cloud.websecurityscanner.v1alpha.VulnerableParameters.parameter_names", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=258, - serialized_end=305, -) - - -_VULNERABLEHEADERS_HEADER = _descriptor.Descriptor( - name="Header", - full_name="google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=505, - serialized_end=542, -) - -_VULNERABLEHEADERS = _descriptor.Descriptor( - name="VulnerableHeaders", - full_name="google.cloud.websecurityscanner.v1alpha.VulnerableHeaders", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="headers", - full_name="google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.headers", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="missing_headers", - full_name="google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.missing_headers", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_VULNERABLEHEADERS_HEADER], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=308, - serialized_end=542, -) - - -_XSS = _descriptor.Descriptor( - name="Xss", - full_name="google.cloud.websecurityscanner.v1alpha.Xss", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="stack_traces", - full_name="google.cloud.websecurityscanner.v1alpha.Xss.stack_traces", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="error_message", - full_name="google.cloud.websecurityscanner.v1alpha.Xss.error_message", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=544, - serialized_end=594, -) - -_VULNERABLEHEADERS_HEADER.containing_type = _VULNERABLEHEADERS -_VULNERABLEHEADERS.fields_by_name["headers"].message_type = _VULNERABLEHEADERS_HEADER -_VULNERABLEHEADERS.fields_by_name[ - "missing_headers" -].message_type = _VULNERABLEHEADERS_HEADER -DESCRIPTOR.message_types_by_name["OutdatedLibrary"] = _OUTDATEDLIBRARY -DESCRIPTOR.message_types_by_name["ViolatingResource"] = _VIOLATINGRESOURCE -DESCRIPTOR.message_types_by_name["VulnerableParameters"] = _VULNERABLEPARAMETERS -DESCRIPTOR.message_types_by_name["VulnerableHeaders"] = _VULNERABLEHEADERS -DESCRIPTOR.message_types_by_name["Xss"] = _XSS -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -OutdatedLibrary = _reflection.GeneratedProtocolMessageType( - "OutdatedLibrary", - (_message.Message,), - dict( - DESCRIPTOR=_OUTDATEDLIBRARY, - __module__="google.cloud.websecurityscanner_v1alpha.proto.finding_addon_pb2", - __doc__="""Information reported for an outdated library. - - - Attributes: - library_name: - The name of the outdated library. - version: - The version number. - learn_more_urls: - URLs to learn more information about the vulnerabilities in - the library. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.OutdatedLibrary) - ), -) -_sym_db.RegisterMessage(OutdatedLibrary) - -ViolatingResource = _reflection.GeneratedProtocolMessageType( - "ViolatingResource", - (_message.Message,), - dict( - DESCRIPTOR=_VIOLATINGRESOURCE, - __module__="google.cloud.websecurityscanner_v1alpha.proto.finding_addon_pb2", - __doc__="""Information regarding any resource causing the - vulnerability such as JavaScript sources, image, audio files, etc. - - - Attributes: - content_type: - The MIME type of this resource. - resource_url: - URL of this violating resource. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.ViolatingResource) - ), -) -_sym_db.RegisterMessage(ViolatingResource) - -VulnerableParameters = _reflection.GeneratedProtocolMessageType( - "VulnerableParameters", - (_message.Message,), - dict( - DESCRIPTOR=_VULNERABLEPARAMETERS, - __module__="google.cloud.websecurityscanner_v1alpha.proto.finding_addon_pb2", - __doc__="""Information about vulnerable request parameters. - - - Attributes: - parameter_names: - The vulnerable parameter names. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.VulnerableParameters) - ), -) -_sym_db.RegisterMessage(VulnerableParameters) - -VulnerableHeaders = _reflection.GeneratedProtocolMessageType( - "VulnerableHeaders", - (_message.Message,), - dict( - Header=_reflection.GeneratedProtocolMessageType( - "Header", - (_message.Message,), - dict( - DESCRIPTOR=_VULNERABLEHEADERS_HEADER, - __module__="google.cloud.websecurityscanner_v1alpha.proto.finding_addon_pb2", - __doc__="""Describes a HTTP Header. - - - Attributes: - name: - Header name. - value: - Header value. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header) - ), - ), - DESCRIPTOR=_VULNERABLEHEADERS, - __module__="google.cloud.websecurityscanner_v1alpha.proto.finding_addon_pb2", - __doc__="""Information about vulnerable or missing HTTP Headers. - - - Attributes: - headers: - List of vulnerable headers. - missing_headers: - List of missing headers. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.VulnerableHeaders) - ), -) -_sym_db.RegisterMessage(VulnerableHeaders) -_sym_db.RegisterMessage(VulnerableHeaders.Header) - -Xss = _reflection.GeneratedProtocolMessageType( - "Xss", - (_message.Message,), - dict( - DESCRIPTOR=_XSS, - __module__="google.cloud.websecurityscanner_v1alpha.proto.finding_addon_pb2", - __doc__="""Information reported for an XSS. - - - Attributes: - stack_traces: - Stack traces leading to the point where the XSS occurred. - error_message: - An error message generated by a javascript breakage. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.Xss) - ), -) -_sym_db.RegisterMessage(Xss) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_addon_pb2_grpc.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_addon_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_addon_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_pb2.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_pb2.py deleted file mode 100644 index a93f61ba01ed..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_pb2.py +++ /dev/null @@ -1,505 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner_v1alpha/proto/finding.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.websecurityscanner_v1alpha.proto import ( - finding_addon_pb2 as google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__addon__pb2, -) - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/websecurityscanner_v1alpha/proto/finding.proto", - package="google.cloud.websecurityscanner.v1alpha", - syntax="proto3", - serialized_options=_b( - "\n+com.google.cloud.websecurityscanner.v1alphaB\014FindingProtoP\001ZYgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner" - ), - serialized_pb=_b( - '\n;google/cloud/websecurityscanner_v1alpha/proto/finding.proto\x12\'google.cloud.websecurityscanner.v1alpha\x1a\x19google/api/resource.proto\x1a\x41google/cloud/websecurityscanner_v1alpha/proto/finding_addon.proto"\xe9\x08\n\x07\x46inding\x12\x0c\n\x04name\x18\x01 \x01(\t\x12R\n\x0c\x66inding_type\x18\x02 \x01(\x0e\x32<.google.cloud.websecurityscanner.v1alpha.Finding.FindingType\x12\x13\n\x0bhttp_method\x18\x03 \x01(\t\x12\x12\n\nfuzzed_url\x18\x04 \x01(\t\x12\x0c\n\x04\x62ody\x18\x05 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x18\n\x10reproduction_url\x18\x07 \x01(\t\x12\x11\n\tframe_url\x18\x08 \x01(\t\x12\x11\n\tfinal_url\x18\t \x01(\t\x12\x13\n\x0btracking_id\x18\n \x01(\t\x12R\n\x10outdated_library\x18\x0b \x01(\x0b\x32\x38.google.cloud.websecurityscanner.v1alpha.OutdatedLibrary\x12V\n\x12violating_resource\x18\x0c \x01(\x0b\x32:.google.cloud.websecurityscanner.v1alpha.ViolatingResource\x12V\n\x12vulnerable_headers\x18\x0f \x01(\x0b\x32:.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders\x12\\\n\x15vulnerable_parameters\x18\r \x01(\x0b\x32=.google.cloud.websecurityscanner.v1alpha.VulnerableParameters\x12\x39\n\x03xss\x18\x0e \x01(\x0b\x32,.google.cloud.websecurityscanner.v1alpha.Xss"\xb6\x02\n\x0b\x46indingType\x12\x1c\n\x18\x46INDING_TYPE_UNSPECIFIED\x10\x00\x12\x11\n\rMIXED_CONTENT\x10\x01\x12\x14\n\x10OUTDATED_LIBRARY\x10\x02\x12\x11\n\rROSETTA_FLASH\x10\x05\x12\x10\n\x0cXSS_CALLBACK\x10\x03\x12\r\n\tXSS_ERROR\x10\x04\x12\x17\n\x13\x43LEAR_TEXT_PASSWORD\x10\x06\x12\x18\n\x14INVALID_CONTENT_TYPE\x10\x07\x12\x18\n\x14XSS_ANGULAR_CALLBACK\x10\x08\x12\x12\n\x0eINVALID_HEADER\x10\t\x12#\n\x1fMISSPELLED_SECURITY_HEADER_NAME\x10\n\x12&\n"MISMATCHING_SECURITY_HEADER_VALUES\x10\x0b:\x84\x01\xea\x41\x80\x01\n)websecurityscanner.googleapis.com/Finding\x12Sprojects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}B\x98\x01\n+com.google.cloud.websecurityscanner.v1alphaB\x0c\x46indingProtoP\x01ZYgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscannerb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__addon__pb2.DESCRIPTOR, - ], -) - - -_FINDING_FINDINGTYPE = _descriptor.EnumDescriptor( - name="FindingType", - full_name="google.cloud.websecurityscanner.v1alpha.Finding.FindingType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="FINDING_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="MIXED_CONTENT", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="OUTDATED_LIBRARY", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="ROSETTA_FLASH", index=3, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="XSS_CALLBACK", index=4, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="XSS_ERROR", index=5, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CLEAR_TEXT_PASSWORD", - index=6, - number=6, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="INVALID_CONTENT_TYPE", - index=7, - number=7, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="XSS_ANGULAR_CALLBACK", - index=8, - number=8, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="INVALID_HEADER", index=9, number=9, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MISSPELLED_SECURITY_HEADER_NAME", - index=10, - number=10, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="MISMATCHING_SECURITY_HEADER_VALUES", - index=11, - number=11, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=883, - serialized_end=1193, -) -_sym_db.RegisterEnumDescriptor(_FINDING_FINDINGTYPE) - - -_FINDING = _descriptor.Descriptor( - name="Finding", - full_name="google.cloud.websecurityscanner.v1alpha.Finding", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.websecurityscanner.v1alpha.Finding.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="finding_type", - full_name="google.cloud.websecurityscanner.v1alpha.Finding.finding_type", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="http_method", - full_name="google.cloud.websecurityscanner.v1alpha.Finding.http_method", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="fuzzed_url", - full_name="google.cloud.websecurityscanner.v1alpha.Finding.fuzzed_url", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="body", - full_name="google.cloud.websecurityscanner.v1alpha.Finding.body", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.websecurityscanner.v1alpha.Finding.description", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="reproduction_url", - full_name="google.cloud.websecurityscanner.v1alpha.Finding.reproduction_url", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frame_url", - full_name="google.cloud.websecurityscanner.v1alpha.Finding.frame_url", - index=7, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="final_url", - full_name="google.cloud.websecurityscanner.v1alpha.Finding.final_url", - index=8, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tracking_id", - full_name="google.cloud.websecurityscanner.v1alpha.Finding.tracking_id", - index=9, - number=10, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="outdated_library", - full_name="google.cloud.websecurityscanner.v1alpha.Finding.outdated_library", - index=10, - number=11, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="violating_resource", - full_name="google.cloud.websecurityscanner.v1alpha.Finding.violating_resource", - index=11, - number=12, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="vulnerable_headers", - full_name="google.cloud.websecurityscanner.v1alpha.Finding.vulnerable_headers", - index=12, - number=15, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="vulnerable_parameters", - full_name="google.cloud.websecurityscanner.v1alpha.Finding.vulnerable_parameters", - index=13, - number=13, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="xss", - full_name="google.cloud.websecurityscanner.v1alpha.Finding.xss", - index=14, - number=14, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_FINDING_FINDINGTYPE], - serialized_options=_b( - "\352A\200\001\n)websecurityscanner.googleapis.com/Finding\022Sprojects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=199, - serialized_end=1328, -) - -_FINDING.fields_by_name["finding_type"].enum_type = _FINDING_FINDINGTYPE -_FINDING.fields_by_name[ - "outdated_library" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__addon__pb2._OUTDATEDLIBRARY -) -_FINDING.fields_by_name[ - "violating_resource" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__addon__pb2._VIOLATINGRESOURCE -) -_FINDING.fields_by_name[ - "vulnerable_headers" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__addon__pb2._VULNERABLEHEADERS -) -_FINDING.fields_by_name[ - "vulnerable_parameters" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__addon__pb2._VULNERABLEPARAMETERS -) -_FINDING.fields_by_name[ - "xss" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__addon__pb2._XSS -) -_FINDING_FINDINGTYPE.containing_type = _FINDING -DESCRIPTOR.message_types_by_name["Finding"] = _FINDING -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Finding = _reflection.GeneratedProtocolMessageType( - "Finding", - (_message.Message,), - dict( - DESCRIPTOR=_FINDING, - __module__="google.cloud.websecurityscanner_v1alpha.proto.finding_pb2", - __doc__="""A Finding resource represents a vulnerability instance - identified during a ScanRun. - - - Attributes: - name: - The resource name of the Finding. The name follows the format - of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{ - scanRunId}/findings/{findingId}'. The finding IDs are - generated by the system. - finding_type: - The type of the Finding. - http_method: - The http method of the request that triggered the - vulnerability, in uppercase. - fuzzed_url: - The URL produced by the server-side fuzzer and used in the - request that triggered the vulnerability. - body: - The body of the request that triggered the vulnerability. - description: - The description of the vulnerability. - reproduction_url: - The URL containing human-readable payload that user can - leverage to reproduce the vulnerability. - frame_url: - If the vulnerability was originated from nested IFrame, the - immediate parent IFrame is reported. - final_url: - The URL where the browser lands when the vulnerability is - detected. - tracking_id: - The tracking ID uniquely identifies a vulnerability instance - across multiple ScanRuns. - outdated_library: - An addon containing information about outdated libraries. - violating_resource: - An addon containing detailed information regarding any - resource causing the vulnerability such as JavaScript sources, - image, audio files, etc. - vulnerable_headers: - An addon containing information about vulnerable or missing - HTTP headers. - vulnerable_parameters: - An addon containing information about request parameters which - were found to be vulnerable. - xss: - An addon containing information reported for an XSS, if any. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.Finding) - ), -) -_sym_db.RegisterMessage(Finding) - - -DESCRIPTOR._options = None -_FINDING._options = None -# @@protoc_insertion_point(module_scope) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_pb2_grpc.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_type_stats.proto b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_type_stats.proto deleted file mode 100644 index e46b330c627e..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_type_stats.proto +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.websecurityscanner.v1alpha; - -import "google/cloud/websecurityscanner/v1alpha/finding.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner"; -option java_multiple_files = true; -option java_outer_classname = "FindingTypeStatsProto"; -option java_package = "com.google.cloud.websecurityscanner.v1alpha"; - -// A FindingTypeStats resource represents stats regarding a specific FindingType -// of Findings under a given ScanRun. -message FindingTypeStats { - // The finding type associated with the stats. - Finding.FindingType finding_type = 1; - - // The count of findings belonging to this finding type. - int32 finding_count = 2; -} diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_type_stats_pb2.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_type_stats_pb2.py deleted file mode 100644 index d132206fbdcf..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_type_stats_pb2.py +++ /dev/null @@ -1,126 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner_v1alpha/proto/finding_type_stats.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.cloud.websecurityscanner_v1alpha.proto import ( - finding_pb2 as google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__pb2, -) - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/websecurityscanner_v1alpha/proto/finding_type_stats.proto", - package="google.cloud.websecurityscanner.v1alpha", - syntax="proto3", - serialized_options=_b( - "\n+com.google.cloud.websecurityscanner.v1alphaB\025FindingTypeStatsProtoP\001ZYgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner" - ), - serialized_pb=_b( - "\nFgoogle/cloud/websecurityscanner_v1alpha/proto/finding_type_stats.proto\x12'google.cloud.websecurityscanner.v1alpha\x1a;google/cloud/websecurityscanner_v1alpha/proto/finding.proto\"}\n\x10\x46indingTypeStats\x12R\n\x0c\x66inding_type\x18\x01 \x01(\x0e\x32<.google.cloud.websecurityscanner.v1alpha.Finding.FindingType\x12\x15\n\rfinding_count\x18\x02 \x01(\x05\x42\xa1\x01\n+com.google.cloud.websecurityscanner.v1alphaB\x15\x46indingTypeStatsProtoP\x01ZYgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscannerb\x06proto3" - ), - dependencies=[ - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__pb2.DESCRIPTOR - ], -) - - -_FINDINGTYPESTATS = _descriptor.Descriptor( - name="FindingTypeStats", - full_name="google.cloud.websecurityscanner.v1alpha.FindingTypeStats", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="finding_type", - full_name="google.cloud.websecurityscanner.v1alpha.FindingTypeStats.finding_type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="finding_count", - full_name="google.cloud.websecurityscanner.v1alpha.FindingTypeStats.finding_count", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=176, - serialized_end=301, -) - -_FINDINGTYPESTATS.fields_by_name[ - "finding_type" -].enum_type = ( - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__pb2._FINDING_FINDINGTYPE -) -DESCRIPTOR.message_types_by_name["FindingTypeStats"] = _FINDINGTYPESTATS -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -FindingTypeStats = _reflection.GeneratedProtocolMessageType( - "FindingTypeStats", - (_message.Message,), - dict( - DESCRIPTOR=_FINDINGTYPESTATS, - __module__="google.cloud.websecurityscanner_v1alpha.proto.finding_type_stats_pb2", - __doc__="""A FindingTypeStats resource represents stats regarding a - specific FindingType of Findings under a given ScanRun. - - - Attributes: - finding_type: - The finding type associated with the stats. - finding_count: - The count of findings belonging to this finding type. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.FindingTypeStats) - ), -) -_sym_db.RegisterMessage(FindingTypeStats) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_type_stats_pb2_grpc.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_type_stats_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/finding_type_stats_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/scan_config.proto b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/scan_config.proto deleted file mode 100644 index 5497b1a0f6ac..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/scan_config.proto +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.websecurityscanner.v1alpha; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/websecurityscanner/v1alpha/scan_run.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner"; -option java_multiple_files = true; -option java_outer_classname = "ScanConfigProto"; -option java_package = "com.google.cloud.websecurityscanner.v1alpha"; - -// A ScanConfig resource contains the configurations to launch a scan. -// next id: 12 -message ScanConfig { - option (google.api.resource) = { - type: "websecurityscanner.googleapis.com/ScanConfig" - pattern: "projects/{project}/scanConfigs/{scan_config}" - }; - - // Scan authentication configuration. - message Authentication { - // Describes authentication configuration that uses a Google account. - message GoogleAccount { - // Required. The user name of the Google account. - string username = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Input only. The password of the Google account. The credential is stored encrypted - // and not returned in any response nor included in audit logs. - string password = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = INPUT_ONLY - ]; - } - - // Describes authentication configuration that uses a custom account. - message CustomAccount { - // Required. The user name of the custom account. - string username = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Input only. The password of the custom account. The credential is stored encrypted - // and not returned in any response nor included in audit logs. - string password = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = INPUT_ONLY - ]; - - // Required. The login form URL of the website. - string login_url = 3 [(google.api.field_behavior) = REQUIRED]; - } - - // Required. - // Authentication configuration - oneof authentication { - // Authentication using a Google account. - GoogleAccount google_account = 1; - - // Authentication using a custom account. - CustomAccount custom_account = 2; - } - } - - // Scan schedule configuration. - message Schedule { - // A timestamp indicates when the next run will be scheduled. The value is - // refreshed by the server after each run. If unspecified, it will default - // to current server time, which means the scan will be scheduled to start - // immediately. - google.protobuf.Timestamp schedule_time = 1; - - // Required. The duration of time between executions in days. - int32 interval_duration_days = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Type of user agents used for scanning. - enum UserAgent { - // The user agent is unknown. Service will default to CHROME_LINUX. - USER_AGENT_UNSPECIFIED = 0; - - // Chrome on Linux. This is the service default if unspecified. - CHROME_LINUX = 1; - - // Chrome on Android. - CHROME_ANDROID = 2; - - // Safari on IPhone. - SAFARI_IPHONE = 3; - } - - // Cloud platforms supported by Cloud Web Security Scanner. - enum TargetPlatform { - // The target platform is unknown. Requests with this enum value will be - // rejected with INVALID_ARGUMENT error. - TARGET_PLATFORM_UNSPECIFIED = 0; - - // Google App Engine service. - APP_ENGINE = 1; - - // Google Compute Engine service. - COMPUTE = 2; - } - - // The resource name of the ScanConfig. The name follows the format of - // 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are - // generated by the system. - string name = 1; - - // Required. The user provided display name of the ScanConfig. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // The maximum QPS during scanning. A valid value ranges from 5 to 20 - // inclusively. If the field is unspecified or its value is set 0, server will - // default to 15. Other values outside of [5, 20] range will be rejected with - // INVALID_ARGUMENT error. - int32 max_qps = 3; - - // Required. The starting URLs from which the scanner finds site pages. - repeated string starting_urls = 4 [(google.api.field_behavior) = REQUIRED]; - - // The authentication configuration. If specified, service will use the - // authentication configuration during scanning. - Authentication authentication = 5; - - // The user agent used during scanning. - UserAgent user_agent = 6; - - // The blacklist URL patterns as described in - // https://cloud.google.com/security-scanner/docs/excluded-urls - repeated string blacklist_patterns = 7; - - // The schedule of the ScanConfig. - Schedule schedule = 8; - - // Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be - // used as a default. - repeated TargetPlatform target_platforms = 9; - - // Latest ScanRun if available. - ScanRun latest_run = 11; -} diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/scan_config_pb2.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/scan_config_pb2.py deleted file mode 100644 index ca936fb03a7d..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/scan_config_pb2.py +++ /dev/null @@ -1,743 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner_v1alpha/proto/scan_config.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.websecurityscanner_v1alpha.proto import ( - scan_run_pb2 as google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__run__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/websecurityscanner_v1alpha/proto/scan_config.proto", - package="google.cloud.websecurityscanner.v1alpha", - syntax="proto3", - serialized_options=_b( - "\n+com.google.cloud.websecurityscanner.v1alphaB\017ScanConfigProtoP\001ZYgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner" - ), - serialized_pb=_b( - '\n?google/cloud/websecurityscanner_v1alpha/proto/scan_config.proto\x12\'google.cloud.websecurityscanner.v1alpha\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a - // . - // Supported field: 'finding_type'. - // Supported operator: '='. - string filter = 2 [(google.api.field_behavior) = REQUIRED]; - - // A token identifying a page of results to be returned. This should be a - // `next_page_token` value returned from a previous List request. - // If unspecified, the first page of results is returned. - string page_token = 3; - - // The maximum number of Findings to return, can be limited by server. - // If not specified or not positive, the implementation will select a - // reasonable value. - int32 page_size = 4; -} - -// Response for the `ListFindings` method. -message ListFindingsResponse { - // The list of Findings returned. - repeated Finding findings = 1; - - // Token to retrieve the next page of results, or empty if there are no - // more results in the list. - string next_page_token = 2; -} - -// Request for the `ListFindingTypeStats` method. -message ListFindingTypeStatsRequest { - // Required. The parent resource name, which should be a scan run resource name in the - // format - // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "websecurityscanner.googleapis.com/ScanRun" - } - ]; -} - -// Response for the `ListFindingTypeStats` method. -message ListFindingTypeStatsResponse { - // The list of FindingTypeStats returned. - repeated FindingTypeStats finding_type_stats = 1; -} diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/web_security_scanner_pb2.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/web_security_scanner_pb2.py deleted file mode 100644 index dd3772510a9e..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/web_security_scanner_pb2.py +++ /dev/null @@ -1,1711 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner_v1alpha/proto/web_security_scanner.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.websecurityscanner_v1alpha.proto import ( - crawled_url_pb2 as google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_crawled__url__pb2, -) -from google.cloud.websecurityscanner_v1alpha.proto import ( - finding_pb2 as google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__pb2, -) -from google.cloud.websecurityscanner_v1alpha.proto import ( - finding_type_stats_pb2 as google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__type__stats__pb2, -) -from google.cloud.websecurityscanner_v1alpha.proto import ( - scan_config_pb2 as google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__config__pb2, -) -from google.cloud.websecurityscanner_v1alpha.proto import ( - scan_run_pb2 as google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__run__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/websecurityscanner_v1alpha/proto/web_security_scanner.proto", - package="google.cloud.websecurityscanner.v1alpha", - syntax="proto3", - serialized_options=_b( - "\n+com.google.cloud.websecurityscanner.v1alphaB\027WebSecurityScannerProtoP\001ZYgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner" - ), - serialized_pb=_b( - '\nHgoogle/cloud/websecurityscanner_v1alpha/proto/web_security_scanner.proto\x12\'google.cloud.websecurityscanner.v1alpha\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a?google/cloud/websecurityscanner_v1alpha/proto/crawled_url.proto\x1a;google/cloud/websecurityscanner_v1alpha/proto/finding.proto\x1a\x46google/cloud/websecurityscanner_v1alpha/proto/finding_type_stats.proto\x1a?google/cloud/websecurityscanner_v1alpha/proto/scan_config.proto\x1a/v1alpha/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}\xda\x41\x04name\x12\xe3\x01\n\x0cListFindings\x12<.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest\x1a=.google.cloud.websecurityscanner.v1alpha.ListFindingsResponse"V\x82\xd3\xe4\x93\x02@\x12>/v1alpha/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings\xda\x41\rparent,filter\x12\xfc\x01\n\x14ListFindingTypeStats\x12\x44.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest\x1a\x45.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse"W\x82\xd3\xe4\x93\x02H\x12\x46/v1alpha/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats\xda\x41\x06parent\x1aU\xca\x41!websecurityscanner.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xa3\x01\n+com.google.cloud.websecurityscanner.v1alphaB\x17WebSecurityScannerProtoP\x01ZYgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscannerb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_crawled__url__pb2.DESCRIPTOR, - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__pb2.DESCRIPTOR, - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__type__stats__pb2.DESCRIPTOR, - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__config__pb2.DESCRIPTOR, - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__run__pb2.DESCRIPTOR, - google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - ], -) - - -_CREATESCANCONFIGREQUEST = _descriptor.Descriptor( - name="CreateScanConfigRequest", - full_name="google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A-\n+cloudresourcemanager.googleapis.com/Project" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="scan_config", - full_name="google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest.scan_config", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=621, - serialized_end=794, -) - - -_DELETESCANCONFIGREQUEST = _descriptor.Descriptor( - name="DeleteScanConfigRequest", - full_name="google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A.\n,websecurityscanner.googleapis.com/ScanConfig" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=796, - serialized_end=889, -) - - -_GETSCANCONFIGREQUEST = _descriptor.Descriptor( - name="GetScanConfigRequest", - full_name="google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A.\n,websecurityscanner.googleapis.com/ScanConfig" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=891, - serialized_end=981, -) - - -_LISTSCANCONFIGSREQUEST = _descriptor.Descriptor( - name="ListScanConfigsRequest", - full_name="google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A-\n+cloudresourcemanager.googleapis.com/Project" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest.page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest.page_size", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=984, - serialized_end=1116, -) - - -_UPDATESCANCONFIGREQUEST = _descriptor.Descriptor( - name="UpdateScanConfigRequest", - full_name="google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="scan_config", - full_name="google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest.scan_config", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest.update_mask", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1119, - serialized_end=1277, -) - - -_LISTSCANCONFIGSRESPONSE = _descriptor.Descriptor( - name="ListScanConfigsResponse", - full_name="google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="scan_configs", - full_name="google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse.scan_configs", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1279, - serialized_end=1404, -) - - -_STARTSCANRUNREQUEST = _descriptor.Descriptor( - name="StartScanRunRequest", - full_name="google.cloud.websecurityscanner.v1alpha.StartScanRunRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.websecurityscanner.v1alpha.StartScanRunRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A.\n,websecurityscanner.googleapis.com/ScanConfig" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1406, - serialized_end=1495, -) - - -_GETSCANRUNREQUEST = _descriptor.Descriptor( - name="GetScanRunRequest", - full_name="google.cloud.websecurityscanner.v1alpha.GetScanRunRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.websecurityscanner.v1alpha.GetScanRunRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A+\n)websecurityscanner.googleapis.com/ScanRun" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1497, - serialized_end=1581, -) - - -_LISTSCANRUNSREQUEST = _descriptor.Descriptor( - name="ListScanRunsRequest", - full_name="google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A.\n,websecurityscanner.googleapis.com/ScanConfig" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest.page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest.page_size", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1584, - serialized_end=1714, -) - - -_LISTSCANRUNSRESPONSE = _descriptor.Descriptor( - name="ListScanRunsResponse", - full_name="google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="scan_runs", - full_name="google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse.scan_runs", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1716, - serialized_end=1832, -) - - -_STOPSCANRUNREQUEST = _descriptor.Descriptor( - name="StopScanRunRequest", - full_name="google.cloud.websecurityscanner.v1alpha.StopScanRunRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.websecurityscanner.v1alpha.StopScanRunRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A+\n)websecurityscanner.googleapis.com/ScanRun" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1834, - serialized_end=1919, -) - - -_LISTCRAWLEDURLSREQUEST = _descriptor.Descriptor( - name="ListCrawledUrlsRequest", - full_name="google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A+\n)websecurityscanner.googleapis.com/ScanRun" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest.page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest.page_size", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1922, - serialized_end=2052, -) - - -_LISTCRAWLEDURLSRESPONSE = _descriptor.Descriptor( - name="ListCrawledUrlsResponse", - full_name="google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="crawled_urls", - full_name="google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse.crawled_urls", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2054, - serialized_end=2179, -) - - -_GETFINDINGREQUEST = _descriptor.Descriptor( - name="GetFindingRequest", - full_name="google.cloud.websecurityscanner.v1alpha.GetFindingRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.websecurityscanner.v1alpha.GetFindingRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A+\n)websecurityscanner.googleapis.com/Finding" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2181, - serialized_end=2265, -) - - -_LISTFINDINGSREQUEST = _descriptor.Descriptor( - name="ListFindingsRequest", - full_name="google.cloud.websecurityscanner.v1alpha.ListFindingsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.websecurityscanner.v1alpha.ListFindingsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A+\n)websecurityscanner.googleapis.com/ScanRun" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.websecurityscanner.v1alpha.ListFindingsRequest.filter", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.websecurityscanner.v1alpha.ListFindingsRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.websecurityscanner.v1alpha.ListFindingsRequest.page_size", - index=3, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2268, - serialized_end=2416, -) - - -_LISTFINDINGSRESPONSE = _descriptor.Descriptor( - name="ListFindingsResponse", - full_name="google.cloud.websecurityscanner.v1alpha.ListFindingsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="findings", - full_name="google.cloud.websecurityscanner.v1alpha.ListFindingsResponse.findings", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.websecurityscanner.v1alpha.ListFindingsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2418, - serialized_end=2533, -) - - -_LISTFINDINGTYPESTATSREQUEST = _descriptor.Descriptor( - name="ListFindingTypeStatsRequest", - full_name="google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A+\n)websecurityscanner.googleapis.com/ScanRun" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2535, - serialized_end=2631, -) - - -_LISTFINDINGTYPESTATSRESPONSE = _descriptor.Descriptor( - name="ListFindingTypeStatsResponse", - full_name="google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="finding_type_stats", - full_name="google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse.finding_type_stats", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2633, - serialized_end=2750, -) - -_CREATESCANCONFIGREQUEST.fields_by_name[ - "scan_config" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__config__pb2._SCANCONFIG -) -_UPDATESCANCONFIGREQUEST.fields_by_name[ - "scan_config" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__config__pb2._SCANCONFIG -) -_UPDATESCANCONFIGREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_LISTSCANCONFIGSRESPONSE.fields_by_name[ - "scan_configs" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__config__pb2._SCANCONFIG -) -_LISTSCANRUNSRESPONSE.fields_by_name[ - "scan_runs" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__run__pb2._SCANRUN -) -_LISTCRAWLEDURLSRESPONSE.fields_by_name[ - "crawled_urls" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_crawled__url__pb2._CRAWLEDURL -) -_LISTFINDINGSRESPONSE.fields_by_name[ - "findings" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__pb2._FINDING -) -_LISTFINDINGTYPESTATSRESPONSE.fields_by_name[ - "finding_type_stats" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__type__stats__pb2._FINDINGTYPESTATS -) -DESCRIPTOR.message_types_by_name["CreateScanConfigRequest"] = _CREATESCANCONFIGREQUEST -DESCRIPTOR.message_types_by_name["DeleteScanConfigRequest"] = _DELETESCANCONFIGREQUEST -DESCRIPTOR.message_types_by_name["GetScanConfigRequest"] = _GETSCANCONFIGREQUEST -DESCRIPTOR.message_types_by_name["ListScanConfigsRequest"] = _LISTSCANCONFIGSREQUEST -DESCRIPTOR.message_types_by_name["UpdateScanConfigRequest"] = _UPDATESCANCONFIGREQUEST -DESCRIPTOR.message_types_by_name["ListScanConfigsResponse"] = _LISTSCANCONFIGSRESPONSE -DESCRIPTOR.message_types_by_name["StartScanRunRequest"] = _STARTSCANRUNREQUEST -DESCRIPTOR.message_types_by_name["GetScanRunRequest"] = _GETSCANRUNREQUEST -DESCRIPTOR.message_types_by_name["ListScanRunsRequest"] = _LISTSCANRUNSREQUEST -DESCRIPTOR.message_types_by_name["ListScanRunsResponse"] = _LISTSCANRUNSRESPONSE -DESCRIPTOR.message_types_by_name["StopScanRunRequest"] = _STOPSCANRUNREQUEST -DESCRIPTOR.message_types_by_name["ListCrawledUrlsRequest"] = _LISTCRAWLEDURLSREQUEST -DESCRIPTOR.message_types_by_name["ListCrawledUrlsResponse"] = _LISTCRAWLEDURLSRESPONSE -DESCRIPTOR.message_types_by_name["GetFindingRequest"] = _GETFINDINGREQUEST -DESCRIPTOR.message_types_by_name["ListFindingsRequest"] = _LISTFINDINGSREQUEST -DESCRIPTOR.message_types_by_name["ListFindingsResponse"] = _LISTFINDINGSRESPONSE -DESCRIPTOR.message_types_by_name[ - "ListFindingTypeStatsRequest" -] = _LISTFINDINGTYPESTATSREQUEST -DESCRIPTOR.message_types_by_name[ - "ListFindingTypeStatsResponse" -] = _LISTFINDINGTYPESTATSRESPONSE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -CreateScanConfigRequest = _reflection.GeneratedProtocolMessageType( - "CreateScanConfigRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATESCANCONFIGREQUEST, - __module__="google.cloud.websecurityscanner_v1alpha.proto.web_security_scanner_pb2", - __doc__="""Request for the ``CreateScanConfig`` method. - - - Attributes: - parent: - Required. The parent resource name where the scan is created, - which should be a project resource name in the format - 'projects/{projectId}'. - scan_config: - Required. The ScanConfig to be created. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest) - ), -) -_sym_db.RegisterMessage(CreateScanConfigRequest) - -DeleteScanConfigRequest = _reflection.GeneratedProtocolMessageType( - "DeleteScanConfigRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETESCANCONFIGREQUEST, - __module__="google.cloud.websecurityscanner_v1alpha.proto.web_security_scanner_pb2", - __doc__="""Request for the ``DeleteScanConfig`` method. - - - Attributes: - name: - Required. The resource name of the ScanConfig to be deleted. - The name follows the format of - 'projects/{projectId}/scanConfigs/{scanConfigId}'. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest) - ), -) -_sym_db.RegisterMessage(DeleteScanConfigRequest) - -GetScanConfigRequest = _reflection.GeneratedProtocolMessageType( - "GetScanConfigRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETSCANCONFIGREQUEST, - __module__="google.cloud.websecurityscanner_v1alpha.proto.web_security_scanner_pb2", - __doc__="""Request for the ``GetScanConfig`` method. - - - Attributes: - name: - Required. The resource name of the ScanConfig to be returned. - The name follows the format of - 'projects/{projectId}/scanConfigs/{scanConfigId}'. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest) - ), -) -_sym_db.RegisterMessage(GetScanConfigRequest) - -ListScanConfigsRequest = _reflection.GeneratedProtocolMessageType( - "ListScanConfigsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTSCANCONFIGSREQUEST, - __module__="google.cloud.websecurityscanner_v1alpha.proto.web_security_scanner_pb2", - __doc__="""Request for the ``ListScanConfigs`` method. - - - Attributes: - parent: - Required. The parent resource name, which should be a project - resource name in the format 'projects/{projectId}'. - page_token: - A token identifying a page of results to be returned. This - should be a ``next_page_token`` value returned from a previous - List request. If unspecified, the first page of results is - returned. - page_size: - The maximum number of ScanConfigs to return, can be limited by - server. If not specified or not positive, the implementation - will select a reasonable value. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest) - ), -) -_sym_db.RegisterMessage(ListScanConfigsRequest) - -UpdateScanConfigRequest = _reflection.GeneratedProtocolMessageType( - "UpdateScanConfigRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATESCANCONFIGREQUEST, - __module__="google.cloud.websecurityscanner_v1alpha.proto.web_security_scanner_pb2", - __doc__="""Request for the ``UpdateScanConfigRequest`` method. - - - Attributes: - scan_config: - Required. The ScanConfig to be updated. The name field must be - set to identify the resource to be updated. The values of - fields not covered by the mask will be ignored. - update_mask: - Required. The update mask applies to the resource. For the - ``FieldMask`` definition, see - https://developers.google.com/protocol- - buffers/docs/reference/google.protobuf#fieldmask - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest) - ), -) -_sym_db.RegisterMessage(UpdateScanConfigRequest) - -ListScanConfigsResponse = _reflection.GeneratedProtocolMessageType( - "ListScanConfigsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTSCANCONFIGSRESPONSE, - __module__="google.cloud.websecurityscanner_v1alpha.proto.web_security_scanner_pb2", - __doc__="""Response for the ``ListScanConfigs`` method. - - - Attributes: - scan_configs: - The list of ScanConfigs returned. - next_page_token: - Token to retrieve the next page of results, or empty if there - are no more results in the list. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse) - ), -) -_sym_db.RegisterMessage(ListScanConfigsResponse) - -StartScanRunRequest = _reflection.GeneratedProtocolMessageType( - "StartScanRunRequest", - (_message.Message,), - dict( - DESCRIPTOR=_STARTSCANRUNREQUEST, - __module__="google.cloud.websecurityscanner_v1alpha.proto.web_security_scanner_pb2", - __doc__="""Request for the ``StartScanRun`` method. - - - Attributes: - name: - Required. The resource name of the ScanConfig to be used. The - name follows the format of - 'projects/{projectId}/scanConfigs/{scanConfigId}'. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.StartScanRunRequest) - ), -) -_sym_db.RegisterMessage(StartScanRunRequest) - -GetScanRunRequest = _reflection.GeneratedProtocolMessageType( - "GetScanRunRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETSCANRUNREQUEST, - __module__="google.cloud.websecurityscanner_v1alpha.proto.web_security_scanner_pb2", - __doc__="""Request for the ``GetScanRun`` method. - - - Attributes: - name: - Required. The resource name of the ScanRun to be returned. The - name follows the format of 'projects/{projectId}/scanConfigs/{ - scanConfigId}/scanRuns/{scanRunId}'. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.GetScanRunRequest) - ), -) -_sym_db.RegisterMessage(GetScanRunRequest) - -ListScanRunsRequest = _reflection.GeneratedProtocolMessageType( - "ListScanRunsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTSCANRUNSREQUEST, - __module__="google.cloud.websecurityscanner_v1alpha.proto.web_security_scanner_pb2", - __doc__="""Request for the ``ListScanRuns`` method. - - - Attributes: - parent: - Required. The parent resource name, which should be a scan - resource name in the format - 'projects/{projectId}/scanConfigs/{scanConfigId}'. - page_token: - A token identifying a page of results to be returned. This - should be a ``next_page_token`` value returned from a previous - List request. If unspecified, the first page of results is - returned. - page_size: - The maximum number of ScanRuns to return, can be limited by - server. If not specified or not positive, the implementation - will select a reasonable value. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest) - ), -) -_sym_db.RegisterMessage(ListScanRunsRequest) - -ListScanRunsResponse = _reflection.GeneratedProtocolMessageType( - "ListScanRunsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTSCANRUNSRESPONSE, - __module__="google.cloud.websecurityscanner_v1alpha.proto.web_security_scanner_pb2", - __doc__="""Response for the ``ListScanRuns`` method. - - - Attributes: - scan_runs: - The list of ScanRuns returned. - next_page_token: - Token to retrieve the next page of results, or empty if there - are no more results in the list. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse) - ), -) -_sym_db.RegisterMessage(ListScanRunsResponse) - -StopScanRunRequest = _reflection.GeneratedProtocolMessageType( - "StopScanRunRequest", - (_message.Message,), - dict( - DESCRIPTOR=_STOPSCANRUNREQUEST, - __module__="google.cloud.websecurityscanner_v1alpha.proto.web_security_scanner_pb2", - __doc__="""Request for the ``StopScanRun`` method. - - - Attributes: - name: - Required. The resource name of the ScanRun to be stopped. The - name follows the format of 'projects/{projectId}/scanConfigs/{ - scanConfigId}/scanRuns/{scanRunId}'. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.StopScanRunRequest) - ), -) -_sym_db.RegisterMessage(StopScanRunRequest) - -ListCrawledUrlsRequest = _reflection.GeneratedProtocolMessageType( - "ListCrawledUrlsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTCRAWLEDURLSREQUEST, - __module__="google.cloud.websecurityscanner_v1alpha.proto.web_security_scanner_pb2", - __doc__="""Request for the ``ListCrawledUrls`` method. - - - Attributes: - parent: - Required. The parent resource name, which should be a scan run - resource name in the format 'projects/{projectId}/scanConfigs/ - {scanConfigId}/scanRuns/{scanRunId}'. - page_token: - A token identifying a page of results to be returned. This - should be a ``next_page_token`` value returned from a previous - List request. If unspecified, the first page of results is - returned. - page_size: - The maximum number of CrawledUrls to return, can be limited by - server. If not specified or not positive, the implementation - will select a reasonable value. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest) - ), -) -_sym_db.RegisterMessage(ListCrawledUrlsRequest) - -ListCrawledUrlsResponse = _reflection.GeneratedProtocolMessageType( - "ListCrawledUrlsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTCRAWLEDURLSRESPONSE, - __module__="google.cloud.websecurityscanner_v1alpha.proto.web_security_scanner_pb2", - __doc__="""Response for the ``ListCrawledUrls`` method. - - - Attributes: - crawled_urls: - The list of CrawledUrls returned. - next_page_token: - Token to retrieve the next page of results, or empty if there - are no more results in the list. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse) - ), -) -_sym_db.RegisterMessage(ListCrawledUrlsResponse) - -GetFindingRequest = _reflection.GeneratedProtocolMessageType( - "GetFindingRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETFINDINGREQUEST, - __module__="google.cloud.websecurityscanner_v1alpha.proto.web_security_scanner_pb2", - __doc__="""Request for the ``GetFinding`` method. - - - Attributes: - name: - Required. The resource name of the Finding to be returned. The - name follows the format of 'projects/{projectId}/scanConfigs/{ - scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.GetFindingRequest) - ), -) -_sym_db.RegisterMessage(GetFindingRequest) - -ListFindingsRequest = _reflection.GeneratedProtocolMessageType( - "ListFindingsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTFINDINGSREQUEST, - __module__="google.cloud.websecurityscanner_v1alpha.proto.web_security_scanner_pb2", - __doc__="""Request for the ``ListFindings`` method. - - - Attributes: - parent: - Required. The parent resource name, which should be a scan run - resource name in the format 'projects/{projectId}/scanConfigs/ - {scanConfigId}/scanRuns/{scanRunId}'. - filter: - Required. The filter expression. The expression must be in the - format: . Supported field: 'finding\_type'. Supported - operator: '='. - page_token: - A token identifying a page of results to be returned. This - should be a ``next_page_token`` value returned from a previous - List request. If unspecified, the first page of results is - returned. - page_size: - The maximum number of Findings to return, can be limited by - server. If not specified or not positive, the implementation - will select a reasonable value. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.ListFindingsRequest) - ), -) -_sym_db.RegisterMessage(ListFindingsRequest) - -ListFindingsResponse = _reflection.GeneratedProtocolMessageType( - "ListFindingsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTFINDINGSRESPONSE, - __module__="google.cloud.websecurityscanner_v1alpha.proto.web_security_scanner_pb2", - __doc__="""Response for the ``ListFindings`` method. - - - Attributes: - findings: - The list of Findings returned. - next_page_token: - Token to retrieve the next page of results, or empty if there - are no more results in the list. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.ListFindingsResponse) - ), -) -_sym_db.RegisterMessage(ListFindingsResponse) - -ListFindingTypeStatsRequest = _reflection.GeneratedProtocolMessageType( - "ListFindingTypeStatsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTFINDINGTYPESTATSREQUEST, - __module__="google.cloud.websecurityscanner_v1alpha.proto.web_security_scanner_pb2", - __doc__="""Request for the ``ListFindingTypeStats`` method. - - - Attributes: - parent: - Required. The parent resource name, which should be a scan run - resource name in the format 'projects/{projectId}/scanConfigs/ - {scanConfigId}/scanRuns/{scanRunId}'. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest) - ), -) -_sym_db.RegisterMessage(ListFindingTypeStatsRequest) - -ListFindingTypeStatsResponse = _reflection.GeneratedProtocolMessageType( - "ListFindingTypeStatsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTFINDINGTYPESTATSRESPONSE, - __module__="google.cloud.websecurityscanner_v1alpha.proto.web_security_scanner_pb2", - __doc__="""Response for the ``ListFindingTypeStats`` method. - - - Attributes: - finding_type_stats: - The list of FindingTypeStats returned. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse) - ), -) -_sym_db.RegisterMessage(ListFindingTypeStatsResponse) - - -DESCRIPTOR._options = None -_CREATESCANCONFIGREQUEST.fields_by_name["parent"]._options = None -_CREATESCANCONFIGREQUEST.fields_by_name["scan_config"]._options = None -_DELETESCANCONFIGREQUEST.fields_by_name["name"]._options = None -_GETSCANCONFIGREQUEST.fields_by_name["name"]._options = None -_LISTSCANCONFIGSREQUEST.fields_by_name["parent"]._options = None -_UPDATESCANCONFIGREQUEST.fields_by_name["scan_config"]._options = None -_UPDATESCANCONFIGREQUEST.fields_by_name["update_mask"]._options = None -_STARTSCANRUNREQUEST.fields_by_name["name"]._options = None -_GETSCANRUNREQUEST.fields_by_name["name"]._options = None -_LISTSCANRUNSREQUEST.fields_by_name["parent"]._options = None -_STOPSCANRUNREQUEST.fields_by_name["name"]._options = None -_LISTCRAWLEDURLSREQUEST.fields_by_name["parent"]._options = None -_GETFINDINGREQUEST.fields_by_name["name"]._options = None -_LISTFINDINGSREQUEST.fields_by_name["parent"]._options = None -_LISTFINDINGSREQUEST.fields_by_name["filter"]._options = None -_LISTFINDINGTYPESTATSREQUEST.fields_by_name["parent"]._options = None - -_WEBSECURITYSCANNER = _descriptor.ServiceDescriptor( - name="WebSecurityScanner", - full_name="google.cloud.websecurityscanner.v1alpha.WebSecurityScanner", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A!websecurityscanner.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=2753, - serialized_end=5621, - methods=[ - _descriptor.MethodDescriptor( - name="CreateScanConfig", - full_name="google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.CreateScanConfig", - index=0, - containing_service=None, - input_type=_CREATESCANCONFIGREQUEST, - output_type=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__config__pb2._SCANCONFIG, - serialized_options=_b( - '\202\323\344\223\0027"(/v1alpha/{parent=projects/*}/scanConfigs:\013scan_config\332A\022parent,scan_config' - ), - ), - _descriptor.MethodDescriptor( - name="DeleteScanConfig", - full_name="google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.DeleteScanConfig", - index=1, - containing_service=None, - input_type=_DELETESCANCONFIGREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002**(/v1alpha/{name=projects/*/scanConfigs/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="GetScanConfig", - full_name="google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.GetScanConfig", - index=2, - containing_service=None, - input_type=_GETSCANCONFIGREQUEST, - output_type=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__config__pb2._SCANCONFIG, - serialized_options=_b( - "\202\323\344\223\002*\022(/v1alpha/{name=projects/*/scanConfigs/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ListScanConfigs", - full_name="google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListScanConfigs", - index=3, - containing_service=None, - input_type=_LISTSCANCONFIGSREQUEST, - output_type=_LISTSCANCONFIGSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002*\022(/v1alpha/{parent=projects/*}/scanConfigs\332A\006parent" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateScanConfig", - full_name="google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.UpdateScanConfig", - index=4, - containing_service=None, - input_type=_UPDATESCANCONFIGREQUEST, - output_type=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__config__pb2._SCANCONFIG, - serialized_options=_b( - "\202\323\344\223\002C24/v1alpha/{scan_config.name=projects/*/scanConfigs/*}:\013scan_config\332A\027scan_config,update_mask" - ), - ), - _descriptor.MethodDescriptor( - name="StartScanRun", - full_name="google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.StartScanRun", - index=5, - containing_service=None, - input_type=_STARTSCANRUNREQUEST, - output_type=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__run__pb2._SCANRUN, - serialized_options=_b( - '\202\323\344\223\0023"./v1alpha/{name=projects/*/scanConfigs/*}:start:\001*\332A\004name' - ), - ), - _descriptor.MethodDescriptor( - name="GetScanRun", - full_name="google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.GetScanRun", - index=6, - containing_service=None, - input_type=_GETSCANRUNREQUEST, - output_type=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__run__pb2._SCANRUN, - serialized_options=_b( - "\202\323\344\223\0025\0223/v1alpha/{name=projects/*/scanConfigs/*/scanRuns/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ListScanRuns", - full_name="google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListScanRuns", - index=7, - containing_service=None, - input_type=_LISTSCANRUNSREQUEST, - output_type=_LISTSCANRUNSRESPONSE, - serialized_options=_b( - "\202\323\344\223\0025\0223/v1alpha/{parent=projects/*/scanConfigs/*}/scanRuns\332A\006parent" - ), - ), - _descriptor.MethodDescriptor( - name="StopScanRun", - full_name="google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.StopScanRun", - index=8, - containing_service=None, - input_type=_STOPSCANRUNREQUEST, - output_type=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__run__pb2._SCANRUN, - serialized_options=_b( - '\202\323\344\223\002="8/v1alpha/{name=projects/*/scanConfigs/*/scanRuns/*}:stop:\001*\332A\004name' - ), - ), - _descriptor.MethodDescriptor( - name="ListCrawledUrls", - full_name="google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListCrawledUrls", - index=9, - containing_service=None, - input_type=_LISTCRAWLEDURLSREQUEST, - output_type=_LISTCRAWLEDURLSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002C\022A/v1alpha/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls\332A\006parent" - ), - ), - _descriptor.MethodDescriptor( - name="GetFinding", - full_name="google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.GetFinding", - index=10, - containing_service=None, - input_type=_GETFINDINGREQUEST, - output_type=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__pb2._FINDING, - serialized_options=_b( - "\202\323\344\223\002@\022>/v1alpha/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ListFindings", - full_name="google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListFindings", - index=11, - containing_service=None, - input_type=_LISTFINDINGSREQUEST, - output_type=_LISTFINDINGSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002@\022>/v1alpha/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings\332A\rparent,filter" - ), - ), - _descriptor.MethodDescriptor( - name="ListFindingTypeStats", - full_name="google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListFindingTypeStats", - index=12, - containing_service=None, - input_type=_LISTFINDINGTYPESTATSREQUEST, - output_type=_LISTFINDINGTYPESTATSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002H\022F/v1alpha/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats\332A\006parent" - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_WEBSECURITYSCANNER) - -DESCRIPTOR.services_by_name["WebSecurityScanner"] = _WEBSECURITYSCANNER - -# @@protoc_insertion_point(module_scope) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/web_security_scanner_pb2_grpc.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/web_security_scanner_pb2_grpc.py deleted file mode 100644 index c50069030d88..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/proto/web_security_scanner_pb2_grpc.py +++ /dev/null @@ -1,269 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.websecurityscanner_v1alpha.proto import ( - finding_pb2 as google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__pb2, -) -from google.cloud.websecurityscanner_v1alpha.proto import ( - scan_config_pb2 as google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__config__pb2, -) -from google.cloud.websecurityscanner_v1alpha.proto import ( - scan_run_pb2 as google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__run__pb2, -) -from google.cloud.websecurityscanner_v1alpha.proto import ( - web_security_scanner_pb2 as google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class WebSecurityScannerStub(object): - """Cloud Web Security Scanner Service identifies security vulnerabilities in web - applications hosted on Google Cloud Platform. It crawls your application, and - attempts to exercise as many user inputs and event handlers as possible. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateScanConfig = channel.unary_unary( - "/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/CreateScanConfig", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.CreateScanConfigRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__config__pb2.ScanConfig.FromString, - ) - self.DeleteScanConfig = channel.unary_unary( - "/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/DeleteScanConfig", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.DeleteScanConfigRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.GetScanConfig = channel.unary_unary( - "/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/GetScanConfig", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.GetScanConfigRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__config__pb2.ScanConfig.FromString, - ) - self.ListScanConfigs = channel.unary_unary( - "/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/ListScanConfigs", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListScanConfigsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListScanConfigsResponse.FromString, - ) - self.UpdateScanConfig = channel.unary_unary( - "/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/UpdateScanConfig", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.UpdateScanConfigRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__config__pb2.ScanConfig.FromString, - ) - self.StartScanRun = channel.unary_unary( - "/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/StartScanRun", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.StartScanRunRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__run__pb2.ScanRun.FromString, - ) - self.GetScanRun = channel.unary_unary( - "/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/GetScanRun", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.GetScanRunRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__run__pb2.ScanRun.FromString, - ) - self.ListScanRuns = channel.unary_unary( - "/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/ListScanRuns", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListScanRunsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListScanRunsResponse.FromString, - ) - self.StopScanRun = channel.unary_unary( - "/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/StopScanRun", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.StopScanRunRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__run__pb2.ScanRun.FromString, - ) - self.ListCrawledUrls = channel.unary_unary( - "/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/ListCrawledUrls", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListCrawledUrlsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListCrawledUrlsResponse.FromString, - ) - self.GetFinding = channel.unary_unary( - "/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/GetFinding", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.GetFindingRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__pb2.Finding.FromString, - ) - self.ListFindings = channel.unary_unary( - "/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/ListFindings", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListFindingsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListFindingsResponse.FromString, - ) - self.ListFindingTypeStats = channel.unary_unary( - "/google.cloud.websecurityscanner.v1alpha.WebSecurityScanner/ListFindingTypeStats", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListFindingTypeStatsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListFindingTypeStatsResponse.FromString, - ) - - -class WebSecurityScannerServicer(object): - """Cloud Web Security Scanner Service identifies security vulnerabilities in web - applications hosted on Google Cloud Platform. It crawls your application, and - attempts to exercise as many user inputs and event handlers as possible. - """ - - def CreateScanConfig(self, request, context): - """Creates a new ScanConfig. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteScanConfig(self, request, context): - """Deletes an existing ScanConfig and its child resources. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetScanConfig(self, request, context): - """Gets a ScanConfig. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListScanConfigs(self, request, context): - """Lists ScanConfigs under a given project. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateScanConfig(self, request, context): - """Updates a ScanConfig. This method support partial update of a ScanConfig. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def StartScanRun(self, request, context): - """Start a ScanRun according to the given ScanConfig. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetScanRun(self, request, context): - """Gets a ScanRun. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListScanRuns(self, request, context): - """Lists ScanRuns under a given ScanConfig, in descending order of ScanRun - stop time. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def StopScanRun(self, request, context): - """Stops a ScanRun. The stopped ScanRun is returned. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListCrawledUrls(self, request, context): - """List CrawledUrls under a given ScanRun. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetFinding(self, request, context): - """Gets a Finding. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListFindings(self, request, context): - """List Findings under a given ScanRun. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListFindingTypeStats(self, request, context): - """List all FindingTypeStats under a given ScanRun. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_WebSecurityScannerServicer_to_server(servicer, server): - rpc_method_handlers = { - "CreateScanConfig": grpc.unary_unary_rpc_method_handler( - servicer.CreateScanConfig, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.CreateScanConfigRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__config__pb2.ScanConfig.SerializeToString, - ), - "DeleteScanConfig": grpc.unary_unary_rpc_method_handler( - servicer.DeleteScanConfig, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.DeleteScanConfigRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "GetScanConfig": grpc.unary_unary_rpc_method_handler( - servicer.GetScanConfig, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.GetScanConfigRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__config__pb2.ScanConfig.SerializeToString, - ), - "ListScanConfigs": grpc.unary_unary_rpc_method_handler( - servicer.ListScanConfigs, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListScanConfigsRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListScanConfigsResponse.SerializeToString, - ), - "UpdateScanConfig": grpc.unary_unary_rpc_method_handler( - servicer.UpdateScanConfig, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.UpdateScanConfigRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__config__pb2.ScanConfig.SerializeToString, - ), - "StartScanRun": grpc.unary_unary_rpc_method_handler( - servicer.StartScanRun, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.StartScanRunRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__run__pb2.ScanRun.SerializeToString, - ), - "GetScanRun": grpc.unary_unary_rpc_method_handler( - servicer.GetScanRun, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.GetScanRunRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__run__pb2.ScanRun.SerializeToString, - ), - "ListScanRuns": grpc.unary_unary_rpc_method_handler( - servicer.ListScanRuns, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListScanRunsRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListScanRunsResponse.SerializeToString, - ), - "StopScanRun": grpc.unary_unary_rpc_method_handler( - servicer.StopScanRun, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.StopScanRunRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_scan__run__pb2.ScanRun.SerializeToString, - ), - "ListCrawledUrls": grpc.unary_unary_rpc_method_handler( - servicer.ListCrawledUrls, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListCrawledUrlsRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListCrawledUrlsResponse.SerializeToString, - ), - "GetFinding": grpc.unary_unary_rpc_method_handler( - servicer.GetFinding, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.GetFindingRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_finding__pb2.Finding.SerializeToString, - ), - "ListFindings": grpc.unary_unary_rpc_method_handler( - servicer.ListFindings, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListFindingsRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListFindingsResponse.SerializeToString, - ), - "ListFindingTypeStats": grpc.unary_unary_rpc_method_handler( - servicer.ListFindingTypeStats, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListFindingTypeStatsRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1alpha_dot_proto_dot_web__security__scanner__pb2.ListFindingTypeStatsResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner", - rpc_method_handlers, - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/types.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/types.py deleted file mode 100644 index aef8624549de..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/types.py +++ /dev/null @@ -1,60 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.websecurityscanner_v1alpha.proto import crawled_url_pb2 -from google.cloud.websecurityscanner_v1alpha.proto import finding_addon_pb2 -from google.cloud.websecurityscanner_v1alpha.proto import finding_pb2 -from google.cloud.websecurityscanner_v1alpha.proto import finding_type_stats_pb2 -from google.cloud.websecurityscanner_v1alpha.proto import scan_config_pb2 -from google.cloud.websecurityscanner_v1alpha.proto import scan_run_pb2 -from google.cloud.websecurityscanner_v1alpha.proto import web_security_scanner_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 -from google.protobuf import timestamp_pb2 - - -_shared_modules = [empty_pb2, field_mask_pb2, timestamp_pb2] - -_local_modules = [ - crawled_url_pb2, - finding_addon_pb2, - finding_pb2, - finding_type_stats_pb2, - scan_config_pb2, - scan_run_pb2, - web_security_scanner_pb2, -] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.websecurityscanner_v1alpha.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/__init__.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/__init__.py deleted file mode 100644 index c0188387ce45..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/__init__.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.websecurityscanner_v1beta import types -from google.cloud.websecurityscanner_v1beta.gapic import enums -from google.cloud.websecurityscanner_v1beta.gapic import web_security_scanner_client - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class WebSecurityScannerClient(web_security_scanner_client.WebSecurityScannerClient): - __doc__ = web_security_scanner_client.WebSecurityScannerClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "WebSecurityScannerClient") diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/__init__.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/enums.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/enums.py deleted file mode 100644 index 11c8118f6972..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/enums.py +++ /dev/null @@ -1,289 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class ScanConfig(object): - class ExportToSecurityCommandCenter(enum.IntEnum): - """ - Controls export of scan configurations and results to Cloud Security - Command Center. - - Attributes: - EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED (int): Use default, which is ENABLED. - ENABLED (int): Export results of this scan to Cloud Security Command Center. - DISABLED (int): Do not export results of this scan to Cloud Security Command Center. - """ - - EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED = 0 - ENABLED = 1 - DISABLED = 2 - - class RiskLevel(enum.IntEnum): - """ - Scan risk levels supported by Cloud Web Security Scanner. LOW impact - scanning will minimize requests with the potential to modify data. To - achieve the maximum scan coverage, NORMAL risk level is recommended. - - Attributes: - RISK_LEVEL_UNSPECIFIED (int): Use default, which is NORMAL. - NORMAL (int): Normal scanning (Recommended) - LOW (int): Lower impact scanning - """ - - RISK_LEVEL_UNSPECIFIED = 0 - NORMAL = 1 - LOW = 2 - - class TargetPlatform(enum.IntEnum): - """ - Cloud platforms supported by Cloud Web Security Scanner. - - Attributes: - TARGET_PLATFORM_UNSPECIFIED (int): The target platform is unknown. Requests with this enum value will be - rejected with INVALID\_ARGUMENT error. - APP_ENGINE (int): Google App Engine service. - COMPUTE (int): Google Compute Engine service. - """ - - TARGET_PLATFORM_UNSPECIFIED = 0 - APP_ENGINE = 1 - COMPUTE = 2 - - class UserAgent(enum.IntEnum): - """ - Type of user agents used for scanning. - - Attributes: - USER_AGENT_UNSPECIFIED (int): The user agent is unknown. Service will default to CHROME\_LINUX. - CHROME_LINUX (int): Chrome on Linux. This is the service default if unspecified. - CHROME_ANDROID (int): Chrome on Android. - SAFARI_IPHONE (int): Safari on IPhone. - """ - - USER_AGENT_UNSPECIFIED = 0 - CHROME_LINUX = 1 - CHROME_ANDROID = 2 - SAFARI_IPHONE = 3 - - -class ScanConfigError(object): - class Code(enum.IntEnum): - """ - Output only. - Defines an error reason code. - Next id: 44 - - Attributes: - CODE_UNSPECIFIED (int): There is no error. - OK (int): There is no error. - INTERNAL_ERROR (int): Indicates an internal server error. - Please DO NOT USE THIS ERROR CODE unless the root cause is truly unknown. - APPENGINE_API_BACKEND_ERROR (int): One of the seed URLs is an App Engine URL but we cannot validate the scan - settings due to an App Engine API backend error. - APPENGINE_API_NOT_ACCESSIBLE (int): One of the seed URLs is an App Engine URL but we cannot access the - App Engine API to validate scan settings. - APPENGINE_DEFAULT_HOST_MISSING (int): One of the seed URLs is an App Engine URL but the Default Host of the - App Engine is not set. - CANNOT_USE_GOOGLE_COM_ACCOUNT (int): Google corporate accounts can not be used for scanning. - CANNOT_USE_OWNER_ACCOUNT (int): The account of the scan creator can not be used for scanning. - COMPUTE_API_BACKEND_ERROR (int): This scan targets Compute Engine, but we cannot validate scan settings - due to a Compute Engine API backend error. - COMPUTE_API_NOT_ACCESSIBLE (int): This scan targets Compute Engine, but we cannot access the Compute Engine - API to validate the scan settings. - CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT (int): The Custom Login URL does not belong to the current project. - CUSTOM_LOGIN_URL_MALFORMED (int): The Custom Login URL is malformed (can not be parsed). - CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS (int): The Custom Login URL is mapped to a non-routable IP address in DNS. - CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS (int): The Custom Login URL is mapped to an IP address which is not reserved for - the current project. - CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS (int): The Custom Login URL has a non-routable IP address. - CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS (int): The Custom Login URL has an IP address which is not reserved for the - current project. - DUPLICATE_SCAN_NAME (int): Another scan with the same name (case-sensitive) already exists. - INVALID_FIELD_VALUE (int): A field is set to an invalid value. - FAILED_TO_AUTHENTICATE_TO_TARGET (int): There was an error trying to authenticate to the scan target. - FINDING_TYPE_UNSPECIFIED (int): Finding type value is not specified in the list findings request. - FORBIDDEN_TO_SCAN_COMPUTE (int): Scan targets Compute Engine, yet current project was not whitelisted for - Google Compute Engine Scanning Alpha access. - FORBIDDEN_UPDATE_TO_MANAGED_SCAN (int): User tries to update managed scan - MALFORMED_FILTER (int): The supplied filter is malformed. For example, it can not be parsed, does - not have a filter type in expression, or the same filter type appears - more than once. - MALFORMED_RESOURCE_NAME (int): The supplied resource name is malformed (can not be parsed). - PROJECT_INACTIVE (int): The current project is not in an active state. - REQUIRED_FIELD (int): A required field is not set. - RESOURCE_NAME_INCONSISTENT (int): Project id, scanconfig id, scanrun id, or finding id are not consistent - with each other in resource name. - SCAN_ALREADY_RUNNING (int): The scan being requested to start is already running. - SCAN_NOT_RUNNING (int): The scan that was requested to be stopped is not running. - SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT (int): One of the seed URLs does not belong to the current project. - SEED_URL_MALFORMED (int): One of the seed URLs is malformed (can not be parsed). - SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS (int): One of the seed URLs is mapped to a non-routable IP address in DNS. - SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS (int): One of the seed URLs is mapped to an IP address which is not reserved - for the current project. - SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS (int): One of the seed URLs has on-routable IP address. - SEED_URL_HAS_UNRESERVED_IP_ADDRESS (int): One of the seed URLs has an IP address that is not reserved - for the current project. - SERVICE_ACCOUNT_NOT_CONFIGURED (int): The Cloud Security Scanner service account is not configured under the - project. - TOO_MANY_SCANS (int): A project has reached the maximum number of scans. - UNABLE_TO_RESOLVE_PROJECT_INFO (int): Resolving the details of the current project fails. - UNSUPPORTED_BLACKLIST_PATTERN_FORMAT (int): One or more blacklist patterns were in the wrong format. - UNSUPPORTED_FILTER (int): The supplied filter is not supported. - UNSUPPORTED_FINDING_TYPE (int): The supplied finding type is not supported. For example, we do not - provide findings of the given finding type. - UNSUPPORTED_URL_SCHEME (int): The URL scheme of one or more of the supplied URLs is not supported. - """ - - CODE_UNSPECIFIED = 0 - OK = 0 - INTERNAL_ERROR = 1 - APPENGINE_API_BACKEND_ERROR = 2 - APPENGINE_API_NOT_ACCESSIBLE = 3 - APPENGINE_DEFAULT_HOST_MISSING = 4 - CANNOT_USE_GOOGLE_COM_ACCOUNT = 6 - CANNOT_USE_OWNER_ACCOUNT = 7 - COMPUTE_API_BACKEND_ERROR = 8 - COMPUTE_API_NOT_ACCESSIBLE = 9 - CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 10 - CUSTOM_LOGIN_URL_MALFORMED = 11 - CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 12 - CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS = 13 - CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 14 - CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS = 15 - DUPLICATE_SCAN_NAME = 16 - INVALID_FIELD_VALUE = 18 - FAILED_TO_AUTHENTICATE_TO_TARGET = 19 - FINDING_TYPE_UNSPECIFIED = 20 - FORBIDDEN_TO_SCAN_COMPUTE = 21 - FORBIDDEN_UPDATE_TO_MANAGED_SCAN = 43 - MALFORMED_FILTER = 22 - MALFORMED_RESOURCE_NAME = 23 - PROJECT_INACTIVE = 24 - REQUIRED_FIELD = 25 - RESOURCE_NAME_INCONSISTENT = 26 - SCAN_ALREADY_RUNNING = 27 - SCAN_NOT_RUNNING = 28 - SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 29 - SEED_URL_MALFORMED = 30 - SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 31 - SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS = 32 - SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 33 - SEED_URL_HAS_UNRESERVED_IP_ADDRESS = 35 - SERVICE_ACCOUNT_NOT_CONFIGURED = 36 - TOO_MANY_SCANS = 37 - UNABLE_TO_RESOLVE_PROJECT_INFO = 38 - UNSUPPORTED_BLACKLIST_PATTERN_FORMAT = 39 - UNSUPPORTED_FILTER = 40 - UNSUPPORTED_FINDING_TYPE = 41 - UNSUPPORTED_URL_SCHEME = 42 - - -class ScanRun(object): - class ExecutionState(enum.IntEnum): - """ - Types of ScanRun execution state. - - Attributes: - EXECUTION_STATE_UNSPECIFIED (int): Represents an invalid state caused by internal server error. This value - should never be returned. - QUEUED (int): The scan is waiting in the queue. - SCANNING (int): The scan is in progress. - FINISHED (int): The scan is either finished or stopped by user. - """ - - EXECUTION_STATE_UNSPECIFIED = 0 - QUEUED = 1 - SCANNING = 2 - FINISHED = 3 - - class ResultState(enum.IntEnum): - """ - Types of ScanRun result state. - - Attributes: - RESULT_STATE_UNSPECIFIED (int): Default value. This value is returned when the ScanRun is not yet - finished. - SUCCESS (int): The scan finished without errors. - ERROR (int): The scan finished with errors. - KILLED (int): The scan was terminated by user. - """ - - RESULT_STATE_UNSPECIFIED = 0 - SUCCESS = 1 - ERROR = 2 - KILLED = 3 - - -class ScanRunErrorTrace(object): - class Code(enum.IntEnum): - """ - Output only. - Defines an error reason code. - Next id: 7 - - Attributes: - CODE_UNSPECIFIED (int): Default value is never used. - INTERNAL_ERROR (int): Indicates that the scan run failed due to an internal server error. - SCAN_CONFIG_ISSUE (int): Indicates a scan configuration error, usually due to outdated ScanConfig - settings, such as starting\_urls or the DNS configuration. - AUTHENTICATION_CONFIG_ISSUE (int): Indicates an authentication error, usually due to outdated ScanConfig - authentication settings. - TIMED_OUT_WHILE_SCANNING (int): Indicates a scan operation timeout, usually caused by a very large site. - TOO_MANY_REDIRECTS (int): Indicates that a scan encountered excessive redirects, either to - authentication or some other page outside of the scan scope. - TOO_MANY_HTTP_ERRORS (int): Indicates that a scan encountered numerous errors from the web site - pages. When available, most\_common\_http\_error\_code field indicates - the most common HTTP error code encountered during the scan. - """ - - CODE_UNSPECIFIED = 0 - INTERNAL_ERROR = 1 - SCAN_CONFIG_ISSUE = 2 - AUTHENTICATION_CONFIG_ISSUE = 3 - TIMED_OUT_WHILE_SCANNING = 4 - TOO_MANY_REDIRECTS = 5 - TOO_MANY_HTTP_ERRORS = 6 - - -class ScanRunWarningTrace(object): - class Code(enum.IntEnum): - """ - Output only. - Defines a warning message code. - Next id: 6 - - Attributes: - CODE_UNSPECIFIED (int): Default value is never used. - INSUFFICIENT_CRAWL_RESULTS (int): Indicates that a scan discovered an unexpectedly low number of URLs. This - is sometimes caused by complex navigation features or by using a single - URL for numerous pages. - TOO_MANY_CRAWL_RESULTS (int): Indicates that a scan discovered too many URLs to test, or excessive - redundant URLs. - TOO_MANY_FUZZ_TASKS (int): Indicates that too many tests have been generated for the scan. Customer - should try reducing the number of starting URLs, increasing the QPS rate, - or narrowing down the scope of the scan using the excluded patterns. - BLOCKED_BY_IAP (int): Indicates that a scan is blocked by IAP. - """ - - CODE_UNSPECIFIED = 0 - INSUFFICIENT_CRAWL_RESULTS = 1 - TOO_MANY_CRAWL_RESULTS = 2 - TOO_MANY_FUZZ_TASKS = 3 - BLOCKED_BY_IAP = 4 diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/transports/__init__.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/transports/web_security_scanner_grpc_transport.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/transports/web_security_scanner_grpc_transport.py deleted file mode 100644 index a8475f925d9f..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/transports/web_security_scanner_grpc_transport.py +++ /dev/null @@ -1,283 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import google.api_core.grpc_helpers - -from google.cloud.websecurityscanner_v1beta.proto import web_security_scanner_pb2_grpc - - -class WebSecurityScannerGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.websecurityscanner.v1beta WebSecurityScanner API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, - channel=None, - credentials=None, - address="websecurityscanner.googleapis.com:443", - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "web_security_scanner_stub": web_security_scanner_pb2_grpc.WebSecurityScannerStub( - channel - ) - } - - @classmethod - def create_channel( - cls, address="websecurityscanner.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def create_scan_config(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.create_scan_config`. - - Creates a new ScanConfig. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].CreateScanConfig - - @property - def delete_scan_config(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.delete_scan_config`. - - Deletes an existing ScanConfig and its child resources. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].DeleteScanConfig - - @property - def get_scan_config(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.get_scan_config`. - - Gets a ScanConfig. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].GetScanConfig - - @property - def list_scan_configs(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.list_scan_configs`. - - Lists ScanConfigs under a given project. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].ListScanConfigs - - @property - def update_scan_config(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.update_scan_config`. - - Updates a ScanConfig. This method support partial update of a ScanConfig. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].UpdateScanConfig - - @property - def start_scan_run(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.start_scan_run`. - - Start a ScanRun according to the given ScanConfig. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].StartScanRun - - @property - def get_scan_run(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.get_scan_run`. - - Gets a ScanRun. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].GetScanRun - - @property - def list_scan_runs(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.list_scan_runs`. - - Lists ScanRuns under a given ScanConfig, in descending order of ScanRun - stop time. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].ListScanRuns - - @property - def stop_scan_run(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.stop_scan_run`. - - Stops a ScanRun. The stopped ScanRun is returned. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].StopScanRun - - @property - def list_crawled_urls(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.list_crawled_urls`. - - List CrawledUrls under a given ScanRun. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].ListCrawledUrls - - @property - def get_finding(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.get_finding`. - - Gets a Finding. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].GetFinding - - @property - def list_findings(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.list_findings`. - - List Findings under a given ScanRun. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].ListFindings - - @property - def list_finding_type_stats(self): - """Return the gRPC stub for :meth:`WebSecurityScannerClient.list_finding_type_stats`. - - List all FindingTypeStats under a given ScanRun. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["web_security_scanner_stub"].ListFindingTypeStats diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/web_security_scanner_client.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/web_security_scanner_client.py deleted file mode 100644 index fdf2b67a7fac..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/web_security_scanner_client.py +++ /dev/null @@ -1,1320 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Accesses the google.cloud.websecurityscanner.v1beta WebSecurityScanner API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.page_iterator -import google.api_core.path_template -import grpc - -from google.cloud.websecurityscanner_v1beta.gapic import enums -from google.cloud.websecurityscanner_v1beta.gapic import ( - web_security_scanner_client_config, -) -from google.cloud.websecurityscanner_v1beta.gapic.transports import ( - web_security_scanner_grpc_transport, -) -from google.cloud.websecurityscanner_v1beta.proto import finding_pb2 -from google.cloud.websecurityscanner_v1beta.proto import scan_config_pb2 -from google.cloud.websecurityscanner_v1beta.proto import scan_run_pb2 -from google.cloud.websecurityscanner_v1beta.proto import web_security_scanner_pb2 -from google.cloud.websecurityscanner_v1beta.proto import web_security_scanner_pb2_grpc -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-websecurityscanner" -).version - - -class WebSecurityScannerClient(object): - """ - Cloud Web Security Scanner Service identifies security vulnerabilities in web - applications hosted on Google Cloud Platform. It crawls your application, and - attempts to exercise as many user inputs and event handlers as possible. - """ - - SERVICE_ADDRESS = "websecurityscanner.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - WebSecurityScannerClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def finding_path(cls, project, scan_config, scan_run, finding): - """Return a fully-qualified finding string.""" - return google.api_core.path_template.expand( - "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}", - project=project, - scan_config=scan_config, - scan_run=scan_run, - finding=finding, - ) - - @classmethod - def project_path(cls, project): - """Return a fully-qualified project string.""" - return google.api_core.path_template.expand( - "projects/{project}", project=project - ) - - @classmethod - def scan_config_path(cls, project, scan_config): - """Return a fully-qualified scan_config string.""" - return google.api_core.path_template.expand( - "projects/{project}/scanConfigs/{scan_config}", - project=project, - scan_config=scan_config, - ) - - @classmethod - def scan_run_path(cls, project, scan_config, scan_run): - """Return a fully-qualified scan_run string.""" - return google.api_core.path_template.expand( - "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}", - project=project, - scan_config=scan_config, - scan_run=scan_run, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.WebSecurityScannerGrpcTransport, - Callable[[~.Credentials, type], ~.WebSecurityScannerGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = web_security_scanner_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=web_security_scanner_grpc_transport.WebSecurityScannerGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = web_security_scanner_grpc_transport.WebSecurityScannerGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION - ) - else: - client_info.gapic_version = _GAPIC_LIBRARY_VERSION - self._client_info = client_info - - # Parse out the default settings for retry and timeout for each RPC - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def create_scan_config( - self, - parent, - scan_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a new ScanConfig. - - Example: - >>> from google.cloud import websecurityscanner_v1beta - >>> - >>> client = websecurityscanner_v1beta.WebSecurityScannerClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> # TODO: Initialize `scan_config`: - >>> scan_config = {} - >>> - >>> response = client.create_scan_config(parent, scan_config) - - Args: - parent (str): Required. The parent resource name where the scan is created, which should be a - project resource name in the format 'projects/{projectId}'. - scan_config (Union[dict, ~google.cloud.websecurityscanner_v1beta.types.ScanConfig]): Required. The ScanConfig to be created. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.websecurityscanner_v1beta.types.ScanConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.websecurityscanner_v1beta.types.ScanConfig` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_scan_config" not in self._inner_api_calls: - self._inner_api_calls[ - "create_scan_config" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_scan_config, - default_retry=self._method_configs["CreateScanConfig"].retry, - default_timeout=self._method_configs["CreateScanConfig"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.CreateScanConfigRequest( - parent=parent, scan_config=scan_config - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_scan_config"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_scan_config( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes an existing ScanConfig and its child resources. - - Example: - >>> from google.cloud import websecurityscanner_v1beta - >>> - >>> client = websecurityscanner_v1beta.WebSecurityScannerClient() - >>> - >>> name = client.scan_config_path('[PROJECT]', '[SCAN_CONFIG]') - >>> - >>> client.delete_scan_config(name) - - Args: - name (str): Required. The resource name of the ScanConfig to be deleted. The name follows the - format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_scan_config" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_scan_config" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_scan_config, - default_retry=self._method_configs["DeleteScanConfig"].retry, - default_timeout=self._method_configs["DeleteScanConfig"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.DeleteScanConfigRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_scan_config"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_scan_config( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a ScanConfig. - - Example: - >>> from google.cloud import websecurityscanner_v1beta - >>> - >>> client = websecurityscanner_v1beta.WebSecurityScannerClient() - >>> - >>> name = client.scan_config_path('[PROJECT]', '[SCAN_CONFIG]') - >>> - >>> response = client.get_scan_config(name) - - Args: - name (str): Required. The resource name of the ScanConfig to be returned. The name follows the - format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.websecurityscanner_v1beta.types.ScanConfig` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_scan_config" not in self._inner_api_calls: - self._inner_api_calls[ - "get_scan_config" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_scan_config, - default_retry=self._method_configs["GetScanConfig"].retry, - default_timeout=self._method_configs["GetScanConfig"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.GetScanConfigRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_scan_config"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_scan_configs( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists ScanConfigs under a given project. - - Example: - >>> from google.cloud import websecurityscanner_v1beta - >>> - >>> client = websecurityscanner_v1beta.WebSecurityScannerClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> # Iterate over all results - >>> for element in client.list_scan_configs(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_scan_configs(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The parent resource name, which should be a project resource name in the - format 'projects/{projectId}'. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.websecurityscanner_v1beta.types.ScanConfig` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_scan_configs" not in self._inner_api_calls: - self._inner_api_calls[ - "list_scan_configs" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_scan_configs, - default_retry=self._method_configs["ListScanConfigs"].retry, - default_timeout=self._method_configs["ListScanConfigs"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.ListScanConfigsRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_scan_configs"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="scan_configs", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def update_scan_config( - self, - scan_config, - update_mask, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates a ScanConfig. This method support partial update of a ScanConfig. - - Example: - >>> from google.cloud import websecurityscanner_v1beta - >>> - >>> client = websecurityscanner_v1beta.WebSecurityScannerClient() - >>> - >>> # TODO: Initialize `scan_config`: - >>> scan_config = {} - >>> - >>> # TODO: Initialize `update_mask`: - >>> update_mask = {} - >>> - >>> response = client.update_scan_config(scan_config, update_mask) - - Args: - scan_config (Union[dict, ~google.cloud.websecurityscanner_v1beta.types.ScanConfig]): Required. The ScanConfig to be updated. The name field must be set to identify the - resource to be updated. The values of fields not covered by the mask - will be ignored. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.websecurityscanner_v1beta.types.ScanConfig` - update_mask (Union[dict, ~google.cloud.websecurityscanner_v1beta.types.FieldMask]): Required. The update mask applies to the resource. For the ``FieldMask`` - definition, see - https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.websecurityscanner_v1beta.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.websecurityscanner_v1beta.types.ScanConfig` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_scan_config" not in self._inner_api_calls: - self._inner_api_calls[ - "update_scan_config" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_scan_config, - default_retry=self._method_configs["UpdateScanConfig"].retry, - default_timeout=self._method_configs["UpdateScanConfig"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.UpdateScanConfigRequest( - scan_config=scan_config, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("scan_config.name", scan_config.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_scan_config"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def start_scan_run( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Start a ScanRun according to the given ScanConfig. - - Example: - >>> from google.cloud import websecurityscanner_v1beta - >>> - >>> client = websecurityscanner_v1beta.WebSecurityScannerClient() - >>> - >>> name = client.scan_config_path('[PROJECT]', '[SCAN_CONFIG]') - >>> - >>> response = client.start_scan_run(name) - - Args: - name (str): Required. The resource name of the ScanConfig to be used. The name follows the - format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.websecurityscanner_v1beta.types.ScanRun` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "start_scan_run" not in self._inner_api_calls: - self._inner_api_calls[ - "start_scan_run" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.start_scan_run, - default_retry=self._method_configs["StartScanRun"].retry, - default_timeout=self._method_configs["StartScanRun"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.StartScanRunRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["start_scan_run"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_scan_run( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a ScanRun. - - Example: - >>> from google.cloud import websecurityscanner_v1beta - >>> - >>> client = websecurityscanner_v1beta.WebSecurityScannerClient() - >>> - >>> name = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]') - >>> - >>> response = client.get_scan_run(name) - - Args: - name (str): Required. The resource name of the ScanRun to be returned. The name follows the - format of - 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.websecurityscanner_v1beta.types.ScanRun` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_scan_run" not in self._inner_api_calls: - self._inner_api_calls[ - "get_scan_run" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_scan_run, - default_retry=self._method_configs["GetScanRun"].retry, - default_timeout=self._method_configs["GetScanRun"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.GetScanRunRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_scan_run"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_scan_runs( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists ScanRuns under a given ScanConfig, in descending order of ScanRun - stop time. - - Example: - >>> from google.cloud import websecurityscanner_v1beta - >>> - >>> client = websecurityscanner_v1beta.WebSecurityScannerClient() - >>> - >>> parent = client.scan_config_path('[PROJECT]', '[SCAN_CONFIG]') - >>> - >>> # Iterate over all results - >>> for element in client.list_scan_runs(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_scan_runs(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The parent resource name, which should be a scan resource name in the - format 'projects/{projectId}/scanConfigs/{scanConfigId}'. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.websecurityscanner_v1beta.types.ScanRun` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_scan_runs" not in self._inner_api_calls: - self._inner_api_calls[ - "list_scan_runs" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_scan_runs, - default_retry=self._method_configs["ListScanRuns"].retry, - default_timeout=self._method_configs["ListScanRuns"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.ListScanRunsRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_scan_runs"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="scan_runs", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def stop_scan_run( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Stops a ScanRun. The stopped ScanRun is returned. - - Example: - >>> from google.cloud import websecurityscanner_v1beta - >>> - >>> client = websecurityscanner_v1beta.WebSecurityScannerClient() - >>> - >>> name = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]') - >>> - >>> response = client.stop_scan_run(name) - - Args: - name (str): Required. The resource name of the ScanRun to be stopped. The name follows the - format of - 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.websecurityscanner_v1beta.types.ScanRun` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "stop_scan_run" not in self._inner_api_calls: - self._inner_api_calls[ - "stop_scan_run" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.stop_scan_run, - default_retry=self._method_configs["StopScanRun"].retry, - default_timeout=self._method_configs["StopScanRun"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.StopScanRunRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["stop_scan_run"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_crawled_urls( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - List CrawledUrls under a given ScanRun. - - Example: - >>> from google.cloud import websecurityscanner_v1beta - >>> - >>> client = websecurityscanner_v1beta.WebSecurityScannerClient() - >>> - >>> parent = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]') - >>> - >>> # Iterate over all results - >>> for element in client.list_crawled_urls(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_crawled_urls(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The parent resource name, which should be a scan run resource name in the - format - 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.websecurityscanner_v1beta.types.CrawledUrl` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_crawled_urls" not in self._inner_api_calls: - self._inner_api_calls[ - "list_crawled_urls" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_crawled_urls, - default_retry=self._method_configs["ListCrawledUrls"].retry, - default_timeout=self._method_configs["ListCrawledUrls"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.ListCrawledUrlsRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_crawled_urls"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="crawled_urls", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_finding( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a Finding. - - Example: - >>> from google.cloud import websecurityscanner_v1beta - >>> - >>> client = websecurityscanner_v1beta.WebSecurityScannerClient() - >>> - >>> name = client.finding_path('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]', '[FINDING]') - >>> - >>> response = client.get_finding(name) - - Args: - name (str): Required. The resource name of the Finding to be returned. The name follows the - format of - 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.websecurityscanner_v1beta.types.Finding` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_finding" not in self._inner_api_calls: - self._inner_api_calls[ - "get_finding" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_finding, - default_retry=self._method_configs["GetFinding"].retry, - default_timeout=self._method_configs["GetFinding"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.GetFindingRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_finding"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_findings( - self, - parent, - filter_, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - List Findings under a given ScanRun. - - Example: - >>> from google.cloud import websecurityscanner_v1beta - >>> - >>> client = websecurityscanner_v1beta.WebSecurityScannerClient() - >>> - >>> parent = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]') - >>> - >>> # TODO: Initialize `filter_`: - >>> filter_ = '' - >>> - >>> # Iterate over all results - >>> for element in client.list_findings(parent, filter_): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_findings(parent, filter_).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The parent resource name, which should be a scan run resource name in the - format - 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - filter_ (str): Required. The filter expression. The expression must be in the format: . - Supported field: 'finding\_type'. Supported operator: '='. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.websecurityscanner_v1beta.types.Finding` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_findings" not in self._inner_api_calls: - self._inner_api_calls[ - "list_findings" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_findings, - default_retry=self._method_configs["ListFindings"].retry, - default_timeout=self._method_configs["ListFindings"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.ListFindingsRequest( - parent=parent, filter=filter_, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_findings"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="findings", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def list_finding_type_stats( - self, - parent, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - List all FindingTypeStats under a given ScanRun. - - Example: - >>> from google.cloud import websecurityscanner_v1beta - >>> - >>> client = websecurityscanner_v1beta.WebSecurityScannerClient() - >>> - >>> parent = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]') - >>> - >>> response = client.list_finding_type_stats(parent) - - Args: - parent (str): Required. The parent resource name, which should be a scan run resource name in the - format - 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.websecurityscanner_v1beta.types.ListFindingTypeStatsResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_finding_type_stats" not in self._inner_api_calls: - self._inner_api_calls[ - "list_finding_type_stats" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_finding_type_stats, - default_retry=self._method_configs["ListFindingTypeStats"].retry, - default_timeout=self._method_configs["ListFindingTypeStats"].timeout, - client_info=self._client_info, - ) - - request = web_security_scanner_pb2.ListFindingTypeStatsRequest(parent=parent) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["list_finding_type_stats"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/web_security_scanner_client_config.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/web_security_scanner_client_config.py deleted file mode 100644 index 61dafbb68866..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/gapic/web_security_scanner_client_config.py +++ /dev/null @@ -1,88 +0,0 @@ -config = { - "interfaces": { - "google.cloud.websecurityscanner.v1beta.WebSecurityScanner": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "CreateScanConfig": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteScanConfig": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetScanConfig": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListScanConfigs": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateScanConfig": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "StartScanRun": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetScanRun": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListScanRuns": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "StopScanRun": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListCrawledUrls": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetFinding": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListFindings": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListFindingTypeStats": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/__init__.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/crawled_url.proto b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/crawled_url.proto deleted file mode 100644 index 9316f8b2a269..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/crawled_url.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.websecurityscanner.v1beta; - -option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; -option java_multiple_files = true; -option java_outer_classname = "CrawledUrlProto"; -option java_package = "com.google.cloud.websecurityscanner.v1beta"; -option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; - -// A CrawledUrl resource represents a URL that was crawled during a ScanRun. Web -// Security Scanner Service crawls the web applications, following all links -// within the scope of sites, to find the URLs to test against. -message CrawledUrl { - // The http method of the request that was used to visit the URL, in - // uppercase. - string http_method = 1; - - // The URL that was crawled. - string url = 2; - - // The body of the request that was used to visit the URL. - string body = 3; -} diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/crawled_url_pb2.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/crawled_url_pb2.py deleted file mode 100644 index 02dd9557a266..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/crawled_url_pb2.py +++ /dev/null @@ -1,136 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner_v1beta/proto/crawled_url.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/websecurityscanner_v1beta/proto/crawled_url.proto", - package="google.cloud.websecurityscanner.v1beta", - syntax="proto3", - serialized_options=_b( - "\n*com.google.cloud.websecurityscanner.v1betaB\017CrawledUrlProtoP\001ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\312\002&Google\\Cloud\\WebSecurityScanner\\V1beta" - ), - serialized_pb=_b( - '\n>google/cloud/websecurityscanner_v1beta/proto/crawled_url.proto\x12&google.cloud.websecurityscanner.v1beta"<\n\nCrawledUrl\x12\x13\n\x0bhttp_method\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\x0c\n\x04\x62ody\x18\x03 \x01(\tB\xc2\x01\n*com.google.cloud.websecurityscanner.v1betaB\x0f\x43rawledUrlProtoP\x01ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1betab\x06proto3' - ), -) - - -_CRAWLEDURL = _descriptor.Descriptor( - name="CrawledUrl", - full_name="google.cloud.websecurityscanner.v1beta.CrawledUrl", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="http_method", - full_name="google.cloud.websecurityscanner.v1beta.CrawledUrl.http_method", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="url", - full_name="google.cloud.websecurityscanner.v1beta.CrawledUrl.url", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="body", - full_name="google.cloud.websecurityscanner.v1beta.CrawledUrl.body", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=106, - serialized_end=166, -) - -DESCRIPTOR.message_types_by_name["CrawledUrl"] = _CRAWLEDURL -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -CrawledUrl = _reflection.GeneratedProtocolMessageType( - "CrawledUrl", - (_message.Message,), - dict( - DESCRIPTOR=_CRAWLEDURL, - __module__="google.cloud.websecurityscanner_v1beta.proto.crawled_url_pb2", - __doc__="""A CrawledUrl resource represents a URL that was crawled - during a ScanRun. Web Security Scanner Service crawls the web - applications, following all links within the scope of sites, to find the - URLs to test against. - - - Attributes: - http_method: - The http method of the request that was used to visit the URL, - in uppercase. - url: - The URL that was crawled. - body: - The body of the request that was used to visit the URL. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.CrawledUrl) - ), -) -_sym_db.RegisterMessage(CrawledUrl) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/crawled_url_pb2_grpc.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/crawled_url_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/crawled_url_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding.proto b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding.proto deleted file mode 100644 index 5f86c9c71d05..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding.proto +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.websecurityscanner.v1beta; - -import "google/api/resource.proto"; -import "google/cloud/websecurityscanner/v1beta/finding_addon.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; -option java_multiple_files = true; -option java_outer_classname = "FindingProto"; -option java_package = "com.google.cloud.websecurityscanner.v1beta"; -option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; - -// A Finding resource represents a vulnerability instance identified during a -// ScanRun. -message Finding { - option (google.api.resource) = { - type: "websecurityscanner.googleapis.com/Finding" - pattern: "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}" - }; - - // The resource name of the Finding. The name follows the format of - // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'. - // The finding IDs are generated by the system. - string name = 1; - - // The type of the Finding. - // Detailed and up-to-date information on findings can be found here: - // https://cloud.google.com/security-scanner/docs/scan-result-details - string finding_type = 2; - - // The http method of the request that triggered the vulnerability, in - // uppercase. - string http_method = 3; - - // The URL produced by the server-side fuzzer and used in the request that - // triggered the vulnerability. - string fuzzed_url = 4; - - // The body of the request that triggered the vulnerability. - string body = 5; - - // The description of the vulnerability. - string description = 6; - - // The URL containing human-readable payload that user can leverage to - // reproduce the vulnerability. - string reproduction_url = 7; - - // If the vulnerability was originated from nested IFrame, the immediate - // parent IFrame is reported. - string frame_url = 8; - - // The URL where the browser lands when the vulnerability is detected. - string final_url = 9; - - // The tracking ID uniquely identifies a vulnerability instance across - // multiple ScanRuns. - string tracking_id = 10; - - // An addon containing information reported for a vulnerability with an HTML - // form, if any. - Form form = 16; - - // An addon containing information about outdated libraries. - OutdatedLibrary outdated_library = 11; - - // An addon containing detailed information regarding any resource causing the - // vulnerability such as JavaScript sources, image, audio files, etc. - ViolatingResource violating_resource = 12; - - // An addon containing information about vulnerable or missing HTTP headers. - VulnerableHeaders vulnerable_headers = 15; - - // An addon containing information about request parameters which were found - // to be vulnerable. - VulnerableParameters vulnerable_parameters = 13; - - // An addon containing information reported for an XSS, if any. - Xss xss = 14; -} diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_addon.proto b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_addon.proto deleted file mode 100644 index ea5989a13dae..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_addon.proto +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.websecurityscanner.v1beta; - -option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; -option java_multiple_files = true; -option java_outer_classname = "FindingAddonProto"; -option java_package = "com.google.cloud.websecurityscanner.v1beta"; -option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; - -// ! Information about a vulnerability with an HTML. -message Form { - // ! The URI where to send the form when it's submitted. - string action_uri = 1; - - // ! The names of form fields related to the vulnerability. - repeated string fields = 2; -} - -// Information reported for an outdated library. -message OutdatedLibrary { - // The name of the outdated library. - string library_name = 1; - - // The version number. - string version = 2; - - // URLs to learn more information about the vulnerabilities in the library. - repeated string learn_more_urls = 3; -} - -// Information regarding any resource causing the vulnerability such -// as JavaScript sources, image, audio files, etc. -message ViolatingResource { - // The MIME type of this resource. - string content_type = 1; - - // URL of this violating resource. - string resource_url = 2; -} - -// Information about vulnerable request parameters. -message VulnerableParameters { - // The vulnerable parameter names. - repeated string parameter_names = 1; -} - -// Information about vulnerable or missing HTTP Headers. -message VulnerableHeaders { - // Describes a HTTP Header. - message Header { - // Header name. - string name = 1; - - // Header value. - string value = 2; - } - - // List of vulnerable headers. - repeated Header headers = 1; - - // List of missing headers. - repeated Header missing_headers = 2; -} - -// Information reported for an XSS. -message Xss { - // Stack traces leading to the point where the XSS occurred. - repeated string stack_traces = 1; - - // An error message generated by a javascript breakage. - string error_message = 2; -} diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_addon_pb2.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_addon_pb2.py deleted file mode 100644 index c9eeda74ad20..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_addon_pb2.py +++ /dev/null @@ -1,584 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner_v1beta/proto/finding_addon.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/websecurityscanner_v1beta/proto/finding_addon.proto", - package="google.cloud.websecurityscanner.v1beta", - syntax="proto3", - serialized_options=_b( - "\n*com.google.cloud.websecurityscanner.v1betaB\021FindingAddonProtoP\001ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\312\002&Google\\Cloud\\WebSecurityScanner\\V1beta" - ), - serialized_pb=_b( - '\n@google/cloud/websecurityscanner_v1beta/proto/finding_addon.proto\x12&google.cloud.websecurityscanner.v1beta"*\n\x04\x46orm\x12\x12\n\naction_uri\x18\x01 \x01(\t\x12\x0e\n\x06\x66ields\x18\x02 \x03(\t"Q\n\x0fOutdatedLibrary\x12\x14\n\x0clibrary_name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x17\n\x0flearn_more_urls\x18\x03 \x03(\t"?\n\x11ViolatingResource\x12\x14\n\x0c\x63ontent_type\x18\x01 \x01(\t\x12\x14\n\x0cresource_url\x18\x02 \x01(\t"/\n\x14VulnerableParameters\x12\x17\n\x0fparameter_names\x18\x01 \x03(\t"\xe8\x01\n\x11VulnerableHeaders\x12Q\n\x07headers\x18\x01 \x03(\x0b\x32@.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header\x12Y\n\x0fmissing_headers\x18\x02 \x03(\x0b\x32@.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header\x1a%\n\x06Header\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t"2\n\x03Xss\x12\x14\n\x0cstack_traces\x18\x01 \x03(\t\x12\x15\n\rerror_message\x18\x02 \x01(\tB\xc4\x01\n*com.google.cloud.websecurityscanner.v1betaB\x11\x46indingAddonProtoP\x01ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1betab\x06proto3' - ), -) - - -_FORM = _descriptor.Descriptor( - name="Form", - full_name="google.cloud.websecurityscanner.v1beta.Form", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="action_uri", - full_name="google.cloud.websecurityscanner.v1beta.Form.action_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="fields", - full_name="google.cloud.websecurityscanner.v1beta.Form.fields", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=108, - serialized_end=150, -) - - -_OUTDATEDLIBRARY = _descriptor.Descriptor( - name="OutdatedLibrary", - full_name="google.cloud.websecurityscanner.v1beta.OutdatedLibrary", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="library_name", - full_name="google.cloud.websecurityscanner.v1beta.OutdatedLibrary.library_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="version", - full_name="google.cloud.websecurityscanner.v1beta.OutdatedLibrary.version", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="learn_more_urls", - full_name="google.cloud.websecurityscanner.v1beta.OutdatedLibrary.learn_more_urls", - index=2, - number=3, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=152, - serialized_end=233, -) - - -_VIOLATINGRESOURCE = _descriptor.Descriptor( - name="ViolatingResource", - full_name="google.cloud.websecurityscanner.v1beta.ViolatingResource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="content_type", - full_name="google.cloud.websecurityscanner.v1beta.ViolatingResource.content_type", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="resource_url", - full_name="google.cloud.websecurityscanner.v1beta.ViolatingResource.resource_url", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=235, - serialized_end=298, -) - - -_VULNERABLEPARAMETERS = _descriptor.Descriptor( - name="VulnerableParameters", - full_name="google.cloud.websecurityscanner.v1beta.VulnerableParameters", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parameter_names", - full_name="google.cloud.websecurityscanner.v1beta.VulnerableParameters.parameter_names", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=300, - serialized_end=347, -) - - -_VULNERABLEHEADERS_HEADER = _descriptor.Descriptor( - name="Header", - full_name="google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=545, - serialized_end=582, -) - -_VULNERABLEHEADERS = _descriptor.Descriptor( - name="VulnerableHeaders", - full_name="google.cloud.websecurityscanner.v1beta.VulnerableHeaders", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="headers", - full_name="google.cloud.websecurityscanner.v1beta.VulnerableHeaders.headers", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="missing_headers", - full_name="google.cloud.websecurityscanner.v1beta.VulnerableHeaders.missing_headers", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_VULNERABLEHEADERS_HEADER], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=350, - serialized_end=582, -) - - -_XSS = _descriptor.Descriptor( - name="Xss", - full_name="google.cloud.websecurityscanner.v1beta.Xss", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="stack_traces", - full_name="google.cloud.websecurityscanner.v1beta.Xss.stack_traces", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="error_message", - full_name="google.cloud.websecurityscanner.v1beta.Xss.error_message", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=584, - serialized_end=634, -) - -_VULNERABLEHEADERS_HEADER.containing_type = _VULNERABLEHEADERS -_VULNERABLEHEADERS.fields_by_name["headers"].message_type = _VULNERABLEHEADERS_HEADER -_VULNERABLEHEADERS.fields_by_name[ - "missing_headers" -].message_type = _VULNERABLEHEADERS_HEADER -DESCRIPTOR.message_types_by_name["Form"] = _FORM -DESCRIPTOR.message_types_by_name["OutdatedLibrary"] = _OUTDATEDLIBRARY -DESCRIPTOR.message_types_by_name["ViolatingResource"] = _VIOLATINGRESOURCE -DESCRIPTOR.message_types_by_name["VulnerableParameters"] = _VULNERABLEPARAMETERS -DESCRIPTOR.message_types_by_name["VulnerableHeaders"] = _VULNERABLEHEADERS -DESCRIPTOR.message_types_by_name["Xss"] = _XSS -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Form = _reflection.GeneratedProtocolMessageType( - "Form", - (_message.Message,), - dict( - DESCRIPTOR=_FORM, - __module__="google.cloud.websecurityscanner_v1beta.proto.finding_addon_pb2", - __doc__="""! Information about a vulnerability with an HTML. - - - Attributes: - action_uri: - ! The URI where to send the form when it's submitted. - fields: - ! The names of form fields related to the vulnerability. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.Form) - ), -) -_sym_db.RegisterMessage(Form) - -OutdatedLibrary = _reflection.GeneratedProtocolMessageType( - "OutdatedLibrary", - (_message.Message,), - dict( - DESCRIPTOR=_OUTDATEDLIBRARY, - __module__="google.cloud.websecurityscanner_v1beta.proto.finding_addon_pb2", - __doc__="""Information reported for an outdated library. - - - Attributes: - library_name: - The name of the outdated library. - version: - The version number. - learn_more_urls: - URLs to learn more information about the vulnerabilities in - the library. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.OutdatedLibrary) - ), -) -_sym_db.RegisterMessage(OutdatedLibrary) - -ViolatingResource = _reflection.GeneratedProtocolMessageType( - "ViolatingResource", - (_message.Message,), - dict( - DESCRIPTOR=_VIOLATINGRESOURCE, - __module__="google.cloud.websecurityscanner_v1beta.proto.finding_addon_pb2", - __doc__="""Information regarding any resource causing the - vulnerability such as JavaScript sources, image, audio files, etc. - - - Attributes: - content_type: - The MIME type of this resource. - resource_url: - URL of this violating resource. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ViolatingResource) - ), -) -_sym_db.RegisterMessage(ViolatingResource) - -VulnerableParameters = _reflection.GeneratedProtocolMessageType( - "VulnerableParameters", - (_message.Message,), - dict( - DESCRIPTOR=_VULNERABLEPARAMETERS, - __module__="google.cloud.websecurityscanner_v1beta.proto.finding_addon_pb2", - __doc__="""Information about vulnerable request parameters. - - - Attributes: - parameter_names: - The vulnerable parameter names. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.VulnerableParameters) - ), -) -_sym_db.RegisterMessage(VulnerableParameters) - -VulnerableHeaders = _reflection.GeneratedProtocolMessageType( - "VulnerableHeaders", - (_message.Message,), - dict( - Header=_reflection.GeneratedProtocolMessageType( - "Header", - (_message.Message,), - dict( - DESCRIPTOR=_VULNERABLEHEADERS_HEADER, - __module__="google.cloud.websecurityscanner_v1beta.proto.finding_addon_pb2", - __doc__="""Describes a HTTP Header. - - - Attributes: - name: - Header name. - value: - Header value. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header) - ), - ), - DESCRIPTOR=_VULNERABLEHEADERS, - __module__="google.cloud.websecurityscanner_v1beta.proto.finding_addon_pb2", - __doc__="""Information about vulnerable or missing HTTP Headers. - - - Attributes: - headers: - List of vulnerable headers. - missing_headers: - List of missing headers. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.VulnerableHeaders) - ), -) -_sym_db.RegisterMessage(VulnerableHeaders) -_sym_db.RegisterMessage(VulnerableHeaders.Header) - -Xss = _reflection.GeneratedProtocolMessageType( - "Xss", - (_message.Message,), - dict( - DESCRIPTOR=_XSS, - __module__="google.cloud.websecurityscanner_v1beta.proto.finding_addon_pb2", - __doc__="""Information reported for an XSS. - - - Attributes: - stack_traces: - Stack traces leading to the point where the XSS occurred. - error_message: - An error message generated by a javascript breakage. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.Xss) - ), -) -_sym_db.RegisterMessage(Xss) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_addon_pb2_grpc.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_addon_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_addon_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_pb2.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_pb2.py deleted file mode 100644 index a17e7ca70909..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_pb2.py +++ /dev/null @@ -1,453 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner_v1beta/proto/finding.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.websecurityscanner_v1beta.proto import ( - finding_addon_pb2 as google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_finding__addon__pb2, -) - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/websecurityscanner_v1beta/proto/finding.proto", - package="google.cloud.websecurityscanner.v1beta", - syntax="proto3", - serialized_options=_b( - "\n*com.google.cloud.websecurityscanner.v1betaB\014FindingProtoP\001ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\312\002&Google\\Cloud\\WebSecurityScanner\\V1beta" - ), - serialized_pb=_b( - '\n:google/cloud/websecurityscanner_v1beta/proto/finding.proto\x12&google.cloud.websecurityscanner.v1beta\x1a\x19google/api/resource.proto\x1a@google/cloud/websecurityscanner_v1beta/proto/finding_addon.proto"\xa9\x06\n\x07\x46inding\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x66inding_type\x18\x02 \x01(\t\x12\x13\n\x0bhttp_method\x18\x03 \x01(\t\x12\x12\n\nfuzzed_url\x18\x04 \x01(\t\x12\x0c\n\x04\x62ody\x18\x05 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x18\n\x10reproduction_url\x18\x07 \x01(\t\x12\x11\n\tframe_url\x18\x08 \x01(\t\x12\x11\n\tfinal_url\x18\t \x01(\t\x12\x13\n\x0btracking_id\x18\n \x01(\t\x12:\n\x04\x66orm\x18\x10 \x01(\x0b\x32,.google.cloud.websecurityscanner.v1beta.Form\x12Q\n\x10outdated_library\x18\x0b \x01(\x0b\x32\x37.google.cloud.websecurityscanner.v1beta.OutdatedLibrary\x12U\n\x12violating_resource\x18\x0c \x01(\x0b\x32\x39.google.cloud.websecurityscanner.v1beta.ViolatingResource\x12U\n\x12vulnerable_headers\x18\x0f \x01(\x0b\x32\x39.google.cloud.websecurityscanner.v1beta.VulnerableHeaders\x12[\n\x15vulnerable_parameters\x18\r \x01(\x0b\x32<.google.cloud.websecurityscanner.v1beta.VulnerableParameters\x12\x38\n\x03xss\x18\x0e \x01(\x0b\x32+.google.cloud.websecurityscanner.v1beta.Xss:\x84\x01\xea\x41\x80\x01\n)websecurityscanner.googleapis.com/Finding\x12Sprojects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}B\xbf\x01\n*com.google.cloud.websecurityscanner.v1betaB\x0c\x46indingProtoP\x01ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1betab\x06proto3' - ), - dependencies=[ - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_finding__addon__pb2.DESCRIPTOR, - ], -) - - -_FINDING = _descriptor.Descriptor( - name="Finding", - full_name="google.cloud.websecurityscanner.v1beta.Finding", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.websecurityscanner.v1beta.Finding.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="finding_type", - full_name="google.cloud.websecurityscanner.v1beta.Finding.finding_type", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="http_method", - full_name="google.cloud.websecurityscanner.v1beta.Finding.http_method", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="fuzzed_url", - full_name="google.cloud.websecurityscanner.v1beta.Finding.fuzzed_url", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="body", - full_name="google.cloud.websecurityscanner.v1beta.Finding.body", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.websecurityscanner.v1beta.Finding.description", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="reproduction_url", - full_name="google.cloud.websecurityscanner.v1beta.Finding.reproduction_url", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frame_url", - full_name="google.cloud.websecurityscanner.v1beta.Finding.frame_url", - index=7, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="final_url", - full_name="google.cloud.websecurityscanner.v1beta.Finding.final_url", - index=8, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tracking_id", - full_name="google.cloud.websecurityscanner.v1beta.Finding.tracking_id", - index=9, - number=10, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="form", - full_name="google.cloud.websecurityscanner.v1beta.Finding.form", - index=10, - number=16, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="outdated_library", - full_name="google.cloud.websecurityscanner.v1beta.Finding.outdated_library", - index=11, - number=11, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="violating_resource", - full_name="google.cloud.websecurityscanner.v1beta.Finding.violating_resource", - index=12, - number=12, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="vulnerable_headers", - full_name="google.cloud.websecurityscanner.v1beta.Finding.vulnerable_headers", - index=13, - number=15, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="vulnerable_parameters", - full_name="google.cloud.websecurityscanner.v1beta.Finding.vulnerable_parameters", - index=14, - number=13, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="xss", - full_name="google.cloud.websecurityscanner.v1beta.Finding.xss", - index=15, - number=14, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b( - "\352A\200\001\n)websecurityscanner.googleapis.com/Finding\022Sprojects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=196, - serialized_end=1005, -) - -_FINDING.fields_by_name[ - "form" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_finding__addon__pb2._FORM -) -_FINDING.fields_by_name[ - "outdated_library" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_finding__addon__pb2._OUTDATEDLIBRARY -) -_FINDING.fields_by_name[ - "violating_resource" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_finding__addon__pb2._VIOLATINGRESOURCE -) -_FINDING.fields_by_name[ - "vulnerable_headers" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_finding__addon__pb2._VULNERABLEHEADERS -) -_FINDING.fields_by_name[ - "vulnerable_parameters" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_finding__addon__pb2._VULNERABLEPARAMETERS -) -_FINDING.fields_by_name[ - "xss" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_finding__addon__pb2._XSS -) -DESCRIPTOR.message_types_by_name["Finding"] = _FINDING -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Finding = _reflection.GeneratedProtocolMessageType( - "Finding", - (_message.Message,), - dict( - DESCRIPTOR=_FINDING, - __module__="google.cloud.websecurityscanner_v1beta.proto.finding_pb2", - __doc__="""A Finding resource represents a vulnerability instance - identified during a ScanRun. - - - Attributes: - name: - The resource name of the Finding. The name follows the format - of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{ - scanRunId}/findings/{findingId}'. The finding IDs are - generated by the system. - finding_type: - The type of the Finding. Detailed and up-to-date information - on findings can be found here: - https://cloud.google.com/security-scanner/docs/scan-result- - details - http_method: - The http method of the request that triggered the - vulnerability, in uppercase. - fuzzed_url: - The URL produced by the server-side fuzzer and used in the - request that triggered the vulnerability. - body: - The body of the request that triggered the vulnerability. - description: - The description of the vulnerability. - reproduction_url: - The URL containing human-readable payload that user can - leverage to reproduce the vulnerability. - frame_url: - If the vulnerability was originated from nested IFrame, the - immediate parent IFrame is reported. - final_url: - The URL where the browser lands when the vulnerability is - detected. - tracking_id: - The tracking ID uniquely identifies a vulnerability instance - across multiple ScanRuns. - form: - An addon containing information reported for a vulnerability - with an HTML form, if any. - outdated_library: - An addon containing information about outdated libraries. - violating_resource: - An addon containing detailed information regarding any - resource causing the vulnerability such as JavaScript sources, - image, audio files, etc. - vulnerable_headers: - An addon containing information about vulnerable or missing - HTTP headers. - vulnerable_parameters: - An addon containing information about request parameters which - were found to be vulnerable. - xss: - An addon containing information reported for an XSS, if any. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.Finding) - ), -) -_sym_db.RegisterMessage(Finding) - - -DESCRIPTOR._options = None -_FINDING._options = None -# @@protoc_insertion_point(module_scope) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_pb2_grpc.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_type_stats.proto b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_type_stats.proto deleted file mode 100644 index 97f4882d1540..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_type_stats.proto +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.websecurityscanner.v1beta; - -option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; -option java_multiple_files = true; -option java_outer_classname = "FindingTypeStatsProto"; -option java_package = "com.google.cloud.websecurityscanner.v1beta"; -option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; - -// A FindingTypeStats resource represents stats regarding a specific FindingType -// of Findings under a given ScanRun. -message FindingTypeStats { - // The finding type associated with the stats. - string finding_type = 1; - - // The count of findings belonging to this finding type. - int32 finding_count = 2; -} diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_type_stats_pb2.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_type_stats_pb2.py deleted file mode 100644 index dd944cb51fa1..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_type_stats_pb2.py +++ /dev/null @@ -1,113 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner_v1beta/proto/finding_type_stats.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/websecurityscanner_v1beta/proto/finding_type_stats.proto", - package="google.cloud.websecurityscanner.v1beta", - syntax="proto3", - serialized_options=_b( - "\n*com.google.cloud.websecurityscanner.v1betaB\025FindingTypeStatsProtoP\001ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\312\002&Google\\Cloud\\WebSecurityScanner\\V1beta" - ), - serialized_pb=_b( - '\nEgoogle/cloud/websecurityscanner_v1beta/proto/finding_type_stats.proto\x12&google.cloud.websecurityscanner.v1beta"?\n\x10\x46indingTypeStats\x12\x14\n\x0c\x66inding_type\x18\x01 \x01(\t\x12\x15\n\rfinding_count\x18\x02 \x01(\x05\x42\xc8\x01\n*com.google.cloud.websecurityscanner.v1betaB\x15\x46indingTypeStatsProtoP\x01ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1betab\x06proto3' - ), -) - - -_FINDINGTYPESTATS = _descriptor.Descriptor( - name="FindingTypeStats", - full_name="google.cloud.websecurityscanner.v1beta.FindingTypeStats", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="finding_type", - full_name="google.cloud.websecurityscanner.v1beta.FindingTypeStats.finding_type", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="finding_count", - full_name="google.cloud.websecurityscanner.v1beta.FindingTypeStats.finding_count", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=113, - serialized_end=176, -) - -DESCRIPTOR.message_types_by_name["FindingTypeStats"] = _FINDINGTYPESTATS -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -FindingTypeStats = _reflection.GeneratedProtocolMessageType( - "FindingTypeStats", - (_message.Message,), - dict( - DESCRIPTOR=_FINDINGTYPESTATS, - __module__="google.cloud.websecurityscanner_v1beta.proto.finding_type_stats_pb2", - __doc__="""A FindingTypeStats resource represents stats regarding a - specific FindingType of Findings under a given ScanRun. - - - Attributes: - finding_type: - The finding type associated with the stats. - finding_count: - The count of findings belonging to this finding type. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.FindingTypeStats) - ), -) -_sym_db.RegisterMessage(FindingTypeStats) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_type_stats_pb2_grpc.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_type_stats_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/finding_type_stats_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config.proto b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config.proto deleted file mode 100644 index c2b7dcb31727..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config.proto +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.websecurityscanner.v1beta; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/websecurityscanner/v1beta/scan_run.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; -option java_multiple_files = true; -option java_outer_classname = "ScanConfigProto"; -option java_package = "com.google.cloud.websecurityscanner.v1beta"; -option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; - -// A ScanConfig resource contains the configurations to launch a scan. -message ScanConfig { - option (google.api.resource) = { - type: "websecurityscanner.googleapis.com/ScanConfig" - pattern: "projects/{project}/scanConfigs/{scan_config}" - }; - - // Scan authentication configuration. - message Authentication { - // Describes authentication configuration that uses a Google account. - message GoogleAccount { - // Required. The user name of the Google account. - string username = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Input only. The password of the Google account. The credential is stored encrypted - // and not returned in any response nor included in audit logs. - string password = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = INPUT_ONLY - ]; - } - - // Describes authentication configuration that uses a custom account. - message CustomAccount { - // Required. The user name of the custom account. - string username = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Input only. The password of the custom account. The credential is stored encrypted - // and not returned in any response nor included in audit logs. - string password = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = INPUT_ONLY - ]; - - // Required. The login form URL of the website. - string login_url = 3 [(google.api.field_behavior) = REQUIRED]; - } - - // Required. - // Authentication configuration - oneof authentication { - // Authentication using a Google account. - GoogleAccount google_account = 1; - - // Authentication using a custom account. - CustomAccount custom_account = 2; - } - } - - // Scan schedule configuration. - message Schedule { - // A timestamp indicates when the next run will be scheduled. The value is - // refreshed by the server after each run. If unspecified, it will default - // to current server time, which means the scan will be scheduled to start - // immediately. - google.protobuf.Timestamp schedule_time = 1; - - // Required. The duration of time between executions in days. - int32 interval_duration_days = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Type of user agents used for scanning. - enum UserAgent { - // The user agent is unknown. Service will default to CHROME_LINUX. - USER_AGENT_UNSPECIFIED = 0; - - // Chrome on Linux. This is the service default if unspecified. - CHROME_LINUX = 1; - - // Chrome on Android. - CHROME_ANDROID = 2; - - // Safari on IPhone. - SAFARI_IPHONE = 3; - } - - // Cloud platforms supported by Cloud Web Security Scanner. - enum TargetPlatform { - // The target platform is unknown. Requests with this enum value will be - // rejected with INVALID_ARGUMENT error. - TARGET_PLATFORM_UNSPECIFIED = 0; - - // Google App Engine service. - APP_ENGINE = 1; - - // Google Compute Engine service. - COMPUTE = 2; - } - - // Scan risk levels supported by Cloud Web Security Scanner. LOW impact - // scanning will minimize requests with the potential to modify data. To - // achieve the maximum scan coverage, NORMAL risk level is recommended. - enum RiskLevel { - // Use default, which is NORMAL. - RISK_LEVEL_UNSPECIFIED = 0; - - // Normal scanning (Recommended) - NORMAL = 1; - - // Lower impact scanning - LOW = 2; - } - - // Controls export of scan configurations and results to Cloud Security - // Command Center. - enum ExportToSecurityCommandCenter { - // Use default, which is ENABLED. - EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED = 0; - - // Export results of this scan to Cloud Security Command Center. - ENABLED = 1; - - // Do not export results of this scan to Cloud Security Command Center. - DISABLED = 2; - } - - // The resource name of the ScanConfig. The name follows the format of - // 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are - // generated by the system. - string name = 1; - - // Required. The user provided display name of the ScanConfig. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // The maximum QPS during scanning. A valid value ranges from 5 to 20 - // inclusively. If the field is unspecified or its value is set 0, server will - // default to 15. Other values outside of [5, 20] range will be rejected with - // INVALID_ARGUMENT error. - int32 max_qps = 3; - - // Required. The starting URLs from which the scanner finds site pages. - repeated string starting_urls = 4 [(google.api.field_behavior) = REQUIRED]; - - // The authentication configuration. If specified, service will use the - // authentication configuration during scanning. - Authentication authentication = 5; - - // The user agent used during scanning. - UserAgent user_agent = 6; - - // The blacklist URL patterns as described in - // https://cloud.google.com/security-scanner/docs/excluded-urls - repeated string blacklist_patterns = 7; - - // The schedule of the ScanConfig. - Schedule schedule = 8; - - // Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be - // used as a default. - repeated TargetPlatform target_platforms = 9; - - // Controls export of scan configurations and results to Cloud Security - // Command Center. - ExportToSecurityCommandCenter export_to_security_command_center = 10; - - // Latest ScanRun if available. - ScanRun latest_run = 11; - - // The risk level selected for the scan - RiskLevel risk_level = 12; -} diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_error.proto b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_error.proto deleted file mode 100644 index a50bdcaf37f6..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_error.proto +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.websecurityscanner.v1beta; - -option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; -option java_multiple_files = true; -option java_outer_classname = "ScanConfigErrorProto"; -option java_package = "com.google.cloud.websecurityscanner.v1beta"; -option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; - -// Defines a custom error message used by CreateScanConfig and UpdateScanConfig -// APIs when scan configuration validation fails. It is also reported as part of -// a ScanRunErrorTrace message if scan validation fails due to a scan -// configuration error. -message ScanConfigError { - // Output only. - // Defines an error reason code. - // Next id: 44 - enum Code { - option allow_alias = true; - - // There is no error. - CODE_UNSPECIFIED = 0; - - // There is no error. - OK = 0; - - // Indicates an internal server error. - // Please DO NOT USE THIS ERROR CODE unless the root cause is truly unknown. - INTERNAL_ERROR = 1; - - // One of the seed URLs is an App Engine URL but we cannot validate the scan - // settings due to an App Engine API backend error. - APPENGINE_API_BACKEND_ERROR = 2; - - // One of the seed URLs is an App Engine URL but we cannot access the - // App Engine API to validate scan settings. - APPENGINE_API_NOT_ACCESSIBLE = 3; - - // One of the seed URLs is an App Engine URL but the Default Host of the - // App Engine is not set. - APPENGINE_DEFAULT_HOST_MISSING = 4; - - // Google corporate accounts can not be used for scanning. - CANNOT_USE_GOOGLE_COM_ACCOUNT = 6; - - // The account of the scan creator can not be used for scanning. - CANNOT_USE_OWNER_ACCOUNT = 7; - - // This scan targets Compute Engine, but we cannot validate scan settings - // due to a Compute Engine API backend error. - COMPUTE_API_BACKEND_ERROR = 8; - - // This scan targets Compute Engine, but we cannot access the Compute Engine - // API to validate the scan settings. - COMPUTE_API_NOT_ACCESSIBLE = 9; - - // The Custom Login URL does not belong to the current project. - CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 10; - - // The Custom Login URL is malformed (can not be parsed). - CUSTOM_LOGIN_URL_MALFORMED = 11; - - // The Custom Login URL is mapped to a non-routable IP address in DNS. - CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 12; - - // The Custom Login URL is mapped to an IP address which is not reserved for - // the current project. - CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS = 13; - - // The Custom Login URL has a non-routable IP address. - CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 14; - - // The Custom Login URL has an IP address which is not reserved for the - // current project. - CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS = 15; - - // Another scan with the same name (case-sensitive) already exists. - DUPLICATE_SCAN_NAME = 16; - - // A field is set to an invalid value. - INVALID_FIELD_VALUE = 18; - - // There was an error trying to authenticate to the scan target. - FAILED_TO_AUTHENTICATE_TO_TARGET = 19; - - // Finding type value is not specified in the list findings request. - FINDING_TYPE_UNSPECIFIED = 20; - - // Scan targets Compute Engine, yet current project was not whitelisted for - // Google Compute Engine Scanning Alpha access. - FORBIDDEN_TO_SCAN_COMPUTE = 21; - - // User tries to update managed scan - FORBIDDEN_UPDATE_TO_MANAGED_SCAN = 43; - - // The supplied filter is malformed. For example, it can not be parsed, does - // not have a filter type in expression, or the same filter type appears - // more than once. - MALFORMED_FILTER = 22; - - // The supplied resource name is malformed (can not be parsed). - MALFORMED_RESOURCE_NAME = 23; - - // The current project is not in an active state. - PROJECT_INACTIVE = 24; - - // A required field is not set. - REQUIRED_FIELD = 25; - - // Project id, scanconfig id, scanrun id, or finding id are not consistent - // with each other in resource name. - RESOURCE_NAME_INCONSISTENT = 26; - - // The scan being requested to start is already running. - SCAN_ALREADY_RUNNING = 27; - - // The scan that was requested to be stopped is not running. - SCAN_NOT_RUNNING = 28; - - // One of the seed URLs does not belong to the current project. - SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 29; - - // One of the seed URLs is malformed (can not be parsed). - SEED_URL_MALFORMED = 30; - - // One of the seed URLs is mapped to a non-routable IP address in DNS. - SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 31; - - // One of the seed URLs is mapped to an IP address which is not reserved - // for the current project. - SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS = 32; - - // One of the seed URLs has on-routable IP address. - SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 33; - - // One of the seed URLs has an IP address that is not reserved - // for the current project. - SEED_URL_HAS_UNRESERVED_IP_ADDRESS = 35; - - // The Cloud Security Scanner service account is not configured under the - // project. - SERVICE_ACCOUNT_NOT_CONFIGURED = 36; - - // A project has reached the maximum number of scans. - TOO_MANY_SCANS = 37; - - // Resolving the details of the current project fails. - UNABLE_TO_RESOLVE_PROJECT_INFO = 38; - - // One or more blacklist patterns were in the wrong format. - UNSUPPORTED_BLACKLIST_PATTERN_FORMAT = 39; - - // The supplied filter is not supported. - UNSUPPORTED_FILTER = 40; - - // The supplied finding type is not supported. For example, we do not - // provide findings of the given finding type. - UNSUPPORTED_FINDING_TYPE = 41; - - // The URL scheme of one or more of the supplied URLs is not supported. - UNSUPPORTED_URL_SCHEME = 42; - } - - // Indicates the reason code for a configuration failure. - Code code = 1; - - // Indicates the full name of the ScanConfig field that triggers this error, - // for example "scan_config.max_qps". This field is provided for - // troubleshooting purposes only and its actual value can change in the - // future. - string field_name = 2; -} diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_error_pb2.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_error_pb2.py deleted file mode 100644 index ce90e7dbdc4e..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_error_pb2.py +++ /dev/null @@ -1,422 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner_v1beta/proto/scan_config_error.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/websecurityscanner_v1beta/proto/scan_config_error.proto", - package="google.cloud.websecurityscanner.v1beta", - syntax="proto3", - serialized_options=_b( - "\n*com.google.cloud.websecurityscanner.v1betaB\024ScanConfigErrorProtoP\001ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\312\002&Google\\Cloud\\WebSecurityScanner\\V1beta" - ), - serialized_pb=_b( - '\nDgoogle/cloud/websecurityscanner_v1beta/proto/scan_config_error.proto\x12&google.cloud.websecurityscanner.v1beta"\xed\x0b\n\x0fScanConfigError\x12J\n\x04\x63ode\x18\x01 \x01(\x0e\x32<.google.cloud.websecurityscanner.v1beta.ScanConfigError.Code\x12\x12\n\nfield_name\x18\x02 \x01(\t"\xf9\n\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x06\n\x02OK\x10\x00\x12\x12\n\x0eINTERNAL_ERROR\x10\x01\x12\x1f\n\x1b\x41PPENGINE_API_BACKEND_ERROR\x10\x02\x12 \n\x1c\x41PPENGINE_API_NOT_ACCESSIBLE\x10\x03\x12"\n\x1e\x41PPENGINE_DEFAULT_HOST_MISSING\x10\x04\x12!\n\x1d\x43\x41NNOT_USE_GOOGLE_COM_ACCOUNT\x10\x06\x12\x1c\n\x18\x43\x41NNOT_USE_OWNER_ACCOUNT\x10\x07\x12\x1d\n\x19\x43OMPUTE_API_BACKEND_ERROR\x10\x08\x12\x1e\n\x1a\x43OMPUTE_API_NOT_ACCESSIBLE\x10\t\x12\x37\n3CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT\x10\n\x12\x1e\n\x1a\x43USTOM_LOGIN_URL_MALFORMED\x10\x0b\x12\x33\n/CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS\x10\x0c\x12\x31\n-CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS\x10\r\x12\x30\n,CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS\x10\x0e\x12.\n*CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS\x10\x0f\x12\x17\n\x13\x44UPLICATE_SCAN_NAME\x10\x10\x12\x17\n\x13INVALID_FIELD_VALUE\x10\x12\x12$\n FAILED_TO_AUTHENTICATE_TO_TARGET\x10\x13\x12\x1c\n\x18\x46INDING_TYPE_UNSPECIFIED\x10\x14\x12\x1d\n\x19\x46ORBIDDEN_TO_SCAN_COMPUTE\x10\x15\x12$\n FORBIDDEN_UPDATE_TO_MANAGED_SCAN\x10+\x12\x14\n\x10MALFORMED_FILTER\x10\x16\x12\x1b\n\x17MALFORMED_RESOURCE_NAME\x10\x17\x12\x14\n\x10PROJECT_INACTIVE\x10\x18\x12\x12\n\x0eREQUIRED_FIELD\x10\x19\x12\x1e\n\x1aRESOURCE_NAME_INCONSISTENT\x10\x1a\x12\x18\n\x14SCAN_ALREADY_RUNNING\x10\x1b\x12\x14\n\x10SCAN_NOT_RUNNING\x10\x1c\x12/\n+SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT\x10\x1d\x12\x16\n\x12SEED_URL_MALFORMED\x10\x1e\x12+\n\'SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS\x10\x1f\x12)\n%SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS\x10 \x12(\n$SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS\x10!\x12&\n"SEED_URL_HAS_UNRESERVED_IP_ADDRESS\x10#\x12"\n\x1eSERVICE_ACCOUNT_NOT_CONFIGURED\x10$\x12\x12\n\x0eTOO_MANY_SCANS\x10%\x12"\n\x1eUNABLE_TO_RESOLVE_PROJECT_INFO\x10&\x12(\n$UNSUPPORTED_BLACKLIST_PATTERN_FORMAT\x10\'\x12\x16\n\x12UNSUPPORTED_FILTER\x10(\x12\x1c\n\x18UNSUPPORTED_FINDING_TYPE\x10)\x12\x1a\n\x16UNSUPPORTED_URL_SCHEME\x10*\x1a\x02\x10\x01\x42\xc7\x01\n*com.google.cloud.websecurityscanner.v1betaB\x14ScanConfigErrorProtoP\x01ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1betab\x06proto3' - ), -) - - -_SCANCONFIGERROR_CODE = _descriptor.EnumDescriptor( - name="Code", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfigError.Code", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="CODE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="OK", index=1, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="INTERNAL_ERROR", index=2, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="APPENGINE_API_BACKEND_ERROR", - index=3, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="APPENGINE_API_NOT_ACCESSIBLE", - index=4, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="APPENGINE_DEFAULT_HOST_MISSING", - index=5, - number=4, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CANNOT_USE_GOOGLE_COM_ACCOUNT", - index=6, - number=6, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CANNOT_USE_OWNER_ACCOUNT", - index=7, - number=7, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="COMPUTE_API_BACKEND_ERROR", - index=8, - number=8, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="COMPUTE_API_NOT_ACCESSIBLE", - index=9, - number=9, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT", - index=10, - number=10, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CUSTOM_LOGIN_URL_MALFORMED", - index=11, - number=11, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS", - index=12, - number=12, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS", - index=13, - number=13, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS", - index=14, - number=14, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS", - index=15, - number=15, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="DUPLICATE_SCAN_NAME", - index=16, - number=16, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="INVALID_FIELD_VALUE", - index=17, - number=18, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FAILED_TO_AUTHENTICATE_TO_TARGET", - index=18, - number=19, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FINDING_TYPE_UNSPECIFIED", - index=19, - number=20, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FORBIDDEN_TO_SCAN_COMPUTE", - index=20, - number=21, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FORBIDDEN_UPDATE_TO_MANAGED_SCAN", - index=21, - number=43, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="MALFORMED_FILTER", - index=22, - number=22, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="MALFORMED_RESOURCE_NAME", - index=23, - number=23, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="PROJECT_INACTIVE", - index=24, - number=24, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="REQUIRED_FIELD", - index=25, - number=25, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RESOURCE_NAME_INCONSISTENT", - index=26, - number=26, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SCAN_ALREADY_RUNNING", - index=27, - number=27, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SCAN_NOT_RUNNING", - index=28, - number=28, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT", - index=29, - number=29, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SEED_URL_MALFORMED", - index=30, - number=30, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS", - index=31, - number=31, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS", - index=32, - number=32, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS", - index=33, - number=33, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SEED_URL_HAS_UNRESERVED_IP_ADDRESS", - index=34, - number=35, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SERVICE_ACCOUNT_NOT_CONFIGURED", - index=35, - number=36, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TOO_MANY_SCANS", - index=36, - number=37, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="UNABLE_TO_RESOLVE_PROJECT_INFO", - index=37, - number=38, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="UNSUPPORTED_BLACKLIST_PATTERN_FORMAT", - index=38, - number=39, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="UNSUPPORTED_FILTER", - index=39, - number=40, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="UNSUPPORTED_FINDING_TYPE", - index=40, - number=41, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="UNSUPPORTED_URL_SCHEME", - index=41, - number=42, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=_b("\020\001"), - serialized_start=229, - serialized_end=1630, -) -_sym_db.RegisterEnumDescriptor(_SCANCONFIGERROR_CODE) - - -_SCANCONFIGERROR = _descriptor.Descriptor( - name="ScanConfigError", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfigError", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="code", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfigError.code", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="field_name", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfigError.field_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_SCANCONFIGERROR_CODE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=113, - serialized_end=1630, -) - -_SCANCONFIGERROR.fields_by_name["code"].enum_type = _SCANCONFIGERROR_CODE -_SCANCONFIGERROR_CODE.containing_type = _SCANCONFIGERROR -DESCRIPTOR.message_types_by_name["ScanConfigError"] = _SCANCONFIGERROR -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ScanConfigError = _reflection.GeneratedProtocolMessageType( - "ScanConfigError", - (_message.Message,), - dict( - DESCRIPTOR=_SCANCONFIGERROR, - __module__="google.cloud.websecurityscanner_v1beta.proto.scan_config_error_pb2", - __doc__="""Defines a custom error message used by CreateScanConfig - and UpdateScanConfig APIs when scan configuration validation fails. It - is also reported as part of a ScanRunErrorTrace message if scan - validation fails due to a scan configuration error. - - - Attributes: - code: - Indicates the reason code for a configuration failure. - field_name: - Indicates the full name of the ScanConfig field that triggers - this error, for example "scan\_config.max\_qps". This field is - provided for troubleshooting purposes only and its actual - value can change in the future. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ScanConfigError) - ), -) -_sym_db.RegisterMessage(ScanConfigError) - - -DESCRIPTOR._options = None -_SCANCONFIGERROR_CODE._options = None -# @@protoc_insertion_point(module_scope) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_error_pb2_grpc.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_error_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_error_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_pb2.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_pb2.py deleted file mode 100644 index dadf65792aa8..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_pb2.py +++ /dev/null @@ -1,848 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner_v1beta/proto/scan_config.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.websecurityscanner_v1beta.proto import ( - scan_run_pb2 as google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/websecurityscanner_v1beta/proto/scan_config.proto", - package="google.cloud.websecurityscanner.v1beta", - syntax="proto3", - serialized_options=_b( - "\n*com.google.cloud.websecurityscanner.v1betaB\017ScanConfigProtoP\001ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\312\002&Google\\Cloud\\WebSecurityScanner\\V1beta" - ), - serialized_pb=_b( - '\n>google/cloud/websecurityscanner_v1beta/proto/scan_config.proto\x12&google.cloud.websecurityscanner.v1beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a;google/cloud/websecurityscanner_v1beta/proto/scan_run.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xa6\r\n\nScanConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07max_qps\x18\x03 \x01(\x05\x12\x1a\n\rstarting_urls\x18\x04 \x03(\tB\x03\xe0\x41\x02\x12Y\n\x0e\x61uthentication\x18\x05 \x01(\x0b\x32\x41.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication\x12P\n\nuser_agent\x18\x06 \x01(\x0e\x32<.google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent\x12\x1a\n\x12\x62lacklist_patterns\x18\x07 \x03(\t\x12M\n\x08schedule\x18\x08 \x01(\x0b\x32;.google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule\x12[\n\x10target_platforms\x18\t \x03(\x0e\x32\x41.google.cloud.websecurityscanner.v1beta.ScanConfig.TargetPlatform\x12{\n!export_to_security_command_center\x18\n \x01(\x0e\x32P.google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter\x12\x43\n\nlatest_run\x18\x0b \x01(\x0b\x32/.google.cloud.websecurityscanner.v1beta.ScanRun\x12P\n\nrisk_level\x18\x0c \x01(\x0e\x32<.google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel\x1a\x94\x03\n\x0e\x41uthentication\x12i\n\x0egoogle_account\x18\x01 \x01(\x0b\x32O.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccountH\x00\x12i\n\x0e\x63ustom_account\x18\x02 \x01(\x0b\x32O.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccountH\x00\x1a@\n\rGoogleAccount\x12\x15\n\x08username\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x08password\x18\x02 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x04\x1aX\n\rCustomAccount\x12\x15\n\x08username\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x08password\x18\x02 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x04\x12\x16\n\tlogin_url\x18\x03 \x01(\tB\x03\xe0\x41\x02\x42\x10\n\x0e\x61uthentication\x1a\x62\n\x08Schedule\x12\x31\n\rschedule_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12#\n\x16interval_duration_days\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02"`\n\tUserAgent\x12\x1a\n\x16USER_AGENT_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x43HROME_LINUX\x10\x01\x12\x12\n\x0e\x43HROME_ANDROID\x10\x02\x12\x11\n\rSAFARI_IPHONE\x10\x03"N\n\x0eTargetPlatform\x12\x1f\n\x1bTARGET_PLATFORM_UNSPECIFIED\x10\x00\x12\x0e\n\nAPP_ENGINE\x10\x01\x12\x0b\n\x07\x43OMPUTE\x10\x02"<\n\tRiskLevel\x12\x1a\n\x16RISK_LEVEL_UNSPECIFIED\x10\x00\x12\n\n\x06NORMAL\x10\x01\x12\x07\n\x03LOW\x10\x02"m\n\x1d\x45xportToSecurityCommandCenter\x12\x31\n-EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02:_\xea\x41\\\n,websecurityscanner.googleapis.com/ScanConfig\x12,projects/{project}/scanConfigs/{scan_config}B\xc2\x01\n*com.google.cloud.websecurityscanner.v1betaB\x0fScanConfigProtoP\x01ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1betab\x06proto3' - ), - dependencies=[ - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_SCANCONFIG_USERAGENT = _descriptor.EnumDescriptor( - name="UserAgent", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="USER_AGENT_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CHROME_LINUX", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CHROME_ANDROID", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SAFARI_IPHONE", index=3, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1517, - serialized_end=1613, -) -_sym_db.RegisterEnumDescriptor(_SCANCONFIG_USERAGENT) - -_SCANCONFIG_TARGETPLATFORM = _descriptor.EnumDescriptor( - name="TargetPlatform", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.TargetPlatform", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="TARGET_PLATFORM_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="APP_ENGINE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="COMPUTE", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1615, - serialized_end=1693, -) -_sym_db.RegisterEnumDescriptor(_SCANCONFIG_TARGETPLATFORM) - -_SCANCONFIG_RISKLEVEL = _descriptor.EnumDescriptor( - name="RiskLevel", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="RISK_LEVEL_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NORMAL", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LOW", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1695, - serialized_end=1755, -) -_sym_db.RegisterEnumDescriptor(_SCANCONFIG_RISKLEVEL) - -_SCANCONFIG_EXPORTTOSECURITYCOMMANDCENTER = _descriptor.EnumDescriptor( - name="ExportToSecurityCommandCenter", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="ENABLED", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DISABLED", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1757, - serialized_end=1866, -) -_sym_db.RegisterEnumDescriptor(_SCANCONFIG_EXPORTTOSECURITYCOMMANDCENTER) - - -_SCANCONFIG_AUTHENTICATION_GOOGLEACCOUNT = _descriptor.Descriptor( - name="GoogleAccount", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="username", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount.username", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="password", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount.password", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002\340A\004"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1243, - serialized_end=1307, -) - -_SCANCONFIG_AUTHENTICATION_CUSTOMACCOUNT = _descriptor.Descriptor( - name="CustomAccount", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="username", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount.username", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="password", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount.password", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002\340A\004"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="login_url", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount.login_url", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1309, - serialized_end=1397, -) - -_SCANCONFIG_AUTHENTICATION = _descriptor.Descriptor( - name="Authentication", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="google_account", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.google_account", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="custom_account", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.custom_account", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[ - _SCANCONFIG_AUTHENTICATION_GOOGLEACCOUNT, - _SCANCONFIG_AUTHENTICATION_CUSTOMACCOUNT, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="authentication", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.authentication", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1011, - serialized_end=1415, -) - -_SCANCONFIG_SCHEDULE = _descriptor.Descriptor( - name="Schedule", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="schedule_time", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule.schedule_time", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="interval_duration_days", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule.interval_duration_days", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1417, - serialized_end=1515, -) - -_SCANCONFIG = _descriptor.Descriptor( - name="ScanConfig", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_qps", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.max_qps", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="starting_urls", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.starting_urls", - index=3, - number=4, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="authentication", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.authentication", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="user_agent", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.user_agent", - index=5, - number=6, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="blacklist_patterns", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.blacklist_patterns", - index=6, - number=7, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="schedule", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.schedule", - index=7, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="target_platforms", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.target_platforms", - index=8, - number=9, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="export_to_security_command_center", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.export_to_security_command_center", - index=9, - number=10, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="latest_run", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.latest_run", - index=10, - number=11, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="risk_level", - full_name="google.cloud.websecurityscanner.v1beta.ScanConfig.risk_level", - index=11, - number=12, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_SCANCONFIG_AUTHENTICATION, _SCANCONFIG_SCHEDULE], - enum_types=[ - _SCANCONFIG_USERAGENT, - _SCANCONFIG_TARGETPLATFORM, - _SCANCONFIG_RISKLEVEL, - _SCANCONFIG_EXPORTTOSECURITYCOMMANDCENTER, - ], - serialized_options=_b( - "\352A\\\n,websecurityscanner.googleapis.com/ScanConfig\022,projects/{project}/scanConfigs/{scan_config}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=261, - serialized_end=1963, -) - -_SCANCONFIG_AUTHENTICATION_GOOGLEACCOUNT.containing_type = _SCANCONFIG_AUTHENTICATION -_SCANCONFIG_AUTHENTICATION_CUSTOMACCOUNT.containing_type = _SCANCONFIG_AUTHENTICATION -_SCANCONFIG_AUTHENTICATION.fields_by_name[ - "google_account" -].message_type = _SCANCONFIG_AUTHENTICATION_GOOGLEACCOUNT -_SCANCONFIG_AUTHENTICATION.fields_by_name[ - "custom_account" -].message_type = _SCANCONFIG_AUTHENTICATION_CUSTOMACCOUNT -_SCANCONFIG_AUTHENTICATION.containing_type = _SCANCONFIG -_SCANCONFIG_AUTHENTICATION.oneofs_by_name["authentication"].fields.append( - _SCANCONFIG_AUTHENTICATION.fields_by_name["google_account"] -) -_SCANCONFIG_AUTHENTICATION.fields_by_name[ - "google_account" -].containing_oneof = _SCANCONFIG_AUTHENTICATION.oneofs_by_name["authentication"] -_SCANCONFIG_AUTHENTICATION.oneofs_by_name["authentication"].fields.append( - _SCANCONFIG_AUTHENTICATION.fields_by_name["custom_account"] -) -_SCANCONFIG_AUTHENTICATION.fields_by_name[ - "custom_account" -].containing_oneof = _SCANCONFIG_AUTHENTICATION.oneofs_by_name["authentication"] -_SCANCONFIG_SCHEDULE.fields_by_name[ - "schedule_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_SCANCONFIG_SCHEDULE.containing_type = _SCANCONFIG -_SCANCONFIG.fields_by_name["authentication"].message_type = _SCANCONFIG_AUTHENTICATION -_SCANCONFIG.fields_by_name["user_agent"].enum_type = _SCANCONFIG_USERAGENT -_SCANCONFIG.fields_by_name["schedule"].message_type = _SCANCONFIG_SCHEDULE -_SCANCONFIG.fields_by_name["target_platforms"].enum_type = _SCANCONFIG_TARGETPLATFORM -_SCANCONFIG.fields_by_name[ - "export_to_security_command_center" -].enum_type = _SCANCONFIG_EXPORTTOSECURITYCOMMANDCENTER -_SCANCONFIG.fields_by_name[ - "latest_run" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__pb2._SCANRUN -) -_SCANCONFIG.fields_by_name["risk_level"].enum_type = _SCANCONFIG_RISKLEVEL -_SCANCONFIG_USERAGENT.containing_type = _SCANCONFIG -_SCANCONFIG_TARGETPLATFORM.containing_type = _SCANCONFIG -_SCANCONFIG_RISKLEVEL.containing_type = _SCANCONFIG -_SCANCONFIG_EXPORTTOSECURITYCOMMANDCENTER.containing_type = _SCANCONFIG -DESCRIPTOR.message_types_by_name["ScanConfig"] = _SCANCONFIG -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ScanConfig = _reflection.GeneratedProtocolMessageType( - "ScanConfig", - (_message.Message,), - dict( - Authentication=_reflection.GeneratedProtocolMessageType( - "Authentication", - (_message.Message,), - dict( - GoogleAccount=_reflection.GeneratedProtocolMessageType( - "GoogleAccount", - (_message.Message,), - dict( - DESCRIPTOR=_SCANCONFIG_AUTHENTICATION_GOOGLEACCOUNT, - __module__="google.cloud.websecurityscanner_v1beta.proto.scan_config_pb2", - __doc__="""Describes authentication configuration that uses a Google account. - - - Attributes: - username: - Required. The user name of the Google account. - password: - Required. Input only. The password of the Google account. The - credential is stored encrypted and not returned in any - response nor included in audit logs. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount) - ), - ), - CustomAccount=_reflection.GeneratedProtocolMessageType( - "CustomAccount", - (_message.Message,), - dict( - DESCRIPTOR=_SCANCONFIG_AUTHENTICATION_CUSTOMACCOUNT, - __module__="google.cloud.websecurityscanner_v1beta.proto.scan_config_pb2", - __doc__="""Describes authentication configuration that uses a custom - account. - - - Attributes: - username: - Required. The user name of the custom account. - password: - Required. Input only. The password of the custom account. The - credential is stored encrypted and not returned in any - response nor included in audit logs. - login_url: - Required. The login form URL of the website. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount) - ), - ), - DESCRIPTOR=_SCANCONFIG_AUTHENTICATION, - __module__="google.cloud.websecurityscanner_v1beta.proto.scan_config_pb2", - __doc__="""Scan authentication configuration. - - - Attributes: - authentication: - Required. Authentication configuration - google_account: - Authentication using a Google account. - custom_account: - Authentication using a custom account. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication) - ), - ), - Schedule=_reflection.GeneratedProtocolMessageType( - "Schedule", - (_message.Message,), - dict( - DESCRIPTOR=_SCANCONFIG_SCHEDULE, - __module__="google.cloud.websecurityscanner_v1beta.proto.scan_config_pb2", - __doc__="""Scan schedule configuration. - - - Attributes: - schedule_time: - A timestamp indicates when the next run will be scheduled. The - value is refreshed by the server after each run. If - unspecified, it will default to current server time, which - means the scan will be scheduled to start immediately. - interval_duration_days: - Required. The duration of time between executions in days. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule) - ), - ), - DESCRIPTOR=_SCANCONFIG, - __module__="google.cloud.websecurityscanner_v1beta.proto.scan_config_pb2", - __doc__="""A ScanConfig resource contains the configurations to - launch a scan. - - - Attributes: - name: - The resource name of the ScanConfig. The name follows the - format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - The ScanConfig IDs are generated by the system. - display_name: - Required. The user provided display name of the ScanConfig. - max_qps: - The maximum QPS during scanning. A valid value ranges from 5 - to 20 inclusively. If the field is unspecified or its value is - set 0, server will default to 15. Other values outside of [5, - 20] range will be rejected with INVALID\_ARGUMENT error. - starting_urls: - Required. The starting URLs from which the scanner finds site - pages. - authentication: - The authentication configuration. If specified, service will - use the authentication configuration during scanning. - user_agent: - The user agent used during scanning. - blacklist_patterns: - The blacklist URL patterns as described in - https://cloud.google.com/security-scanner/docs/excluded-urls - schedule: - The schedule of the ScanConfig. - target_platforms: - Set of Cloud Platforms targeted by the scan. If empty, - APP\_ENGINE will be used as a default. - export_to_security_command_center: - Controls export of scan configurations and results to Cloud - Security Command Center. - latest_run: - Latest ScanRun if available. - risk_level: - The risk level selected for the scan - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ScanConfig) - ), -) -_sym_db.RegisterMessage(ScanConfig) -_sym_db.RegisterMessage(ScanConfig.Authentication) -_sym_db.RegisterMessage(ScanConfig.Authentication.GoogleAccount) -_sym_db.RegisterMessage(ScanConfig.Authentication.CustomAccount) -_sym_db.RegisterMessage(ScanConfig.Schedule) - - -DESCRIPTOR._options = None -_SCANCONFIG_AUTHENTICATION_GOOGLEACCOUNT.fields_by_name["username"]._options = None -_SCANCONFIG_AUTHENTICATION_GOOGLEACCOUNT.fields_by_name["password"]._options = None -_SCANCONFIG_AUTHENTICATION_CUSTOMACCOUNT.fields_by_name["username"]._options = None -_SCANCONFIG_AUTHENTICATION_CUSTOMACCOUNT.fields_by_name["password"]._options = None -_SCANCONFIG_AUTHENTICATION_CUSTOMACCOUNT.fields_by_name["login_url"]._options = None -_SCANCONFIG_SCHEDULE.fields_by_name["interval_duration_days"]._options = None -_SCANCONFIG.fields_by_name["display_name"]._options = None -_SCANCONFIG.fields_by_name["starting_urls"]._options = None -_SCANCONFIG._options = None -# @@protoc_insertion_point(module_scope) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_pb2_grpc.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_config_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run.proto b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run.proto deleted file mode 100644 index 84564c6e2f50..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run.proto +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.websecurityscanner.v1beta; - -import "google/api/resource.proto"; -import "google/cloud/websecurityscanner/v1beta/scan_run_error_trace.proto"; -import "google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; -option java_multiple_files = true; -option java_outer_classname = "ScanRunProto"; -option java_package = "com.google.cloud.websecurityscanner.v1beta"; -option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; - -// A ScanRun is a output-only resource representing an actual run of the scan. -// Next id: 12 -message ScanRun { - option (google.api.resource) = { - type: "websecurityscanner.googleapis.com/ScanRun" - pattern: "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}" - }; - - // Types of ScanRun execution state. - enum ExecutionState { - // Represents an invalid state caused by internal server error. This value - // should never be returned. - EXECUTION_STATE_UNSPECIFIED = 0; - - // The scan is waiting in the queue. - QUEUED = 1; - - // The scan is in progress. - SCANNING = 2; - - // The scan is either finished or stopped by user. - FINISHED = 3; - } - - // Types of ScanRun result state. - enum ResultState { - // Default value. This value is returned when the ScanRun is not yet - // finished. - RESULT_STATE_UNSPECIFIED = 0; - - // The scan finished without errors. - SUCCESS = 1; - - // The scan finished with errors. - ERROR = 2; - - // The scan was terminated by user. - KILLED = 3; - } - - // The resource name of the ScanRun. The name follows the format of - // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - // The ScanRun IDs are generated by the system. - string name = 1; - - // The execution state of the ScanRun. - ExecutionState execution_state = 2; - - // The result state of the ScanRun. This field is only available after the - // execution state reaches "FINISHED". - ResultState result_state = 3; - - // The time at which the ScanRun started. - google.protobuf.Timestamp start_time = 4; - - // The time at which the ScanRun reached termination state - that the ScanRun - // is either finished or stopped by user. - google.protobuf.Timestamp end_time = 5; - - // The number of URLs crawled during this ScanRun. If the scan is in progress, - // the value represents the number of URLs crawled up to now. - int64 urls_crawled_count = 6; - - // The number of URLs tested during this ScanRun. If the scan is in progress, - // the value represents the number of URLs tested up to now. The number of - // URLs tested is usually larger than the number URLS crawled because - // typically a crawled URL is tested with multiple test payloads. - int64 urls_tested_count = 7; - - // Whether the scan run has found any vulnerabilities. - bool has_vulnerabilities = 8; - - // The percentage of total completion ranging from 0 to 100. - // If the scan is in queue, the value is 0. - // If the scan is running, the value ranges from 0 to 100. - // If the scan is finished, the value is 100. - int32 progress_percent = 9; - - // If result_state is an ERROR, this field provides the primary reason for - // scan's termination and more details, if such are available. - ScanRunErrorTrace error_trace = 10; - - // A list of warnings, if such are encountered during this scan run. - repeated ScanRunWarningTrace warning_traces = 11; -} diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_error_trace.proto b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_error_trace.proto deleted file mode 100644 index 248967d245a4..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_error_trace.proto +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.websecurityscanner.v1beta; - -import "google/cloud/websecurityscanner/v1beta/scan_config_error.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; -option java_multiple_files = true; -option java_outer_classname = "ScanRunErrorTraceProto"; -option java_package = "com.google.cloud.websecurityscanner.v1beta"; -option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; - -// Output only. -// Defines an error trace message for a ScanRun. -message ScanRunErrorTrace { - // Output only. - // Defines an error reason code. - // Next id: 7 - enum Code { - // Default value is never used. - CODE_UNSPECIFIED = 0; - - // Indicates that the scan run failed due to an internal server error. - INTERNAL_ERROR = 1; - - // Indicates a scan configuration error, usually due to outdated ScanConfig - // settings, such as starting_urls or the DNS configuration. - SCAN_CONFIG_ISSUE = 2; - - // Indicates an authentication error, usually due to outdated ScanConfig - // authentication settings. - AUTHENTICATION_CONFIG_ISSUE = 3; - - // Indicates a scan operation timeout, usually caused by a very large site. - TIMED_OUT_WHILE_SCANNING = 4; - - // Indicates that a scan encountered excessive redirects, either to - // authentication or some other page outside of the scan scope. - TOO_MANY_REDIRECTS = 5; - - // Indicates that a scan encountered numerous errors from the web site - // pages. When available, most_common_http_error_code field indicates the - // most common HTTP error code encountered during the scan. - TOO_MANY_HTTP_ERRORS = 6; - } - - // Indicates the error reason code. - Code code = 1; - - // If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error - // message encountered during scan configuration validation that is performed - // before each scan run. - ScanConfigError scan_config_error = 2; - - // If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most - // common HTTP error code, if such is available. For example, if this code is - // 404, the scan has encountered too many NOT_FOUND responses. - int32 most_common_http_error_code = 3; -} diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_error_trace_pb2.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_error_trace_pb2.py deleted file mode 100644 index b5975a795354..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_error_trace_pb2.py +++ /dev/null @@ -1,212 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner_v1beta/proto/scan_run_error_trace.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.cloud.websecurityscanner_v1beta.proto import ( - scan_config_error_pb2 as google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__config__error__pb2, -) - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/websecurityscanner_v1beta/proto/scan_run_error_trace.proto", - package="google.cloud.websecurityscanner.v1beta", - syntax="proto3", - serialized_options=_b( - "\n*com.google.cloud.websecurityscanner.v1betaB\026ScanRunErrorTraceProtoP\001ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\312\002&Google\\Cloud\\WebSecurityScanner\\V1beta" - ), - serialized_pb=_b( - '\nGgoogle/cloud/websecurityscanner_v1beta/proto/scan_run_error_trace.proto\x12&google.cloud.websecurityscanner.v1beta\x1a\x44google/cloud/websecurityscanner_v1beta/proto/scan_config_error.proto"\x95\x03\n\x11ScanRunErrorTrace\x12L\n\x04\x63ode\x18\x01 \x01(\x0e\x32>.google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code\x12R\n\x11scan_config_error\x18\x02 \x01(\x0b\x32\x37.google.cloud.websecurityscanner.v1beta.ScanConfigError\x12#\n\x1bmost_common_http_error_code\x18\x03 \x01(\x05"\xb8\x01\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x12\n\x0eINTERNAL_ERROR\x10\x01\x12\x15\n\x11SCAN_CONFIG_ISSUE\x10\x02\x12\x1f\n\x1b\x41UTHENTICATION_CONFIG_ISSUE\x10\x03\x12\x1c\n\x18TIMED_OUT_WHILE_SCANNING\x10\x04\x12\x16\n\x12TOO_MANY_REDIRECTS\x10\x05\x12\x18\n\x14TOO_MANY_HTTP_ERRORS\x10\x06\x42\xc9\x01\n*com.google.cloud.websecurityscanner.v1betaB\x16ScanRunErrorTraceProtoP\x01ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1betab\x06proto3' - ), - dependencies=[ - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__config__error__pb2.DESCRIPTOR - ], -) - - -_SCANRUNERRORTRACE_CODE = _descriptor.EnumDescriptor( - name="Code", - full_name="google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="CODE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="INTERNAL_ERROR", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SCAN_CONFIG_ISSUE", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="AUTHENTICATION_CONFIG_ISSUE", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TIMED_OUT_WHILE_SCANNING", - index=4, - number=4, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TOO_MANY_REDIRECTS", - index=5, - number=5, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TOO_MANY_HTTP_ERRORS", - index=6, - number=6, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=407, - serialized_end=591, -) -_sym_db.RegisterEnumDescriptor(_SCANRUNERRORTRACE_CODE) - - -_SCANRUNERRORTRACE = _descriptor.Descriptor( - name="ScanRunErrorTrace", - full_name="google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="code", - full_name="google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.code", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="scan_config_error", - full_name="google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.scan_config_error", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="most_common_http_error_code", - full_name="google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.most_common_http_error_code", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_SCANRUNERRORTRACE_CODE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=186, - serialized_end=591, -) - -_SCANRUNERRORTRACE.fields_by_name["code"].enum_type = _SCANRUNERRORTRACE_CODE -_SCANRUNERRORTRACE.fields_by_name[ - "scan_config_error" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__config__error__pb2._SCANCONFIGERROR -) -_SCANRUNERRORTRACE_CODE.containing_type = _SCANRUNERRORTRACE -DESCRIPTOR.message_types_by_name["ScanRunErrorTrace"] = _SCANRUNERRORTRACE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ScanRunErrorTrace = _reflection.GeneratedProtocolMessageType( - "ScanRunErrorTrace", - (_message.Message,), - dict( - DESCRIPTOR=_SCANRUNERRORTRACE, - __module__="google.cloud.websecurityscanner_v1beta.proto.scan_run_error_trace_pb2", - __doc__="""Output only. Defines an error trace message for a ScanRun. - - - Attributes: - code: - Indicates the error reason code. - scan_config_error: - If the scan encounters SCAN\_CONFIG\_ISSUE error, this field - has the error message encountered during scan configuration - validation that is performed before each scan run. - most_common_http_error_code: - If the scan encounters TOO\_MANY\_HTTP\_ERRORS, this field - indicates the most common HTTP error code, if such is - available. For example, if this code is 404, the scan has - encountered too many NOT\_FOUND responses. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace) - ), -) -_sym_db.RegisterMessage(ScanRunErrorTrace) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_error_trace_pb2_grpc.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_error_trace_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_error_trace_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_pb2.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_pb2.py deleted file mode 100644 index bfea80e196eb..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_pb2.py +++ /dev/null @@ -1,409 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner_v1beta/proto/scan_run.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.websecurityscanner_v1beta.proto import ( - scan_run_error_trace_pb2 as google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__error__trace__pb2, -) -from google.cloud.websecurityscanner_v1beta.proto import ( - scan_run_warning_trace_pb2 as google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__warning__trace__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/websecurityscanner_v1beta/proto/scan_run.proto", - package="google.cloud.websecurityscanner.v1beta", - syntax="proto3", - serialized_options=_b( - "\n*com.google.cloud.websecurityscanner.v1betaB\014ScanRunProtoP\001ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\312\002&Google\\Cloud\\WebSecurityScanner\\V1beta" - ), - serialized_pb=_b( - '\n;google/cloud/websecurityscanner_v1beta/proto/scan_run.proto\x12&google.cloud.websecurityscanner.v1beta\x1a\x19google/api/resource.proto\x1aGgoogle/cloud/websecurityscanner_v1beta/proto/scan_run_error_trace.proto\x1aIgoogle/cloud/websecurityscanner_v1beta/proto/scan_run_warning_trace.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xd2\x06\n\x07ScanRun\x12\x0c\n\x04name\x18\x01 \x01(\t\x12W\n\x0f\x65xecution_state\x18\x02 \x01(\x0e\x32>.google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState\x12Q\n\x0cresult_state\x18\x03 \x01(\x0e\x32;.google.cloud.websecurityscanner.v1beta.ScanRun.ResultState\x12.\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1a\n\x12urls_crawled_count\x18\x06 \x01(\x03\x12\x19\n\x11urls_tested_count\x18\x07 \x01(\x03\x12\x1b\n\x13has_vulnerabilities\x18\x08 \x01(\x08\x12\x18\n\x10progress_percent\x18\t \x01(\x05\x12N\n\x0b\x65rror_trace\x18\n \x01(\x0b\x32\x39.google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace\x12S\n\x0ewarning_traces\x18\x0b \x03(\x0b\x32;.google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace"Y\n\x0e\x45xecutionState\x12\x1f\n\x1b\x45XECUTION_STATE_UNSPECIFIED\x10\x00\x12\n\n\x06QUEUED\x10\x01\x12\x0c\n\x08SCANNING\x10\x02\x12\x0c\n\x08\x46INISHED\x10\x03"O\n\x0bResultState\x12\x1c\n\x18RESULT_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07SUCCESS\x10\x01\x12\t\n\x05\x45RROR\x10\x02\x12\n\n\x06KILLED\x10\x03:p\xea\x41m\n)websecurityscanner.googleapis.com/ScanRun\x12@projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}B\xbf\x01\n*com.google.cloud.websecurityscanner.v1betaB\x0cScanRunProtoP\x01ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1betab\x06proto3' - ), - dependencies=[ - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__error__trace__pb2.DESCRIPTOR, - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__warning__trace__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_SCANRUN_EXECUTIONSTATE = _descriptor.EnumDescriptor( - name="ExecutionState", - full_name="google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="EXECUTION_STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="QUEUED", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SCANNING", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FINISHED", index=3, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=878, - serialized_end=967, -) -_sym_db.RegisterEnumDescriptor(_SCANRUN_EXECUTIONSTATE) - -_SCANRUN_RESULTSTATE = _descriptor.EnumDescriptor( - name="ResultState", - full_name="google.cloud.websecurityscanner.v1beta.ScanRun.ResultState", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="RESULT_STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SUCCESS", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="ERROR", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="KILLED", index=3, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=969, - serialized_end=1048, -) -_sym_db.RegisterEnumDescriptor(_SCANRUN_RESULTSTATE) - - -_SCANRUN = _descriptor.Descriptor( - name="ScanRun", - full_name="google.cloud.websecurityscanner.v1beta.ScanRun", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.websecurityscanner.v1beta.ScanRun.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="execution_state", - full_name="google.cloud.websecurityscanner.v1beta.ScanRun.execution_state", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="result_state", - full_name="google.cloud.websecurityscanner.v1beta.ScanRun.result_state", - index=2, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.cloud.websecurityscanner.v1beta.ScanRun.start_time", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.cloud.websecurityscanner.v1beta.ScanRun.end_time", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="urls_crawled_count", - full_name="google.cloud.websecurityscanner.v1beta.ScanRun.urls_crawled_count", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="urls_tested_count", - full_name="google.cloud.websecurityscanner.v1beta.ScanRun.urls_tested_count", - index=6, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="has_vulnerabilities", - full_name="google.cloud.websecurityscanner.v1beta.ScanRun.has_vulnerabilities", - index=7, - number=8, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="progress_percent", - full_name="google.cloud.websecurityscanner.v1beta.ScanRun.progress_percent", - index=8, - number=9, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="error_trace", - full_name="google.cloud.websecurityscanner.v1beta.ScanRun.error_trace", - index=9, - number=10, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="warning_traces", - full_name="google.cloud.websecurityscanner.v1beta.ScanRun.warning_traces", - index=10, - number=11, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_SCANRUN_EXECUTIONSTATE, _SCANRUN_RESULTSTATE], - serialized_options=_b( - "\352Am\n)websecurityscanner.googleapis.com/ScanRun\022@projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=312, - serialized_end=1162, -) - -_SCANRUN.fields_by_name["execution_state"].enum_type = _SCANRUN_EXECUTIONSTATE -_SCANRUN.fields_by_name["result_state"].enum_type = _SCANRUN_RESULTSTATE -_SCANRUN.fields_by_name[ - "start_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_SCANRUN.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_SCANRUN.fields_by_name[ - "error_trace" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__error__trace__pb2._SCANRUNERRORTRACE -) -_SCANRUN.fields_by_name[ - "warning_traces" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__warning__trace__pb2._SCANRUNWARNINGTRACE -) -_SCANRUN_EXECUTIONSTATE.containing_type = _SCANRUN -_SCANRUN_RESULTSTATE.containing_type = _SCANRUN -DESCRIPTOR.message_types_by_name["ScanRun"] = _SCANRUN -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ScanRun = _reflection.GeneratedProtocolMessageType( - "ScanRun", - (_message.Message,), - dict( - DESCRIPTOR=_SCANRUN, - __module__="google.cloud.websecurityscanner_v1beta.proto.scan_run_pb2", - __doc__="""A ScanRun is a output-only resource representing an actual - run of the scan. Next id: 12 - - - Attributes: - name: - The resource name of the ScanRun. The name follows the format - of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{ - scanRunId}'. The ScanRun IDs are generated by the system. - execution_state: - The execution state of the ScanRun. - result_state: - The result state of the ScanRun. This field is only available - after the execution state reaches "FINISHED". - start_time: - The time at which the ScanRun started. - end_time: - The time at which the ScanRun reached termination state - that - the ScanRun is either finished or stopped by user. - urls_crawled_count: - The number of URLs crawled during this ScanRun. If the scan is - in progress, the value represents the number of URLs crawled - up to now. - urls_tested_count: - The number of URLs tested during this ScanRun. If the scan is - in progress, the value represents the number of URLs tested up - to now. The number of URLs tested is usually larger than the - number URLS crawled because typically a crawled URL is tested - with multiple test payloads. - has_vulnerabilities: - Whether the scan run has found any vulnerabilities. - progress_percent: - The percentage of total completion ranging from 0 to 100. If - the scan is in queue, the value is 0. If the scan is running, - the value ranges from 0 to 100. If the scan is finished, the - value is 100. - error_trace: - If result\_state is an ERROR, this field provides the primary - reason for scan's termination and more details, if such are - available. - warning_traces: - A list of warnings, if such are encountered during this scan - run. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ScanRun) - ), -) -_sym_db.RegisterMessage(ScanRun) - - -DESCRIPTOR._options = None -_SCANRUN._options = None -# @@protoc_insertion_point(module_scope) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_pb2_grpc.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_warning_trace.proto b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_warning_trace.proto deleted file mode 100644 index 8207a02906a4..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_warning_trace.proto +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.websecurityscanner.v1beta; - -option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; -option java_multiple_files = true; -option java_outer_classname = "ScanRunWarningTraceProto"; -option java_package = "com.google.cloud.websecurityscanner.v1beta"; -option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; - -// Output only. -// Defines a warning trace message for ScanRun. Warning traces provide customers -// with useful information that helps make the scanning process more effective. -message ScanRunWarningTrace { - // Output only. - // Defines a warning message code. - // Next id: 6 - enum Code { - // Default value is never used. - CODE_UNSPECIFIED = 0; - - // Indicates that a scan discovered an unexpectedly low number of URLs. This - // is sometimes caused by complex navigation features or by using a single - // URL for numerous pages. - INSUFFICIENT_CRAWL_RESULTS = 1; - - // Indicates that a scan discovered too many URLs to test, or excessive - // redundant URLs. - TOO_MANY_CRAWL_RESULTS = 2; - - // Indicates that too many tests have been generated for the scan. Customer - // should try reducing the number of starting URLs, increasing the QPS rate, - // or narrowing down the scope of the scan using the excluded patterns. - TOO_MANY_FUZZ_TASKS = 3; - - // Indicates that a scan is blocked by IAP. - BLOCKED_BY_IAP = 4; - } - - // Indicates the warning code. - Code code = 1; -} diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_warning_trace_pb2.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_warning_trace_pb2.py deleted file mode 100644 index a225eccc8cd2..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_warning_trace_pb2.py +++ /dev/null @@ -1,142 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner_v1beta/proto/scan_run_warning_trace.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/websecurityscanner_v1beta/proto/scan_run_warning_trace.proto", - package="google.cloud.websecurityscanner.v1beta", - syntax="proto3", - serialized_options=_b( - "\n*com.google.cloud.websecurityscanner.v1betaB\030ScanRunWarningTraceProtoP\001ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\312\002&Google\\Cloud\\WebSecurityScanner\\V1beta" - ), - serialized_pb=_b( - '\nIgoogle/cloud/websecurityscanner_v1beta/proto/scan_run_warning_trace.proto\x12&google.cloud.websecurityscanner.v1beta"\xed\x01\n\x13ScanRunWarningTrace\x12N\n\x04\x63ode\x18\x01 \x01(\x0e\x32@.google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code"\x85\x01\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x1e\n\x1aINSUFFICIENT_CRAWL_RESULTS\x10\x01\x12\x1a\n\x16TOO_MANY_CRAWL_RESULTS\x10\x02\x12\x17\n\x13TOO_MANY_FUZZ_TASKS\x10\x03\x12\x12\n\x0e\x42LOCKED_BY_IAP\x10\x04\x42\xcb\x01\n*com.google.cloud.websecurityscanner.v1betaB\x18ScanRunWarningTraceProtoP\x01ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1betab\x06proto3' - ), -) - - -_SCANRUNWARNINGTRACE_CODE = _descriptor.EnumDescriptor( - name="Code", - full_name="google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="CODE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="INSUFFICIENT_CRAWL_RESULTS", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TOO_MANY_CRAWL_RESULTS", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TOO_MANY_FUZZ_TASKS", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="BLOCKED_BY_IAP", index=4, number=4, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=222, - serialized_end=355, -) -_sym_db.RegisterEnumDescriptor(_SCANRUNWARNINGTRACE_CODE) - - -_SCANRUNWARNINGTRACE = _descriptor.Descriptor( - name="ScanRunWarningTrace", - full_name="google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="code", - full_name="google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.code", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[_SCANRUNWARNINGTRACE_CODE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=118, - serialized_end=355, -) - -_SCANRUNWARNINGTRACE.fields_by_name["code"].enum_type = _SCANRUNWARNINGTRACE_CODE -_SCANRUNWARNINGTRACE_CODE.containing_type = _SCANRUNWARNINGTRACE -DESCRIPTOR.message_types_by_name["ScanRunWarningTrace"] = _SCANRUNWARNINGTRACE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ScanRunWarningTrace = _reflection.GeneratedProtocolMessageType( - "ScanRunWarningTrace", - (_message.Message,), - dict( - DESCRIPTOR=_SCANRUNWARNINGTRACE, - __module__="google.cloud.websecurityscanner_v1beta.proto.scan_run_warning_trace_pb2", - __doc__="""Output only. Defines a warning trace message for ScanRun. - Warning traces provide customers with useful information that helps make - the scanning process more effective. - - - Attributes: - code: - Indicates the warning code. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace) - ), -) -_sym_db.RegisterMessage(ScanRunWarningTrace) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_warning_trace_pb2_grpc.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_warning_trace_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/scan_run_warning_trace_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/web_security_scanner.proto b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/web_security_scanner.proto deleted file mode 100644 index 9ea6207c2420..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/web_security_scanner.proto +++ /dev/null @@ -1,411 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.websecurityscanner.v1beta; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/websecurityscanner/v1beta/crawled_url.proto"; -import "google/cloud/websecurityscanner/v1beta/finding.proto"; -import "google/cloud/websecurityscanner/v1beta/finding_type_stats.proto"; -import "google/cloud/websecurityscanner/v1beta/scan_config.proto"; -import "google/cloud/websecurityscanner/v1beta/scan_run.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; -option java_multiple_files = true; -option java_outer_classname = "WebSecurityScannerProto"; -option java_package = "com.google.cloud.websecurityscanner.v1beta"; -option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; - -// Cloud Web Security Scanner Service identifies security vulnerabilities in web -// applications hosted on Google Cloud Platform. It crawls your application, and -// attempts to exercise as many user inputs and event handlers as possible. -service WebSecurityScanner { - option (google.api.default_host) = "websecurityscanner.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a new ScanConfig. - rpc CreateScanConfig(CreateScanConfigRequest) returns (ScanConfig) { - option (google.api.http) = { - post: "/v1beta/{parent=projects/*}/scanConfigs" - body: "scan_config" - }; - option (google.api.method_signature) = "parent,scan_config"; - } - - // Deletes an existing ScanConfig and its child resources. - rpc DeleteScanConfig(DeleteScanConfigRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta/{name=projects/*/scanConfigs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Gets a ScanConfig. - rpc GetScanConfig(GetScanConfigRequest) returns (ScanConfig) { - option (google.api.http) = { - get: "/v1beta/{name=projects/*/scanConfigs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists ScanConfigs under a given project. - rpc ListScanConfigs(ListScanConfigsRequest) returns (ListScanConfigsResponse) { - option (google.api.http) = { - get: "/v1beta/{parent=projects/*}/scanConfigs" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates a ScanConfig. This method support partial update of a ScanConfig. - rpc UpdateScanConfig(UpdateScanConfigRequest) returns (ScanConfig) { - option (google.api.http) = { - patch: "/v1beta/{scan_config.name=projects/*/scanConfigs/*}" - body: "scan_config" - }; - option (google.api.method_signature) = "scan_config,update_mask"; - } - - // Start a ScanRun according to the given ScanConfig. - rpc StartScanRun(StartScanRunRequest) returns (ScanRun) { - option (google.api.http) = { - post: "/v1beta/{name=projects/*/scanConfigs/*}:start" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Gets a ScanRun. - rpc GetScanRun(GetScanRunRequest) returns (ScanRun) { - option (google.api.http) = { - get: "/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists ScanRuns under a given ScanConfig, in descending order of ScanRun - // stop time. - rpc ListScanRuns(ListScanRunsRequest) returns (ListScanRunsResponse) { - option (google.api.http) = { - get: "/v1beta/{parent=projects/*/scanConfigs/*}/scanRuns" - }; - option (google.api.method_signature) = "parent"; - } - - // Stops a ScanRun. The stopped ScanRun is returned. - rpc StopScanRun(StopScanRunRequest) returns (ScanRun) { - option (google.api.http) = { - post: "/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}:stop" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // List CrawledUrls under a given ScanRun. - rpc ListCrawledUrls(ListCrawledUrlsRequest) returns (ListCrawledUrlsResponse) { - option (google.api.http) = { - get: "/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets a Finding. - rpc GetFinding(GetFindingRequest) returns (Finding) { - option (google.api.http) = { - get: "/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List Findings under a given ScanRun. - rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { - option (google.api.http) = { - get: "/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings" - }; - option (google.api.method_signature) = "parent,filter"; - } - - // List all FindingTypeStats under a given ScanRun. - rpc ListFindingTypeStats(ListFindingTypeStatsRequest) returns (ListFindingTypeStatsResponse) { - option (google.api.http) = { - get: "/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats" - }; - option (google.api.method_signature) = "parent"; - } -} - -// Request for the `CreateScanConfig` method. -message CreateScanConfigRequest { - // Required. The parent resource name where the scan is created, which should be a - // project resource name in the format 'projects/{projectId}'. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. The ScanConfig to be created. - ScanConfig scan_config = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for the `DeleteScanConfig` method. -message DeleteScanConfigRequest { - // Required. The resource name of the ScanConfig to be deleted. The name follows the - // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "websecurityscanner.googleapis.com/ScanConfig" - } - ]; -} - -// Request for the `GetScanConfig` method. -message GetScanConfigRequest { - // Required. The resource name of the ScanConfig to be returned. The name follows the - // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "websecurityscanner.googleapis.com/ScanConfig" - } - ]; -} - -// Request for the `ListScanConfigs` method. -message ListScanConfigsRequest { - // Required. The parent resource name, which should be a project resource name in the - // format 'projects/{projectId}'. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // A token identifying a page of results to be returned. This should be a - // `next_page_token` value returned from a previous List request. - // If unspecified, the first page of results is returned. - string page_token = 2; - - // The maximum number of ScanConfigs to return, can be limited by server. - // If not specified or not positive, the implementation will select a - // reasonable value. - int32 page_size = 3; -} - -// Request for the `UpdateScanConfigRequest` method. -message UpdateScanConfigRequest { - // Required. The ScanConfig to be updated. The name field must be set to identify the - // resource to be updated. The values of fields not covered by the mask - // will be ignored. - ScanConfig scan_config = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The update mask applies to the resource. For the `FieldMask` definition, - // see - // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - google.protobuf.FieldMask update_mask = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Response for the `ListScanConfigs` method. -message ListScanConfigsResponse { - // The list of ScanConfigs returned. - repeated ScanConfig scan_configs = 1; - - // Token to retrieve the next page of results, or empty if there are no - // more results in the list. - string next_page_token = 2; -} - -// Request for the `StartScanRun` method. -message StartScanRunRequest { - // Required. The resource name of the ScanConfig to be used. The name follows the - // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "websecurityscanner.googleapis.com/ScanConfig" - } - ]; -} - -// Request for the `GetScanRun` method. -message GetScanRunRequest { - // Required. The resource name of the ScanRun to be returned. The name follows the - // format of - // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "websecurityscanner.googleapis.com/ScanRun" - } - ]; -} - -// Request for the `ListScanRuns` method. -message ListScanRunsRequest { - // Required. The parent resource name, which should be a scan resource name in the - // format 'projects/{projectId}/scanConfigs/{scanConfigId}'. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "websecurityscanner.googleapis.com/ScanConfig" - } - ]; - - // A token identifying a page of results to be returned. This should be a - // `next_page_token` value returned from a previous List request. - // If unspecified, the first page of results is returned. - string page_token = 2; - - // The maximum number of ScanRuns to return, can be limited by server. - // If not specified or not positive, the implementation will select a - // reasonable value. - int32 page_size = 3; -} - -// Response for the `ListScanRuns` method. -message ListScanRunsResponse { - // The list of ScanRuns returned. - repeated ScanRun scan_runs = 1; - - // Token to retrieve the next page of results, or empty if there are no - // more results in the list. - string next_page_token = 2; -} - -// Request for the `StopScanRun` method. -message StopScanRunRequest { - // Required. The resource name of the ScanRun to be stopped. The name follows the - // format of - // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "websecurityscanner.googleapis.com/ScanRun" - } - ]; -} - -// Request for the `ListCrawledUrls` method. -message ListCrawledUrlsRequest { - // Required. The parent resource name, which should be a scan run resource name in the - // format - // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "websecurityscanner.googleapis.com/ScanRun" - } - ]; - - // A token identifying a page of results to be returned. This should be a - // `next_page_token` value returned from a previous List request. - // If unspecified, the first page of results is returned. - string page_token = 2; - - // The maximum number of CrawledUrls to return, can be limited by server. - // If not specified or not positive, the implementation will select a - // reasonable value. - int32 page_size = 3; -} - -// Response for the `ListCrawledUrls` method. -message ListCrawledUrlsResponse { - // The list of CrawledUrls returned. - repeated CrawledUrl crawled_urls = 1; - - // Token to retrieve the next page of results, or empty if there are no - // more results in the list. - string next_page_token = 2; -} - -// Request for the `GetFinding` method. -message GetFindingRequest { - // Required. The resource name of the Finding to be returned. The name follows the - // format of - // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "websecurityscanner.googleapis.com/Finding" - } - ]; -} - -// Request for the `ListFindings` method. -message ListFindingsRequest { - // Required. The parent resource name, which should be a scan run resource name in the - // format - // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "websecurityscanner.googleapis.com/ScanRun" - } - ]; - - // Required. The filter expression. The expression must be in the format: - // . - // Supported field: 'finding_type'. - // Supported operator: '='. - string filter = 2 [(google.api.field_behavior) = REQUIRED]; - - // A token identifying a page of results to be returned. This should be a - // `next_page_token` value returned from a previous List request. - // If unspecified, the first page of results is returned. - string page_token = 3; - - // The maximum number of Findings to return, can be limited by server. - // If not specified or not positive, the implementation will select a - // reasonable value. - int32 page_size = 4; -} - -// Response for the `ListFindings` method. -message ListFindingsResponse { - // The list of Findings returned. - repeated Finding findings = 1; - - // Token to retrieve the next page of results, or empty if there are no - // more results in the list. - string next_page_token = 2; -} - -// Request for the `ListFindingTypeStats` method. -message ListFindingTypeStatsRequest { - // Required. The parent resource name, which should be a scan run resource name in the - // format - // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "websecurityscanner.googleapis.com/ScanRun" - } - ]; -} - -// Response for the `ListFindingTypeStats` method. -message ListFindingTypeStatsResponse { - // The list of FindingTypeStats returned. - repeated FindingTypeStats finding_type_stats = 1; -} diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/web_security_scanner_pb2.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/web_security_scanner_pb2.py deleted file mode 100644 index ad3f1d89f4b2..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/web_security_scanner_pb2.py +++ /dev/null @@ -1,1711 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner_v1beta/proto/web_security_scanner.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.websecurityscanner_v1beta.proto import ( - crawled_url_pb2 as google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_crawled__url__pb2, -) -from google.cloud.websecurityscanner_v1beta.proto import ( - finding_pb2 as google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_finding__pb2, -) -from google.cloud.websecurityscanner_v1beta.proto import ( - finding_type_stats_pb2 as google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_finding__type__stats__pb2, -) -from google.cloud.websecurityscanner_v1beta.proto import ( - scan_config_pb2 as google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__config__pb2, -) -from google.cloud.websecurityscanner_v1beta.proto import ( - scan_run_pb2 as google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/websecurityscanner_v1beta/proto/web_security_scanner.proto", - package="google.cloud.websecurityscanner.v1beta", - syntax="proto3", - serialized_options=_b( - "\n*com.google.cloud.websecurityscanner.v1betaB\027WebSecurityScannerProtoP\001ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\312\002&Google\\Cloud\\WebSecurityScanner\\V1beta" - ), - serialized_pb=_b( - '\nGgoogle/cloud/websecurityscanner_v1beta/proto/web_security_scanner.proto\x12&google.cloud.websecurityscanner.v1beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a>google/cloud/websecurityscanner_v1beta/proto/crawled_url.proto\x1a:google/cloud/websecurityscanner_v1beta/proto/finding.proto\x1a\x45google/cloud/websecurityscanner_v1beta/proto/finding_type_stats.proto\x1a>google/cloud/websecurityscanner_v1beta/proto/scan_config.proto\x1a;google/cloud/websecurityscanner_v1beta/proto/scan_run.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto"\xac\x01\n\x17\x43reateScanConfigRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12L\n\x0bscan_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.websecurityscanner.v1beta.ScanConfigB\x03\xe0\x41\x02"]\n\x17\x44\x65leteScanConfigRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,websecurityscanner.googleapis.com/ScanConfig"Z\n\x14GetScanConfigRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,websecurityscanner.googleapis.com/ScanConfig"\x84\x01\n\x16ListScanConfigsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05"\x9d\x01\n\x17UpdateScanConfigRequest\x12L\n\x0bscan_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.websecurityscanner.v1beta.ScanConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02"|\n\x17ListScanConfigsResponse\x12H\n\x0cscan_configs\x18\x01 \x03(\x0b\x32\x32.google.cloud.websecurityscanner.v1beta.ScanConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"Y\n\x13StartScanRunRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,websecurityscanner.googleapis.com/ScanConfig"T\n\x11GetScanRunRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)websecurityscanner.googleapis.com/ScanRun"\x82\x01\n\x13ListScanRunsRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,websecurityscanner.googleapis.com/ScanConfig\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05"s\n\x14ListScanRunsResponse\x12\x42\n\tscan_runs\x18\x01 \x03(\x0b\x32/.google.cloud.websecurityscanner.v1beta.ScanRun\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"U\n\x12StopScanRunRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)websecurityscanner.googleapis.com/ScanRun"\x82\x01\n\x16ListCrawledUrlsRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)websecurityscanner.googleapis.com/ScanRun\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05"|\n\x17ListCrawledUrlsResponse\x12H\n\x0c\x63rawled_urls\x18\x01 \x03(\x0b\x32\x32.google.cloud.websecurityscanner.v1beta.CrawledUrl\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"T\n\x11GetFindingRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)websecurityscanner.googleapis.com/Finding"\x94\x01\n\x13ListFindingsRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)websecurityscanner.googleapis.com/ScanRun\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05"r\n\x14ListFindingsResponse\x12\x41\n\x08\x66indings\x18\x01 \x03(\x0b\x32/.google.cloud.websecurityscanner.v1beta.Finding\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"`\n\x1bListFindingTypeStatsRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)websecurityscanner.googleapis.com/ScanRun"t\n\x1cListFindingTypeStatsResponse\x12T\n\x12\x66inding_type_stats\x18\x01 \x03(\x0b\x32\x38.google.cloud.websecurityscanner.v1beta.FindingTypeStats2\x8e\x16\n\x12WebSecurityScanner\x12\xda\x01\n\x10\x43reateScanConfig\x12?.google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest\x1a\x32.google.cloud.websecurityscanner.v1beta.ScanConfig"Q\x82\xd3\xe4\x93\x02\x36"\'/v1beta/{parent=projects/*}/scanConfigs:\x0bscan_config\xda\x41\x12parent,scan_config\x12\xa3\x01\n\x10\x44\x65leteScanConfig\x12?.google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest\x1a\x16.google.protobuf.Empty"6\x82\xd3\xe4\x93\x02)*\'/v1beta/{name=projects/*/scanConfigs/*}\xda\x41\x04name\x12\xb9\x01\n\rGetScanConfig\x12<.google.cloud.websecurityscanner.v1beta.GetScanConfigRequest\x1a\x32.google.cloud.websecurityscanner.v1beta.ScanConfig"6\x82\xd3\xe4\x93\x02)\x12\'/v1beta/{name=projects/*/scanConfigs/*}\xda\x41\x04name\x12\xcc\x01\n\x0fListScanConfigs\x12>.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest\x1a?.google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse"8\x82\xd3\xe4\x93\x02)\x12\'/v1beta/{parent=projects/*}/scanConfigs\xda\x41\x06parent\x12\xeb\x01\n\x10UpdateScanConfig\x12?.google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest\x1a\x32.google.cloud.websecurityscanner.v1beta.ScanConfig"b\x82\xd3\xe4\x93\x02\x42\x32\x33/v1beta/{scan_config.name=projects/*/scanConfigs/*}:\x0bscan_config\xda\x41\x17scan_config,update_mask\x12\xbd\x01\n\x0cStartScanRun\x12;.google.cloud.websecurityscanner.v1beta.StartScanRunRequest\x1a/.google.cloud.websecurityscanner.v1beta.ScanRun"?\x82\xd3\xe4\x93\x02\x32"-/v1beta/{name=projects/*/scanConfigs/*}:start:\x01*\xda\x41\x04name\x12\xbb\x01\n\nGetScanRun\x12\x39.google.cloud.websecurityscanner.v1beta.GetScanRunRequest\x1a/.google.cloud.websecurityscanner.v1beta.ScanRun"A\x82\xd3\xe4\x93\x02\x34\x12\x32/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}\xda\x41\x04name\x12\xce\x01\n\x0cListScanRuns\x12;.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest\x1a<.google.cloud.websecurityscanner.v1beta.ListScanRunsResponse"C\x82\xd3\xe4\x93\x02\x34\x12\x32/v1beta/{parent=projects/*/scanConfigs/*}/scanRuns\xda\x41\x06parent\x12\xc5\x01\n\x0bStopScanRun\x12:.google.cloud.websecurityscanner.v1beta.StopScanRunRequest\x1a/.google.cloud.websecurityscanner.v1beta.ScanRun"I\x82\xd3\xe4\x93\x02<"7/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}:stop:\x01*\xda\x41\x04name\x12\xe5\x01\n\x0fListCrawledUrls\x12>.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest\x1a?.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse"Q\x82\xd3\xe4\x93\x02\x42\x12@/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls\xda\x41\x06parent\x12\xc6\x01\n\nGetFinding\x12\x39.google.cloud.websecurityscanner.v1beta.GetFindingRequest\x1a/.google.cloud.websecurityscanner.v1beta.Finding"L\x82\xd3\xe4\x93\x02?\x12=/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}\xda\x41\x04name\x12\xe0\x01\n\x0cListFindings\x12;.google.cloud.websecurityscanner.v1beta.ListFindingsRequest\x1a<.google.cloud.websecurityscanner.v1beta.ListFindingsResponse"U\x82\xd3\xe4\x93\x02?\x12=/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings\xda\x41\rparent,filter\x12\xf9\x01\n\x14ListFindingTypeStats\x12\x43.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest\x1a\x44.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse"V\x82\xd3\xe4\x93\x02G\x12\x45/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats\xda\x41\x06parent\x1aU\xca\x41!websecurityscanner.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xca\x01\n*com.google.cloud.websecurityscanner.v1betaB\x17WebSecurityScannerProtoP\x01ZXgoogle.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1betab\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_crawled__url__pb2.DESCRIPTOR, - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_finding__pb2.DESCRIPTOR, - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_finding__type__stats__pb2.DESCRIPTOR, - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__config__pb2.DESCRIPTOR, - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__pb2.DESCRIPTOR, - google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - ], -) - - -_CREATESCANCONFIGREQUEST = _descriptor.Descriptor( - name="CreateScanConfigRequest", - full_name="google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A-\n+cloudresourcemanager.googleapis.com/Project" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="scan_config", - full_name="google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest.scan_config", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=614, - serialized_end=786, -) - - -_DELETESCANCONFIGREQUEST = _descriptor.Descriptor( - name="DeleteScanConfigRequest", - full_name="google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A.\n,websecurityscanner.googleapis.com/ScanConfig" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=788, - serialized_end=881, -) - - -_GETSCANCONFIGREQUEST = _descriptor.Descriptor( - name="GetScanConfigRequest", - full_name="google.cloud.websecurityscanner.v1beta.GetScanConfigRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.websecurityscanner.v1beta.GetScanConfigRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A.\n,websecurityscanner.googleapis.com/ScanConfig" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=883, - serialized_end=973, -) - - -_LISTSCANCONFIGSREQUEST = _descriptor.Descriptor( - name="ListScanConfigsRequest", - full_name="google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A-\n+cloudresourcemanager.googleapis.com/Project" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest.page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest.page_size", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=976, - serialized_end=1108, -) - - -_UPDATESCANCONFIGREQUEST = _descriptor.Descriptor( - name="UpdateScanConfigRequest", - full_name="google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="scan_config", - full_name="google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest.scan_config", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest.update_mask", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1111, - serialized_end=1268, -) - - -_LISTSCANCONFIGSRESPONSE = _descriptor.Descriptor( - name="ListScanConfigsResponse", - full_name="google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="scan_configs", - full_name="google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse.scan_configs", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1270, - serialized_end=1394, -) - - -_STARTSCANRUNREQUEST = _descriptor.Descriptor( - name="StartScanRunRequest", - full_name="google.cloud.websecurityscanner.v1beta.StartScanRunRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.websecurityscanner.v1beta.StartScanRunRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A.\n,websecurityscanner.googleapis.com/ScanConfig" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1396, - serialized_end=1485, -) - - -_GETSCANRUNREQUEST = _descriptor.Descriptor( - name="GetScanRunRequest", - full_name="google.cloud.websecurityscanner.v1beta.GetScanRunRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.websecurityscanner.v1beta.GetScanRunRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A+\n)websecurityscanner.googleapis.com/ScanRun" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1487, - serialized_end=1571, -) - - -_LISTSCANRUNSREQUEST = _descriptor.Descriptor( - name="ListScanRunsRequest", - full_name="google.cloud.websecurityscanner.v1beta.ListScanRunsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.websecurityscanner.v1beta.ListScanRunsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A.\n,websecurityscanner.googleapis.com/ScanConfig" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.websecurityscanner.v1beta.ListScanRunsRequest.page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.websecurityscanner.v1beta.ListScanRunsRequest.page_size", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1574, - serialized_end=1704, -) - - -_LISTSCANRUNSRESPONSE = _descriptor.Descriptor( - name="ListScanRunsResponse", - full_name="google.cloud.websecurityscanner.v1beta.ListScanRunsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="scan_runs", - full_name="google.cloud.websecurityscanner.v1beta.ListScanRunsResponse.scan_runs", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.websecurityscanner.v1beta.ListScanRunsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1706, - serialized_end=1821, -) - - -_STOPSCANRUNREQUEST = _descriptor.Descriptor( - name="StopScanRunRequest", - full_name="google.cloud.websecurityscanner.v1beta.StopScanRunRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.websecurityscanner.v1beta.StopScanRunRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A+\n)websecurityscanner.googleapis.com/ScanRun" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1823, - serialized_end=1908, -) - - -_LISTCRAWLEDURLSREQUEST = _descriptor.Descriptor( - name="ListCrawledUrlsRequest", - full_name="google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A+\n)websecurityscanner.googleapis.com/ScanRun" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest.page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest.page_size", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1911, - serialized_end=2041, -) - - -_LISTCRAWLEDURLSRESPONSE = _descriptor.Descriptor( - name="ListCrawledUrlsResponse", - full_name="google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="crawled_urls", - full_name="google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse.crawled_urls", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2043, - serialized_end=2167, -) - - -_GETFINDINGREQUEST = _descriptor.Descriptor( - name="GetFindingRequest", - full_name="google.cloud.websecurityscanner.v1beta.GetFindingRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.websecurityscanner.v1beta.GetFindingRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A+\n)websecurityscanner.googleapis.com/Finding" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2169, - serialized_end=2253, -) - - -_LISTFINDINGSREQUEST = _descriptor.Descriptor( - name="ListFindingsRequest", - full_name="google.cloud.websecurityscanner.v1beta.ListFindingsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.websecurityscanner.v1beta.ListFindingsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A+\n)websecurityscanner.googleapis.com/ScanRun" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.websecurityscanner.v1beta.ListFindingsRequest.filter", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.websecurityscanner.v1beta.ListFindingsRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.websecurityscanner.v1beta.ListFindingsRequest.page_size", - index=3, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2256, - serialized_end=2404, -) - - -_LISTFINDINGSRESPONSE = _descriptor.Descriptor( - name="ListFindingsResponse", - full_name="google.cloud.websecurityscanner.v1beta.ListFindingsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="findings", - full_name="google.cloud.websecurityscanner.v1beta.ListFindingsResponse.findings", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.websecurityscanner.v1beta.ListFindingsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2406, - serialized_end=2520, -) - - -_LISTFINDINGTYPESTATSREQUEST = _descriptor.Descriptor( - name="ListFindingTypeStatsRequest", - full_name="google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A+\n)websecurityscanner.googleapis.com/ScanRun" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2522, - serialized_end=2618, -) - - -_LISTFINDINGTYPESTATSRESPONSE = _descriptor.Descriptor( - name="ListFindingTypeStatsResponse", - full_name="google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="finding_type_stats", - full_name="google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse.finding_type_stats", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2620, - serialized_end=2736, -) - -_CREATESCANCONFIGREQUEST.fields_by_name[ - "scan_config" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__config__pb2._SCANCONFIG -) -_UPDATESCANCONFIGREQUEST.fields_by_name[ - "scan_config" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__config__pb2._SCANCONFIG -) -_UPDATESCANCONFIGREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_LISTSCANCONFIGSRESPONSE.fields_by_name[ - "scan_configs" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__config__pb2._SCANCONFIG -) -_LISTSCANRUNSRESPONSE.fields_by_name[ - "scan_runs" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__pb2._SCANRUN -) -_LISTCRAWLEDURLSRESPONSE.fields_by_name[ - "crawled_urls" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_crawled__url__pb2._CRAWLEDURL -) -_LISTFINDINGSRESPONSE.fields_by_name[ - "findings" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_finding__pb2._FINDING -) -_LISTFINDINGTYPESTATSRESPONSE.fields_by_name[ - "finding_type_stats" -].message_type = ( - google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_finding__type__stats__pb2._FINDINGTYPESTATS -) -DESCRIPTOR.message_types_by_name["CreateScanConfigRequest"] = _CREATESCANCONFIGREQUEST -DESCRIPTOR.message_types_by_name["DeleteScanConfigRequest"] = _DELETESCANCONFIGREQUEST -DESCRIPTOR.message_types_by_name["GetScanConfigRequest"] = _GETSCANCONFIGREQUEST -DESCRIPTOR.message_types_by_name["ListScanConfigsRequest"] = _LISTSCANCONFIGSREQUEST -DESCRIPTOR.message_types_by_name["UpdateScanConfigRequest"] = _UPDATESCANCONFIGREQUEST -DESCRIPTOR.message_types_by_name["ListScanConfigsResponse"] = _LISTSCANCONFIGSRESPONSE -DESCRIPTOR.message_types_by_name["StartScanRunRequest"] = _STARTSCANRUNREQUEST -DESCRIPTOR.message_types_by_name["GetScanRunRequest"] = _GETSCANRUNREQUEST -DESCRIPTOR.message_types_by_name["ListScanRunsRequest"] = _LISTSCANRUNSREQUEST -DESCRIPTOR.message_types_by_name["ListScanRunsResponse"] = _LISTSCANRUNSRESPONSE -DESCRIPTOR.message_types_by_name["StopScanRunRequest"] = _STOPSCANRUNREQUEST -DESCRIPTOR.message_types_by_name["ListCrawledUrlsRequest"] = _LISTCRAWLEDURLSREQUEST -DESCRIPTOR.message_types_by_name["ListCrawledUrlsResponse"] = _LISTCRAWLEDURLSRESPONSE -DESCRIPTOR.message_types_by_name["GetFindingRequest"] = _GETFINDINGREQUEST -DESCRIPTOR.message_types_by_name["ListFindingsRequest"] = _LISTFINDINGSREQUEST -DESCRIPTOR.message_types_by_name["ListFindingsResponse"] = _LISTFINDINGSRESPONSE -DESCRIPTOR.message_types_by_name[ - "ListFindingTypeStatsRequest" -] = _LISTFINDINGTYPESTATSREQUEST -DESCRIPTOR.message_types_by_name[ - "ListFindingTypeStatsResponse" -] = _LISTFINDINGTYPESTATSRESPONSE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -CreateScanConfigRequest = _reflection.GeneratedProtocolMessageType( - "CreateScanConfigRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATESCANCONFIGREQUEST, - __module__="google.cloud.websecurityscanner_v1beta.proto.web_security_scanner_pb2", - __doc__="""Request for the ``CreateScanConfig`` method. - - - Attributes: - parent: - Required. The parent resource name where the scan is created, - which should be a project resource name in the format - 'projects/{projectId}'. - scan_config: - Required. The ScanConfig to be created. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest) - ), -) -_sym_db.RegisterMessage(CreateScanConfigRequest) - -DeleteScanConfigRequest = _reflection.GeneratedProtocolMessageType( - "DeleteScanConfigRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETESCANCONFIGREQUEST, - __module__="google.cloud.websecurityscanner_v1beta.proto.web_security_scanner_pb2", - __doc__="""Request for the ``DeleteScanConfig`` method. - - - Attributes: - name: - Required. The resource name of the ScanConfig to be deleted. - The name follows the format of - 'projects/{projectId}/scanConfigs/{scanConfigId}'. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest) - ), -) -_sym_db.RegisterMessage(DeleteScanConfigRequest) - -GetScanConfigRequest = _reflection.GeneratedProtocolMessageType( - "GetScanConfigRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETSCANCONFIGREQUEST, - __module__="google.cloud.websecurityscanner_v1beta.proto.web_security_scanner_pb2", - __doc__="""Request for the ``GetScanConfig`` method. - - - Attributes: - name: - Required. The resource name of the ScanConfig to be returned. - The name follows the format of - 'projects/{projectId}/scanConfigs/{scanConfigId}'. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.GetScanConfigRequest) - ), -) -_sym_db.RegisterMessage(GetScanConfigRequest) - -ListScanConfigsRequest = _reflection.GeneratedProtocolMessageType( - "ListScanConfigsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTSCANCONFIGSREQUEST, - __module__="google.cloud.websecurityscanner_v1beta.proto.web_security_scanner_pb2", - __doc__="""Request for the ``ListScanConfigs`` method. - - - Attributes: - parent: - Required. The parent resource name, which should be a project - resource name in the format 'projects/{projectId}'. - page_token: - A token identifying a page of results to be returned. This - should be a ``next_page_token`` value returned from a previous - List request. If unspecified, the first page of results is - returned. - page_size: - The maximum number of ScanConfigs to return, can be limited by - server. If not specified or not positive, the implementation - will select a reasonable value. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest) - ), -) -_sym_db.RegisterMessage(ListScanConfigsRequest) - -UpdateScanConfigRequest = _reflection.GeneratedProtocolMessageType( - "UpdateScanConfigRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATESCANCONFIGREQUEST, - __module__="google.cloud.websecurityscanner_v1beta.proto.web_security_scanner_pb2", - __doc__="""Request for the ``UpdateScanConfigRequest`` method. - - - Attributes: - scan_config: - Required. The ScanConfig to be updated. The name field must be - set to identify the resource to be updated. The values of - fields not covered by the mask will be ignored. - update_mask: - Required. The update mask applies to the resource. For the - ``FieldMask`` definition, see - https://developers.google.com/protocol- - buffers/docs/reference/google.protobuf#fieldmask - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest) - ), -) -_sym_db.RegisterMessage(UpdateScanConfigRequest) - -ListScanConfigsResponse = _reflection.GeneratedProtocolMessageType( - "ListScanConfigsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTSCANCONFIGSRESPONSE, - __module__="google.cloud.websecurityscanner_v1beta.proto.web_security_scanner_pb2", - __doc__="""Response for the ``ListScanConfigs`` method. - - - Attributes: - scan_configs: - The list of ScanConfigs returned. - next_page_token: - Token to retrieve the next page of results, or empty if there - are no more results in the list. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse) - ), -) -_sym_db.RegisterMessage(ListScanConfigsResponse) - -StartScanRunRequest = _reflection.GeneratedProtocolMessageType( - "StartScanRunRequest", - (_message.Message,), - dict( - DESCRIPTOR=_STARTSCANRUNREQUEST, - __module__="google.cloud.websecurityscanner_v1beta.proto.web_security_scanner_pb2", - __doc__="""Request for the ``StartScanRun`` method. - - - Attributes: - name: - Required. The resource name of the ScanConfig to be used. The - name follows the format of - 'projects/{projectId}/scanConfigs/{scanConfigId}'. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.StartScanRunRequest) - ), -) -_sym_db.RegisterMessage(StartScanRunRequest) - -GetScanRunRequest = _reflection.GeneratedProtocolMessageType( - "GetScanRunRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETSCANRUNREQUEST, - __module__="google.cloud.websecurityscanner_v1beta.proto.web_security_scanner_pb2", - __doc__="""Request for the ``GetScanRun`` method. - - - Attributes: - name: - Required. The resource name of the ScanRun to be returned. The - name follows the format of 'projects/{projectId}/scanConfigs/{ - scanConfigId}/scanRuns/{scanRunId}'. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.GetScanRunRequest) - ), -) -_sym_db.RegisterMessage(GetScanRunRequest) - -ListScanRunsRequest = _reflection.GeneratedProtocolMessageType( - "ListScanRunsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTSCANRUNSREQUEST, - __module__="google.cloud.websecurityscanner_v1beta.proto.web_security_scanner_pb2", - __doc__="""Request for the ``ListScanRuns`` method. - - - Attributes: - parent: - Required. The parent resource name, which should be a scan - resource name in the format - 'projects/{projectId}/scanConfigs/{scanConfigId}'. - page_token: - A token identifying a page of results to be returned. This - should be a ``next_page_token`` value returned from a previous - List request. If unspecified, the first page of results is - returned. - page_size: - The maximum number of ScanRuns to return, can be limited by - server. If not specified or not positive, the implementation - will select a reasonable value. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ListScanRunsRequest) - ), -) -_sym_db.RegisterMessage(ListScanRunsRequest) - -ListScanRunsResponse = _reflection.GeneratedProtocolMessageType( - "ListScanRunsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTSCANRUNSRESPONSE, - __module__="google.cloud.websecurityscanner_v1beta.proto.web_security_scanner_pb2", - __doc__="""Response for the ``ListScanRuns`` method. - - - Attributes: - scan_runs: - The list of ScanRuns returned. - next_page_token: - Token to retrieve the next page of results, or empty if there - are no more results in the list. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ListScanRunsResponse) - ), -) -_sym_db.RegisterMessage(ListScanRunsResponse) - -StopScanRunRequest = _reflection.GeneratedProtocolMessageType( - "StopScanRunRequest", - (_message.Message,), - dict( - DESCRIPTOR=_STOPSCANRUNREQUEST, - __module__="google.cloud.websecurityscanner_v1beta.proto.web_security_scanner_pb2", - __doc__="""Request for the ``StopScanRun`` method. - - - Attributes: - name: - Required. The resource name of the ScanRun to be stopped. The - name follows the format of 'projects/{projectId}/scanConfigs/{ - scanConfigId}/scanRuns/{scanRunId}'. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.StopScanRunRequest) - ), -) -_sym_db.RegisterMessage(StopScanRunRequest) - -ListCrawledUrlsRequest = _reflection.GeneratedProtocolMessageType( - "ListCrawledUrlsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTCRAWLEDURLSREQUEST, - __module__="google.cloud.websecurityscanner_v1beta.proto.web_security_scanner_pb2", - __doc__="""Request for the ``ListCrawledUrls`` method. - - - Attributes: - parent: - Required. The parent resource name, which should be a scan run - resource name in the format 'projects/{projectId}/scanConfigs/ - {scanConfigId}/scanRuns/{scanRunId}'. - page_token: - A token identifying a page of results to be returned. This - should be a ``next_page_token`` value returned from a previous - List request. If unspecified, the first page of results is - returned. - page_size: - The maximum number of CrawledUrls to return, can be limited by - server. If not specified or not positive, the implementation - will select a reasonable value. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest) - ), -) -_sym_db.RegisterMessage(ListCrawledUrlsRequest) - -ListCrawledUrlsResponse = _reflection.GeneratedProtocolMessageType( - "ListCrawledUrlsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTCRAWLEDURLSRESPONSE, - __module__="google.cloud.websecurityscanner_v1beta.proto.web_security_scanner_pb2", - __doc__="""Response for the ``ListCrawledUrls`` method. - - - Attributes: - crawled_urls: - The list of CrawledUrls returned. - next_page_token: - Token to retrieve the next page of results, or empty if there - are no more results in the list. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse) - ), -) -_sym_db.RegisterMessage(ListCrawledUrlsResponse) - -GetFindingRequest = _reflection.GeneratedProtocolMessageType( - "GetFindingRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETFINDINGREQUEST, - __module__="google.cloud.websecurityscanner_v1beta.proto.web_security_scanner_pb2", - __doc__="""Request for the ``GetFinding`` method. - - - Attributes: - name: - Required. The resource name of the Finding to be returned. The - name follows the format of 'projects/{projectId}/scanConfigs/{ - scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.GetFindingRequest) - ), -) -_sym_db.RegisterMessage(GetFindingRequest) - -ListFindingsRequest = _reflection.GeneratedProtocolMessageType( - "ListFindingsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTFINDINGSREQUEST, - __module__="google.cloud.websecurityscanner_v1beta.proto.web_security_scanner_pb2", - __doc__="""Request for the ``ListFindings`` method. - - - Attributes: - parent: - Required. The parent resource name, which should be a scan run - resource name in the format 'projects/{projectId}/scanConfigs/ - {scanConfigId}/scanRuns/{scanRunId}'. - filter: - Required. The filter expression. The expression must be in the - format: . Supported field: 'finding\_type'. Supported - operator: '='. - page_token: - A token identifying a page of results to be returned. This - should be a ``next_page_token`` value returned from a previous - List request. If unspecified, the first page of results is - returned. - page_size: - The maximum number of Findings to return, can be limited by - server. If not specified or not positive, the implementation - will select a reasonable value. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ListFindingsRequest) - ), -) -_sym_db.RegisterMessage(ListFindingsRequest) - -ListFindingsResponse = _reflection.GeneratedProtocolMessageType( - "ListFindingsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTFINDINGSRESPONSE, - __module__="google.cloud.websecurityscanner_v1beta.proto.web_security_scanner_pb2", - __doc__="""Response for the ``ListFindings`` method. - - - Attributes: - findings: - The list of Findings returned. - next_page_token: - Token to retrieve the next page of results, or empty if there - are no more results in the list. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ListFindingsResponse) - ), -) -_sym_db.RegisterMessage(ListFindingsResponse) - -ListFindingTypeStatsRequest = _reflection.GeneratedProtocolMessageType( - "ListFindingTypeStatsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTFINDINGTYPESTATSREQUEST, - __module__="google.cloud.websecurityscanner_v1beta.proto.web_security_scanner_pb2", - __doc__="""Request for the ``ListFindingTypeStats`` method. - - - Attributes: - parent: - Required. The parent resource name, which should be a scan run - resource name in the format 'projects/{projectId}/scanConfigs/ - {scanConfigId}/scanRuns/{scanRunId}'. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest) - ), -) -_sym_db.RegisterMessage(ListFindingTypeStatsRequest) - -ListFindingTypeStatsResponse = _reflection.GeneratedProtocolMessageType( - "ListFindingTypeStatsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTFINDINGTYPESTATSRESPONSE, - __module__="google.cloud.websecurityscanner_v1beta.proto.web_security_scanner_pb2", - __doc__="""Response for the ``ListFindingTypeStats`` method. - - - Attributes: - finding_type_stats: - The list of FindingTypeStats returned. - """, - # @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse) - ), -) -_sym_db.RegisterMessage(ListFindingTypeStatsResponse) - - -DESCRIPTOR._options = None -_CREATESCANCONFIGREQUEST.fields_by_name["parent"]._options = None -_CREATESCANCONFIGREQUEST.fields_by_name["scan_config"]._options = None -_DELETESCANCONFIGREQUEST.fields_by_name["name"]._options = None -_GETSCANCONFIGREQUEST.fields_by_name["name"]._options = None -_LISTSCANCONFIGSREQUEST.fields_by_name["parent"]._options = None -_UPDATESCANCONFIGREQUEST.fields_by_name["scan_config"]._options = None -_UPDATESCANCONFIGREQUEST.fields_by_name["update_mask"]._options = None -_STARTSCANRUNREQUEST.fields_by_name["name"]._options = None -_GETSCANRUNREQUEST.fields_by_name["name"]._options = None -_LISTSCANRUNSREQUEST.fields_by_name["parent"]._options = None -_STOPSCANRUNREQUEST.fields_by_name["name"]._options = None -_LISTCRAWLEDURLSREQUEST.fields_by_name["parent"]._options = None -_GETFINDINGREQUEST.fields_by_name["name"]._options = None -_LISTFINDINGSREQUEST.fields_by_name["parent"]._options = None -_LISTFINDINGSREQUEST.fields_by_name["filter"]._options = None -_LISTFINDINGTYPESTATSREQUEST.fields_by_name["parent"]._options = None - -_WEBSECURITYSCANNER = _descriptor.ServiceDescriptor( - name="WebSecurityScanner", - full_name="google.cloud.websecurityscanner.v1beta.WebSecurityScanner", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A!websecurityscanner.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=2739, - serialized_end=5569, - methods=[ - _descriptor.MethodDescriptor( - name="CreateScanConfig", - full_name="google.cloud.websecurityscanner.v1beta.WebSecurityScanner.CreateScanConfig", - index=0, - containing_service=None, - input_type=_CREATESCANCONFIGREQUEST, - output_type=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__config__pb2._SCANCONFIG, - serialized_options=_b( - "\202\323\344\223\0026\"'/v1beta/{parent=projects/*}/scanConfigs:\013scan_config\332A\022parent,scan_config" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteScanConfig", - full_name="google.cloud.websecurityscanner.v1beta.WebSecurityScanner.DeleteScanConfig", - index=1, - containing_service=None, - input_type=_DELETESCANCONFIGREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002)*'/v1beta/{name=projects/*/scanConfigs/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="GetScanConfig", - full_name="google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetScanConfig", - index=2, - containing_service=None, - input_type=_GETSCANCONFIGREQUEST, - output_type=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__config__pb2._SCANCONFIG, - serialized_options=_b( - "\202\323\344\223\002)\022'/v1beta/{name=projects/*/scanConfigs/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ListScanConfigs", - full_name="google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListScanConfigs", - index=3, - containing_service=None, - input_type=_LISTSCANCONFIGSREQUEST, - output_type=_LISTSCANCONFIGSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002)\022'/v1beta/{parent=projects/*}/scanConfigs\332A\006parent" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateScanConfig", - full_name="google.cloud.websecurityscanner.v1beta.WebSecurityScanner.UpdateScanConfig", - index=4, - containing_service=None, - input_type=_UPDATESCANCONFIGREQUEST, - output_type=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__config__pb2._SCANCONFIG, - serialized_options=_b( - "\202\323\344\223\002B23/v1beta/{scan_config.name=projects/*/scanConfigs/*}:\013scan_config\332A\027scan_config,update_mask" - ), - ), - _descriptor.MethodDescriptor( - name="StartScanRun", - full_name="google.cloud.websecurityscanner.v1beta.WebSecurityScanner.StartScanRun", - index=5, - containing_service=None, - input_type=_STARTSCANRUNREQUEST, - output_type=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__pb2._SCANRUN, - serialized_options=_b( - '\202\323\344\223\0022"-/v1beta/{name=projects/*/scanConfigs/*}:start:\001*\332A\004name' - ), - ), - _descriptor.MethodDescriptor( - name="GetScanRun", - full_name="google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetScanRun", - index=6, - containing_service=None, - input_type=_GETSCANRUNREQUEST, - output_type=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__pb2._SCANRUN, - serialized_options=_b( - "\202\323\344\223\0024\0222/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ListScanRuns", - full_name="google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListScanRuns", - index=7, - containing_service=None, - input_type=_LISTSCANRUNSREQUEST, - output_type=_LISTSCANRUNSRESPONSE, - serialized_options=_b( - "\202\323\344\223\0024\0222/v1beta/{parent=projects/*/scanConfigs/*}/scanRuns\332A\006parent" - ), - ), - _descriptor.MethodDescriptor( - name="StopScanRun", - full_name="google.cloud.websecurityscanner.v1beta.WebSecurityScanner.StopScanRun", - index=8, - containing_service=None, - input_type=_STOPSCANRUNREQUEST, - output_type=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__pb2._SCANRUN, - serialized_options=_b( - '\202\323\344\223\002<"7/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}:stop:\001*\332A\004name' - ), - ), - _descriptor.MethodDescriptor( - name="ListCrawledUrls", - full_name="google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListCrawledUrls", - index=9, - containing_service=None, - input_type=_LISTCRAWLEDURLSREQUEST, - output_type=_LISTCRAWLEDURLSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002B\022@/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls\332A\006parent" - ), - ), - _descriptor.MethodDescriptor( - name="GetFinding", - full_name="google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetFinding", - index=10, - containing_service=None, - input_type=_GETFINDINGREQUEST, - output_type=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_finding__pb2._FINDING, - serialized_options=_b( - "\202\323\344\223\002?\022=/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ListFindings", - full_name="google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListFindings", - index=11, - containing_service=None, - input_type=_LISTFINDINGSREQUEST, - output_type=_LISTFINDINGSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002?\022=/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings\332A\rparent,filter" - ), - ), - _descriptor.MethodDescriptor( - name="ListFindingTypeStats", - full_name="google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListFindingTypeStats", - index=12, - containing_service=None, - input_type=_LISTFINDINGTYPESTATSREQUEST, - output_type=_LISTFINDINGTYPESTATSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002G\022E/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats\332A\006parent" - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_WEBSECURITYSCANNER) - -DESCRIPTOR.services_by_name["WebSecurityScanner"] = _WEBSECURITYSCANNER - -# @@protoc_insertion_point(module_scope) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/web_security_scanner_pb2_grpc.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/web_security_scanner_pb2_grpc.py deleted file mode 100644 index 172dfb8bd526..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/proto/web_security_scanner_pb2_grpc.py +++ /dev/null @@ -1,268 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.websecurityscanner_v1beta.proto import ( - finding_pb2 as google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_finding__pb2, -) -from google.cloud.websecurityscanner_v1beta.proto import ( - scan_config_pb2 as google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__config__pb2, -) -from google.cloud.websecurityscanner_v1beta.proto import ( - scan_run_pb2 as google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__pb2, -) -from google.cloud.websecurityscanner_v1beta.proto import ( - web_security_scanner_pb2 as google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class WebSecurityScannerStub(object): - """Cloud Web Security Scanner Service identifies security vulnerabilities in web - applications hosted on Google Cloud Platform. It crawls your application, and - attempts to exercise as many user inputs and event handlers as possible. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateScanConfig = channel.unary_unary( - "/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/CreateScanConfig", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.CreateScanConfigRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__config__pb2.ScanConfig.FromString, - ) - self.DeleteScanConfig = channel.unary_unary( - "/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/DeleteScanConfig", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.DeleteScanConfigRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.GetScanConfig = channel.unary_unary( - "/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/GetScanConfig", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.GetScanConfigRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__config__pb2.ScanConfig.FromString, - ) - self.ListScanConfigs = channel.unary_unary( - "/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListScanConfigs", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListScanConfigsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListScanConfigsResponse.FromString, - ) - self.UpdateScanConfig = channel.unary_unary( - "/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/UpdateScanConfig", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.UpdateScanConfigRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__config__pb2.ScanConfig.FromString, - ) - self.StartScanRun = channel.unary_unary( - "/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/StartScanRun", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.StartScanRunRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__pb2.ScanRun.FromString, - ) - self.GetScanRun = channel.unary_unary( - "/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/GetScanRun", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.GetScanRunRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__pb2.ScanRun.FromString, - ) - self.ListScanRuns = channel.unary_unary( - "/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListScanRuns", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListScanRunsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListScanRunsResponse.FromString, - ) - self.StopScanRun = channel.unary_unary( - "/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/StopScanRun", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.StopScanRunRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__pb2.ScanRun.FromString, - ) - self.ListCrawledUrls = channel.unary_unary( - "/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListCrawledUrls", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListCrawledUrlsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListCrawledUrlsResponse.FromString, - ) - self.GetFinding = channel.unary_unary( - "/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/GetFinding", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.GetFindingRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_finding__pb2.Finding.FromString, - ) - self.ListFindings = channel.unary_unary( - "/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListFindings", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListFindingsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListFindingsResponse.FromString, - ) - self.ListFindingTypeStats = channel.unary_unary( - "/google.cloud.websecurityscanner.v1beta.WebSecurityScanner/ListFindingTypeStats", - request_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListFindingTypeStatsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListFindingTypeStatsResponse.FromString, - ) - - -class WebSecurityScannerServicer(object): - """Cloud Web Security Scanner Service identifies security vulnerabilities in web - applications hosted on Google Cloud Platform. It crawls your application, and - attempts to exercise as many user inputs and event handlers as possible. - """ - - def CreateScanConfig(self, request, context): - """Creates a new ScanConfig. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteScanConfig(self, request, context): - """Deletes an existing ScanConfig and its child resources. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetScanConfig(self, request, context): - """Gets a ScanConfig. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListScanConfigs(self, request, context): - """Lists ScanConfigs under a given project. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateScanConfig(self, request, context): - """Updates a ScanConfig. This method support partial update of a ScanConfig. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def StartScanRun(self, request, context): - """Start a ScanRun according to the given ScanConfig. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetScanRun(self, request, context): - """Gets a ScanRun. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListScanRuns(self, request, context): - """Lists ScanRuns under a given ScanConfig, in descending order of ScanRun - stop time. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def StopScanRun(self, request, context): - """Stops a ScanRun. The stopped ScanRun is returned. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListCrawledUrls(self, request, context): - """List CrawledUrls under a given ScanRun. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetFinding(self, request, context): - """Gets a Finding. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListFindings(self, request, context): - """List Findings under a given ScanRun. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListFindingTypeStats(self, request, context): - """List all FindingTypeStats under a given ScanRun. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_WebSecurityScannerServicer_to_server(servicer, server): - rpc_method_handlers = { - "CreateScanConfig": grpc.unary_unary_rpc_method_handler( - servicer.CreateScanConfig, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.CreateScanConfigRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__config__pb2.ScanConfig.SerializeToString, - ), - "DeleteScanConfig": grpc.unary_unary_rpc_method_handler( - servicer.DeleteScanConfig, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.DeleteScanConfigRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "GetScanConfig": grpc.unary_unary_rpc_method_handler( - servicer.GetScanConfig, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.GetScanConfigRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__config__pb2.ScanConfig.SerializeToString, - ), - "ListScanConfigs": grpc.unary_unary_rpc_method_handler( - servicer.ListScanConfigs, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListScanConfigsRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListScanConfigsResponse.SerializeToString, - ), - "UpdateScanConfig": grpc.unary_unary_rpc_method_handler( - servicer.UpdateScanConfig, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.UpdateScanConfigRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__config__pb2.ScanConfig.SerializeToString, - ), - "StartScanRun": grpc.unary_unary_rpc_method_handler( - servicer.StartScanRun, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.StartScanRunRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__pb2.ScanRun.SerializeToString, - ), - "GetScanRun": grpc.unary_unary_rpc_method_handler( - servicer.GetScanRun, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.GetScanRunRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__pb2.ScanRun.SerializeToString, - ), - "ListScanRuns": grpc.unary_unary_rpc_method_handler( - servicer.ListScanRuns, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListScanRunsRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListScanRunsResponse.SerializeToString, - ), - "StopScanRun": grpc.unary_unary_rpc_method_handler( - servicer.StopScanRun, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.StopScanRunRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_scan__run__pb2.ScanRun.SerializeToString, - ), - "ListCrawledUrls": grpc.unary_unary_rpc_method_handler( - servicer.ListCrawledUrls, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListCrawledUrlsRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListCrawledUrlsResponse.SerializeToString, - ), - "GetFinding": grpc.unary_unary_rpc_method_handler( - servicer.GetFinding, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.GetFindingRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_finding__pb2.Finding.SerializeToString, - ), - "ListFindings": grpc.unary_unary_rpc_method_handler( - servicer.ListFindings, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListFindingsRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListFindingsResponse.SerializeToString, - ), - "ListFindingTypeStats": grpc.unary_unary_rpc_method_handler( - servicer.ListFindingTypeStats, - request_deserializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListFindingTypeStatsRequest.FromString, - response_serializer=google_dot_cloud_dot_websecurityscanner__v1beta_dot_proto_dot_web__security__scanner__pb2.ListFindingTypeStatsResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.websecurityscanner.v1beta.WebSecurityScanner", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1beta/types.py b/websecurityscanner/google/cloud/websecurityscanner_v1beta/types.py deleted file mode 100644 index ad3a32e344a0..000000000000 --- a/websecurityscanner/google/cloud/websecurityscanner_v1beta/types.py +++ /dev/null @@ -1,66 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.websecurityscanner_v1beta.proto import crawled_url_pb2 -from google.cloud.websecurityscanner_v1beta.proto import finding_addon_pb2 -from google.cloud.websecurityscanner_v1beta.proto import finding_pb2 -from google.cloud.websecurityscanner_v1beta.proto import finding_type_stats_pb2 -from google.cloud.websecurityscanner_v1beta.proto import scan_config_error_pb2 -from google.cloud.websecurityscanner_v1beta.proto import scan_config_pb2 -from google.cloud.websecurityscanner_v1beta.proto import scan_run_error_trace_pb2 -from google.cloud.websecurityscanner_v1beta.proto import scan_run_pb2 -from google.cloud.websecurityscanner_v1beta.proto import scan_run_warning_trace_pb2 -from google.cloud.websecurityscanner_v1beta.proto import web_security_scanner_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 -from google.protobuf import timestamp_pb2 - - -_shared_modules = [empty_pb2, field_mask_pb2, timestamp_pb2] - -_local_modules = [ - crawled_url_pb2, - finding_addon_pb2, - finding_pb2, - finding_type_stats_pb2, - scan_config_error_pb2, - scan_config_pb2, - scan_run_error_trace_pb2, - scan_run_pb2, - scan_run_warning_trace_pb2, - web_security_scanner_pb2, -] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.websecurityscanner_v1beta.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/websecurityscanner/noxfile.py b/websecurityscanner/noxfile.py deleted file mode 100644 index 7949a4e3925a..000000000000 --- a/websecurityscanner/noxfile.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/websecurityscanner/setup.cfg b/websecurityscanner/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/websecurityscanner/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/websecurityscanner/setup.py b/websecurityscanner/setup.py deleted file mode 100644 index c218c522f91c..000000000000 --- a/websecurityscanner/setup.py +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import io -import os - -import setuptools - - -# Package metadata. - -name = "google-cloud-websecurityscanner" -description = ("Google Cloud Web Security Scanner API client library",) -version = "0.3.0" -# Should be one of: -# 'Development Status :: 3 - Alpha' -# 'Development Status :: 4 - Beta' -# 'Development Status :: 5 - Production/Stable' -release_status = "Development Status :: 3 - Alpha" -dependencies = ["google-api-core[grpc] >= 1.14.0, < 2.0.0dev"] - -extras = {} - - -# Setup boilerplate below this line. - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -# Only include packages under the 'google' namespace. Do not include tests, -# benchmarks, etc. -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -# Determine which namespaces are needed. -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") - - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/GoogleCloudPlatform/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "Development Status :: 3 - Alpha", - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - extras_require=extras, - python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", - include_package_data=True, - zip_safe=False, -) diff --git a/websecurityscanner/synth.metadata b/websecurityscanner/synth.metadata deleted file mode 100644 index 9d294197e99b..000000000000 --- a/websecurityscanner/synth.metadata +++ /dev/null @@ -1,340 +0,0 @@ -{ - "updateTime": "2020-01-30T13:47:11.288804Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c1246a29e22b0f98e800a536b5b0da2d933a55f2", - "internalRef": "292310790", - "log": "c1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\n" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "websecurityscanner", - "apiVersion": "v1alpha", - "language": "python", - "generator": "gapic", - "config": "google/cloud/websecurityscanner/artman_websecurityscanner_v1alpha.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "websecurityscanner", - "apiVersion": "v1beta", - "language": "python", - "generator": "gapic", - "config": "google/cloud/websecurityscanner/artman_websecurityscanner_v1beta.yaml" - } - } - ], - "newFiles": [ - { - "path": ".coveragerc" - }, - { - "path": ".flake8" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "LICENSE" - }, - { - "path": "MANIFEST.in" - }, - { - "path": "README.rst" - }, - { - "path": "docs/README.rst" - }, - { - "path": "docs/_static/custom.css" - }, - { - "path": "docs/_templates/layout.html" - }, - { - "path": "docs/changelog.md" - }, - { - "path": "docs/conf.py" - }, - { - "path": "docs/gapic/v1alpha/api.rst" - }, - { - "path": "docs/gapic/v1alpha/types.rst" - }, - { - "path": "docs/gapic/v1beta/api.rst" - }, - { - "path": "docs/gapic/v1beta/types.rst" - }, - { - "path": "docs/index.rst" - }, - { - "path": "google/__init__.py" - }, - { - "path": "google/cloud/__init__.py" - }, - { - "path": "google/cloud/websecurityscanner.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/__init__.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/gapic/__init__.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/gapic/enums.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/gapic/transports/web_security_scanner_grpc_transport.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client_config.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/__init__.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/crawled_url.proto" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/crawled_url_pb2.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/crawled_url_pb2_grpc.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/finding.proto" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/finding_addon.proto" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/finding_addon_pb2.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/finding_addon_pb2_grpc.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/finding_pb2.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/finding_pb2_grpc.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/finding_type_stats.proto" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/finding_type_stats_pb2.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/finding_type_stats_pb2_grpc.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/scan_config.proto" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/scan_config_pb2.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/scan_config_pb2_grpc.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/scan_run.proto" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/scan_run_pb2.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/scan_run_pb2_grpc.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/web_security_scanner.proto" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/web_security_scanner_pb2.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/proto/web_security_scanner_pb2_grpc.py" - }, - { - "path": "google/cloud/websecurityscanner_v1alpha/types.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/__init__.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/gapic/__init__.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/gapic/enums.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/gapic/transports/web_security_scanner_grpc_transport.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/gapic/web_security_scanner_client.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/gapic/web_security_scanner_client_config.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/__init__.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/crawled_url.proto" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/crawled_url_pb2.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/crawled_url_pb2_grpc.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/finding.proto" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/finding_addon.proto" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/finding_addon_pb2.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/finding_addon_pb2_grpc.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/finding_pb2.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/finding_pb2_grpc.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/finding_type_stats.proto" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/finding_type_stats_pb2.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/finding_type_stats_pb2_grpc.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/scan_config.proto" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/scan_config_error.proto" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/scan_config_error_pb2.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/scan_config_error_pb2_grpc.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/scan_config_pb2.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/scan_config_pb2_grpc.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/scan_run.proto" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/scan_run_error_trace.proto" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/scan_run_error_trace_pb2.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/scan_run_error_trace_pb2_grpc.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/scan_run_pb2.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/scan_run_pb2_grpc.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/scan_run_warning_trace.proto" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/scan_run_warning_trace_pb2.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/scan_run_warning_trace_pb2_grpc.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/web_security_scanner.proto" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/web_security_scanner_pb2.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/proto/web_security_scanner_pb2_grpc.py" - }, - { - "path": "google/cloud/websecurityscanner_v1beta/types.py" - }, - { - "path": "noxfile.py" - }, - { - "path": "setup.cfg" - }, - { - "path": "setup.py" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "tests/unit/gapic/v1alpha/test_web_security_scanner_client_v1alpha.py" - }, - { - "path": "tests/unit/gapic/v1beta/test_web_security_scanner_client_v1beta.py" - } - ] -} \ No newline at end of file diff --git a/websecurityscanner/synth.py b/websecurityscanner/synth.py deleted file mode 100644 index 32cd47f86efc..000000000000 --- a/websecurityscanner/synth.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated parts of this library.""" -import synthtool as s -from synthtool import gcp - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() - - -# ---------------------------------------------------------------------------- -# Generate websecurityscanner GAPIC layer -# ---------------------------------------------------------------------------- -versions = ["v1alpha", "v1beta"] - -for version in versions: - library = gapic.py_library( - "websecurityscanner", - version, - config_path=f"/google/cloud/websecurityscanner" - f"/artman_websecurityscanner_{version}.yaml", - artman_output_name=f"websecurityscanner-{version}", - include_protos=True, - ) - - s.move(library / f"google/cloud/websecurityscanner_{version}/proto") - s.move(library / f"google/cloud/websecurityscanner_{version}/gapic") - s.move(library / f"google/cloud/websecurityscanner_{version}/*.py") - s.move(library / f"docs/gapic/{version}") - s.move(library / f"tests/unit/gapic/{version}") - -s.move(library / "google/cloud/websecurityscanner.py") - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = common.py_library(unit_cov_level=97, cov_level=100) -s.move(templated_files) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/websecurityscanner/tests/unit/gapic/v1alpha/test_web_security_scanner_client_v1alpha.py b/websecurityscanner/tests/unit/gapic/v1alpha/test_web_security_scanner_client_v1alpha.py deleted file mode 100644 index e123b29ee680..000000000000 --- a/websecurityscanner/tests/unit/gapic/v1alpha/test_web_security_scanner_client_v1alpha.py +++ /dev/null @@ -1,677 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import websecurityscanner_v1alpha -from google.cloud.websecurityscanner_v1alpha.proto import crawled_url_pb2 -from google.cloud.websecurityscanner_v1alpha.proto import finding_pb2 -from google.cloud.websecurityscanner_v1alpha.proto import scan_config_pb2 -from google.cloud.websecurityscanner_v1alpha.proto import scan_run_pb2 -from google.cloud.websecurityscanner_v1alpha.proto import web_security_scanner_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestWebSecurityScannerClient(object): - def test_create_scan_config(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - max_qps = 844445913 - expected_response = { - "name": name, - "display_name": display_name, - "max_qps": max_qps, - } - expected_response = scan_config_pb2.ScanConfig(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - scan_config = {} - - response = client.create_scan_config(parent, scan_config) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.CreateScanConfigRequest( - parent=parent, scan_config=scan_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_scan_config_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup request - parent = client.project_path("[PROJECT]") - scan_config = {} - - with pytest.raises(CustomException): - client.create_scan_config(parent, scan_config) - - def test_delete_scan_config(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup Request - name = client.scan_config_path("[PROJECT]", "[SCAN_CONFIG]") - - client.delete_scan_config(name) - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.DeleteScanConfigRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_scan_config_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup request - name = client.scan_config_path("[PROJECT]", "[SCAN_CONFIG]") - - with pytest.raises(CustomException): - client.delete_scan_config(name) - - def test_get_scan_config(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - max_qps = 844445913 - expected_response = { - "name": name_2, - "display_name": display_name, - "max_qps": max_qps, - } - expected_response = scan_config_pb2.ScanConfig(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup Request - name = client.scan_config_path("[PROJECT]", "[SCAN_CONFIG]") - - response = client.get_scan_config(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.GetScanConfigRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_scan_config_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup request - name = client.scan_config_path("[PROJECT]", "[SCAN_CONFIG]") - - with pytest.raises(CustomException): - client.get_scan_config(name) - - def test_list_scan_configs(self): - # Setup Expected Response - next_page_token = "" - scan_configs_element = {} - scan_configs = [scan_configs_element] - expected_response = { - "next_page_token": next_page_token, - "scan_configs": scan_configs, - } - expected_response = web_security_scanner_pb2.ListScanConfigsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - - paged_list_response = client.list_scan_configs(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.scan_configs[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.ListScanConfigsRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_scan_configs_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup request - parent = client.project_path("[PROJECT]") - - paged_list_response = client.list_scan_configs(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_update_scan_config(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - max_qps = 844445913 - expected_response = { - "name": name, - "display_name": display_name, - "max_qps": max_qps, - } - expected_response = scan_config_pb2.ScanConfig(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup Request - scan_config = {} - update_mask = {} - - response = client.update_scan_config(scan_config, update_mask) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.UpdateScanConfigRequest( - scan_config=scan_config, update_mask=update_mask - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_scan_config_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup request - scan_config = {} - update_mask = {} - - with pytest.raises(CustomException): - client.update_scan_config(scan_config, update_mask) - - def test_start_scan_run(self): - # Setup Expected Response - name_2 = "name2-1052831874" - urls_crawled_count = 1749797253 - urls_tested_count = 1498664068 - has_vulnerabilities = False - progress_percent = 2137894861 - expected_response = { - "name": name_2, - "urls_crawled_count": urls_crawled_count, - "urls_tested_count": urls_tested_count, - "has_vulnerabilities": has_vulnerabilities, - "progress_percent": progress_percent, - } - expected_response = scan_run_pb2.ScanRun(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup Request - name = client.scan_config_path("[PROJECT]", "[SCAN_CONFIG]") - - response = client.start_scan_run(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.StartScanRunRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_start_scan_run_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup request - name = client.scan_config_path("[PROJECT]", "[SCAN_CONFIG]") - - with pytest.raises(CustomException): - client.start_scan_run(name) - - def test_get_scan_run(self): - # Setup Expected Response - name_2 = "name2-1052831874" - urls_crawled_count = 1749797253 - urls_tested_count = 1498664068 - has_vulnerabilities = False - progress_percent = 2137894861 - expected_response = { - "name": name_2, - "urls_crawled_count": urls_crawled_count, - "urls_tested_count": urls_tested_count, - "has_vulnerabilities": has_vulnerabilities, - "progress_percent": progress_percent, - } - expected_response = scan_run_pb2.ScanRun(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup Request - name = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - - response = client.get_scan_run(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.GetScanRunRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_scan_run_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup request - name = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - - with pytest.raises(CustomException): - client.get_scan_run(name) - - def test_list_scan_runs(self): - # Setup Expected Response - next_page_token = "" - scan_runs_element = {} - scan_runs = [scan_runs_element] - expected_response = {"next_page_token": next_page_token, "scan_runs": scan_runs} - expected_response = web_security_scanner_pb2.ListScanRunsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup Request - parent = client.scan_config_path("[PROJECT]", "[SCAN_CONFIG]") - - paged_list_response = client.list_scan_runs(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.scan_runs[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.ListScanRunsRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_scan_runs_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup request - parent = client.scan_config_path("[PROJECT]", "[SCAN_CONFIG]") - - paged_list_response = client.list_scan_runs(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_stop_scan_run(self): - # Setup Expected Response - name_2 = "name2-1052831874" - urls_crawled_count = 1749797253 - urls_tested_count = 1498664068 - has_vulnerabilities = False - progress_percent = 2137894861 - expected_response = { - "name": name_2, - "urls_crawled_count": urls_crawled_count, - "urls_tested_count": urls_tested_count, - "has_vulnerabilities": has_vulnerabilities, - "progress_percent": progress_percent, - } - expected_response = scan_run_pb2.ScanRun(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup Request - name = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - - response = client.stop_scan_run(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.StopScanRunRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_stop_scan_run_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup request - name = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - - with pytest.raises(CustomException): - client.stop_scan_run(name) - - def test_list_crawled_urls(self): - # Setup Expected Response - next_page_token = "" - crawled_urls_element = {} - crawled_urls = [crawled_urls_element] - expected_response = { - "next_page_token": next_page_token, - "crawled_urls": crawled_urls, - } - expected_response = web_security_scanner_pb2.ListCrawledUrlsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup Request - parent = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - - paged_list_response = client.list_crawled_urls(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.crawled_urls[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.ListCrawledUrlsRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_crawled_urls_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup request - parent = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - - paged_list_response = client.list_crawled_urls(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_finding(self): - # Setup Expected Response - name_2 = "name2-1052831874" - http_method = "httpMethod820747384" - fuzzed_url = "fuzzedUrl-2120677666" - body = "body3029410" - description = "description-1724546052" - reproduction_url = "reproductionUrl-244934180" - frame_url = "frameUrl545464221" - final_url = "finalUrl355601190" - tracking_id = "trackingId1878901667" - expected_response = { - "name": name_2, - "http_method": http_method, - "fuzzed_url": fuzzed_url, - "body": body, - "description": description, - "reproduction_url": reproduction_url, - "frame_url": frame_url, - "final_url": final_url, - "tracking_id": tracking_id, - } - expected_response = finding_pb2.Finding(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup Request - name = client.finding_path( - "[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]" - ) - - response = client.get_finding(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.GetFindingRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_finding_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup request - name = client.finding_path( - "[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]" - ) - - with pytest.raises(CustomException): - client.get_finding(name) - - def test_list_findings(self): - # Setup Expected Response - next_page_token = "" - findings_element = {} - findings = [findings_element] - expected_response = {"next_page_token": next_page_token, "findings": findings} - expected_response = web_security_scanner_pb2.ListFindingsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup Request - parent = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - filter_ = "filter-1274492040" - - paged_list_response = client.list_findings(parent, filter_) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.findings[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.ListFindingsRequest( - parent=parent, filter=filter_ - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_findings_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup request - parent = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - filter_ = "filter-1274492040" - - paged_list_response = client.list_findings(parent, filter_) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_list_finding_type_stats(self): - # Setup Expected Response - expected_response = {} - expected_response = web_security_scanner_pb2.ListFindingTypeStatsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup Request - parent = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - - response = client.list_finding_type_stats(parent) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.ListFindingTypeStatsRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_finding_type_stats_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1alpha.WebSecurityScannerClient() - - # Setup request - parent = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - - with pytest.raises(CustomException): - client.list_finding_type_stats(parent) diff --git a/websecurityscanner/tests/unit/gapic/v1beta/test_web_security_scanner_client_v1beta.py b/websecurityscanner/tests/unit/gapic/v1beta/test_web_security_scanner_client_v1beta.py deleted file mode 100644 index 1d0e23ab9901..000000000000 --- a/websecurityscanner/tests/unit/gapic/v1beta/test_web_security_scanner_client_v1beta.py +++ /dev/null @@ -1,679 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import websecurityscanner_v1beta -from google.cloud.websecurityscanner_v1beta.proto import crawled_url_pb2 -from google.cloud.websecurityscanner_v1beta.proto import finding_pb2 -from google.cloud.websecurityscanner_v1beta.proto import scan_config_pb2 -from google.cloud.websecurityscanner_v1beta.proto import scan_run_pb2 -from google.cloud.websecurityscanner_v1beta.proto import web_security_scanner_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestWebSecurityScannerClient(object): - def test_create_scan_config(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - max_qps = 844445913 - expected_response = { - "name": name, - "display_name": display_name, - "max_qps": max_qps, - } - expected_response = scan_config_pb2.ScanConfig(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - scan_config = {} - - response = client.create_scan_config(parent, scan_config) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.CreateScanConfigRequest( - parent=parent, scan_config=scan_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_scan_config_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup request - parent = client.project_path("[PROJECT]") - scan_config = {} - - with pytest.raises(CustomException): - client.create_scan_config(parent, scan_config) - - def test_delete_scan_config(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup Request - name = client.scan_config_path("[PROJECT]", "[SCAN_CONFIG]") - - client.delete_scan_config(name) - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.DeleteScanConfigRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_scan_config_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup request - name = client.scan_config_path("[PROJECT]", "[SCAN_CONFIG]") - - with pytest.raises(CustomException): - client.delete_scan_config(name) - - def test_get_scan_config(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - max_qps = 844445913 - expected_response = { - "name": name_2, - "display_name": display_name, - "max_qps": max_qps, - } - expected_response = scan_config_pb2.ScanConfig(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup Request - name = client.scan_config_path("[PROJECT]", "[SCAN_CONFIG]") - - response = client.get_scan_config(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.GetScanConfigRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_scan_config_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup request - name = client.scan_config_path("[PROJECT]", "[SCAN_CONFIG]") - - with pytest.raises(CustomException): - client.get_scan_config(name) - - def test_list_scan_configs(self): - # Setup Expected Response - next_page_token = "" - scan_configs_element = {} - scan_configs = [scan_configs_element] - expected_response = { - "next_page_token": next_page_token, - "scan_configs": scan_configs, - } - expected_response = web_security_scanner_pb2.ListScanConfigsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - - paged_list_response = client.list_scan_configs(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.scan_configs[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.ListScanConfigsRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_scan_configs_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup request - parent = client.project_path("[PROJECT]") - - paged_list_response = client.list_scan_configs(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_update_scan_config(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - max_qps = 844445913 - expected_response = { - "name": name, - "display_name": display_name, - "max_qps": max_qps, - } - expected_response = scan_config_pb2.ScanConfig(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup Request - scan_config = {} - update_mask = {} - - response = client.update_scan_config(scan_config, update_mask) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.UpdateScanConfigRequest( - scan_config=scan_config, update_mask=update_mask - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_scan_config_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup request - scan_config = {} - update_mask = {} - - with pytest.raises(CustomException): - client.update_scan_config(scan_config, update_mask) - - def test_start_scan_run(self): - # Setup Expected Response - name_2 = "name2-1052831874" - urls_crawled_count = 1749797253 - urls_tested_count = 1498664068 - has_vulnerabilities = False - progress_percent = 2137894861 - expected_response = { - "name": name_2, - "urls_crawled_count": urls_crawled_count, - "urls_tested_count": urls_tested_count, - "has_vulnerabilities": has_vulnerabilities, - "progress_percent": progress_percent, - } - expected_response = scan_run_pb2.ScanRun(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup Request - name = client.scan_config_path("[PROJECT]", "[SCAN_CONFIG]") - - response = client.start_scan_run(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.StartScanRunRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_start_scan_run_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup request - name = client.scan_config_path("[PROJECT]", "[SCAN_CONFIG]") - - with pytest.raises(CustomException): - client.start_scan_run(name) - - def test_get_scan_run(self): - # Setup Expected Response - name_2 = "name2-1052831874" - urls_crawled_count = 1749797253 - urls_tested_count = 1498664068 - has_vulnerabilities = False - progress_percent = 2137894861 - expected_response = { - "name": name_2, - "urls_crawled_count": urls_crawled_count, - "urls_tested_count": urls_tested_count, - "has_vulnerabilities": has_vulnerabilities, - "progress_percent": progress_percent, - } - expected_response = scan_run_pb2.ScanRun(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup Request - name = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - - response = client.get_scan_run(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.GetScanRunRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_scan_run_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup request - name = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - - with pytest.raises(CustomException): - client.get_scan_run(name) - - def test_list_scan_runs(self): - # Setup Expected Response - next_page_token = "" - scan_runs_element = {} - scan_runs = [scan_runs_element] - expected_response = {"next_page_token": next_page_token, "scan_runs": scan_runs} - expected_response = web_security_scanner_pb2.ListScanRunsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup Request - parent = client.scan_config_path("[PROJECT]", "[SCAN_CONFIG]") - - paged_list_response = client.list_scan_runs(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.scan_runs[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.ListScanRunsRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_scan_runs_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup request - parent = client.scan_config_path("[PROJECT]", "[SCAN_CONFIG]") - - paged_list_response = client.list_scan_runs(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_stop_scan_run(self): - # Setup Expected Response - name_2 = "name2-1052831874" - urls_crawled_count = 1749797253 - urls_tested_count = 1498664068 - has_vulnerabilities = False - progress_percent = 2137894861 - expected_response = { - "name": name_2, - "urls_crawled_count": urls_crawled_count, - "urls_tested_count": urls_tested_count, - "has_vulnerabilities": has_vulnerabilities, - "progress_percent": progress_percent, - } - expected_response = scan_run_pb2.ScanRun(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup Request - name = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - - response = client.stop_scan_run(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.StopScanRunRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_stop_scan_run_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup request - name = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - - with pytest.raises(CustomException): - client.stop_scan_run(name) - - def test_list_crawled_urls(self): - # Setup Expected Response - next_page_token = "" - crawled_urls_element = {} - crawled_urls = [crawled_urls_element] - expected_response = { - "next_page_token": next_page_token, - "crawled_urls": crawled_urls, - } - expected_response = web_security_scanner_pb2.ListCrawledUrlsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup Request - parent = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - - paged_list_response = client.list_crawled_urls(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.crawled_urls[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.ListCrawledUrlsRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_crawled_urls_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup request - parent = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - - paged_list_response = client.list_crawled_urls(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_finding(self): - # Setup Expected Response - name_2 = "name2-1052831874" - finding_type = "findingType274496048" - http_method = "httpMethod820747384" - fuzzed_url = "fuzzedUrl-2120677666" - body = "body3029410" - description = "description-1724546052" - reproduction_url = "reproductionUrl-244934180" - frame_url = "frameUrl545464221" - final_url = "finalUrl355601190" - tracking_id = "trackingId1878901667" - expected_response = { - "name": name_2, - "finding_type": finding_type, - "http_method": http_method, - "fuzzed_url": fuzzed_url, - "body": body, - "description": description, - "reproduction_url": reproduction_url, - "frame_url": frame_url, - "final_url": final_url, - "tracking_id": tracking_id, - } - expected_response = finding_pb2.Finding(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup Request - name = client.finding_path( - "[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]" - ) - - response = client.get_finding(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.GetFindingRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_finding_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup request - name = client.finding_path( - "[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]" - ) - - with pytest.raises(CustomException): - client.get_finding(name) - - def test_list_findings(self): - # Setup Expected Response - next_page_token = "" - findings_element = {} - findings = [findings_element] - expected_response = {"next_page_token": next_page_token, "findings": findings} - expected_response = web_security_scanner_pb2.ListFindingsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup Request - parent = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - filter_ = "filter-1274492040" - - paged_list_response = client.list_findings(parent, filter_) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.findings[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.ListFindingsRequest( - parent=parent, filter=filter_ - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_findings_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup request - parent = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - filter_ = "filter-1274492040" - - paged_list_response = client.list_findings(parent, filter_) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_list_finding_type_stats(self): - # Setup Expected Response - expected_response = {} - expected_response = web_security_scanner_pb2.ListFindingTypeStatsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup Request - parent = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - - response = client.list_finding_type_stats(parent) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = web_security_scanner_pb2.ListFindingTypeStatsRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_finding_type_stats_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = websecurityscanner_v1beta.WebSecurityScannerClient() - - # Setup request - parent = client.scan_run_path("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]") - - with pytest.raises(CustomException): - client.list_finding_type_stats(parent)