diff --git a/packages/google-cloud-dataflow-client/owlbot.py b/packages/google-cloud-dataflow-client/owlbot.py new file mode 100644 index 000000000000..9fedcf19e7c0 --- /dev/null +++ b/packages/google-cloud-dataflow-client/owlbot.py @@ -0,0 +1,60 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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 pathlib import Path + +import synthtool as s +import synthtool.gcp as gcp +from synthtool.languages import python + +# ---------------------------------------------------------------------------- +# Copy the generated client from the owl-bot staging directory +# ---------------------------------------------------------------------------- + +default_version = "v1beta3" + +for library in s.get_staging_dirs(default_version): + # Work around to avoid a breaking change + # Replace `set` with `set_` + s.replace( + library / "google/cloud/dataflow_v1beta3/types/metrics.py", + "set \(google.protobuf.struct_pb2.Value\)", + "set_ (google.protobuf.struct_pb2.Value)", + ) + + s.replace( + library / "google/cloud/dataflow_v1beta3/types/metrics.py", + "set = proto.Field", + "set_ = proto.Field", + ) + s.move(library, excludes=["setup.py"]) +s.remove_staging_dirs() + +# ---------------------------------------------------------------------------- +# Add templated files +# ---------------------------------------------------------------------------- + +templated_files = gcp.CommonTemplates().py_library( + cov_level=100, + microgenerator=True, + versions=gcp.common.detect_versions(path="./google", default_first=True), +) +s.move(templated_files, excludes=[".coveragerc"]) # the microgenerator has a good coveragerc file + +python.py_samples(skip_readmes=True) + + +# run blacken session for all directories which have a noxfile +for noxfile in Path(".").glob("**/noxfile.py"): + s.shell.run(["nox", "-s", "format"], cwd=noxfile.parent, hide_output=False) \ No newline at end of file diff --git a/packages/google-cloud-dataflow-client/samples/generated_samples/snippet_metadata_dataflow_v1beta3.json b/packages/google-cloud-dataflow-client/samples/generated_samples/snippet_metadata_dataflow_v1beta3.json index d148a71145f6..85eeb8de8e9b 100644 --- a/packages/google-cloud-dataflow-client/samples/generated_samples/snippet_metadata_dataflow_v1beta3.json +++ b/packages/google-cloud-dataflow-client/samples/generated_samples/snippet_metadata_dataflow_v1beta3.json @@ -354,7 +354,7 @@ "shortName": "aggregated_list_jobs" }, "description": "Sample for AggregatedListJobs", - "file": "dataflow_v1beta3_generated_jobs_v1_beta3_aggregated_list_jobs_sync_0d901b38.py", + "file": "dataflow_v1beta3_generated_jobs_v1_beta3_aggregated_list_jobs_sync_26f07383.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_AggregatedListJobs_sync", @@ -390,7 +390,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_jobs_v1_beta3_aggregated_list_jobs_sync_0d901b38.py" + "title": "dataflow_v1beta3_generated_jobs_v1_beta3_aggregated_list_jobs_sync_26f07383.py" }, { "canonical": true, @@ -430,7 +430,7 @@ "shortName": "aggregated_list_jobs" }, "description": "Sample for AggregatedListJobs", - "file": "dataflow_v1beta3_generated_jobs_v1_beta3_aggregated_list_jobs_sync_26f07383.py", + "file": "dataflow_v1beta3_generated_jobs_v1_beta3_aggregated_list_jobs_sync_0d901b38.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_AggregatedListJobs_sync", @@ -466,7 +466,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_jobs_v1_beta3_aggregated_list_jobs_sync_26f07383.py" + "title": "dataflow_v1beta3_generated_jobs_v1_beta3_aggregated_list_jobs_sync_0d901b38.py" }, { "canonical": true, @@ -583,7 +583,7 @@ "shortName": "check_active_jobs" }, "description": "Sample for CheckActiveJobs", - "file": "dataflow_v1beta3_generated_jobs_v1_beta3_check_active_jobs_sync_aab49b35.py", + "file": "dataflow_v1beta3_generated_jobs_v1_beta3_check_active_jobs_sync_baed931b.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_CheckActiveJobs_sync", @@ -619,7 +619,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_jobs_v1_beta3_check_active_jobs_sync_aab49b35.py" + "title": "dataflow_v1beta3_generated_jobs_v1_beta3_check_active_jobs_sync_baed931b.py" }, { "canonical": true, @@ -659,7 +659,7 @@ "shortName": "check_active_jobs" }, "description": "Sample for CheckActiveJobs", - "file": "dataflow_v1beta3_generated_jobs_v1_beta3_check_active_jobs_sync_baed931b.py", + "file": "dataflow_v1beta3_generated_jobs_v1_beta3_check_active_jobs_sync_aab49b35.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_CheckActiveJobs_sync", @@ -695,7 +695,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_jobs_v1_beta3_check_active_jobs_sync_baed931b.py" + "title": "dataflow_v1beta3_generated_jobs_v1_beta3_check_active_jobs_sync_aab49b35.py" }, { "canonical": true, @@ -812,7 +812,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "dataflow_v1beta3_generated_jobs_v1_beta3_create_job_sync_ad13d605.py", + "file": "dataflow_v1beta3_generated_jobs_v1_beta3_create_job_sync_2a1b0208.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_CreateJob_sync", @@ -848,7 +848,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_jobs_v1_beta3_create_job_sync_ad13d605.py" + "title": "dataflow_v1beta3_generated_jobs_v1_beta3_create_job_sync_2a1b0208.py" }, { "canonical": true, @@ -888,7 +888,7 @@ "shortName": "create_job" }, "description": "Sample for CreateJob", - "file": "dataflow_v1beta3_generated_jobs_v1_beta3_create_job_sync_2a1b0208.py", + "file": "dataflow_v1beta3_generated_jobs_v1_beta3_create_job_sync_ad13d605.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_CreateJob_sync", @@ -924,7 +924,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_jobs_v1_beta3_create_job_sync_2a1b0208.py" + "title": "dataflow_v1beta3_generated_jobs_v1_beta3_create_job_sync_ad13d605.py" }, { "canonical": true, @@ -1041,7 +1041,7 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "dataflow_v1beta3_generated_jobs_v1_beta3_get_job_sync_3e418026.py", + "file": "dataflow_v1beta3_generated_jobs_v1_beta3_get_job_sync_45212860.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_GetJob_sync", @@ -1077,7 +1077,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_jobs_v1_beta3_get_job_sync_3e418026.py" + "title": "dataflow_v1beta3_generated_jobs_v1_beta3_get_job_sync_45212860.py" }, { "canonical": true, @@ -1117,7 +1117,7 @@ "shortName": "get_job" }, "description": "Sample for GetJob", - "file": "dataflow_v1beta3_generated_jobs_v1_beta3_get_job_sync_45212860.py", + "file": "dataflow_v1beta3_generated_jobs_v1_beta3_get_job_sync_3e418026.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_GetJob_sync", @@ -1153,7 +1153,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_jobs_v1_beta3_get_job_sync_45212860.py" + "title": "dataflow_v1beta3_generated_jobs_v1_beta3_get_job_sync_3e418026.py" }, { "canonical": true, @@ -1270,7 +1270,7 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "dataflow_v1beta3_generated_jobs_v1_beta3_list_jobs_sync_97a60855.py", + "file": "dataflow_v1beta3_generated_jobs_v1_beta3_list_jobs_sync_bfb75b4c.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_ListJobs_sync", @@ -1306,7 +1306,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_jobs_v1_beta3_list_jobs_sync_97a60855.py" + "title": "dataflow_v1beta3_generated_jobs_v1_beta3_list_jobs_sync_bfb75b4c.py" }, { "canonical": true, @@ -1346,7 +1346,7 @@ "shortName": "list_jobs" }, "description": "Sample for ListJobs", - "file": "dataflow_v1beta3_generated_jobs_v1_beta3_list_jobs_sync_bfb75b4c.py", + "file": "dataflow_v1beta3_generated_jobs_v1_beta3_list_jobs_sync_97a60855.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_ListJobs_sync", @@ -1382,7 +1382,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_jobs_v1_beta3_list_jobs_sync_bfb75b4c.py" + "title": "dataflow_v1beta3_generated_jobs_v1_beta3_list_jobs_sync_97a60855.py" }, { "canonical": true, @@ -1499,7 +1499,7 @@ "shortName": "snapshot_job" }, "description": "Sample for SnapshotJob", - "file": "dataflow_v1beta3_generated_jobs_v1_beta3_snapshot_job_sync_60f4d8fe.py", + "file": "dataflow_v1beta3_generated_jobs_v1_beta3_snapshot_job_sync_ff3cb8bd.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_SnapshotJob_sync", @@ -1535,7 +1535,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_jobs_v1_beta3_snapshot_job_sync_60f4d8fe.py" + "title": "dataflow_v1beta3_generated_jobs_v1_beta3_snapshot_job_sync_ff3cb8bd.py" }, { "canonical": true, @@ -1575,7 +1575,7 @@ "shortName": "snapshot_job" }, "description": "Sample for SnapshotJob", - "file": "dataflow_v1beta3_generated_jobs_v1_beta3_snapshot_job_sync_ff3cb8bd.py", + "file": "dataflow_v1beta3_generated_jobs_v1_beta3_snapshot_job_sync_60f4d8fe.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_SnapshotJob_sync", @@ -1611,7 +1611,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_jobs_v1_beta3_snapshot_job_sync_ff3cb8bd.py" + "title": "dataflow_v1beta3_generated_jobs_v1_beta3_snapshot_job_sync_60f4d8fe.py" }, { "canonical": true, @@ -1728,7 +1728,7 @@ "shortName": "update_job" }, "description": "Sample for UpdateJob", - "file": "dataflow_v1beta3_generated_jobs_v1_beta3_update_job_sync_8db1fd08.py", + "file": "dataflow_v1beta3_generated_jobs_v1_beta3_update_job_sync_e2fa191d.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_UpdateJob_sync", @@ -1764,7 +1764,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_jobs_v1_beta3_update_job_sync_8db1fd08.py" + "title": "dataflow_v1beta3_generated_jobs_v1_beta3_update_job_sync_e2fa191d.py" }, { "canonical": true, @@ -1804,7 +1804,7 @@ "shortName": "update_job" }, "description": "Sample for UpdateJob", - "file": "dataflow_v1beta3_generated_jobs_v1_beta3_update_job_sync_e2fa191d.py", + "file": "dataflow_v1beta3_generated_jobs_v1_beta3_update_job_sync_8db1fd08.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_UpdateJob_sync", @@ -1840,7 +1840,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_jobs_v1_beta3_update_job_sync_e2fa191d.py" + "title": "dataflow_v1beta3_generated_jobs_v1_beta3_update_job_sync_8db1fd08.py" }, { "canonical": true, @@ -2186,7 +2186,7 @@ "shortName": "get_job_execution_details" }, "description": "Sample for GetJobExecutionDetails", - "file": "dataflow_v1beta3_generated_metrics_v1_beta3_get_job_execution_details_sync_a4ff4d57.py", + "file": "dataflow_v1beta3_generated_metrics_v1_beta3_get_job_execution_details_sync_b7550163.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_MetricsV1Beta3_GetJobExecutionDetails_sync", @@ -2222,7 +2222,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_metrics_v1_beta3_get_job_execution_details_sync_a4ff4d57.py" + "title": "dataflow_v1beta3_generated_metrics_v1_beta3_get_job_execution_details_sync_b7550163.py" }, { "canonical": true, @@ -2262,7 +2262,7 @@ "shortName": "get_job_execution_details" }, "description": "Sample for GetJobExecutionDetails", - "file": "dataflow_v1beta3_generated_metrics_v1_beta3_get_job_execution_details_sync_b7550163.py", + "file": "dataflow_v1beta3_generated_metrics_v1_beta3_get_job_execution_details_sync_a4ff4d57.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_MetricsV1Beta3_GetJobExecutionDetails_sync", @@ -2298,7 +2298,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_metrics_v1_beta3_get_job_execution_details_sync_b7550163.py" + "title": "dataflow_v1beta3_generated_metrics_v1_beta3_get_job_execution_details_sync_a4ff4d57.py" }, { "canonical": true, @@ -2415,7 +2415,7 @@ "shortName": "get_job_metrics" }, "description": "Sample for GetJobMetrics", - "file": "dataflow_v1beta3_generated_metrics_v1_beta3_get_job_metrics_sync_59dce217.py", + "file": "dataflow_v1beta3_generated_metrics_v1_beta3_get_job_metrics_sync_02835968.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_MetricsV1Beta3_GetJobMetrics_sync", @@ -2451,7 +2451,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_metrics_v1_beta3_get_job_metrics_sync_59dce217.py" + "title": "dataflow_v1beta3_generated_metrics_v1_beta3_get_job_metrics_sync_02835968.py" }, { "canonical": true, @@ -2491,7 +2491,7 @@ "shortName": "get_job_metrics" }, "description": "Sample for GetJobMetrics", - "file": "dataflow_v1beta3_generated_metrics_v1_beta3_get_job_metrics_sync_02835968.py", + "file": "dataflow_v1beta3_generated_metrics_v1_beta3_get_job_metrics_sync_59dce217.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_MetricsV1Beta3_GetJobMetrics_sync", @@ -2527,7 +2527,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_metrics_v1_beta3_get_job_metrics_sync_02835968.py" + "title": "dataflow_v1beta3_generated_metrics_v1_beta3_get_job_metrics_sync_59dce217.py" }, { "canonical": true, @@ -2644,7 +2644,7 @@ "shortName": "get_stage_execution_details" }, "description": "Sample for GetStageExecutionDetails", - "file": "dataflow_v1beta3_generated_metrics_v1_beta3_get_stage_execution_details_sync_9490a11d.py", + "file": "dataflow_v1beta3_generated_metrics_v1_beta3_get_stage_execution_details_sync_4acb3ded.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_MetricsV1Beta3_GetStageExecutionDetails_sync", @@ -2680,7 +2680,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_metrics_v1_beta3_get_stage_execution_details_sync_9490a11d.py" + "title": "dataflow_v1beta3_generated_metrics_v1_beta3_get_stage_execution_details_sync_4acb3ded.py" }, { "canonical": true, @@ -2720,7 +2720,7 @@ "shortName": "get_stage_execution_details" }, "description": "Sample for GetStageExecutionDetails", - "file": "dataflow_v1beta3_generated_metrics_v1_beta3_get_stage_execution_details_sync_4acb3ded.py", + "file": "dataflow_v1beta3_generated_metrics_v1_beta3_get_stage_execution_details_sync_9490a11d.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_MetricsV1Beta3_GetStageExecutionDetails_sync", @@ -2756,7 +2756,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_metrics_v1_beta3_get_stage_execution_details_sync_4acb3ded.py" + "title": "dataflow_v1beta3_generated_metrics_v1_beta3_get_stage_execution_details_sync_9490a11d.py" }, { "canonical": true, @@ -3560,7 +3560,7 @@ "shortName": "create_job_from_template" }, "description": "Sample for CreateJobFromTemplate", - "file": "dataflow_v1beta3_generated_templates_service_create_job_from_template_sync_9e26a4bf.py", + "file": "dataflow_v1beta3_generated_templates_service_create_job_from_template_sync_e2cb482f.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_TemplatesService_CreateJobFromTemplate_sync", @@ -3596,7 +3596,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_templates_service_create_job_from_template_sync_9e26a4bf.py" + "title": "dataflow_v1beta3_generated_templates_service_create_job_from_template_sync_e2cb482f.py" }, { "canonical": true, @@ -3636,7 +3636,7 @@ "shortName": "create_job_from_template" }, "description": "Sample for CreateJobFromTemplate", - "file": "dataflow_v1beta3_generated_templates_service_create_job_from_template_sync_e2cb482f.py", + "file": "dataflow_v1beta3_generated_templates_service_create_job_from_template_sync_9e26a4bf.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_TemplatesService_CreateJobFromTemplate_sync", @@ -3672,7 +3672,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_templates_service_create_job_from_template_sync_e2cb482f.py" + "title": "dataflow_v1beta3_generated_templates_service_create_job_from_template_sync_9e26a4bf.py" }, { "canonical": true, @@ -3789,7 +3789,7 @@ "shortName": "get_template" }, "description": "Sample for GetTemplate", - "file": "dataflow_v1beta3_generated_templates_service_get_template_sync_732e6209.py", + "file": "dataflow_v1beta3_generated_templates_service_get_template_sync_07cd261a.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_TemplatesService_GetTemplate_sync", @@ -3825,7 +3825,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_templates_service_get_template_sync_732e6209.py" + "title": "dataflow_v1beta3_generated_templates_service_get_template_sync_07cd261a.py" }, { "canonical": true, @@ -3865,7 +3865,7 @@ "shortName": "get_template" }, "description": "Sample for GetTemplate", - "file": "dataflow_v1beta3_generated_templates_service_get_template_sync_07cd261a.py", + "file": "dataflow_v1beta3_generated_templates_service_get_template_sync_732e6209.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_TemplatesService_GetTemplate_sync", @@ -3901,7 +3901,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_templates_service_get_template_sync_07cd261a.py" + "title": "dataflow_v1beta3_generated_templates_service_get_template_sync_732e6209.py" }, { "canonical": true, @@ -4018,7 +4018,7 @@ "shortName": "launch_template" }, "description": "Sample for LaunchTemplate", - "file": "dataflow_v1beta3_generated_templates_service_launch_template_sync_77764eb9.py", + "file": "dataflow_v1beta3_generated_templates_service_launch_template_sync_140179ca.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_TemplatesService_LaunchTemplate_sync", @@ -4054,7 +4054,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_templates_service_launch_template_sync_77764eb9.py" + "title": "dataflow_v1beta3_generated_templates_service_launch_template_sync_140179ca.py" }, { "canonical": true, @@ -4094,7 +4094,7 @@ "shortName": "launch_template" }, "description": "Sample for LaunchTemplate", - "file": "dataflow_v1beta3_generated_templates_service_launch_template_sync_140179ca.py", + "file": "dataflow_v1beta3_generated_templates_service_launch_template_sync_77764eb9.py", "language": "PYTHON", "origin": "API_DEFINITION", "regionTag": "dataflow_v1beta3_generated_TemplatesService_LaunchTemplate_sync", @@ -4130,7 +4130,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "dataflow_v1beta3_generated_templates_service_launch_template_sync_140179ca.py" + "title": "dataflow_v1beta3_generated_templates_service_launch_template_sync_77764eb9.py" } ] }