From 6af764070c7e2b0c03bfb5b1303b53c51278f4a6 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 18 Nov 2024 23:42:52 +0000 Subject: [PATCH] feat:support manual instance count in Cloud Run for manual scaling feature PiperOrigin-RevId: 697723876 Source-Link: https://github.com/googleapis/googleapis/commit/c6eb517e76204c0cd71ab298c165eebbf12682eb Source-Link: https://github.com/googleapis/googleapis-gen/commit/7dd2077b5bcab9d8d72d1c0e38c5241435ec616d Copy-Tag: eyJwIjoiUnVuLy5Pd2xCb3QueWFtbCIsImgiOiI3ZGQyMDc3YjViY2FiOWQ4ZDcyZDFjMGUzOGM1MjQxNDM1ZWM2MTZkIn0= --- .../GPBMetadata/Google/Cloud/Run/V2/Build.php | Bin 0 -> 2450 bytes .../Google/Cloud/Run/V2/Condition.php | Bin 0 -> 2428 bytes .../Google/Cloud/Run/V2/Execution.php | 109 ++ .../Google/Cloud/Run/V2/ExecutionTemplate.php | 42 + .../GPBMetadata/Google/Cloud/Run/V2/Job.php | Bin 0 -> 6807 bytes .../Google/Cloud/Run/V2/K8SMin.php | Bin 0 -> 3770 bytes .../Google/Cloud/Run/V2/Revision.php | 112 ++ .../Google/Cloud/Run/V2/RevisionTemplate.php | 62 + .../Google/Cloud/Run/V2/Service.php | 135 ++ .../Google/Cloud/Run/V2/Status.php | 29 + .../GPBMetadata/Google/Cloud/Run/V2/Task.php | 103 ++ .../Google/Cloud/Run/V2/TaskTemplate.php | Bin 0 -> 1579 bytes .../Google/Cloud/Run/V2/TrafficTarget.php | Bin 0 -> 1280 bytes .../Google/Cloud/Run/V2/VendorSettings.php | Bin 0 -> 2510 bytes .../Cloud/Run/V2/BinaryAuthorization.php | 160 ++ .../Cloud/Run/V2/CancelExecutionRequest.php | 172 ++ .../Google/Cloud/Run/V2/CloudSqlInstance.php | 86 + .../src/Google/Cloud/Run/V2/Condition.php | 337 ++++ .../Cloud/Run/V2/Condition/CommonReason.php | 148 ++ .../Run/V2/Condition/ExecutionReason.php | 86 + .../Cloud/Run/V2/Condition/RevisionReason.php | 141 ++ .../Cloud/Run/V2/Condition/Severity.php | 71 + .../Google/Cloud/Run/V2/Condition/State.php | 78 + .../src/Google/Cloud/Run/V2/Container.php | 531 ++++++ .../src/Google/Cloud/Run/V2/ContainerPort.php | 109 ++ .../Google/Cloud/Run/V2/CreateJobRequest.php | 216 +++ .../Cloud/Run/V2/CreateServiceRequest.php | 221 +++ .../Cloud/Run/V2/DeleteExecutionRequest.php | 172 ++ .../Google/Cloud/Run/V2/DeleteJobRequest.php | 167 ++ .../Cloud/Run/V2/DeleteRevisionRequest.php | 169 ++ .../Cloud/Run/V2/DeleteServiceRequest.php | 167 ++ .../Cloud/Run/V2/EmptyDirVolumeSource.php | 143 ++ .../Run/V2/EmptyDirVolumeSource/Medium.php | 58 + .../Run/V2/EncryptionKeyRevocationAction.php | 61 + .../proto/src/Google/Cloud/Run/V2/EnvVar.php | 152 ++ .../src/Google/Cloud/Run/V2/EnvVarSource.php | 77 + .../src/Google/Cloud/Run/V2/Execution.php | 1183 ++++++++++++ .../Cloud/Run/V2/ExecutionEnvironment.php | 61 + .../Cloud/Run/V2/ExecutionReference.php | 238 +++ .../ExecutionReference/CompletionStatus.php | 85 + .../Google/Cloud/Run/V2/ExecutionTemplate.php | 322 ++++ .../Google/Cloud/Run/V2/GCSVolumeSource.php | 140 ++ .../src/Google/Cloud/Run/V2/GRPCAction.php | 121 ++ .../Cloud/Run/V2/GetExecutionRequest.php | 96 + .../src/Google/Cloud/Run/V2/GetJobRequest.php | 91 + .../Cloud/Run/V2/GetRevisionRequest.php | 91 + .../Google/Cloud/Run/V2/GetServiceRequest.php | 91 + .../Google/Cloud/Run/V2/GetTaskRequest.php | 91 + .../src/Google/Cloud/Run/V2/HTTPGetAction.php | 147 ++ .../src/Google/Cloud/Run/V2/HTTPHeader.php | 101 ++ .../Google/Cloud/Run/V2/IngressTraffic.php | 75 + .../v2/proto/src/Google/Cloud/Run/V2/Job.php | 1249 +++++++++++++ .../Cloud/Run/V2/ListExecutionsRequest.php | 202 +++ .../Cloud/Run/V2/ListExecutionsResponse.php | 105 ++ .../Google/Cloud/Run/V2/ListJobsRequest.php | 197 ++ .../Google/Cloud/Run/V2/ListJobsResponse.php | 105 ++ .../Cloud/Run/V2/ListRevisionsRequest.php | 202 +++ .../Cloud/Run/V2/ListRevisionsResponse.php | 105 ++ .../Cloud/Run/V2/ListServicesRequest.php | 202 +++ .../Cloud/Run/V2/ListServicesResponse.php | 105 ++ .../Google/Cloud/Run/V2/ListTasksRequest.php | 202 +++ .../Google/Cloud/Run/V2/ListTasksResponse.php | 105 ++ .../Google/Cloud/Run/V2/NFSVolumeSource.php | 135 ++ .../src/Google/Cloud/Run/V2/NodeSelector.php | 67 + .../proto/src/Google/Cloud/Run/V2/Probe.php | 319 ++++ .../Cloud/Run/V2/ResourceRequirements.php | 175 ++ .../src/Google/Cloud/Run/V2/Revision.php | 1373 ++++++++++++++ .../Google/Cloud/Run/V2/RevisionScaling.php | 117 ++ .../Cloud/Run/V2/RevisionScalingStatus.php | 67 + .../Google/Cloud/Run/V2/RevisionTemplate.php | 822 +++++++++ .../src/Google/Cloud/Run/V2/RunJobRequest.php | 215 +++ .../Cloud/Run/V2/RunJobRequest/Overrides.php | 160 ++ .../Overrides/ContainerOverride.php | 180 ++ .../Google/Cloud/Run/V2/SecretKeySelector.php | 121 ++ .../Cloud/Run/V2/SecretVolumeSource.php | 217 +++ .../proto/src/Google/Cloud/Run/V2/Service.php | 1609 +++++++++++++++++ .../src/Google/Cloud/Run/V2/ServiceMesh.php | 76 + .../Google/Cloud/Run/V2/ServiceScaling.php | 162 ++ .../Run/V2/ServiceScaling/ScalingMode.php | 65 + .../src/Google/Cloud/Run/V2/StorageSource.php | 155 ++ .../Cloud/Run/V2/SubmitBuildRequest.php | 356 ++++ .../V2/SubmitBuildRequest/BuildpacksBuild.php | 273 +++ .../Run/V2/SubmitBuildRequest/DockerBuild.php | 36 + .../Cloud/Run/V2/SubmitBuildResponse.php | 149 ++ .../Google/Cloud/Run/V2/TCPSocketAction.php | 75 + .../v2/proto/src/Google/Cloud/Run/V2/Task.php | 1339 ++++++++++++++ .../Google/Cloud/Run/V2/TaskAttemptResult.php | 127 ++ .../src/Google/Cloud/Run/V2/TaskTemplate.php | 381 ++++ .../src/Google/Cloud/Run/V2/TrafficTarget.php | 182 ++ .../Run/V2/TrafficTargetAllocationType.php | 61 + .../Cloud/Run/V2/TrafficTargetStatus.php | 203 +++ .../Google/Cloud/Run/V2/UpdateJobRequest.php | 170 ++ .../Cloud/Run/V2/UpdateServiceRequest.php | 229 +++ .../src/Google/Cloud/Run/V2/VersionToPath.php | 188 ++ .../proto/src/Google/Cloud/Run/V2/Volume.php | 247 +++ .../src/Google/Cloud/Run/V2/VolumeMount.php | 117 ++ .../src/Google/Cloud/Run/V2/VpcAccess.php | 160 ++ .../Run/V2/VpcAccess/NetworkInterface.php | 170 ++ .../Cloud/Run/V2/VpcAccess/VpcEgress.php | 64 + .../samples/V2/BuildsClient/submit_build.php | 94 + .../V2/ExecutionsClient/cancel_execution.php | 86 + .../V2/ExecutionsClient/delete_execution.php | 86 + .../V2/ExecutionsClient/get_execution.php | 74 + .../V2/ExecutionsClient/list_executions.php | 80 + .../v2/samples/V2/JobsClient/create_job.php | 97 + .../v2/samples/V2/JobsClient/delete_job.php | 85 + .../samples/V2/JobsClient/get_iam_policy.php | 72 + .../Run/v2/samples/V2/JobsClient/get_job.php | 73 + .../v2/samples/V2/JobsClient/list_jobs.php | 78 + .../Run/v2/samples/V2/JobsClient/run_job.php | 85 + .../samples/V2/JobsClient/set_iam_policy.php | 74 + .../V2/JobsClient/test_iam_permissions.php | 80 + .../v2/samples/V2/JobsClient/update_job.php | 77 + .../V2/RevisionsClient/delete_revision.php | 90 + .../V2/RevisionsClient/get_revision.php | 78 + .../V2/RevisionsClient/list_revisions.php | 80 + .../V2/ServicesClient/create_service.php | 95 + .../V2/ServicesClient/delete_service.php | 87 + .../V2/ServicesClient/get_iam_policy.php | 72 + .../samples/V2/ServicesClient/get_service.php | 73 + .../V2/ServicesClient/list_services.php | 79 + .../V2/ServicesClient/set_iam_policy.php | 74 + .../ServicesClient/test_iam_permissions.php | 80 + .../V2/ServicesClient/update_service.php | 74 + .../v2/samples/V2/TasksClient/get_task.php | 73 + .../v2/samples/V2/TasksClient/list_tasks.php | 79 + .../Run/v2/src/V2/Client/BuildsClient.php | 239 +++ .../Run/v2/src/V2/Client/ExecutionsClient.php | 401 ++++ .../Run/v2/src/V2/Client/JobsClient.php | 693 +++++++ .../Run/v2/src/V2/Client/RevisionsClient.php | 373 ++++ .../Run/v2/src/V2/Client/ServicesClient.php | 686 +++++++ .../Run/v2/src/V2/Client/TasksClient.php | 294 +++ .../Run/v2/src/V2/gapic_metadata.json | 198 ++ .../V2/resources/builds_client_config.json | 27 + .../V2/resources/builds_descriptor_config.php | 43 + .../resources/builds_rest_client_config.php | 88 + .../resources/executions_client_config.json | 42 + .../executions_descriptor_config.php | 102 ++ .../executions_rest_client_config.php | 121 ++ .../src/V2/resources/jobs_client_config.json | 67 + .../V2/resources/jobs_descriptor_config.php | 191 ++ .../V2/resources/jobs_rest_client_config.php | 184 ++ .../V2/resources/revisions_client_config.json | 37 + .../resources/revisions_descriptor_config.php | 86 + .../revisions_rest_client_config.php | 109 ++ .../V2/resources/services_client_config.json | 94 + .../resources/services_descriptor_config.php | 172 ++ .../resources/services_rest_client_config.php | 172 ++ .../src/V2/resources/tasks_client_config.json | 32 + .../V2/resources/tasks_descriptor_config.php | 64 + .../V2/resources/tasks_rest_client_config.php | 98 + .../tests/Unit/V2/Client/BuildsClientTest.php | 192 ++ .../Unit/V2/Client/ExecutionsClientTest.php | 638 +++++++ .../tests/Unit/V2/Client/JobsClientTest.php | 1170 ++++++++++++ .../Unit/V2/Client/RevisionsClientTest.php | 466 +++++ .../Unit/V2/Client/ServicesClientTest.php | 1044 +++++++++++ .../tests/Unit/V2/Client/TasksClientTest.php | 285 +++ 157 files changed, 30971 insertions(+) create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Build.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Condition.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Execution.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/ExecutionTemplate.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Job.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/K8SMin.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Revision.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/RevisionTemplate.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Service.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Status.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Task.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/TaskTemplate.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/TrafficTarget.php create mode 100644 owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/VendorSettings.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/BinaryAuthorization.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CancelExecutionRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CloudSqlInstance.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/CommonReason.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/ExecutionReason.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/RevisionReason.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/Severity.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/State.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Container.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ContainerPort.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateJobRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateServiceRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteExecutionRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteJobRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteRevisionRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteServiceRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource/Medium.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EncryptionKeyRevocationAction.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVar.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVarSource.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Execution.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionEnvironment.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference/CompletionStatus.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionTemplate.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GCSVolumeSource.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GRPCAction.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetExecutionRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetJobRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetRevisionRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetServiceRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetTaskRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPGetAction.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPHeader.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/IngressTraffic.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Job.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsResponse.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsResponse.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsResponse.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesResponse.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksResponse.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NFSVolumeSource.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NodeSelector.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Probe.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ResourceRequirements.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Revision.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScaling.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScalingStatus.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionTemplate.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides/ContainerOverride.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretKeySelector.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretVolumeSource.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Service.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceMesh.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling/ScalingMode.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/StorageSource.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/BuildpacksBuild.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/DockerBuild.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildResponse.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TCPSocketAction.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Task.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskAttemptResult.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskTemplate.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTarget.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetAllocationType.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetStatus.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateJobRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateServiceRequest.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VersionToPath.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Volume.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VolumeMount.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/NetworkInterface.php create mode 100644 owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/VpcEgress.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/BuildsClient/submit_build.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/cancel_execution.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/delete_execution.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/get_execution.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/list_executions.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/create_job.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/delete_job.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/get_iam_policy.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/get_job.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/list_jobs.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/run_job.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/set_iam_policy.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/JobsClient/update_job.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/RevisionsClient/delete_revision.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/RevisionsClient/get_revision.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/RevisionsClient/list_revisions.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/create_service.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/delete_service.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_iam_policy.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_service.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/list_services.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/set_iam_policy.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/ServicesClient/update_service.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/TasksClient/get_task.php create mode 100644 owl-bot-staging/Run/v2/samples/V2/TasksClient/list_tasks.php create mode 100644 owl-bot-staging/Run/v2/src/V2/Client/BuildsClient.php create mode 100644 owl-bot-staging/Run/v2/src/V2/Client/ExecutionsClient.php create mode 100644 owl-bot-staging/Run/v2/src/V2/Client/JobsClient.php create mode 100644 owl-bot-staging/Run/v2/src/V2/Client/RevisionsClient.php create mode 100644 owl-bot-staging/Run/v2/src/V2/Client/ServicesClient.php create mode 100644 owl-bot-staging/Run/v2/src/V2/Client/TasksClient.php create mode 100644 owl-bot-staging/Run/v2/src/V2/gapic_metadata.json create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/builds_client_config.json create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/builds_descriptor_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/builds_rest_client_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/executions_client_config.json create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/executions_descriptor_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/executions_rest_client_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/jobs_client_config.json create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/jobs_descriptor_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/jobs_rest_client_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/revisions_client_config.json create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/revisions_descriptor_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/revisions_rest_client_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/services_client_config.json create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/services_descriptor_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/services_rest_client_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/tasks_client_config.json create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/tasks_descriptor_config.php create mode 100644 owl-bot-staging/Run/v2/src/V2/resources/tasks_rest_client_config.php create mode 100644 owl-bot-staging/Run/v2/tests/Unit/V2/Client/BuildsClientTest.php create mode 100644 owl-bot-staging/Run/v2/tests/Unit/V2/Client/ExecutionsClientTest.php create mode 100644 owl-bot-staging/Run/v2/tests/Unit/V2/Client/JobsClientTest.php create mode 100644 owl-bot-staging/Run/v2/tests/Unit/V2/Client/RevisionsClientTest.php create mode 100644 owl-bot-staging/Run/v2/tests/Unit/V2/Client/ServicesClientTest.php create mode 100644 owl-bot-staging/Run/v2/tests/Unit/V2/Client/TasksClientTest.php diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Build.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Build.php new file mode 100644 index 0000000000000000000000000000000000000000..d54649f835f7a54acab79d2e68ebac1315f85d5f GIT binary patch literal 2450 zcmb7G&u<$=6lR^qO~y$hHiEboh`|lSiP~M^N(DI$Xx$`jRUjd$ii9k!X4hkT$a-g) znROH*AK+i$#DzbFKY$}hoQuSX8&^)uk6nB7OHFfdRy*%~^WOK~_ufAIEEy!=4t$Jb z%#grc7@R;cz%XG{(2zzjNP9iZU`U4vi7;~@+}?v#{UT7636CVxFK7!^ivWFR(yeBv9wEcI!M+Zk>ZP?!0Jj0uV-s zbJ$ky;1odlm!v^NLdXRY^4}`qK8cASC?em>sJCDbMI1}di?+Qq4h5kxR1SM_h#TwB zU@F_ygvu?Z6N?a!0c^V7MVia|@F%KC@1ZDfuwAJckF`-MnX{=}0Dmc=E4HILl zbs@+tC|HV%w?oLVNLjq8<5mFU$y4VNn!JQ`yf~(c1sd~KYnsy(;wr~S5y7!|J)d2I zqi!1y(1=j>daegJYmI9M`8kdIvU6e*_d9!uYRIdT)OEY}Daoqjb-Rbkvln~k5ia^uPwH!_z^b|{ekkOPG+%9;sjEn5( zPIeSc6L#q&VPjPPxeV;XG#C=0b#Q>cOEDMrGAJjA$vCPOv>Nm6nU`M4_P{MJ8x-}i zZ%D6}*cP`1vIW(q+TDcnF$s6|DV4e&WK*~sUW(s`(mb8qea*urdRK20GKfWCM zLd1>^U%7Mr^u)5CfrTy&k1)#sXEosc>jG|T-yG~6u*5MNkr4YR3~4HvDd*u^l9|de zW$G#=^y*E0a`&ZY{pWoMR&}X$QrX?In%t4Y&iz_DDSg{-f*S($d36rX7{0CABB&IC zsQp<2OXsqbb-F2ANRT1U3RS9Fwv06&N4`KzjuKrcT}6EwqHuuyOA2AxD*yzDXNS55 znOh3p!tsbO8V_Y#_#?y!3L?y_vohdH^Q-I9dM*QJXA1fv$J~hpJ5eoT*&l!^j@3mz zN(CLNx$LKj9P09BRe(8dR@(%(uLQCyVCD#)7=r9YFgrp~iVY>L(kE7X4wOwlw-;pg zY909EB*FC`EUKGU})wfWb=aW+~$tFat@oGauSN-9SfBgMZ=|TM?wX9FgSlN>6TE)xV4L72pnZfSH z*erA2;#%M>YooUNn`f&jX+})0oZmfXAVk7ju6ulZeD2Vdtuip*2=|f*i5_Lc_OBLL zk&?SC>Ne19=%u`GeY0*-&u5yHX`kwE4SBiDKn9ZpoBH=3k6csT-X!1C>}g!c`!uIu q?3yv6CIWX)3o~ULl%=Df_tz#n=dM}wh3|qZzX`OZ+1+C>2H<}@%pJM_ literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Condition.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Condition.php new file mode 100644 index 0000000000000000000000000000000000000000..7d7617e7aa8761e1228820dc4126e8daf75f83de GIT binary patch literal 2428 zcma)8+iu%N5RD_>G`=x((kMyOY#alz+eQYQmsV+7P}E9hEs+FCIdLF>psBS(Kqd*2 zGMW}aKcv6Vr+!AiqR;(`&MrmDas;G)u*lt+*)wO(?C^)5;`cE;BOMm9#LL)_oP8kK zdq(0U$|64+k+bpnIZKEiUB*e;jfV%x zI6SyIJn*A%7-T^d)pz%w~^e-q6duK}Wa_RPH*k#^K=P@D+eR^3s&3 zMF{u}2>!+6vr*uaH1jh2*$q-R2=NGS6#R^bEs0{V9*ZOXxL=$y{jNf8jWdI(;)L)%fy@j zYms@E@qAxF$crC?N&3ogSZ3QsCG3^>INIm%?*=^k9}{IW8)hZ&&cW@W=mbqEtg{jc2%R$r@ad++TVG*=ISTEU=zlYV7U9lv{KGc>3gu(N| z{CbwxF-+{`CM+k+OQW#1EIhyYjH4P|UPhrMT$+`Cl*-X9xd&Sby9!d2wmS({6~SJ7 zCYUwxnhj@w#C~D^n72w1Z%xFjeVw=l9@_?I;d)`?_sXRcmXsCEb#7 zSv7RLO*BJyO^Q!?M_P~{z`g0RMe$kHx_s-ld>5qYR$I}!7^foNhwbUA-B(pgTez{f z(}q>MAiM^5ZF)j2%{jdRqY6vZvJ4B4UW1i4ilyg=t-_+Fw+*SX^H&AduNOdm1ou^= z*F)GARc!p}>n+;WbdeSY>FdY3@kYmp+puNP6V2u+mVm#4ho)t8ENa_siz+S5j=J=1 zfqO!Xqu{dT_B7k(fR^Pa@CfsqESuC4I~cb`bx!DtOyJ9@f!0$xoN=Y^92u7O4lP#Y zI(&W8qS#kN8Pp@H9v4Wf@-7gntJbM0Hjn8k*6HTCz=7ScnhCSU4Q#4f)UjO!%Y$jp z7_9S}zfn*KddF=WmTTZC0*|!88Ps|`96DS;7{WT0Hu<7y*p6u+<&(uNyd73G-JzDQ zbR}u$@7u6BD|GoWJSdAXzi?9(VimDI)H$FM zmUs=0sM2+gCMizo&PBG&IaT|%WAu1UTvI_)JPA{=Y1suU@>6)+({xwUv2%2!%*D~` zqH1z2iDIIOqB`0Mr)46suGZ5Wd{vO&mQ#{z8K=yDlVOy5$qFQhStPR#RXqv`U_@7pe?Qd2QQqsyDwEn4mi zkag7XJ8Bu&0tj9;TAcC?y!UzH-Mq(<=E-YLJ65DcyVOD8OU){*internalAddGeneratedFile( + ' +€ +#google/cloud/run/v2/execution.protogoogle.cloud.run.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/launch_stage.protogoogle/api/resource.proto#google/cloud/run/v2/condition.proto\'google/cloud/run/v2/task_template.proto#google/longrunning/operations.protogoogle/protobuf/timestamp.proto"I +GetExecutionRequest2 +name ( B$àAúA +run.googleapis.com/Execution"Š +ListExecutionsRequest4 +parent ( B$àAúArun.googleapis.com/Execution + page_size ( + +page_token (  + show_deleted ("e +ListExecutionsResponse2 + +executions ( 2.google.cloud.run.v2.Execution +next_page_token ( "q +DeleteExecutionRequest2 +name ( B$àAúA +run.googleapis.com/Execution + validate_only ( +etag ( "q +CancelExecutionRequest2 +name ( B$àAúA +run.googleapis.com/Execution + validate_only ( +etag ( "‚ + + Execution +name ( BàA +uid ( BàA + +generation (BàA? +labels ( 2*.google.cloud.run.v2.Execution.LabelsEntryBàAI + annotations ( 2/.google.cloud.run.v2.Execution.AnnotationsEntryBàA4 + create_time ( 2.google.protobuf.TimestampBàA3 + +start_time ( 2.google.protobuf.TimestampBàA8 +completion_time ( 2.google.protobuf.TimestampBàA4 + update_time ( 2.google.protobuf.TimestampBàA4 + delete_time ( 2.google.protobuf.TimestampBàA4 + expire_time + ( 2.google.protobuf.TimestampBàA- + launch_stage (2.google.api.LaunchStage+ +job ( BàAúA +run.googleapis.com/Job + parallelism (BàA + +task_count (BàA8 +template ( 2!.google.cloud.run.v2.TaskTemplateBàA + reconciling (BàA7 + +conditions ( 2.google.cloud.run.v2.ConditionBàA +observed_generation (BàA + running_count (BàA +succeeded_count (BàA + failed_count (BàA +cancelled_count (BàA + retried_count (BàA +log_uri ( BàA + satisfies_pzs (BàA +etagc ( BàA- + LabelsEntry +key (  +value ( :82 +AnnotationsEntry +key (  +value ( :8:oêAl +run.googleapis.com/ExecutionIprojects/{project}/locations/{location}/jobs/{job}/executions/{execution}R2± + +Executionsž + GetExecution(.google.cloud.run.v2.GetExecutionRequest.google.cloud.run.v2.Execution"DÚAname‚Óä“75/v2/{name=projects/*/locations/*/jobs/*/executions/*}± +ListExecutions*.google.cloud.run.v2.ListExecutionsRequest+.google.cloud.run.v2.ListExecutionsResponse"FÚAparent‚Óä“75/v2/{parent=projects/*/locations/*/jobs/*}/executions¼ +DeleteExecution+.google.cloud.run.v2.DeleteExecutionRequest.google.longrunning.Operation"]ÊA + Execution ExecutionÚAname‚Óä“7*5/v2/{name=projects/*/locations/*/jobs/*/executions/*}Æ +CancelExecution+.google.cloud.run.v2.CancelExecutionRequest.google.longrunning.Operation"gÊA + Execution ExecutionÚAname‚Óä“A"internalAddGeneratedFile( + ' + +,google/cloud/run/v2/execution_template.protogoogle.cloud.run.v2\'google/cloud/run/v2/task_template.proto"ë +ExecutionTemplateB +labels ( 22.google.cloud.run.v2.ExecutionTemplate.LabelsEntryL + annotations ( 27.google.cloud.run.v2.ExecutionTemplate.AnnotationsEntry + parallelism ( + +task_count (8 +template ( 2!.google.cloud.run.v2.TaskTemplateBàA- + LabelsEntry +key (  +value ( :82 +AnnotationsEntry +key (  +value ( :8B^ +com.google.cloud.run.v2BExecutionTemplateProtoPZ)cloud.google.com/go/run/apiv2/runpb;runpbbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Job.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Job.php new file mode 100644 index 0000000000000000000000000000000000000000..f04aa7b7517d80a67f221929ccd91e2fa22497c3 GIT binary patch literal 6807 zcmcIp&2t+`6<=AlW3~Jtx086H-DJnwu(5?bBFa_~6r7a4Y#bb0<&P8vs+t;&+VZSN zGqW=zIZnzPC@w5iap1-uz=b2lpTH$>f(xXIf&(Z1gq(QYJzt6?TQZQUSkk=r`n`Vd z_ddGkyU(m+3wlpQy`6mdey5czEbF+coAQApqorbQdqT?zqeB9R@Su-?OQ*`Y$SiCMC zDY`>I?jr9|$536(G(;+}Yp7&-MdWKz-uspbJ6soiGir3xu;Kca;S$?W^m>Ijs;ybB zY1e?YP-qc1a20*ByyB^)%V|gAGPki%xM1YE=-M3;)h>!QaXYs0gxO6OI1j$n`#7m+ zY4xIEnA8iV;S>ttp28&t36^z@8185?8yeA@C338EHPaqVbXx((AMd+Li;O0?M?5@@ zw7WgC<7!50cvVrr)yt;Q1UQ+-HRY?Xhzk1ud-(&>wsgqCYufSs$NMj|>u%yDF`A~m zPh9HA5x}*jwCgV)*5RXOLXw^hZ@VWss@S$^w4l5gU}k;SqE&0OYzUIP(&4hhTO5cU zXi&^trET?>Wp!okspeIYVzU_(jSVQG%R!pcqoO+dr;o?9+Ha+RNp`&?@wk`zai2VPq_$>wEGzw3x(x5K;{o1dz2~uNN;}tm zn1c`5VzBn;>0Wvd&G&#F0yJj^0R2D#>x$57a!n6~9^H>!KzDtpafZyVV<=U&2~-K_ zk9*{+4ge8LXwp(_K!6YvW6O!sy?++R-WLUYn?i+~46$}3=;ApL!&wxE)+~$xb22Y@ z96jigfUOjVW$*%;1YTKd3URhJdw2`YbfNu14=1u|=x4$>(55o$Xl9eRAnF^oipFW< z?==ezFe~#FN*!8s&BzL#sdQggntH)1YVj0KqZvil%~QFpIS!N!ZY!#B~ia|}i_iB4e9@;tVWQlWmwg1%1h z=V%-}?ts(cm+cuZqB(=Sa^;9B8qq|Cpj3rviTH7(NZ=qWOy} zgHOUd!t-ccv0Dykh(oed9OGpaCq@^bMj`XDzk0M^NL8czQn9I#s!kMJW=pWV<*D#K zf#MKL>i>wY6pD8s_ZhG#Uz{$`;>QJOybRoNPWS>%>Pmy?G)~lv`+dy-71B0is~WC- zhM%IO5>Boi7x%?L>sj_+~Qx^-9;Pqra?aK%L4O+HuYqG;i4VStxv=mQY zE;Ti@6nSN7HsMl<;iPV&8*E>uEg+C!agNhk28Sb8ZktUFdb=$oL)t8wRRxL0Cw~r#Z$oPMPaI)^A#o_dPtaUApz!R!32IsP$MFsl z=u{6;<3Mf70kd$MSyzA1*Sx?Jdj!tl1dgxVP5~ut0+yqIL7q za)ckDIeNJQLjhzcuMo8JT`mM#qJ?PUN`ZYeAJGCha67!6&gLHvi9Kj|zM1<>KJ!~T zi+=DBFQL2T-50g(>cQ6Tj=Xs7u7)q4=5gLD^@Ad<_Hx;Ju`fQQ$UJA~inV-ep77_2Cw28he&hvqM6);Et!~Fb{ zzx?Z0W4X*Sy%>ALsp|oLvk}~8IbI8NM*o@$t>JI_13q5rD-u9`J$sIS7ekYL496MY z>YnP{Goz;m&i|Q{cSSY|Fw3);TTW+#0e15=%bqi%CA`XW2j9Qa)pes1V3_w>v_jhsyx_huqq$5Ar4gxa|KIaDRg|;fIC+Y0`6| zxT*mB971#(CBjA!evM|)!wiqtFtLI@Q;21+l}x{gp=rqS;8rf&AzW!l-G@??=tt_7 zUo1QxelwRTGN3)d-(f)WFNCfr0raLk)c#8_2d);w2SHu(R7Htbm{VcqJk5+|4&3tu z+QF&#_c4SIU?igt>C6Zh190}n!8GgHb&FKE##^A<>j_v%t%o@F3J~HigsfHF|9`FMm?GB}>=Vqfu z--Og+KV0Dyeuc!Yk6I>sxdV$s8v{$M#uN6pF$q=PH6J|)E;m>C8;{5f5;}HhYM+-Q NjFZ2_I7jCQ{Rd^~s=NRI literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/K8SMin.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/K8SMin.php new file mode 100644 index 0000000000000000000000000000000000000000..41d418de4e9098803c8c743234a3263e691f4371 GIT binary patch literal 3770 zcmb7H>vG#f6t3gMagK9UZ*I$gqNX%~)&`eC>hyx0J0XcDPBR1J8I3Hhoh7oQtX2lo z$xHB)r(lL(ya5lu1MrtVLVs~~B{_DY($XL4S~}miXV2w3tEVr#V-N1Co5Uf^;KWj! zJ(V95)nhJqP1jbNL90cWYPubd+JqHUb!}hW+dov-*R~Jm5$d}EGf7!(yKdViMbmZz ztH=VU*ew-LmiJ1K_|FTPHZ@hB8yx>zpuSEW%Bf+~pV9GWYRj;Fg3!yht-vukbsbdz_8pTf zE~z1>uwC$6Jm@nu_M|4xj^}P{JDf1bup4W{HyQP~%W7y^F1HEqM@&3fT#B|8bhM=| zhCY_dmz;d2au$%m-Bpzl9x!J``Yi~~`m07loGKn|Y*1obRdQ@}smsdc^HZIZybXFl zqJ$-)WGEg!r_sSHmeoJ!2Bv?p@0sxPKK!1C`FG}Bxf+@jWN8$zGz#6)?OPGf@Mw`m zK81Cn{g#G_RoCGL#iCRuVN}#jKBcA>Clm$7Xvb)i{D}BjP5)gPQD$Hq%d=xRRz9t! z(Fh?1Yy0_8`D+o<#Odb8@JFt6r;y-GVcqE-8BBQ!6R|6PK7$+NN=u3MaS#v4X+Rn2 z5QqE9=P>5EjQjamAG|>vz{^wSfQGQj2SA(0=QR@&qO& zfgZMz+%i|1PdrvgTbBa4b)}kxjD-5y9!w6tQ=Y@LPfXMS9X-_P7>(X?G z^ydgdwGVgl4VX6LCf7yd$WV@HParo~=?OWx2_V}=_Y8h4 zQK1lMe~myU#3~7}C;e~;?Z}lH_x~fhAx)e*Wfc^uUb=s3ROq~r0PY}rxiL$bWA3#&ECE;#WB(oV}qArsy&B<{MmQNIjoo3WZDgEm($ zfT~lF>xR0-dmhmkC}C9$a-#+fmzUIH6hX>K$H$@(a+@rIQH313HB6v#4JIwpG6I{U z3R+=Q$FvGe4Vz&`WxnMch?{e`MuqSXP~3yri&?f1>b3RN?TzjAwb?5O z%IvQ1?jL+No6@QDC!#nYBZh_2Z1-e=X0;udxsYPP(G1KJ z!Xu6$lpx9~*I_E`GS?GVCm+d#(*HREW8vt~;Cgib(k)^eJsq{d#i<}E$3%uw$_FsR zX@|H0@4pr7(c3#P?GZ*@tN&66c=Yl^m}?o-4j9q-F^=V9*S2t?_usET_Ly@|$Gce6 z63NB3b$D3YB)lRofYK{$#TNkF^iacP48l>L+#H9iwYsz#CintI+srd@){AERD6uj& z4{EDJsOltu9L&0Gt5cX7a!!cWaEYgsGEB--9%D{XSLK!FZTktbEom19U(g9%6@n24 zReJ<*Zj~gGc)uE$kCI1QfSC(Xke&)^(ToxGV}SDmCm3L#kBhpcD4eoXC3*FqG~C3o zlN7*eZfDuY>pzwocWbHdm%;D#aGeltZ2I?eqLa`7hlE8vm#FA1H5bDGdZ7ec~&%I8hjeA z#qd6RUHRty2JGF0&BN)6gy90otp77|l`r3evxv$e#yaj2t>iXZ*E0>%#Jl6Ac)5-v zuNlho1o}8gNEa_LHZerRCSIR4Gl=Kzqx=1@hzH@<(7?yjTR)tnW%zk>24?{O0internalAddGeneratedFile( + ' +´ +"google/cloud/run/v2/revision.protogoogle.cloud.run.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/launch_stage.protogoogle/api/resource.protogoogle/api/routing.proto#google/cloud/run/v2/condition.proto!google/cloud/run/v2/k8s.min.proto google/cloud/run/v2/status.proto)google/cloud/run/v2/vendor_settings.proto#google/longrunning/operations.protogoogle/protobuf/duration.protogoogle/protobuf/timestamp.proto"G +GetRevisionRequest1 +name ( B#àAúA +run.googleapis.com/Revision"ˆ +ListRevisionsRequest3 +parent ( B#àAúArun.googleapis.com/Revision + page_size ( + +page_token (  + show_deleted ("b +ListRevisionsResponse0 + revisions ( 2.google.cloud.run.v2.Revision +next_page_token ( "o +DeleteRevisionRequest1 +name ( B#àAúA +run.googleapis.com/Revision + validate_only ( +etag ( "ß +Revision +name ( BàA +uid ( BàA + +generation (BàA> +labels ( 2).google.cloud.run.v2.Revision.LabelsEntryBàAH + annotations ( 2..google.cloud.run.v2.Revision.AnnotationsEntryBàA4 + create_time ( 2.google.protobuf.TimestampBàA4 + update_time ( 2.google.protobuf.TimestampBàA4 + delete_time ( 2.google.protobuf.TimestampBàA4 + expire_time ( 2.google.protobuf.TimestampBàA- + launch_stage + (2.google.api.LaunchStage3 +service ( B"àAúA +run.googleapis.com/Service5 +scaling ( 2$.google.cloud.run.v2.RevisionScaling2 + +vpc_access ( 2.google.cloud.run.v2.VpcAccess( + max_instance_request_concurrency" (* +timeout ( 2.google.protobuf.Duration +service_account ( 2 + +containers ( 2.google.cloud.run.v2.Container, +volumes ( 2.google.cloud.run.v2.VolumeH +execution_environment (2).google.cloud.run.v2.ExecutionEnvironment> +encryption_key ( B&úA# +!cloudkms.googleapis.com/CryptoKey6 + service_mesh ( 2 .google.cloud.run.v2.ServiceMesh\\ + encryption_key_revocation_action (22.google.cloud.run.v2.EncryptionKeyRevocationActionC + encryption_key_shutdown_duration ( 2.google.protobuf.Duration + reconciling (BàA7 + +conditions ( 2.google.cloud.run.v2.ConditionBàA +observed_generation (BàA +log_uri! ( BàA + satisfies_pzs% (BàA +session_affinity& (G +scaling_status\' ( 2*.google.cloud.run.v2.RevisionScalingStatusBàA8 + node_selector( ( 2!.google.cloud.run.v2.NodeSelector +etagc ( BàA- + LabelsEntry +key (  +value ( :82 +AnnotationsEntry +key (  +value ( :8:têAq +run.googleapis.com/RevisionOprojects/{project}/locations/{location}/services/{service}/revisions/{revision}R2… + RevisionsÒ + GetRevision\'.google.cloud.run.v2.GetRevisionRequest.google.cloud.run.v2.Revision"{ÚAname‚Óä“:8/v2/{name=projects/*/locations/*/services/*/revisions/*}ŠÓä“., +name$projects/*/locations/{location=*}/**ç + ListRevisions).google.cloud.run.v2.ListRevisionsRequest*.google.cloud.run.v2.ListRevisionsResponse"ÚAparent‚Óä“:8/v2/{parent=projects/*/locations/*/services/*}/revisionsŠÓä“0. +parent$projects/*/locations/{location=*}/**ð +DeleteRevision*.google.cloud.run.v2.DeleteRevisionRequest.google.longrunning.Operation"’ÊA +RevisionRevisionÚAname‚Óä“:*8/v2/{name=projects/*/locations/*/services/*/revisions/*}ŠÓä“., +name$projects/*/locations/{location=*}/**FÊArun.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformBU +com.google.cloud.run.v2B RevisionProtoPZ)cloud.google.com/go/run/apiv2/runpb;runpbbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/RevisionTemplate.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/RevisionTemplate.php new file mode 100644 index 000000000000..0df8acbe163b --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/RevisionTemplate.php @@ -0,0 +1,62 @@ +internalAddGeneratedFile( + ' +Ð ++google/cloud/run/v2/revision_template.protogoogle.cloud.run.v2google/api/resource.proto!google/cloud/run/v2/k8s.min.proto)google/cloud/run/v2/vendor_settings.protogoogle/protobuf/duration.proto"› +RevisionTemplate5 +revision ( B#àAúA +run.googleapis.com/RevisionF +labels ( 21.google.cloud.run.v2.RevisionTemplate.LabelsEntryBàAP + annotations ( 26.google.cloud.run.v2.RevisionTemplate.AnnotationsEntryBàA: +scaling ( 2$.google.cloud.run.v2.RevisionScalingBàA7 + +vpc_access ( 2.google.cloud.run.v2.VpcAccessBàA/ +timeout ( 2.google.protobuf.DurationBàA +service_account ( BàA2 + +containers + ( 2.google.cloud.run.v2.Container1 +volumes ( 2.google.cloud.run.v2.VolumeBàAM +execution_environment (2).google.cloud.run.v2.ExecutionEnvironmentBàA> +encryption_key ( B&úA# +!cloudkms.googleapis.com/CryptoKey- + max_instance_request_concurrency (BàA; + service_mesh ( 2 .google.cloud.run.v2.ServiceMeshBàAa + encryption_key_revocation_action (22.google.cloud.run.v2.EncryptionKeyRevocationActionBàAH + encryption_key_shutdown_duration ( 2.google.protobuf.DurationBàA +session_affinity (BàA" +health_check_disabled (BàA= + node_selector ( 2!.google.cloud.run.v2.NodeSelectorBàA- + LabelsEntry +key (  +value ( :82 +AnnotationsEntry +key (  +value ( :8B] +com.google.cloud.run.v2BRevisionTemplateProtoPZ)cloud.google.com/go/run/apiv2/runpb;runpbbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Service.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Service.php new file mode 100644 index 000000000000..784370ba87dd --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Service.php @@ -0,0 +1,135 @@ +internalAddGeneratedFile( + ' +É% +!google/cloud/run/v2/service.protogoogle.cloud.run.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/launch_stage.protogoogle/api/resource.protogoogle/api/routing.proto#google/cloud/run/v2/condition.proto+google/cloud/run/v2/revision_template.proto(google/cloud/run/v2/traffic_target.proto)google/cloud/run/v2/vendor_settings.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.proto#google/longrunning/operations.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"® +CreateServiceRequest2 +parent ( B"àAúArun.googleapis.com/Service2 +service ( 2.google.cloud.run.v2.ServiceBàA + +service_id ( BàA + validate_only ("³ +UpdateServiceRequest4 + update_mask ( 2.google.protobuf.FieldMaskBàA2 +service ( 2.google.cloud.run.v2.ServiceBàA + validate_only ( + allow_missing (BàA"† +ListServicesRequest2 +parent ( B"àAúArun.googleapis.com/Service + page_size ( + +page_token (  + show_deleted ("_ +ListServicesResponse. +services ( 2.google.cloud.run.v2.Service +next_page_token ( "E +GetServiceRequest0 +name ( B"àAúA +run.googleapis.com/Service"m +DeleteServiceRequest0 +name ( B"àAúA +run.googleapis.com/Service + validate_only ( +etag ( "€ +Service +name (  + description (  +uid ( BàA + +generation (BàA= +labels ( 2(.google.cloud.run.v2.Service.LabelsEntryBàAG + annotations ( 2-.google.cloud.run.v2.Service.AnnotationsEntryBàA4 + create_time ( 2.google.protobuf.TimestampBàA4 + update_time ( 2.google.protobuf.TimestampBàA4 + delete_time ( 2.google.protobuf.TimestampBàA4 + expire_time + ( 2.google.protobuf.TimestampBàA +creator ( BàA + last_modifier ( BàA +client (  +client_version ( 9 +ingress (2#.google.cloud.run.v2.IngressTrafficBàA2 + launch_stage (2.google.api.LaunchStageBàAK +binary_authorization ( 2(.google.cloud.run.v2.BinaryAuthorizationBàA< +template ( 2%.google.cloud.run.v2.RevisionTemplateBàA8 +traffic ( 2".google.cloud.run.v2.TrafficTargetBàA9 +scaling ( 2#.google.cloud.run.v2.ServiceScalingBàA! +invoker_iam_disabled (BàA! +default_uri_disabled (BàA +urls ( BàA +custom_audiences% (  +observed_generation (BàA? +terminal_condition ( 2.google.cloud.run.v2.ConditionBàA7 + +conditions ( 2.google.cloud.run.v2.ConditionBàAB +latest_ready_revision! ( B#àAúA +run.googleapis.com/RevisionD +latest_created_revision" ( B#àAúA +run.googleapis.com/RevisionG +traffic_statuses# ( 2(.google.cloud.run.v2.TrafficTargetStatusBàA +uri$ ( BàA + satisfies_pzs& (BàA + reconcilingb (BàA +etagc ( BàA- + LabelsEntry +key (  +value ( :82 +AnnotationsEntry +key (  +value ( :8:^êA[ +run.googleapis.com/Service:projects/{project}/locations/{location}/services/{service}R2Í +Servicesý + CreateService).google.cloud.run.v2.CreateServiceRequest.google.longrunning.Operation"¡ÊA +ServiceServiceÚAparent,service,service_id‚Óä“7",/v2/{parent=projects/*/locations/*}/services:serviceŠÓä“-+ +parent!projects/*/locations/{location=*}à + +GetService&.google.cloud.run.v2.GetServiceRequest.google.cloud.run.v2.Service"oÚAname‚Óä“.,/v2/{name=projects/*/locations/*/services/*}ŠÓä“., +name$projects/*/locations/{location=*}/**Õ + ListServices(.google.cloud.run.v2.ListServicesRequest).google.cloud.run.v2.ListServicesResponse"pÚAparent‚Óä“.,/v2/{parent=projects/*/locations/*}/servicesŠÓä“-+ +parent!projects/*/locations/{location=*}’ + UpdateService).google.cloud.run.v2.UpdateServiceRequest.google.longrunning.Operation"¶ÊA +ServiceServiceÚAserviceÚAservice,update_mask‚Óä“?24/v2/{service.name=projects/*/locations/*/services/*}:serviceŠÓä“64 + service.name$projects/*/locations/{location=*}/**à + DeleteService).google.cloud.run.v2.DeleteServiceRequest.google.longrunning.Operation"„ÊA +ServiceServiceÚAname‚Óä“.*,/v2/{name=projects/*/locations/*/services/*}ŠÓä“., +name$projects/*/locations/{location=*}/** + GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy"E‚Óä“?=/v2/{resource=projects/*/locations/*/services/*}:getIamPolicy“ + SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy"H‚Óä“B"=/v2/{resource=projects/*/locations/*/services/*}:setIamPolicy:*¹ +TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"N‚Óä“H"C/v2/{resource=projects/*/locations/*/services/*}:testIamPermissions:*FÊArun.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformBT +com.google.cloud.run.v2B ServiceProtoPZ)cloud.google.com/go/run/apiv2/runpb;runpbbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Status.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Status.php new file mode 100644 index 000000000000..2b1ce742f014 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Status.php @@ -0,0 +1,29 @@ +internalAddGeneratedFile( + ' +Ñ + google/cloud/run/v2/status.protogoogle.cloud.run.v2"; +RevisionScalingStatus" +desired_min_instance_count (BS +com.google.cloud.run.v2B StatusProtoPZ)cloud.google.com/go/run/apiv2/runpb;runpbbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Task.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Task.php new file mode 100644 index 000000000000..868016cd6573 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/Task.php @@ -0,0 +1,103 @@ +internalAddGeneratedFile( + ' +ø +google/cloud/run/v2/task.protogoogle.cloud.run.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto#google/cloud/run/v2/condition.proto!google/cloud/run/v2/k8s.min.proto)google/cloud/run/v2/vendor_settings.protogoogle/protobuf/duration.protogoogle/protobuf/timestamp.protogoogle/rpc/status.proto"? +GetTaskRequest- +name ( BàAúA +run.googleapis.com/Task"€ +ListTasksRequest/ +parent ( BàAúArun.googleapis.com/Task + page_size ( + +page_token (  + show_deleted ("V +ListTasksResponse( +tasks ( 2.google.cloud.run.v2.Task +next_page_token ( "¸ +Task +name ( BàA +uid ( BàA + +generation (BàA: +labels ( 2%.google.cloud.run.v2.Task.LabelsEntryBàAD + annotations ( 2*.google.cloud.run.v2.Task.AnnotationsEntryBàA4 + create_time ( 2.google.protobuf.TimestampBàA7 +scheduled_time" ( 2.google.protobuf.TimestampBàA3 + +start_time ( 2.google.protobuf.TimestampBàA8 +completion_time ( 2.google.protobuf.TimestampBàA4 + update_time ( 2.google.protobuf.TimestampBàA4 + delete_time ( 2.google.protobuf.TimestampBàA4 + expire_time + ( 2.google.protobuf.TimestampBàA+ +job ( BàAúA +run.googleapis.com/Job7 + execution ( B$àAúA +run.googleapis.com/Execution2 + +containers ( 2.google.cloud.run.v2.Container, +volumes ( 2.google.cloud.run.v2.Volume + max_retries (* +timeout ( 2.google.protobuf.Duration +service_account ( H +execution_environment (2).google.cloud.run.v2.ExecutionEnvironment + reconciling (BàA7 + +conditions ( 2.google.cloud.run.v2.ConditionBàA +observed_generation (BàA +index (BàA +retried (BàAH +last_attempt_result ( 2&.google.cloud.run.v2.TaskAttemptResultBàAA +encryption_key ( B)àAúA# +!cloudkms.googleapis.com/CryptoKey7 + +vpc_access ( 2.google.cloud.run.v2.VpcAccessBàA +log_uri ( BàA + satisfies_pzs! (BàA +etagc ( BàA- + LabelsEntry +key (  +value ( :82 +AnnotationsEntry +key (  +value ( :8:wêAt +run.googleapis.com/TaskVprojects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}R"T +TaskAttemptResult\' +status ( 2.google.rpc.StatusBàA + exit_code (BàA2– +Tasks— +GetTask#.google.cloud.run.v2.GetTaskRequest.google.cloud.run.v2.Task"LÚAname‚Óä“?=/v2/{name=projects/*/locations/*/jobs/*/executions/*/tasks/*}ª + ListTasks%.google.cloud.run.v2.ListTasksRequest&.google.cloud.run.v2.ListTasksResponse"NÚAparent‚Óä“?=/v2/{parent=projects/*/locations/*/jobs/*/executions/*}/tasksFÊArun.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformBQ +com.google.cloud.run.v2B TaskProtoPZ)cloud.google.com/go/run/apiv2/runpb;runpbbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/TaskTemplate.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/TaskTemplate.php new file mode 100644 index 0000000000000000000000000000000000000000..75bcf93617ef9dc602423b9df478aafd2ecd206c GIT binary patch literal 1579 zcma)6(M}UV6tz~Y3gbb4DR-JRLY%r;cR zFZn~h_#HkuJG)y-C<%RNo85EH+KH1-#BWm8LASYq)^2JAqF0lsVBl-S%$nks+2WR!;S_&@Qk)& zH4);(2Ne(s_^??&0Zn>D6Zg>4-MxtJo`u|PSGEzN9#IOnj7%$0LB9|-pCIgdjAEsU zHa{Cobr@%w5s&>eP3+)4@e~+=+t_}{sb+%Xh;Yg&6iYbPjIbMlFir2^w4P?Hz-v0A-ViCbM1SUxyLrzE&cBF(jvaN! zjJh+btSl#N60ovNe2pi5Wo?%5a7#Hp;|ZiR3o^16byVU}0$oj@_BNTxEcX&4;`eWU zXVKH?3zM&yYb3ZP%v^C*$lz>op|a}4DmQv?_EK2>1Imqr7n+M&cxVZ)W)j*KQ_udb zW%5gC!6%m;Gr*D=S{7%Db6+3i%P6Or4sg5tjENf;fh8{u4r@fJTLaQiUhB!P(xn16s2vdvJXo zB1tuFQnYc_=}PYIYQ3&h zP(OwT_yWF;C&qS~HngZb;s@U}=ggToGyDF7JeKGM?omz^(R7BVXILLoES1nA5D}gx zVMrAY#EE1PRTjpb0qzex>~vi3IY48PsDRe-T!?u@t3f1^Syd&xdRnV$MZ%B;6HU~d zYAYi}h?5f?XbtG)y}I zUGQD5sp2H^J2VaylUk@Dgx2d&+OmJ?pK@i9Hl<@BF6SES^=l%VSgV9y&5p66I#Ill z=}rmGmv8$JA>%|MS<3^Vu9hCY+DXkerKxc1h%0cEWq>?jfe_$s&uIJ1WCD|*Ue_%5yi z$AcFBWj{mPX~LX~NETZ#qt($O&U}LINeY9>b#Waao908buF1T(k>YoL8fa@J;~2&$ ziT^*Psq93t;$|v)@4JDvS7iUuC=2a*BfHym+Y`?o^&D?v9~=zYw&xD|6YulTnSAPx zhfdq=x=yEX$E={2x5OXVo-_6ehWQHlrCVZ0&Y?SoOog@95qb)4++=jiTqz*iuAy;M z$w%m7GQi2X$W9S(77h|{T233;eR?-LM&6Z{gZnz)qAN@H*M-X>^W8W{=Lr1<&5@7> literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/VendorSettings.php b/owl-bot-staging/Run/v2/proto/src/GPBMetadata/Google/Cloud/Run/V2/VendorSettings.php new file mode 100644 index 0000000000000000000000000000000000000000..5504bca48fbb4fb082ec617d7bef602dfd51f869 GIT binary patch literal 2510 zcmb7GUvt_<5Dz$Yfecu!#FDFp}gg)k;qZ^!5n#DTz^?~l|y@~|rl|q1CD-gZz?n3~> z(mjuKB~UxYftNt==LCJrG>GTxK0fZ6o@NTuH+9QA#zgkWP`5me5NB$n+mx{fuH}o!KCXS&?n_Ps2P+krN zoG(r7l|5MGBZT+TN%UOZ&Bmsuxa4NR!Z#-Eiwl3#gwg~>aQ|1^eU6etO$<@XUV4En zWS4jI{{f{&j#5jZpG4g3Kx%$LxdtD`QR4h$>*LlEx}6)^2MDYP-ow)%_|fr!FaLuuN+;t<$3W`_)n^p=`iYjNNAoL|+a(t_}E54=i62z9M-&x}=m~(Xp{r zkFZ1`-3M61H}nhG?n@y3U7-0rYf481xd-XK%k}4@a3E;U0?#*xrXhpNO^i}5UWK&~ z6(NtcF-L}jOdHl(d}4Y?vu)sX5F_O?P{yXf&BMmT_SXzM5E1DQqGE;y`ipsku-cJ9 zhQV^1yA#vkb?zN1-@;{_X@~JfW#7019?)7USxm!q?c9i&EUc&q-R72TY9$TJVISkEqrdHO z?1ALYp9xs43fYhyS0ADda7S+<7b)#n#dDNU(enl}OUw=u{i3 z#?)@L)lln9?aU?cDQuo^R$=M`%;VqIcT>q72W~N8xJOPH|1m$pp0K0-q4F?PzJmKq zEw!FDC6UMMsn%lMMhW*2dC`)5oEaNUvm+`zlXGt`xre;L1> zgoogle.cloud.run.v2.BinaryAuthorization + */ +class BinaryAuthorization extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. If present, indicates to use Breakglass using this justification. + * If use_default is False, then it must be empty. + * For more information on breakglass, see + * https://cloud.google.com/binary-authorization/docs/using-breakglass + * + * Generated from protobuf field string breakglass_justification = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $breakglass_justification = ''; + protected $binauthz_method; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $use_default + * Optional. If True, indicates to use the default project's binary + * authorization policy. If False, binary authorization will be disabled. + * @type string $policy + * Optional. The path to a binary authorization policy. + * Format: `projects/{project}/platforms/cloudRun/{policy-name}` + * @type string $breakglass_justification + * Optional. If present, indicates to use Breakglass using this justification. + * If use_default is False, then it must be empty. + * For more information on breakglass, see + * https://cloud.google.com/binary-authorization/docs/using-breakglass + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); + parent::__construct($data); + } + + /** + * Optional. If True, indicates to use the default project's binary + * authorization policy. If False, binary authorization will be disabled. + * + * Generated from protobuf field bool use_default = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getUseDefault() + { + return $this->readOneof(1); + } + + public function hasUseDefault() + { + return $this->hasOneof(1); + } + + /** + * Optional. If True, indicates to use the default project's binary + * authorization policy. If False, binary authorization will be disabled. + * + * Generated from protobuf field bool use_default = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setUseDefault($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. The path to a binary authorization policy. + * Format: `projects/{project}/platforms/cloudRun/{policy-name}` + * + * Generated from protobuf field string policy = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getPolicy() + { + return $this->readOneof(3); + } + + public function hasPolicy() + { + return $this->hasOneof(3); + } + + /** + * Optional. The path to a binary authorization policy. + * Format: `projects/{project}/platforms/cloudRun/{policy-name}` + * + * Generated from protobuf field string policy = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. If present, indicates to use Breakglass using this justification. + * If use_default is False, then it must be empty. + * For more information on breakglass, see + * https://cloud.google.com/binary-authorization/docs/using-breakglass + * + * Generated from protobuf field string breakglass_justification = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getBreakglassJustification() + { + return $this->breakglass_justification; + } + + /** + * Optional. If present, indicates to use Breakglass using this justification. + * If use_default is False, then it must be empty. + * For more information on breakglass, see + * https://cloud.google.com/binary-authorization/docs/using-breakglass + * + * Generated from protobuf field string breakglass_justification = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setBreakglassJustification($var) + { + GPBUtil::checkString($var, True); + $this->breakglass_justification = $var; + + return $this; + } + + /** + * @return string + */ + public function getBinauthzMethod() + { + return $this->whichOneof("binauthz_method"); + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CancelExecutionRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CancelExecutionRequest.php new file mode 100644 index 000000000000..771e535b0e3a --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CancelExecutionRequest.php @@ -0,0 +1,172 @@ +google.cloud.run.v2.CancelExecutionRequest + */ +class CancelExecutionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the Execution to cancel. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Indicates that the request should be validated without actually + * cancelling any resources. + * + * Generated from protobuf field bool validate_only = 2; + */ + protected $validate_only = false; + /** + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + */ + protected $etag = ''; + + /** + * @param string $name Required. The name of the Execution to cancel. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. Please see + * {@see ExecutionsClient::executionName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\CancelExecutionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the Execution to cancel. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * @type bool $validate_only + * Indicates that the request should be validated without actually + * cancelling any resources. + * @type string $etag + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Execution::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the Execution to cancel. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the Execution to cancel. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Indicates that the request should be validated without actually + * cancelling any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated without actually + * cancelling any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CloudSqlInstance.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CloudSqlInstance.php new file mode 100644 index 000000000000..93ca08a9f462 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CloudSqlInstance.php @@ -0,0 +1,86 @@ +google.cloud.run.v2.CloudSqlInstance + */ +class CloudSqlInstance extends \Google\Protobuf\Internal\Message +{ + /** + * The Cloud SQL instance connection names, as can be found in + * https://console.cloud.google.com/sql/instances. Visit + * https://cloud.google.com/sql/docs/mysql/connect-run for more information on + * how to connect Cloud SQL and Cloud Run. Format: + * {project}:{location}:{instance} + * + * Generated from protobuf field repeated string instances = 1; + */ + private $instances; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $instances + * The Cloud SQL instance connection names, as can be found in + * https://console.cloud.google.com/sql/instances. Visit + * https://cloud.google.com/sql/docs/mysql/connect-run for more information on + * how to connect Cloud SQL and Cloud Run. Format: + * {project}:{location}:{instance} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * The Cloud SQL instance connection names, as can be found in + * https://console.cloud.google.com/sql/instances. Visit + * https://cloud.google.com/sql/docs/mysql/connect-run for more information on + * how to connect Cloud SQL and Cloud Run. Format: + * {project}:{location}:{instance} + * + * Generated from protobuf field repeated string instances = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * The Cloud SQL instance connection names, as can be found in + * https://console.cloud.google.com/sql/instances. Visit + * https://cloud.google.com/sql/docs/mysql/connect-run for more information on + * how to connect Cloud SQL and Cloud Run. Format: + * {project}:{location}:{instance} + * + * Generated from protobuf field repeated string instances = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->instances = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition.php new file mode 100644 index 000000000000..e15712d24b3f --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition.php @@ -0,0 +1,337 @@ +google.cloud.run.v2.Condition + */ +class Condition extends \Google\Protobuf\Internal\Message +{ + /** + * type is used to communicate the status of the reconciliation process. + * See also: + * https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting + * Types common to all resources include: + * * "Ready": True when the Resource is ready. + * + * Generated from protobuf field string type = 1; + */ + protected $type = ''; + /** + * State of the condition. + * + * Generated from protobuf field .google.cloud.run.v2.Condition.State state = 2; + */ + protected $state = 0; + /** + * Human readable message indicating details about the current status. + * + * Generated from protobuf field string message = 3; + */ + protected $message = ''; + /** + * Last time the condition transitioned from one status to another. + * + * Generated from protobuf field .google.protobuf.Timestamp last_transition_time = 4; + */ + protected $last_transition_time = null; + /** + * How to interpret failures of this condition, one of Error, Warning, Info + * + * Generated from protobuf field .google.cloud.run.v2.Condition.Severity severity = 5; + */ + protected $severity = 0; + protected $reasons; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type + * type is used to communicate the status of the reconciliation process. + * See also: + * https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting + * Types common to all resources include: + * * "Ready": True when the Resource is ready. + * @type int $state + * State of the condition. + * @type string $message + * Human readable message indicating details about the current status. + * @type \Google\Protobuf\Timestamp $last_transition_time + * Last time the condition transitioned from one status to another. + * @type int $severity + * How to interpret failures of this condition, one of Error, Warning, Info + * @type int $reason + * Output only. A common (service-level) reason for this condition. + * @type int $revision_reason + * Output only. A reason for the revision condition. + * @type int $execution_reason + * Output only. A reason for the execution condition. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Condition::initOnce(); + parent::__construct($data); + } + + /** + * type is used to communicate the status of the reconciliation process. + * See also: + * https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting + * Types common to all resources include: + * * "Ready": True when the Resource is ready. + * + * Generated from protobuf field string type = 1; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * type is used to communicate the status of the reconciliation process. + * See also: + * https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting + * Types common to all resources include: + * * "Ready": True when the Resource is ready. + * + * Generated from protobuf field string type = 1; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * State of the condition. + * + * Generated from protobuf field .google.cloud.run.v2.Condition.State state = 2; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * State of the condition. + * + * Generated from protobuf field .google.cloud.run.v2.Condition.State state = 2; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\Condition\State::class); + $this->state = $var; + + return $this; + } + + /** + * Human readable message indicating details about the current status. + * + * Generated from protobuf field string message = 3; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * Human readable message indicating details about the current status. + * + * Generated from protobuf field string message = 3; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + + /** + * Last time the condition transitioned from one status to another. + * + * Generated from protobuf field .google.protobuf.Timestamp last_transition_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastTransitionTime() + { + return $this->last_transition_time; + } + + public function hasLastTransitionTime() + { + return isset($this->last_transition_time); + } + + public function clearLastTransitionTime() + { + unset($this->last_transition_time); + } + + /** + * Last time the condition transitioned from one status to another. + * + * Generated from protobuf field .google.protobuf.Timestamp last_transition_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastTransitionTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_transition_time = $var; + + return $this; + } + + /** + * How to interpret failures of this condition, one of Error, Warning, Info + * + * Generated from protobuf field .google.cloud.run.v2.Condition.Severity severity = 5; + * @return int + */ + public function getSeverity() + { + return $this->severity; + } + + /** + * How to interpret failures of this condition, one of Error, Warning, Info + * + * Generated from protobuf field .google.cloud.run.v2.Condition.Severity severity = 5; + * @param int $var + * @return $this + */ + public function setSeverity($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\Condition\Severity::class); + $this->severity = $var; + + return $this; + } + + /** + * Output only. A common (service-level) reason for this condition. + * + * Generated from protobuf field .google.cloud.run.v2.Condition.CommonReason reason = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getReason() + { + return $this->readOneof(6); + } + + public function hasReason() + { + return $this->hasOneof(6); + } + + /** + * Output only. A common (service-level) reason for this condition. + * + * Generated from protobuf field .google.cloud.run.v2.Condition.CommonReason reason = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setReason($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\Condition\CommonReason::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Output only. A reason for the revision condition. + * + * Generated from protobuf field .google.cloud.run.v2.Condition.RevisionReason revision_reason = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getRevisionReason() + { + return $this->readOneof(9); + } + + public function hasRevisionReason() + { + return $this->hasOneof(9); + } + + /** + * Output only. A reason for the revision condition. + * + * Generated from protobuf field .google.cloud.run.v2.Condition.RevisionReason revision_reason = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setRevisionReason($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\Condition\RevisionReason::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Output only. A reason for the execution condition. + * + * Generated from protobuf field .google.cloud.run.v2.Condition.ExecutionReason execution_reason = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getExecutionReason() + { + return $this->readOneof(11); + } + + public function hasExecutionReason() + { + return $this->hasOneof(11); + } + + /** + * Output only. A reason for the execution condition. + * + * Generated from protobuf field .google.cloud.run.v2.Condition.ExecutionReason execution_reason = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setExecutionReason($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\Condition\ExecutionReason::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * @return string + */ + public function getReasons() + { + return $this->whichOneof("reasons"); + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/CommonReason.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/CommonReason.php new file mode 100644 index 000000000000..b7883e34e0a2 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/CommonReason.php @@ -0,0 +1,148 @@ +google.cloud.run.v2.Condition.CommonReason + */ +class CommonReason +{ + /** + * Default value. + * + * Generated from protobuf enum COMMON_REASON_UNDEFINED = 0; + */ + const COMMON_REASON_UNDEFINED = 0; + /** + * Reason unknown. Further details will be in message. + * + * Generated from protobuf enum UNKNOWN = 1; + */ + const UNKNOWN = 1; + /** + * Revision creation process failed. + * + * Generated from protobuf enum REVISION_FAILED = 3; + */ + const REVISION_FAILED = 3; + /** + * Timed out waiting for completion. + * + * Generated from protobuf enum PROGRESS_DEADLINE_EXCEEDED = 4; + */ + const PROGRESS_DEADLINE_EXCEEDED = 4; + /** + * The container image path is incorrect. + * + * Generated from protobuf enum CONTAINER_MISSING = 6; + */ + const CONTAINER_MISSING = 6; + /** + * Insufficient permissions on the container image. + * + * Generated from protobuf enum CONTAINER_PERMISSION_DENIED = 7; + */ + const CONTAINER_PERMISSION_DENIED = 7; + /** + * Container image is not authorized by policy. + * + * Generated from protobuf enum CONTAINER_IMAGE_UNAUTHORIZED = 8; + */ + const CONTAINER_IMAGE_UNAUTHORIZED = 8; + /** + * Container image policy authorization check failed. + * + * Generated from protobuf enum CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED = 9; + */ + const CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED = 9; + /** + * Insufficient permissions on encryption key. + * + * Generated from protobuf enum ENCRYPTION_KEY_PERMISSION_DENIED = 10; + */ + const ENCRYPTION_KEY_PERMISSION_DENIED = 10; + /** + * Permission check on encryption key failed. + * + * Generated from protobuf enum ENCRYPTION_KEY_CHECK_FAILED = 11; + */ + const ENCRYPTION_KEY_CHECK_FAILED = 11; + /** + * At least one Access check on secrets failed. + * + * Generated from protobuf enum SECRETS_ACCESS_CHECK_FAILED = 12; + */ + const SECRETS_ACCESS_CHECK_FAILED = 12; + /** + * Waiting for operation to complete. + * + * Generated from protobuf enum WAITING_FOR_OPERATION = 13; + */ + const WAITING_FOR_OPERATION = 13; + /** + * System will retry immediately. + * + * Generated from protobuf enum IMMEDIATE_RETRY = 14; + */ + const IMMEDIATE_RETRY = 14; + /** + * System will retry later; current attempt failed. + * + * Generated from protobuf enum POSTPONED_RETRY = 15; + */ + const POSTPONED_RETRY = 15; + /** + * An internal error occurred. Further information may be in the message. + * + * Generated from protobuf enum INTERNAL = 16; + */ + const INTERNAL = 16; + + private static $valueToName = [ + self::COMMON_REASON_UNDEFINED => 'COMMON_REASON_UNDEFINED', + self::UNKNOWN => 'UNKNOWN', + self::REVISION_FAILED => 'REVISION_FAILED', + self::PROGRESS_DEADLINE_EXCEEDED => 'PROGRESS_DEADLINE_EXCEEDED', + self::CONTAINER_MISSING => 'CONTAINER_MISSING', + self::CONTAINER_PERMISSION_DENIED => 'CONTAINER_PERMISSION_DENIED', + self::CONTAINER_IMAGE_UNAUTHORIZED => 'CONTAINER_IMAGE_UNAUTHORIZED', + self::CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED => 'CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED', + self::ENCRYPTION_KEY_PERMISSION_DENIED => 'ENCRYPTION_KEY_PERMISSION_DENIED', + self::ENCRYPTION_KEY_CHECK_FAILED => 'ENCRYPTION_KEY_CHECK_FAILED', + self::SECRETS_ACCESS_CHECK_FAILED => 'SECRETS_ACCESS_CHECK_FAILED', + self::WAITING_FOR_OPERATION => 'WAITING_FOR_OPERATION', + self::IMMEDIATE_RETRY => 'IMMEDIATE_RETRY', + self::POSTPONED_RETRY => 'POSTPONED_RETRY', + self::INTERNAL => 'INTERNAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CommonReason::class, \Google\Cloud\Run\V2\Condition_CommonReason::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/ExecutionReason.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/ExecutionReason.php new file mode 100644 index 000000000000..11956647ed44 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/ExecutionReason.php @@ -0,0 +1,86 @@ +google.cloud.run.v2.Condition.ExecutionReason + */ +class ExecutionReason +{ + /** + * Default value. + * + * Generated from protobuf enum EXECUTION_REASON_UNDEFINED = 0; + */ + const EXECUTION_REASON_UNDEFINED = 0; + /** + * Internal system error getting execution status. System will retry. + * + * Generated from protobuf enum JOB_STATUS_SERVICE_POLLING_ERROR = 1; + */ + const JOB_STATUS_SERVICE_POLLING_ERROR = 1; + /** + * A task reached its retry limit and the last attempt failed due to the + * user container exiting with a non-zero exit code. + * + * Generated from protobuf enum NON_ZERO_EXIT_CODE = 2; + */ + const NON_ZERO_EXIT_CODE = 2; + /** + * The execution was cancelled by users. + * + * Generated from protobuf enum CANCELLED = 3; + */ + const CANCELLED = 3; + /** + * The execution is in the process of being cancelled. + * + * Generated from protobuf enum CANCELLING = 4; + */ + const CANCELLING = 4; + /** + * The execution was deleted. + * + * Generated from protobuf enum DELETED = 5; + */ + const DELETED = 5; + + private static $valueToName = [ + self::EXECUTION_REASON_UNDEFINED => 'EXECUTION_REASON_UNDEFINED', + self::JOB_STATUS_SERVICE_POLLING_ERROR => 'JOB_STATUS_SERVICE_POLLING_ERROR', + self::NON_ZERO_EXIT_CODE => 'NON_ZERO_EXIT_CODE', + self::CANCELLED => 'CANCELLED', + self::CANCELLING => 'CANCELLING', + self::DELETED => 'DELETED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ExecutionReason::class, \Google\Cloud\Run\V2\Condition_ExecutionReason::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/RevisionReason.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/RevisionReason.php new file mode 100644 index 000000000000..267653375813 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/RevisionReason.php @@ -0,0 +1,141 @@ +google.cloud.run.v2.Condition.RevisionReason + */ +class RevisionReason +{ + /** + * Default value. + * + * Generated from protobuf enum REVISION_REASON_UNDEFINED = 0; + */ + const REVISION_REASON_UNDEFINED = 0; + /** + * Revision in Pending state. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * Revision is in Reserve state. + * + * Generated from protobuf enum RESERVE = 2; + */ + const RESERVE = 2; + /** + * Revision is Retired. + * + * Generated from protobuf enum RETIRED = 3; + */ + const RETIRED = 3; + /** + * Revision is being retired. + * + * Generated from protobuf enum RETIRING = 4; + */ + const RETIRING = 4; + /** + * Revision is being recreated. + * + * Generated from protobuf enum RECREATING = 5; + */ + const RECREATING = 5; + /** + * There was a health check error. + * + * Generated from protobuf enum HEALTH_CHECK_CONTAINER_ERROR = 6; + */ + const HEALTH_CHECK_CONTAINER_ERROR = 6; + /** + * Health check failed due to user error from customized path of the + * container. System will retry. + * + * Generated from protobuf enum CUSTOMIZED_PATH_RESPONSE_PENDING = 7; + */ + const CUSTOMIZED_PATH_RESPONSE_PENDING = 7; + /** + * A revision with min_instance_count > 0 was created and is reserved, but + * it was not configured to serve traffic, so it's not live. This can also + * happen momentarily during traffic migration. + * + * Generated from protobuf enum MIN_INSTANCES_NOT_PROVISIONED = 8; + */ + const MIN_INSTANCES_NOT_PROVISIONED = 8; + /** + * The maximum allowed number of active revisions has been reached. + * + * Generated from protobuf enum ACTIVE_REVISION_LIMIT_REACHED = 9; + */ + const ACTIVE_REVISION_LIMIT_REACHED = 9; + /** + * There was no deployment defined. + * This value is no longer used, but Services created in older versions of + * the API might contain this value. + * + * Generated from protobuf enum NO_DEPLOYMENT = 10; + */ + const NO_DEPLOYMENT = 10; + /** + * A revision's container has no port specified since the revision is of a + * manually scaled service with 0 instance count + * + * Generated from protobuf enum HEALTH_CHECK_SKIPPED = 11; + */ + const HEALTH_CHECK_SKIPPED = 11; + /** + * A revision with min_instance_count > 0 was created and is waiting for + * enough instances to begin a traffic migration. + * + * Generated from protobuf enum MIN_INSTANCES_WARMING = 12; + */ + const MIN_INSTANCES_WARMING = 12; + + private static $valueToName = [ + self::REVISION_REASON_UNDEFINED => 'REVISION_REASON_UNDEFINED', + self::PENDING => 'PENDING', + self::RESERVE => 'RESERVE', + self::RETIRED => 'RETIRED', + self::RETIRING => 'RETIRING', + self::RECREATING => 'RECREATING', + self::HEALTH_CHECK_CONTAINER_ERROR => 'HEALTH_CHECK_CONTAINER_ERROR', + self::CUSTOMIZED_PATH_RESPONSE_PENDING => 'CUSTOMIZED_PATH_RESPONSE_PENDING', + self::MIN_INSTANCES_NOT_PROVISIONED => 'MIN_INSTANCES_NOT_PROVISIONED', + self::ACTIVE_REVISION_LIMIT_REACHED => 'ACTIVE_REVISION_LIMIT_REACHED', + self::NO_DEPLOYMENT => 'NO_DEPLOYMENT', + self::HEALTH_CHECK_SKIPPED => 'HEALTH_CHECK_SKIPPED', + self::MIN_INSTANCES_WARMING => 'MIN_INSTANCES_WARMING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RevisionReason::class, \Google\Cloud\Run\V2\Condition_RevisionReason::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/Severity.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/Severity.php new file mode 100644 index 000000000000..eb2c0967fd4b --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/Severity.php @@ -0,0 +1,71 @@ +google.cloud.run.v2.Condition.Severity + */ +class Severity +{ + /** + * Unspecified severity + * + * Generated from protobuf enum SEVERITY_UNSPECIFIED = 0; + */ + const SEVERITY_UNSPECIFIED = 0; + /** + * Error severity. + * + * Generated from protobuf enum ERROR = 1; + */ + const ERROR = 1; + /** + * Warning severity. + * + * Generated from protobuf enum WARNING = 2; + */ + const WARNING = 2; + /** + * Info severity. + * + * Generated from protobuf enum INFO = 3; + */ + const INFO = 3; + + private static $valueToName = [ + self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED', + self::ERROR => 'ERROR', + self::WARNING => 'WARNING', + self::INFO => 'INFO', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Severity::class, \Google\Cloud\Run\V2\Condition_Severity::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/State.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/State.php new file mode 100644 index 000000000000..3ca42a0f1e32 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Condition/State.php @@ -0,0 +1,78 @@ +google.cloud.run.v2.Condition.State + */ +class State +{ + /** + * The default value. This value is used if the state is omitted. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Transient state: Reconciliation has not started yet. + * + * Generated from protobuf enum CONDITION_PENDING = 1; + */ + const CONDITION_PENDING = 1; + /** + * Transient state: reconciliation is still in progress. + * + * Generated from protobuf enum CONDITION_RECONCILING = 2; + */ + const CONDITION_RECONCILING = 2; + /** + * Terminal state: Reconciliation did not succeed. + * + * Generated from protobuf enum CONDITION_FAILED = 3; + */ + const CONDITION_FAILED = 3; + /** + * Terminal state: Reconciliation completed successfully. + * + * Generated from protobuf enum CONDITION_SUCCEEDED = 4; + */ + const CONDITION_SUCCEEDED = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CONDITION_PENDING => 'CONDITION_PENDING', + self::CONDITION_RECONCILING => 'CONDITION_RECONCILING', + self::CONDITION_FAILED => 'CONDITION_FAILED', + self::CONDITION_SUCCEEDED => 'CONDITION_SUCCEEDED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Run\V2\Condition_State::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Container.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Container.php new file mode 100644 index 000000000000..1dc5d80d18b9 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Container.php @@ -0,0 +1,531 @@ +google.cloud.run.v2.Container + */ +class Container extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the container specified as a DNS_LABEL (RFC 1123). + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. Name of the container image in Dockerhub, Google Artifact + * Registry, or Google Container Registry. If the host is not provided, + * Dockerhub is assumed. + * + * Generated from protobuf field string image = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $image = ''; + /** + * Entrypoint array. Not executed within a shell. + * The docker image's ENTRYPOINT is used if this is not provided. + * + * Generated from protobuf field repeated string command = 3; + */ + private $command; + /** + * Arguments to the entrypoint. + * The docker image's CMD is used if this is not provided. + * + * Generated from protobuf field repeated string args = 4; + */ + private $args; + /** + * List of environment variables to set in the container. + * + * Generated from protobuf field repeated .google.cloud.run.v2.EnvVar env = 5; + */ + private $env; + /** + * Compute Resource requirements by this container. + * + * Generated from protobuf field .google.cloud.run.v2.ResourceRequirements resources = 6; + */ + protected $resources = null; + /** + * List of ports to expose from the container. Only a single port can be + * specified. The specified ports must be listening on all interfaces + * (0.0.0.0) within the container to be accessible. + * If omitted, a port number will be chosen and passed to the container + * through the PORT environment variable for the container to listen on. + * + * Generated from protobuf field repeated .google.cloud.run.v2.ContainerPort ports = 7; + */ + private $ports; + /** + * Volume to mount into the container's filesystem. + * + * Generated from protobuf field repeated .google.cloud.run.v2.VolumeMount volume_mounts = 8; + */ + private $volume_mounts; + /** + * Container's working directory. + * If not specified, the container runtime's default will be used, which + * might be configured in the container image. + * + * Generated from protobuf field string working_dir = 9; + */ + protected $working_dir = ''; + /** + * Periodic probe of container liveness. + * Container will be restarted if the probe fails. + * + * Generated from protobuf field .google.cloud.run.v2.Probe liveness_probe = 10; + */ + protected $liveness_probe = null; + /** + * Startup probe of application within the container. + * All other probes are disabled if a startup probe is provided, until it + * succeeds. Container will not be added to service endpoints if the probe + * fails. + * + * Generated from protobuf field .google.cloud.run.v2.Probe startup_probe = 11; + */ + protected $startup_probe = null; + /** + * Names of the containers that must start before this container. + * + * Generated from protobuf field repeated string depends_on = 12; + */ + private $depends_on; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the container specified as a DNS_LABEL (RFC 1123). + * @type string $image + * Required. Name of the container image in Dockerhub, Google Artifact + * Registry, or Google Container Registry. If the host is not provided, + * Dockerhub is assumed. + * @type array|\Google\Protobuf\Internal\RepeatedField $command + * Entrypoint array. Not executed within a shell. + * The docker image's ENTRYPOINT is used if this is not provided. + * @type array|\Google\Protobuf\Internal\RepeatedField $args + * Arguments to the entrypoint. + * The docker image's CMD is used if this is not provided. + * @type array<\Google\Cloud\Run\V2\EnvVar>|\Google\Protobuf\Internal\RepeatedField $env + * List of environment variables to set in the container. + * @type \Google\Cloud\Run\V2\ResourceRequirements $resources + * Compute Resource requirements by this container. + * @type array<\Google\Cloud\Run\V2\ContainerPort>|\Google\Protobuf\Internal\RepeatedField $ports + * List of ports to expose from the container. Only a single port can be + * specified. The specified ports must be listening on all interfaces + * (0.0.0.0) within the container to be accessible. + * If omitted, a port number will be chosen and passed to the container + * through the PORT environment variable for the container to listen on. + * @type array<\Google\Cloud\Run\V2\VolumeMount>|\Google\Protobuf\Internal\RepeatedField $volume_mounts + * Volume to mount into the container's filesystem. + * @type string $working_dir + * Container's working directory. + * If not specified, the container runtime's default will be used, which + * might be configured in the container image. + * @type \Google\Cloud\Run\V2\Probe $liveness_probe + * Periodic probe of container liveness. + * Container will be restarted if the probe fails. + * @type \Google\Cloud\Run\V2\Probe $startup_probe + * Startup probe of application within the container. + * All other probes are disabled if a startup probe is provided, until it + * succeeds. Container will not be added to service endpoints if the probe + * fails. + * @type array|\Google\Protobuf\Internal\RepeatedField $depends_on + * Names of the containers that must start before this container. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Name of the container specified as a DNS_LABEL (RFC 1123). + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the container specified as a DNS_LABEL (RFC 1123). + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Name of the container image in Dockerhub, Google Artifact + * Registry, or Google Container Registry. If the host is not provided, + * Dockerhub is assumed. + * + * Generated from protobuf field string image = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getImage() + { + return $this->image; + } + + /** + * Required. Name of the container image in Dockerhub, Google Artifact + * Registry, or Google Container Registry. If the host is not provided, + * Dockerhub is assumed. + * + * Generated from protobuf field string image = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkString($var, True); + $this->image = $var; + + return $this; + } + + /** + * Entrypoint array. Not executed within a shell. + * The docker image's ENTRYPOINT is used if this is not provided. + * + * Generated from protobuf field repeated string command = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCommand() + { + return $this->command; + } + + /** + * Entrypoint array. Not executed within a shell. + * The docker image's ENTRYPOINT is used if this is not provided. + * + * Generated from protobuf field repeated string command = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCommand($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->command = $arr; + + return $this; + } + + /** + * Arguments to the entrypoint. + * The docker image's CMD is used if this is not provided. + * + * Generated from protobuf field repeated string args = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getArgs() + { + return $this->args; + } + + /** + * Arguments to the entrypoint. + * The docker image's CMD is used if this is not provided. + * + * Generated from protobuf field repeated string args = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setArgs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->args = $arr; + + return $this; + } + + /** + * List of environment variables to set in the container. + * + * Generated from protobuf field repeated .google.cloud.run.v2.EnvVar env = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEnv() + { + return $this->env; + } + + /** + * List of environment variables to set in the container. + * + * Generated from protobuf field repeated .google.cloud.run.v2.EnvVar env = 5; + * @param array<\Google\Cloud\Run\V2\EnvVar>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEnv($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\EnvVar::class); + $this->env = $arr; + + return $this; + } + + /** + * Compute Resource requirements by this container. + * + * Generated from protobuf field .google.cloud.run.v2.ResourceRequirements resources = 6; + * @return \Google\Cloud\Run\V2\ResourceRequirements|null + */ + public function getResources() + { + return $this->resources; + } + + public function hasResources() + { + return isset($this->resources); + } + + public function clearResources() + { + unset($this->resources); + } + + /** + * Compute Resource requirements by this container. + * + * Generated from protobuf field .google.cloud.run.v2.ResourceRequirements resources = 6; + * @param \Google\Cloud\Run\V2\ResourceRequirements $var + * @return $this + */ + public function setResources($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ResourceRequirements::class); + $this->resources = $var; + + return $this; + } + + /** + * List of ports to expose from the container. Only a single port can be + * specified. The specified ports must be listening on all interfaces + * (0.0.0.0) within the container to be accessible. + * If omitted, a port number will be chosen and passed to the container + * through the PORT environment variable for the container to listen on. + * + * Generated from protobuf field repeated .google.cloud.run.v2.ContainerPort ports = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPorts() + { + return $this->ports; + } + + /** + * List of ports to expose from the container. Only a single port can be + * specified. The specified ports must be listening on all interfaces + * (0.0.0.0) within the container to be accessible. + * If omitted, a port number will be chosen and passed to the container + * through the PORT environment variable for the container to listen on. + * + * Generated from protobuf field repeated .google.cloud.run.v2.ContainerPort ports = 7; + * @param array<\Google\Cloud\Run\V2\ContainerPort>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPorts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\ContainerPort::class); + $this->ports = $arr; + + return $this; + } + + /** + * Volume to mount into the container's filesystem. + * + * Generated from protobuf field repeated .google.cloud.run.v2.VolumeMount volume_mounts = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumeMounts() + { + return $this->volume_mounts; + } + + /** + * Volume to mount into the container's filesystem. + * + * Generated from protobuf field repeated .google.cloud.run.v2.VolumeMount volume_mounts = 8; + * @param array<\Google\Cloud\Run\V2\VolumeMount>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumeMounts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\VolumeMount::class); + $this->volume_mounts = $arr; + + return $this; + } + + /** + * Container's working directory. + * If not specified, the container runtime's default will be used, which + * might be configured in the container image. + * + * Generated from protobuf field string working_dir = 9; + * @return string + */ + public function getWorkingDir() + { + return $this->working_dir; + } + + /** + * Container's working directory. + * If not specified, the container runtime's default will be used, which + * might be configured in the container image. + * + * Generated from protobuf field string working_dir = 9; + * @param string $var + * @return $this + */ + public function setWorkingDir($var) + { + GPBUtil::checkString($var, True); + $this->working_dir = $var; + + return $this; + } + + /** + * Periodic probe of container liveness. + * Container will be restarted if the probe fails. + * + * Generated from protobuf field .google.cloud.run.v2.Probe liveness_probe = 10; + * @return \Google\Cloud\Run\V2\Probe|null + */ + public function getLivenessProbe() + { + return $this->liveness_probe; + } + + public function hasLivenessProbe() + { + return isset($this->liveness_probe); + } + + public function clearLivenessProbe() + { + unset($this->liveness_probe); + } + + /** + * Periodic probe of container liveness. + * Container will be restarted if the probe fails. + * + * Generated from protobuf field .google.cloud.run.v2.Probe liveness_probe = 10; + * @param \Google\Cloud\Run\V2\Probe $var + * @return $this + */ + public function setLivenessProbe($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Probe::class); + $this->liveness_probe = $var; + + return $this; + } + + /** + * Startup probe of application within the container. + * All other probes are disabled if a startup probe is provided, until it + * succeeds. Container will not be added to service endpoints if the probe + * fails. + * + * Generated from protobuf field .google.cloud.run.v2.Probe startup_probe = 11; + * @return \Google\Cloud\Run\V2\Probe|null + */ + public function getStartupProbe() + { + return $this->startup_probe; + } + + public function hasStartupProbe() + { + return isset($this->startup_probe); + } + + public function clearStartupProbe() + { + unset($this->startup_probe); + } + + /** + * Startup probe of application within the container. + * All other probes are disabled if a startup probe is provided, until it + * succeeds. Container will not be added to service endpoints if the probe + * fails. + * + * Generated from protobuf field .google.cloud.run.v2.Probe startup_probe = 11; + * @param \Google\Cloud\Run\V2\Probe $var + * @return $this + */ + public function setStartupProbe($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Probe::class); + $this->startup_probe = $var; + + return $this; + } + + /** + * Names of the containers that must start before this container. + * + * Generated from protobuf field repeated string depends_on = 12; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDependsOn() + { + return $this->depends_on; + } + + /** + * Names of the containers that must start before this container. + * + * Generated from protobuf field repeated string depends_on = 12; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDependsOn($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->depends_on = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ContainerPort.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ContainerPort.php new file mode 100644 index 000000000000..9fad73b12eed --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ContainerPort.php @@ -0,0 +1,109 @@ +google.cloud.run.v2.ContainerPort + */ +class ContainerPort extends \Google\Protobuf\Internal\Message +{ + /** + * If specified, used to specify which protocol to use. + * Allowed values are "http1" and "h2c". + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Port number the container listens on. + * This must be a valid TCP port number, 0 < container_port < 65536. + * + * Generated from protobuf field int32 container_port = 3; + */ + protected $container_port = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * If specified, used to specify which protocol to use. + * Allowed values are "http1" and "h2c". + * @type int $container_port + * Port number the container listens on. + * This must be a valid TCP port number, 0 < container_port < 65536. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * If specified, used to specify which protocol to use. + * Allowed values are "http1" and "h2c". + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * If specified, used to specify which protocol to use. + * Allowed values are "http1" and "h2c". + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Port number the container listens on. + * This must be a valid TCP port number, 0 < container_port < 65536. + * + * Generated from protobuf field int32 container_port = 3; + * @return int + */ + public function getContainerPort() + { + return $this->container_port; + } + + /** + * Port number the container listens on. + * This must be a valid TCP port number, 0 < container_port < 65536. + * + * Generated from protobuf field int32 container_port = 3; + * @param int $var + * @return $this + */ + public function setContainerPort($var) + { + GPBUtil::checkInt32($var); + $this->container_port = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateJobRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateJobRequest.php new file mode 100644 index 000000000000..f201e0ba2b8c --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateJobRequest.php @@ -0,0 +1,216 @@ +google.cloud.run.v2.CreateJobRequest + */ +class CreateJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location and project in which this Job should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The Job instance to create. + * + * Generated from protobuf field .google.cloud.run.v2.Job job = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $job = null; + /** + * Required. The unique identifier for the Job. The name of the job becomes + * {parent}/jobs/{job_id}. + * + * Generated from protobuf field string job_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $job_id = ''; + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * + * Generated from protobuf field bool validate_only = 4; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. The location and project in which this Job should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. Please see + * {@see JobsClient::locationName()} for help formatting this field. + * @param \Google\Cloud\Run\V2\Job $job Required. The Job instance to create. + * @param string $jobId Required. The unique identifier for the Job. The name of the job becomes + * {parent}/jobs/{job_id}. + * + * @return \Google\Cloud\Run\V2\CreateJobRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Run\V2\Job $job, string $jobId): self + { + return (new self()) + ->setParent($parent) + ->setJob($job) + ->setJobId($jobId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location and project in which this Job should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * @type \Google\Cloud\Run\V2\Job $job + * Required. The Job instance to create. + * @type string $job_id + * Required. The unique identifier for the Job. The name of the job becomes + * {parent}/jobs/{job_id}. + * @type bool $validate_only + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location and project in which this Job should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The location and project in which this Job should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The Job instance to create. + * + * Generated from protobuf field .google.cloud.run.v2.Job job = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Run\V2\Job|null + */ + public function getJob() + { + return $this->job; + } + + public function hasJob() + { + return isset($this->job); + } + + public function clearJob() + { + unset($this->job); + } + + /** + * Required. The Job instance to create. + * + * Generated from protobuf field .google.cloud.run.v2.Job job = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Run\V2\Job $var + * @return $this + */ + public function setJob($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Job::class); + $this->job = $var; + + return $this; + } + + /** + * Required. The unique identifier for the Job. The name of the job becomes + * {parent}/jobs/{job_id}. + * + * Generated from protobuf field string job_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getJobId() + { + return $this->job_id; + } + + /** + * Required. The unique identifier for the Job. The name of the job becomes + * {parent}/jobs/{job_id}. + * + * Generated from protobuf field string job_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setJobId($var) + { + GPBUtil::checkString($var, True); + $this->job_id = $var; + + return $this; + } + + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * + * Generated from protobuf field bool validate_only = 4; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * + * Generated from protobuf field bool validate_only = 4; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateServiceRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateServiceRequest.php new file mode 100644 index 000000000000..7a5677b8d359 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/CreateServiceRequest.php @@ -0,0 +1,221 @@ +google.cloud.run.v2.CreateServiceRequest + */ +class CreateServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location and project in which this service should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. Only lowercase characters, digits, and hyphens. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The Service instance to create. + * + * Generated from protobuf field .google.cloud.run.v2.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service = null; + /** + * Required. The unique identifier for the Service. It must begin with letter, + * and cannot end with hyphen; must contain fewer than 50 characters. + * The name of the service becomes {parent}/services/{service_id}. + * + * Generated from protobuf field string service_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service_id = ''; + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * + * Generated from protobuf field bool validate_only = 4; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. The location and project in which this service should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. Only lowercase characters, digits, and hyphens. Please see + * {@see ServicesClient::locationName()} for help formatting this field. + * @param \Google\Cloud\Run\V2\Service $service Required. The Service instance to create. + * @param string $serviceId Required. The unique identifier for the Service. It must begin with letter, + * and cannot end with hyphen; must contain fewer than 50 characters. + * The name of the service becomes {parent}/services/{service_id}. + * + * @return \Google\Cloud\Run\V2\CreateServiceRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Run\V2\Service $service, string $serviceId): self + { + return (new self()) + ->setParent($parent) + ->setService($service) + ->setServiceId($serviceId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location and project in which this service should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. Only lowercase characters, digits, and hyphens. + * @type \Google\Cloud\Run\V2\Service $service + * Required. The Service instance to create. + * @type string $service_id + * Required. The unique identifier for the Service. It must begin with letter, + * and cannot end with hyphen; must contain fewer than 50 characters. + * The name of the service becomes {parent}/services/{service_id}. + * @type bool $validate_only + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location and project in which this service should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. Only lowercase characters, digits, and hyphens. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The location and project in which this service should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. Only lowercase characters, digits, and hyphens. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The Service instance to create. + * + * Generated from protobuf field .google.cloud.run.v2.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Run\V2\Service|null + */ + public function getService() + { + return $this->service; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * Required. The Service instance to create. + * + * Generated from protobuf field .google.cloud.run.v2.Service service = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Run\V2\Service $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Service::class); + $this->service = $var; + + return $this; + } + + /** + * Required. The unique identifier for the Service. It must begin with letter, + * and cannot end with hyphen; must contain fewer than 50 characters. + * The name of the service becomes {parent}/services/{service_id}. + * + * Generated from protobuf field string service_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getServiceId() + { + return $this->service_id; + } + + /** + * Required. The unique identifier for the Service. It must begin with letter, + * and cannot end with hyphen; must contain fewer than 50 characters. + * The name of the service becomes {parent}/services/{service_id}. + * + * Generated from protobuf field string service_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setServiceId($var) + { + GPBUtil::checkString($var, True); + $this->service_id = $var; + + return $this; + } + + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * + * Generated from protobuf field bool validate_only = 4; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * + * Generated from protobuf field bool validate_only = 4; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteExecutionRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteExecutionRequest.php new file mode 100644 index 000000000000..ea7d31e245fe --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteExecutionRequest.php @@ -0,0 +1,172 @@ +google.cloud.run.v2.DeleteExecutionRequest + */ +class DeleteExecutionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the Execution to delete. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + */ + protected $validate_only = false; + /** + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + */ + protected $etag = ''; + + /** + * @param string $name Required. The name of the Execution to delete. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. Please see + * {@see ExecutionsClient::executionName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\DeleteExecutionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the Execution to delete. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * @type bool $validate_only + * Indicates that the request should be validated without actually + * deleting any resources. + * @type string $etag + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Execution::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the Execution to delete. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the Execution to delete. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteJobRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteJobRequest.php new file mode 100644 index 000000000000..0c4f53d97680 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteJobRequest.php @@ -0,0 +1,167 @@ +google.cloud.run.v2.DeleteJobRequest + */ +class DeleteJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 3; + */ + protected $validate_only = false; + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 4; + */ + protected $etag = ''; + + /** + * @param string $name Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. Please see + * {@see JobsClient::jobName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\DeleteJobRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * @type bool $validate_only + * Indicates that the request should be validated without actually + * deleting any resources. + * @type string $etag + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 3; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 3; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 4; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 4; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteRevisionRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteRevisionRequest.php new file mode 100644 index 000000000000..0b7bb2e76937 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteRevisionRequest.php @@ -0,0 +1,169 @@ +google.cloud.run.v2.DeleteRevisionRequest + */ +class DeleteRevisionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the Revision to delete. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + */ + protected $validate_only = false; + /** + * A system-generated fingerprint for this version of the + * resource. This may be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + */ + protected $etag = ''; + + /** + * @param string $name Required. The name of the Revision to delete. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * Please see {@see RevisionsClient::revisionName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\DeleteRevisionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the Revision to delete. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * @type bool $validate_only + * Indicates that the request should be validated without actually + * deleting any resources. + * @type string $etag + * A system-generated fingerprint for this version of the + * resource. This may be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Revision::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the Revision to delete. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the Revision to delete. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * A system-generated fingerprint for this version of the + * resource. This may be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * A system-generated fingerprint for this version of the + * resource. This may be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteServiceRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteServiceRequest.php new file mode 100644 index 000000000000..16182d4a1603 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/DeleteServiceRequest.php @@ -0,0 +1,167 @@ +google.cloud.run.v2.DeleteServiceRequest + */ +class DeleteServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + */ + protected $validate_only = false; + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + */ + protected $etag = ''; + + /** + * @param string $name Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. Please see + * {@see ServicesClient::serviceName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\DeleteServiceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + * @type bool $validate_only + * Indicates that the request should be validated without actually + * deleting any resources. + * @type string $etag + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource.php new file mode 100644 index 000000000000..be49c7f974ba --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource.php @@ -0,0 +1,143 @@ +google.cloud.run.v2.EmptyDirVolumeSource + */ +class EmptyDirVolumeSource extends \Google\Protobuf\Internal\Message +{ + /** + * The medium on which the data is stored. Acceptable values today is only + * MEMORY or none. When none, the default will currently be backed by memory + * but could change over time. +optional + * + * Generated from protobuf field .google.cloud.run.v2.EmptyDirVolumeSource.Medium medium = 1; + */ + protected $medium = 0; + /** + * Limit on the storage usable by this EmptyDir volume. + * The size limit is also applicable for memory medium. + * The maximum usage on memory medium EmptyDir would be the minimum value + * between the SizeLimit specified here and the sum of memory limits of all + * containers. The default is nil which means that the limit is undefined. + * More info: + * https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume. + * Info in Kubernetes: + * https://kubernetes.io/docs/concepts/storage/volumes/#emptydir + * + * Generated from protobuf field string size_limit = 2; + */ + protected $size_limit = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $medium + * The medium on which the data is stored. Acceptable values today is only + * MEMORY or none. When none, the default will currently be backed by memory + * but could change over time. +optional + * @type string $size_limit + * Limit on the storage usable by this EmptyDir volume. + * The size limit is also applicable for memory medium. + * The maximum usage on memory medium EmptyDir would be the minimum value + * between the SizeLimit specified here and the sum of memory limits of all + * containers. The default is nil which means that the limit is undefined. + * More info: + * https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume. + * Info in Kubernetes: + * https://kubernetes.io/docs/concepts/storage/volumes/#emptydir + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * The medium on which the data is stored. Acceptable values today is only + * MEMORY or none. When none, the default will currently be backed by memory + * but could change over time. +optional + * + * Generated from protobuf field .google.cloud.run.v2.EmptyDirVolumeSource.Medium medium = 1; + * @return int + */ + public function getMedium() + { + return $this->medium; + } + + /** + * The medium on which the data is stored. Acceptable values today is only + * MEMORY or none. When none, the default will currently be backed by memory + * but could change over time. +optional + * + * Generated from protobuf field .google.cloud.run.v2.EmptyDirVolumeSource.Medium medium = 1; + * @param int $var + * @return $this + */ + public function setMedium($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\EmptyDirVolumeSource\Medium::class); + $this->medium = $var; + + return $this; + } + + /** + * Limit on the storage usable by this EmptyDir volume. + * The size limit is also applicable for memory medium. + * The maximum usage on memory medium EmptyDir would be the minimum value + * between the SizeLimit specified here and the sum of memory limits of all + * containers. The default is nil which means that the limit is undefined. + * More info: + * https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume. + * Info in Kubernetes: + * https://kubernetes.io/docs/concepts/storage/volumes/#emptydir + * + * Generated from protobuf field string size_limit = 2; + * @return string + */ + public function getSizeLimit() + { + return $this->size_limit; + } + + /** + * Limit on the storage usable by this EmptyDir volume. + * The size limit is also applicable for memory medium. + * The maximum usage on memory medium EmptyDir would be the minimum value + * between the SizeLimit specified here and the sum of memory limits of all + * containers. The default is nil which means that the limit is undefined. + * More info: + * https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume. + * Info in Kubernetes: + * https://kubernetes.io/docs/concepts/storage/volumes/#emptydir + * + * Generated from protobuf field string size_limit = 2; + * @param string $var + * @return $this + */ + public function setSizeLimit($var) + { + GPBUtil::checkString($var, True); + $this->size_limit = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource/Medium.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource/Medium.php new file mode 100644 index 000000000000..f226a6c0cdda --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EmptyDirVolumeSource/Medium.php @@ -0,0 +1,58 @@ +google.cloud.run.v2.EmptyDirVolumeSource.Medium + */ +class Medium +{ + /** + * When not specified, falls back to the default implementation which + * is currently in memory (this may change over time). + * + * Generated from protobuf enum MEDIUM_UNSPECIFIED = 0; + */ + const MEDIUM_UNSPECIFIED = 0; + /** + * Explicitly set the EmptyDir to be in memory. Uses tmpfs. + * + * Generated from protobuf enum MEMORY = 1; + */ + const MEMORY = 1; + + private static $valueToName = [ + self::MEDIUM_UNSPECIFIED => 'MEDIUM_UNSPECIFIED', + self::MEMORY => 'MEMORY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Medium::class, \Google\Cloud\Run\V2\EmptyDirVolumeSource_Medium::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EncryptionKeyRevocationAction.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EncryptionKeyRevocationAction.php new file mode 100644 index 000000000000..0b07b810a082 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EncryptionKeyRevocationAction.php @@ -0,0 +1,61 @@ +google.cloud.run.v2.EncryptionKeyRevocationAction + */ +class EncryptionKeyRevocationAction +{ + /** + * Unspecified + * + * Generated from protobuf enum ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED = 0; + */ + const ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED = 0; + /** + * Prevents the creation of new instances. + * + * Generated from protobuf enum PREVENT_NEW = 1; + */ + const PREVENT_NEW = 1; + /** + * Shuts down existing instances, and prevents creation of new ones. + * + * Generated from protobuf enum SHUTDOWN = 2; + */ + const SHUTDOWN = 2; + + private static $valueToName = [ + self::ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED => 'ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED', + self::PREVENT_NEW => 'PREVENT_NEW', + self::SHUTDOWN => 'SHUTDOWN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVar.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVar.php new file mode 100644 index 000000000000..2073c4252a57 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVar.php @@ -0,0 +1,152 @@ +google.cloud.run.v2.EnvVar + */ +class EnvVar extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the environment variable. Must not exceed 32768 + * characters. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + protected $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the environment variable. Must not exceed 32768 + * characters. + * @type string $value + * Literal value of the environment variable. + * Defaults to "", and the maximum length is 32768 bytes. + * Variable references are not supported in Cloud Run. + * @type \Google\Cloud\Run\V2\EnvVarSource $value_source + * Source for the environment variable's value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the environment variable. Must not exceed 32768 + * characters. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the environment variable. Must not exceed 32768 + * characters. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Literal value of the environment variable. + * Defaults to "", and the maximum length is 32768 bytes. + * Variable references are not supported in Cloud Run. + * + * Generated from protobuf field string value = 2; + * @return string + */ + public function getValue() + { + return $this->readOneof(2); + } + + public function hasValue() + { + return $this->hasOneof(2); + } + + /** + * Literal value of the environment variable. + * Defaults to "", and the maximum length is 32768 bytes. + * Variable references are not supported in Cloud Run. + * + * Generated from protobuf field string value = 2; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Source for the environment variable's value. + * + * Generated from protobuf field .google.cloud.run.v2.EnvVarSource value_source = 3; + * @return \Google\Cloud\Run\V2\EnvVarSource|null + */ + public function getValueSource() + { + return $this->readOneof(3); + } + + public function hasValueSource() + { + return $this->hasOneof(3); + } + + /** + * Source for the environment variable's value. + * + * Generated from protobuf field .google.cloud.run.v2.EnvVarSource value_source = 3; + * @param \Google\Cloud\Run\V2\EnvVarSource $var + * @return $this + */ + public function setValueSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\EnvVarSource::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getValues() + { + return $this->whichOneof("values"); + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVarSource.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVarSource.php new file mode 100644 index 000000000000..99ffb8e651c0 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/EnvVarSource.php @@ -0,0 +1,77 @@ +google.cloud.run.v2.EnvVarSource + */ +class EnvVarSource extends \Google\Protobuf\Internal\Message +{ + /** + * Selects a secret and a specific version from Cloud Secret Manager. + * + * Generated from protobuf field .google.cloud.run.v2.SecretKeySelector secret_key_ref = 1; + */ + protected $secret_key_ref = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Run\V2\SecretKeySelector $secret_key_ref + * Selects a secret and a specific version from Cloud Secret Manager. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Selects a secret and a specific version from Cloud Secret Manager. + * + * Generated from protobuf field .google.cloud.run.v2.SecretKeySelector secret_key_ref = 1; + * @return \Google\Cloud\Run\V2\SecretKeySelector|null + */ + public function getSecretKeyRef() + { + return $this->secret_key_ref; + } + + public function hasSecretKeyRef() + { + return isset($this->secret_key_ref); + } + + public function clearSecretKeyRef() + { + unset($this->secret_key_ref); + } + + /** + * Selects a secret and a specific version from Cloud Secret Manager. + * + * Generated from protobuf field .google.cloud.run.v2.SecretKeySelector secret_key_ref = 1; + * @param \Google\Cloud\Run\V2\SecretKeySelector $var + * @return $this + */ + public function setSecretKeyRef($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\SecretKeySelector::class); + $this->secret_key_ref = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Execution.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Execution.php new file mode 100644 index 000000000000..b72c09e5f964 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Execution.php @@ -0,0 +1,1183 @@ +google.cloud.run.v2.Execution + */ +class Execution extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique name of this Execution. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. Server assigned unique identifier for the Execution. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generation = 0; + /** + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $labels; + /** + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $annotations; + /** + * Output only. Represents time when the execution was acknowledged by the + * execution controller. It is not guaranteed to be set in happens-before + * order across separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Represents time when the execution started to run. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + /** + * Output only. Represents time when the execution was completed. It is not + * guaranteed to be set in happens-before order across separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp completion_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $completion_time = null; + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_time = null; + /** + * The least stable launch stage needed to create this resource, as defined by + * [Google Cloud Platform Launch + * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports + * `ALPHA`, `BETA`, and `GA`. + *

Note that this value might not be what was used + * as input. For example, if ALPHA was provided as input in the parent + * resource, but only BETA and GA-level features are were, this field will be + * BETA. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 11; + */ + protected $launch_stage = 0; + /** + * Output only. The name of the parent Job. + * + * Generated from protobuf field string job = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $job = ''; + /** + * Output only. Specifies the maximum desired number of tasks the execution + * should run at any given time. Must be <= task_count. The actual number of + * tasks running in steady state will be less than this number when + * ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when + * the work left to do is less than max parallelism. + * + * Generated from protobuf field int32 parallelism = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $parallelism = 0; + /** + * Output only. Specifies the desired number of tasks the execution should + * run. Setting to 1 means that parallelism is limited to 1 and the success of + * that task signals the success of the execution. + * + * Generated from protobuf field int32 task_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $task_count = 0; + /** + * Output only. The template used to create tasks for this execution. + * + * Generated from protobuf field .google.cloud.run.v2.TaskTemplate template = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $template = null; + /** + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Job.reconciling` for additional information on + * reconciliation process in Cloud Run. + * + * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Output only. The Condition of this Execution, containing its readiness + * status, and detailed error information in case it did not reach the desired + * state. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $conditions; + /** + * Output only. The generation of this Execution. See comments in + * `reconciling` for additional information on reconciliation process in Cloud + * Run. + * + * Generated from protobuf field int64 observed_generation = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $observed_generation = 0; + /** + * Output only. The number of actively running tasks. + * + * Generated from protobuf field int32 running_count = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $running_count = 0; + /** + * Output only. The number of tasks which reached phase Succeeded. + * + * Generated from protobuf field int32 succeeded_count = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $succeeded_count = 0; + /** + * Output only. The number of tasks which reached phase Failed. + * + * Generated from protobuf field int32 failed_count = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $failed_count = 0; + /** + * Output only. The number of tasks which reached phase Cancelled. + * + * Generated from protobuf field int32 cancelled_count = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $cancelled_count = 0; + /** + * Output only. The number of tasks which have retried at least once. + * + * Generated from protobuf field int32 retried_count = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $retried_count = 0; + /** + * Output only. URI where logs for this execution can be found in Cloud + * Console. + * + * Generated from protobuf field string log_uri = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $log_uri = ''; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = false; + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The unique name of this Execution. + * @type string $uid + * Output only. Server assigned unique identifier for the Execution. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * @type int|string $generation + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Represents time when the execution was acknowledged by the + * execution controller. It is not guaranteed to be set in happens-before + * order across separate operations. + * @type \Google\Protobuf\Timestamp $start_time + * Output only. Represents time when the execution started to run. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * @type \Google\Protobuf\Timestamp $completion_time + * Output only. Represents time when the execution was completed. It is not + * guaranteed to be set in happens-before order across separate operations. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last-modified time. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * @type int $launch_stage + * The least stable launch stage needed to create this resource, as defined by + * [Google Cloud Platform Launch + * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports + * `ALPHA`, `BETA`, and `GA`. + *

Note that this value might not be what was used + * as input. For example, if ALPHA was provided as input in the parent + * resource, but only BETA and GA-level features are were, this field will be + * BETA. + * @type string $job + * Output only. The name of the parent Job. + * @type int $parallelism + * Output only. Specifies the maximum desired number of tasks the execution + * should run at any given time. Must be <= task_count. The actual number of + * tasks running in steady state will be less than this number when + * ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when + * the work left to do is less than max parallelism. + * @type int $task_count + * Output only. Specifies the desired number of tasks the execution should + * run. Setting to 1 means that parallelism is limited to 1 and the success of + * that task signals the success of the execution. + * @type \Google\Cloud\Run\V2\TaskTemplate $template + * Output only. The template used to create tasks for this execution. + * @type bool $reconciling + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Job.reconciling` for additional information on + * reconciliation process in Cloud Run. + * @type array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $conditions + * Output only. The Condition of this Execution, containing its readiness + * status, and detailed error information in case it did not reach the desired + * state. + * @type int|string $observed_generation + * Output only. The generation of this Execution. See comments in + * `reconciling` for additional information on reconciliation process in Cloud + * Run. + * @type int $running_count + * Output only. The number of actively running tasks. + * @type int $succeeded_count + * Output only. The number of tasks which reached phase Succeeded. + * @type int $failed_count + * Output only. The number of tasks which reached phase Failed. + * @type int $cancelled_count + * Output only. The number of tasks which reached phase Cancelled. + * @type int $retried_count + * Output only. The number of tasks which have retried at least once. + * @type string $log_uri + * Output only. URI where logs for this execution can be found in Cloud + * Console. + * @type bool $satisfies_pzs + * Output only. Reserved for future use. + * @type string $etag + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Execution::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique name of this Execution. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The unique name of this Execution. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Server assigned unique identifier for the Execution. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Server assigned unique identifier for the Execution. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getGeneration() + { + return $this->generation; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setGeneration($var) + { + GPBUtil::checkInt64($var); + $this->generation = $var; + + return $this; + } + + /** + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. Represents time when the execution was acknowledged by the + * execution controller. It is not guaranteed to be set in happens-before + * order across separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Represents time when the execution was acknowledged by the + * execution controller. It is not guaranteed to be set in happens-before + * order across separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Represents time when the execution started to run. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. Represents time when the execution started to run. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. Represents time when the execution was completed. It is not + * guaranteed to be set in happens-before order across separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp completion_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCompletionTime() + { + return $this->completion_time; + } + + public function hasCompletionTime() + { + return isset($this->completion_time); + } + + public function clearCompletionTime() + { + unset($this->completion_time); + } + + /** + * Output only. Represents time when the execution was completed. It is not + * guaranteed to be set in happens-before order across separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp completion_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCompletionTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->completion_time = $var; + + return $this; + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * The least stable launch stage needed to create this resource, as defined by + * [Google Cloud Platform Launch + * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports + * `ALPHA`, `BETA`, and `GA`. + *

Note that this value might not be what was used + * as input. For example, if ALPHA was provided as input in the parent + * resource, but only BETA and GA-level features are were, this field will be + * BETA. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 11; + * @return int + */ + public function getLaunchStage() + { + return $this->launch_stage; + } + + /** + * The least stable launch stage needed to create this resource, as defined by + * [Google Cloud Platform Launch + * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports + * `ALPHA`, `BETA`, and `GA`. + *

Note that this value might not be what was used + * as input. For example, if ALPHA was provided as input in the parent + * resource, but only BETA and GA-level features are were, this field will be + * BETA. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 11; + * @param int $var + * @return $this + */ + public function setLaunchStage($var) + { + GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); + $this->launch_stage = $var; + + return $this; + } + + /** + * Output only. The name of the parent Job. + * + * Generated from protobuf field string job = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getJob() + { + return $this->job; + } + + /** + * Output only. The name of the parent Job. + * + * Generated from protobuf field string job = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setJob($var) + { + GPBUtil::checkString($var, True); + $this->job = $var; + + return $this; + } + + /** + * Output only. Specifies the maximum desired number of tasks the execution + * should run at any given time. Must be <= task_count. The actual number of + * tasks running in steady state will be less than this number when + * ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when + * the work left to do is less than max parallelism. + * + * Generated from protobuf field int32 parallelism = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getParallelism() + { + return $this->parallelism; + } + + /** + * Output only. Specifies the maximum desired number of tasks the execution + * should run at any given time. Must be <= task_count. The actual number of + * tasks running in steady state will be less than this number when + * ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when + * the work left to do is less than max parallelism. + * + * Generated from protobuf field int32 parallelism = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setParallelism($var) + { + GPBUtil::checkInt32($var); + $this->parallelism = $var; + + return $this; + } + + /** + * Output only. Specifies the desired number of tasks the execution should + * run. Setting to 1 means that parallelism is limited to 1 and the success of + * that task signals the success of the execution. + * + * Generated from protobuf field int32 task_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getTaskCount() + { + return $this->task_count; + } + + /** + * Output only. Specifies the desired number of tasks the execution should + * run. Setting to 1 means that parallelism is limited to 1 and the success of + * that task signals the success of the execution. + * + * Generated from protobuf field int32 task_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setTaskCount($var) + { + GPBUtil::checkInt32($var); + $this->task_count = $var; + + return $this; + } + + /** + * Output only. The template used to create tasks for this execution. + * + * Generated from protobuf field .google.cloud.run.v2.TaskTemplate template = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Run\V2\TaskTemplate|null + */ + public function getTemplate() + { + return $this->template; + } + + public function hasTemplate() + { + return isset($this->template); + } + + public function clearTemplate() + { + unset($this->template); + } + + /** + * Output only. The template used to create tasks for this execution. + * + * Generated from protobuf field .google.cloud.run.v2.TaskTemplate template = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Run\V2\TaskTemplate $var + * @return $this + */ + public function setTemplate($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\TaskTemplate::class); + $this->template = $var; + + return $this; + } + + /** + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Job.reconciling` for additional information on + * reconciliation process in Cloud Run. + * + * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Job.reconciling` for additional information on + * reconciliation process in Cloud Run. + * + * Generated from protobuf field bool reconciling = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Output only. The Condition of this Execution, containing its readiness + * status, and detailed error information in case it did not reach the desired + * state. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConditions() + { + return $this->conditions; + } + + /** + * Output only. The Condition of this Execution, containing its readiness + * status, and detailed error information in case it did not reach the desired + * state. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConditions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Condition::class); + $this->conditions = $arr; + + return $this; + } + + /** + * Output only. The generation of this Execution. See comments in + * `reconciling` for additional information on reconciliation process in Cloud + * Run. + * + * Generated from protobuf field int64 observed_generation = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getObservedGeneration() + { + return $this->observed_generation; + } + + /** + * Output only. The generation of this Execution. See comments in + * `reconciling` for additional information on reconciliation process in Cloud + * Run. + * + * Generated from protobuf field int64 observed_generation = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setObservedGeneration($var) + { + GPBUtil::checkInt64($var); + $this->observed_generation = $var; + + return $this; + } + + /** + * Output only. The number of actively running tasks. + * + * Generated from protobuf field int32 running_count = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getRunningCount() + { + return $this->running_count; + } + + /** + * Output only. The number of actively running tasks. + * + * Generated from protobuf field int32 running_count = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setRunningCount($var) + { + GPBUtil::checkInt32($var); + $this->running_count = $var; + + return $this; + } + + /** + * Output only. The number of tasks which reached phase Succeeded. + * + * Generated from protobuf field int32 succeeded_count = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getSucceededCount() + { + return $this->succeeded_count; + } + + /** + * Output only. The number of tasks which reached phase Succeeded. + * + * Generated from protobuf field int32 succeeded_count = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setSucceededCount($var) + { + GPBUtil::checkInt32($var); + $this->succeeded_count = $var; + + return $this; + } + + /** + * Output only. The number of tasks which reached phase Failed. + * + * Generated from protobuf field int32 failed_count = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getFailedCount() + { + return $this->failed_count; + } + + /** + * Output only. The number of tasks which reached phase Failed. + * + * Generated from protobuf field int32 failed_count = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setFailedCount($var) + { + GPBUtil::checkInt32($var); + $this->failed_count = $var; + + return $this; + } + + /** + * Output only. The number of tasks which reached phase Cancelled. + * + * Generated from protobuf field int32 cancelled_count = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getCancelledCount() + { + return $this->cancelled_count; + } + + /** + * Output only. The number of tasks which reached phase Cancelled. + * + * Generated from protobuf field int32 cancelled_count = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setCancelledCount($var) + { + GPBUtil::checkInt32($var); + $this->cancelled_count = $var; + + return $this; + } + + /** + * Output only. The number of tasks which have retried at least once. + * + * Generated from protobuf field int32 retried_count = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getRetriedCount() + { + return $this->retried_count; + } + + /** + * Output only. The number of tasks which have retried at least once. + * + * Generated from protobuf field int32 retried_count = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setRetriedCount($var) + { + GPBUtil::checkInt32($var); + $this->retried_count = $var; + + return $this; + } + + /** + * Output only. URI where logs for this execution can be found in Cloud + * Console. + * + * Generated from protobuf field string log_uri = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLogUri() + { + return $this->log_uri; + } + + /** + * Output only. URI where logs for this execution can be found in Cloud + * Console. + * + * Generated from protobuf field string log_uri = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLogUri($var) + { + GPBUtil::checkString($var, True); + $this->log_uri = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionEnvironment.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionEnvironment.php new file mode 100644 index 000000000000..da77efe77d8f --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionEnvironment.php @@ -0,0 +1,61 @@ +google.cloud.run.v2.ExecutionEnvironment + */ +class ExecutionEnvironment +{ + /** + * Unspecified + * + * Generated from protobuf enum EXECUTION_ENVIRONMENT_UNSPECIFIED = 0; + */ + const EXECUTION_ENVIRONMENT_UNSPECIFIED = 0; + /** + * Uses the First Generation environment. + * + * Generated from protobuf enum EXECUTION_ENVIRONMENT_GEN1 = 1; + */ + const EXECUTION_ENVIRONMENT_GEN1 = 1; + /** + * Uses Second Generation environment. + * + * Generated from protobuf enum EXECUTION_ENVIRONMENT_GEN2 = 2; + */ + const EXECUTION_ENVIRONMENT_GEN2 = 2; + + private static $valueToName = [ + self::EXECUTION_ENVIRONMENT_UNSPECIFIED => 'EXECUTION_ENVIRONMENT_UNSPECIFIED', + self::EXECUTION_ENVIRONMENT_GEN1 => 'EXECUTION_ENVIRONMENT_GEN1', + self::EXECUTION_ENVIRONMENT_GEN2 => 'EXECUTION_ENVIRONMENT_GEN2', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference.php new file mode 100644 index 000000000000..4de3dd33ddee --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference.php @@ -0,0 +1,238 @@ +google.cloud.run.v2.ExecutionReference + */ +class ExecutionReference extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the execution. + * + * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Creation timestamp of the execution. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; + */ + protected $create_time = null; + /** + * Creation timestamp of the execution. + * + * Generated from protobuf field .google.protobuf.Timestamp completion_time = 3; + */ + protected $completion_time = null; + /** + * The deletion time of the execution. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5; + */ + protected $delete_time = null; + /** + * Status for the execution completion. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionReference.CompletionStatus completion_status = 4; + */ + protected $completion_status = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the execution. + * @type \Google\Protobuf\Timestamp $create_time + * Creation timestamp of the execution. + * @type \Google\Protobuf\Timestamp $completion_time + * Creation timestamp of the execution. + * @type \Google\Protobuf\Timestamp $delete_time + * The deletion time of the execution. It is only + * populated as a response to a Delete request. + * @type int $completion_status + * Status for the execution completion. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * Name of the execution. + * + * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the execution. + * + * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Creation timestamp of the execution. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Creation timestamp of the execution. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Creation timestamp of the execution. + * + * Generated from protobuf field .google.protobuf.Timestamp completion_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCompletionTime() + { + return $this->completion_time; + } + + public function hasCompletionTime() + { + return isset($this->completion_time); + } + + public function clearCompletionTime() + { + unset($this->completion_time); + } + + /** + * Creation timestamp of the execution. + * + * Generated from protobuf field .google.protobuf.Timestamp completion_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCompletionTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->completion_time = $var; + + return $this; + } + + /** + * The deletion time of the execution. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * The deletion time of the execution. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Status for the execution completion. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionReference.CompletionStatus completion_status = 4; + * @return int + */ + public function getCompletionStatus() + { + return $this->completion_status; + } + + /** + * Status for the execution completion. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionReference.CompletionStatus completion_status = 4; + * @param int $var + * @return $this + */ + public function setCompletionStatus($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ExecutionReference\CompletionStatus::class); + $this->completion_status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference/CompletionStatus.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference/CompletionStatus.php new file mode 100644 index 000000000000..329e05e4330a --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionReference/CompletionStatus.php @@ -0,0 +1,85 @@ +google.cloud.run.v2.ExecutionReference.CompletionStatus + */ +class CompletionStatus +{ + /** + * The default value. This value is used if the state is omitted. + * + * Generated from protobuf enum COMPLETION_STATUS_UNSPECIFIED = 0; + */ + const COMPLETION_STATUS_UNSPECIFIED = 0; + /** + * Job execution has succeeded. + * + * Generated from protobuf enum EXECUTION_SUCCEEDED = 1; + */ + const EXECUTION_SUCCEEDED = 1; + /** + * Job execution has failed. + * + * Generated from protobuf enum EXECUTION_FAILED = 2; + */ + const EXECUTION_FAILED = 2; + /** + * Job execution is running normally. + * + * Generated from protobuf enum EXECUTION_RUNNING = 3; + */ + const EXECUTION_RUNNING = 3; + /** + * Waiting for backing resources to be provisioned. + * + * Generated from protobuf enum EXECUTION_PENDING = 4; + */ + const EXECUTION_PENDING = 4; + /** + * Job execution has been cancelled by the user. + * + * Generated from protobuf enum EXECUTION_CANCELLED = 5; + */ + const EXECUTION_CANCELLED = 5; + + private static $valueToName = [ + self::COMPLETION_STATUS_UNSPECIFIED => 'COMPLETION_STATUS_UNSPECIFIED', + self::EXECUTION_SUCCEEDED => 'EXECUTION_SUCCEEDED', + self::EXECUTION_FAILED => 'EXECUTION_FAILED', + self::EXECUTION_RUNNING => 'EXECUTION_RUNNING', + self::EXECUTION_PENDING => 'EXECUTION_PENDING', + self::EXECUTION_CANCELLED => 'EXECUTION_CANCELLED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CompletionStatus::class, \Google\Cloud\Run\V2\ExecutionReference_CompletionStatus::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionTemplate.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionTemplate.php new file mode 100644 index 000000000000..18ee4a6bffb3 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ExecutionTemplate.php @@ -0,0 +1,322 @@ +google.cloud.run.v2.ExecutionTemplate + */ +class ExecutionTemplate extends \Google\Protobuf\Internal\Message +{ + /** + * Unstructured key value map that can be used to organize and categorize + * objects. + * User-provided labels are shared with Google's billing system, so they can + * be used to filter, or break down billing charges by team, component, + * environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 ExecutionTemplate. + * + * Generated from protobuf field map labels = 1; + */ + private $labels; + /** + * Unstructured key value map that may be set by external tools to store and + * arbitrary metadata. They are not queryable and should be preserved + * when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system annotations in v1 now + * have a corresponding field in v2 ExecutionTemplate. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * + * Generated from protobuf field map annotations = 2; + */ + private $annotations; + /** + * Specifies the maximum desired number of tasks the execution should run at + * given time. Must be <= task_count. + * When the job is run, if this field is 0 or unset, the maximum possible + * value will be used for that execution. + * The actual number of tasks running in steady state will be less than this + * number when there are fewer tasks waiting to be completed remaining, + * i.e. when the work left to do is less than max parallelism. + * + * Generated from protobuf field int32 parallelism = 3; + */ + protected $parallelism = 0; + /** + * Specifies the desired number of tasks the execution should run. + * Setting to 1 means that parallelism is limited to 1 and the success of + * that task signals the success of the execution. Defaults to 1. + * + * Generated from protobuf field int32 task_count = 4; + */ + protected $task_count = 0; + /** + * Required. Describes the task(s) that will be created when executing an + * execution. + * + * Generated from protobuf field .google.cloud.run.v2.TaskTemplate template = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $template = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $labels + * Unstructured key value map that can be used to organize and categorize + * objects. + * User-provided labels are shared with Google's billing system, so they can + * be used to filter, or break down billing charges by team, component, + * environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 ExecutionTemplate. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Unstructured key value map that may be set by external tools to store and + * arbitrary metadata. They are not queryable and should be preserved + * when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system annotations in v1 now + * have a corresponding field in v2 ExecutionTemplate. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * @type int $parallelism + * Specifies the maximum desired number of tasks the execution should run at + * given time. Must be <= task_count. + * When the job is run, if this field is 0 or unset, the maximum possible + * value will be used for that execution. + * The actual number of tasks running in steady state will be less than this + * number when there are fewer tasks waiting to be completed remaining, + * i.e. when the work left to do is less than max parallelism. + * @type int $task_count + * Specifies the desired number of tasks the execution should run. + * Setting to 1 means that parallelism is limited to 1 and the success of + * that task signals the success of the execution. Defaults to 1. + * @type \Google\Cloud\Run\V2\TaskTemplate $template + * Required. Describes the task(s) that will be created when executing an + * execution. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\ExecutionTemplate::initOnce(); + parent::__construct($data); + } + + /** + * Unstructured key value map that can be used to organize and categorize + * objects. + * User-provided labels are shared with Google's billing system, so they can + * be used to filter, or break down billing charges by team, component, + * environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 ExecutionTemplate. + * + * Generated from protobuf field map labels = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Unstructured key value map that can be used to organize and categorize + * objects. + * User-provided labels are shared with Google's billing system, so they can + * be used to filter, or break down billing charges by team, component, + * environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 ExecutionTemplate. + * + * Generated from protobuf field map labels = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Unstructured key value map that may be set by external tools to store and + * arbitrary metadata. They are not queryable and should be preserved + * when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system annotations in v1 now + * have a corresponding field in v2 ExecutionTemplate. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * + * Generated from protobuf field map annotations = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Unstructured key value map that may be set by external tools to store and + * arbitrary metadata. They are not queryable and should be preserved + * when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system annotations in v1 now + * have a corresponding field in v2 ExecutionTemplate. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * + * Generated from protobuf field map annotations = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Specifies the maximum desired number of tasks the execution should run at + * given time. Must be <= task_count. + * When the job is run, if this field is 0 or unset, the maximum possible + * value will be used for that execution. + * The actual number of tasks running in steady state will be less than this + * number when there are fewer tasks waiting to be completed remaining, + * i.e. when the work left to do is less than max parallelism. + * + * Generated from protobuf field int32 parallelism = 3; + * @return int + */ + public function getParallelism() + { + return $this->parallelism; + } + + /** + * Specifies the maximum desired number of tasks the execution should run at + * given time. Must be <= task_count. + * When the job is run, if this field is 0 or unset, the maximum possible + * value will be used for that execution. + * The actual number of tasks running in steady state will be less than this + * number when there are fewer tasks waiting to be completed remaining, + * i.e. when the work left to do is less than max parallelism. + * + * Generated from protobuf field int32 parallelism = 3; + * @param int $var + * @return $this + */ + public function setParallelism($var) + { + GPBUtil::checkInt32($var); + $this->parallelism = $var; + + return $this; + } + + /** + * Specifies the desired number of tasks the execution should run. + * Setting to 1 means that parallelism is limited to 1 and the success of + * that task signals the success of the execution. Defaults to 1. + * + * Generated from protobuf field int32 task_count = 4; + * @return int + */ + public function getTaskCount() + { + return $this->task_count; + } + + /** + * Specifies the desired number of tasks the execution should run. + * Setting to 1 means that parallelism is limited to 1 and the success of + * that task signals the success of the execution. Defaults to 1. + * + * Generated from protobuf field int32 task_count = 4; + * @param int $var + * @return $this + */ + public function setTaskCount($var) + { + GPBUtil::checkInt32($var); + $this->task_count = $var; + + return $this; + } + + /** + * Required. Describes the task(s) that will be created when executing an + * execution. + * + * Generated from protobuf field .google.cloud.run.v2.TaskTemplate template = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Run\V2\TaskTemplate|null + */ + public function getTemplate() + { + return $this->template; + } + + public function hasTemplate() + { + return isset($this->template); + } + + public function clearTemplate() + { + unset($this->template); + } + + /** + * Required. Describes the task(s) that will be created when executing an + * execution. + * + * Generated from protobuf field .google.cloud.run.v2.TaskTemplate template = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Run\V2\TaskTemplate $var + * @return $this + */ + public function setTemplate($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\TaskTemplate::class); + $this->template = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GCSVolumeSource.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GCSVolumeSource.php new file mode 100644 index 000000000000..659846b4e6bd --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GCSVolumeSource.php @@ -0,0 +1,140 @@ +google.cloud.run.v2.GCSVolumeSource + */ +class GCSVolumeSource extends \Google\Protobuf\Internal\Message +{ + /** + * Cloud Storage Bucket name. + * + * Generated from protobuf field string bucket = 1; + */ + protected $bucket = ''; + /** + * If true, the volume will be mounted as read only for all mounts. + * + * Generated from protobuf field bool read_only = 2; + */ + protected $read_only = false; + /** + * A list of additional flags to pass to the gcsfuse CLI. + * Options should be specified without the leading "--". + * + * Generated from protobuf field repeated string mount_options = 3; + */ + private $mount_options; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bucket + * Cloud Storage Bucket name. + * @type bool $read_only + * If true, the volume will be mounted as read only for all mounts. + * @type array|\Google\Protobuf\Internal\RepeatedField $mount_options + * A list of additional flags to pass to the gcsfuse CLI. + * Options should be specified without the leading "--". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Cloud Storage Bucket name. + * + * Generated from protobuf field string bucket = 1; + * @return string + */ + public function getBucket() + { + return $this->bucket; + } + + /** + * Cloud Storage Bucket name. + * + * Generated from protobuf field string bucket = 1; + * @param string $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkString($var, True); + $this->bucket = $var; + + return $this; + } + + /** + * If true, the volume will be mounted as read only for all mounts. + * + * Generated from protobuf field bool read_only = 2; + * @return bool + */ + public function getReadOnly() + { + return $this->read_only; + } + + /** + * If true, the volume will be mounted as read only for all mounts. + * + * Generated from protobuf field bool read_only = 2; + * @param bool $var + * @return $this + */ + public function setReadOnly($var) + { + GPBUtil::checkBool($var); + $this->read_only = $var; + + return $this; + } + + /** + * A list of additional flags to pass to the gcsfuse CLI. + * Options should be specified without the leading "--". + * + * Generated from protobuf field repeated string mount_options = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMountOptions() + { + return $this->mount_options; + } + + /** + * A list of additional flags to pass to the gcsfuse CLI. + * Options should be specified without the leading "--". + * + * Generated from protobuf field repeated string mount_options = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMountOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->mount_options = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GRPCAction.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GRPCAction.php new file mode 100644 index 000000000000..826f06cb4711 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GRPCAction.php @@ -0,0 +1,121 @@ +google.cloud.run.v2.GRPCAction + */ +class GRPCAction extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Port number of the gRPC service. Number must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * + * Generated from protobuf field int32 port = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $port = 0; + /** + * Optional. Service is the name of the service to place in the gRPC + * HealthCheckRequest (see + * https://github.com/grpc/grpc/blob/master/doc/health-checking.md ). If this + * is not specified, the default behavior is defined by gRPC. + * + * Generated from protobuf field string service = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $port + * Optional. Port number of the gRPC service. Number must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * @type string $service + * Optional. Service is the name of the service to place in the gRPC + * HealthCheckRequest (see + * https://github.com/grpc/grpc/blob/master/doc/health-checking.md ). If this + * is not specified, the default behavior is defined by gRPC. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Port number of the gRPC service. Number must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * + * Generated from protobuf field int32 port = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPort() + { + return $this->port; + } + + /** + * Optional. Port number of the gRPC service. Number must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * + * Generated from protobuf field int32 port = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + + /** + * Optional. Service is the name of the service to place in the gRPC + * HealthCheckRequest (see + * https://github.com/grpc/grpc/blob/master/doc/health-checking.md ). If this + * is not specified, the default behavior is defined by gRPC. + * + * Generated from protobuf field string service = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * Optional. Service is the name of the service to place in the gRPC + * HealthCheckRequest (see + * https://github.com/grpc/grpc/blob/master/doc/health-checking.md ). If this + * is not specified, the default behavior is defined by gRPC. + * + * Generated from protobuf field string service = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetExecutionRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetExecutionRequest.php new file mode 100644 index 000000000000..8ecf98e5ef55 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetExecutionRequest.php @@ -0,0 +1,96 @@ +google.cloud.run.v2.GetExecutionRequest + */ +class GetExecutionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full name of the Execution. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The full name of the Execution. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. Please see + * {@see ExecutionsClient::executionName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\GetExecutionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full name of the Execution. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Execution::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full name of the Execution. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The full name of the Execution. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetJobRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetJobRequest.php new file mode 100644 index 000000000000..8d43efd711f4 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetJobRequest.php @@ -0,0 +1,91 @@ +google.cloud.run.v2.GetJobRequest + */ +class GetJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. Please see + * {@see JobsClient::jobName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\GetJobRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetRevisionRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetRevisionRequest.php new file mode 100644 index 000000000000..23fa3012691d --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetRevisionRequest.php @@ -0,0 +1,91 @@ +google.cloud.run.v2.GetRevisionRequest + */ +class GetRevisionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full name of the Revision. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The full name of the Revision. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * Please see {@see RevisionsClient::revisionName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\GetRevisionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full name of the Revision. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Revision::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full name of the Revision. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The full name of the Revision. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetServiceRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetServiceRequest.php new file mode 100644 index 000000000000..4a5aeb399c01 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetServiceRequest.php @@ -0,0 +1,91 @@ +google.cloud.run.v2.GetServiceRequest + */ +class GetServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. Please see + * {@see ServicesClient::serviceName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\GetServiceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetTaskRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetTaskRequest.php new file mode 100644 index 000000000000..925a9bb98395 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/GetTaskRequest.php @@ -0,0 +1,91 @@ +google.cloud.run.v2.GetTaskRequest + */ +class GetTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full name of the Task. + * Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The full name of the Task. + * Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} + * Please see {@see TasksClient::taskName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\GetTaskRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full name of the Task. + * Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Task::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full name of the Task. + * Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The full name of the Task. + * Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPGetAction.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPGetAction.php new file mode 100644 index 000000000000..371a24d2a139 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPGetAction.php @@ -0,0 +1,147 @@ +google.cloud.run.v2.HTTPGetAction + */ +class HTTPGetAction extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Path to access on the HTTP server. Defaults to '/'. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $path = ''; + /** + * Optional. Custom headers to set in the request. HTTP allows repeated + * headers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.HTTPHeader http_headers = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $http_headers; + /** + * Optional. Port number to access on the container. Must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * + * Generated from protobuf field int32 port = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $port = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $path + * Optional. Path to access on the HTTP server. Defaults to '/'. + * @type array<\Google\Cloud\Run\V2\HTTPHeader>|\Google\Protobuf\Internal\RepeatedField $http_headers + * Optional. Custom headers to set in the request. HTTP allows repeated + * headers. + * @type int $port + * Optional. Port number to access on the container. Must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Path to access on the HTTP server. Defaults to '/'. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Optional. Path to access on the HTTP server. Defaults to '/'. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + + /** + * Optional. Custom headers to set in the request. HTTP allows repeated + * headers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.HTTPHeader http_headers = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHttpHeaders() + { + return $this->http_headers; + } + + /** + * Optional. Custom headers to set in the request. HTTP allows repeated + * headers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.HTTPHeader http_headers = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Run\V2\HTTPHeader>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHttpHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\HTTPHeader::class); + $this->http_headers = $arr; + + return $this; + } + + /** + * Optional. Port number to access on the container. Must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * + * Generated from protobuf field int32 port = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPort() + { + return $this->port; + } + + /** + * Optional. Port number to access on the container. Must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * + * Generated from protobuf field int32 port = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPHeader.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPHeader.php new file mode 100644 index 000000000000..036332d24bb8 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/HTTPHeader.php @@ -0,0 +1,101 @@ +google.cloud.run.v2.HTTPHeader + */ +class HTTPHeader extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The header field name + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Optional. The header field value + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The header field name + * @type string $value + * Optional. The header field value + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The header field name + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The header field name + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. The header field value + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Optional. The header field value + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/IngressTraffic.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/IngressTraffic.php new file mode 100644 index 000000000000..c9e391f2e464 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/IngressTraffic.php @@ -0,0 +1,75 @@ +google.cloud.run.v2.IngressTraffic + */ +class IngressTraffic +{ + /** + * Unspecified + * + * Generated from protobuf enum INGRESS_TRAFFIC_UNSPECIFIED = 0; + */ + const INGRESS_TRAFFIC_UNSPECIFIED = 0; + /** + * All inbound traffic is allowed. + * + * Generated from protobuf enum INGRESS_TRAFFIC_ALL = 1; + */ + const INGRESS_TRAFFIC_ALL = 1; + /** + * Only internal traffic is allowed. + * + * Generated from protobuf enum INGRESS_TRAFFIC_INTERNAL_ONLY = 2; + */ + const INGRESS_TRAFFIC_INTERNAL_ONLY = 2; + /** + * Both internal and Google Cloud Load Balancer traffic is allowed. + * + * Generated from protobuf enum INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER = 3; + */ + const INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER = 3; + /** + * No ingress traffic is allowed. + * + * Generated from protobuf enum INGRESS_TRAFFIC_NONE = 4; + */ + const INGRESS_TRAFFIC_NONE = 4; + + private static $valueToName = [ + self::INGRESS_TRAFFIC_UNSPECIFIED => 'INGRESS_TRAFFIC_UNSPECIFIED', + self::INGRESS_TRAFFIC_ALL => 'INGRESS_TRAFFIC_ALL', + self::INGRESS_TRAFFIC_INTERNAL_ONLY => 'INGRESS_TRAFFIC_INTERNAL_ONLY', + self::INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER => 'INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER', + self::INGRESS_TRAFFIC_NONE => 'INGRESS_TRAFFIC_NONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Job.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Job.php new file mode 100644 index 000000000000..c38afcf3c49e --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Job.php @@ -0,0 +1,1249 @@ +google.cloud.run.v2.Job + */ +class Job extends \Google\Protobuf\Internal\Message +{ + /** + * The fully qualified name of this Job. + * Format: + * projects/{project}/locations/{location}/jobs/{job} + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. Server assigned unique identifier for the Execution. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generation = 0; + /** + * Unstructured key value map that can be used to organize and categorize + * objects. + * User-provided labels are shared with Google's billing system, so they can + * be used to filter, or break down billing charges by team, component, + * environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 Job. + * + * Generated from protobuf field map labels = 4; + */ + private $labels; + /** + * Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected on new resources. All system + * annotations in v1 now have a corresponding field in v2 Job. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * + * Generated from protobuf field map annotations = 5; + */ + private $annotations; + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. The deletion time. It is only populated as a response to a + * Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_time = null; + /** + * Output only. Email address of the authenticated creator. + * + * Generated from protobuf field string creator = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $creator = ''; + /** + * Output only. Email address of the last authenticated modifier. + * + * Generated from protobuf field string last_modifier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_modifier = ''; + /** + * Arbitrary identifier for the API client. + * + * Generated from protobuf field string client = 12; + */ + protected $client = ''; + /** + * Arbitrary version identifier for the API client. + * + * Generated from protobuf field string client_version = 13; + */ + protected $client_version = ''; + /** + * The launch stage as defined by [Google Cloud Platform + * Launch Stages](https://cloud.google.com/terms/launch-stages). + * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + * is assumed. + * Set the launch stage to a preview stage on input to allow use of preview + * features in that stage. On read (or output), describes whether the resource + * uses preview features. + *

+ * For example, if ALPHA is provided as input, but only BETA and GA-level + * features are used, this field will be BETA on output. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 14; + */ + protected $launch_stage = 0; + /** + * Settings for the Binary Authorization feature. + * + * Generated from protobuf field .google.cloud.run.v2.BinaryAuthorization binary_authorization = 15; + */ + protected $binary_authorization = null; + /** + * Required. The template used to create executions for this Job. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionTemplate template = 16 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $template = null; + /** + * Output only. The generation of this Job. See comments in `reconciling` for + * additional information on reconciliation process in Cloud Run. + * + * Generated from protobuf field int64 observed_generation = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $observed_generation = 0; + /** + * Output only. The Condition of this Job, containing its readiness status, + * and detailed error information in case it did not reach the desired state. + * + * Generated from protobuf field .google.cloud.run.v2.Condition terminal_condition = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $terminal_condition = null; + /** + * Output only. The Conditions of all other associated sub-resources. They + * contain additional diagnostics information in case the Job does not reach + * its desired state. See comments in `reconciling` for additional information + * on reconciliation process in Cloud Run. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $conditions; + /** + * Output only. Number of executions created for this job. + * + * Generated from protobuf field int32 execution_count = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $execution_count = 0; + /** + * Output only. Name of the last created execution. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionReference latest_created_execution = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $latest_created_execution = null; + /** + * Output only. Returns true if the Job is currently being acted upon by the + * system to bring it into the desired state. + * When a new Job is created, or an existing one is updated, Cloud Run + * will asynchronously perform all necessary steps to bring the Job to the + * desired state. This process is called reconciliation. + * While reconciliation is in process, `observed_generation` and + * `latest_succeeded_execution`, will have transient values that might + * mismatch the intended state: Once reconciliation is over (and this field is + * false), there are two possible outcomes: reconciliation succeeded and the + * state matches the Job, or there was an error, and reconciliation failed. + * This state can be found in `terminal_condition.state`. + * If reconciliation succeeded, the following fields will match: + * `observed_generation` and `generation`, `latest_succeeded_execution` and + * `latest_created_execution`. + * If reconciliation failed, `observed_generation` and + * `latest_succeeded_execution` will have the state of the last succeeded + * execution or empty for newly created Job. Additional information on the + * failure can be found in `terminal_condition` and `conditions`. + * + * Generated from protobuf field bool reconciling = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = false; + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $etag = ''; + protected $create_execution; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The fully qualified name of this Job. + * Format: + * projects/{project}/locations/{location}/jobs/{job} + * @type string $uid + * Output only. Server assigned unique identifier for the Execution. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * @type int|string $generation + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Unstructured key value map that can be used to organize and categorize + * objects. + * User-provided labels are shared with Google's billing system, so they can + * be used to filter, or break down billing charges by team, component, + * environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 Job. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected on new resources. All system + * annotations in v1 now have a corresponding field in v2 Job. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The creation time. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last-modified time. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. The deletion time. It is only populated as a response to a + * Delete request. + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. + * @type string $creator + * Output only. Email address of the authenticated creator. + * @type string $last_modifier + * Output only. Email address of the last authenticated modifier. + * @type string $client + * Arbitrary identifier for the API client. + * @type string $client_version + * Arbitrary version identifier for the API client. + * @type int $launch_stage + * The launch stage as defined by [Google Cloud Platform + * Launch Stages](https://cloud.google.com/terms/launch-stages). + * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + * is assumed. + * Set the launch stage to a preview stage on input to allow use of preview + * features in that stage. On read (or output), describes whether the resource + * uses preview features. + *

+ * For example, if ALPHA is provided as input, but only BETA and GA-level + * features are used, this field will be BETA on output. + * @type \Google\Cloud\Run\V2\BinaryAuthorization $binary_authorization + * Settings for the Binary Authorization feature. + * @type \Google\Cloud\Run\V2\ExecutionTemplate $template + * Required. The template used to create executions for this Job. + * @type int|string $observed_generation + * Output only. The generation of this Job. See comments in `reconciling` for + * additional information on reconciliation process in Cloud Run. + * @type \Google\Cloud\Run\V2\Condition $terminal_condition + * Output only. The Condition of this Job, containing its readiness status, + * and detailed error information in case it did not reach the desired state. + * @type array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $conditions + * Output only. The Conditions of all other associated sub-resources. They + * contain additional diagnostics information in case the Job does not reach + * its desired state. See comments in `reconciling` for additional information + * on reconciliation process in Cloud Run. + * @type int $execution_count + * Output only. Number of executions created for this job. + * @type \Google\Cloud\Run\V2\ExecutionReference $latest_created_execution + * Output only. Name of the last created execution. + * @type bool $reconciling + * Output only. Returns true if the Job is currently being acted upon by the + * system to bring it into the desired state. + * When a new Job is created, or an existing one is updated, Cloud Run + * will asynchronously perform all necessary steps to bring the Job to the + * desired state. This process is called reconciliation. + * While reconciliation is in process, `observed_generation` and + * `latest_succeeded_execution`, will have transient values that might + * mismatch the intended state: Once reconciliation is over (and this field is + * false), there are two possible outcomes: reconciliation succeeded and the + * state matches the Job, or there was an error, and reconciliation failed. + * This state can be found in `terminal_condition.state`. + * If reconciliation succeeded, the following fields will match: + * `observed_generation` and `generation`, `latest_succeeded_execution` and + * `latest_created_execution`. + * If reconciliation failed, `observed_generation` and + * `latest_succeeded_execution` will have the state of the last succeeded + * execution or empty for newly created Job. Additional information on the + * failure can be found in `terminal_condition` and `conditions`. + * @type bool $satisfies_pzs + * Output only. Reserved for future use. + * @type string $start_execution_token + * A unique string used as a suffix creating a new execution. The Job will + * become ready when the execution is successfully started. + * The sum of job name and token length must be fewer than 63 characters. + * @type string $run_execution_token + * A unique string used as a suffix for creating a new execution. The Job + * will become ready when the execution is successfully completed. + * The sum of job name and token length must be fewer than 63 characters. + * @type string $etag + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * The fully qualified name of this Job. + * Format: + * projects/{project}/locations/{location}/jobs/{job} + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The fully qualified name of this Job. + * Format: + * projects/{project}/locations/{location}/jobs/{job} + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Server assigned unique identifier for the Execution. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Server assigned unique identifier for the Execution. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getGeneration() + { + return $this->generation; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setGeneration($var) + { + GPBUtil::checkInt64($var); + $this->generation = $var; + + return $this; + } + + /** + * Unstructured key value map that can be used to organize and categorize + * objects. + * User-provided labels are shared with Google's billing system, so they can + * be used to filter, or break down billing charges by team, component, + * environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 Job. + * + * Generated from protobuf field map labels = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Unstructured key value map that can be used to organize and categorize + * objects. + * User-provided labels are shared with Google's billing system, so they can + * be used to filter, or break down billing charges by team, component, + * environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 Job. + * + * Generated from protobuf field map labels = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected on new resources. All system + * annotations in v1 now have a corresponding field in v2 Job. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * + * Generated from protobuf field map annotations = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected on new resources. All system + * annotations in v1 now have a corresponding field in v2 Job. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * + * Generated from protobuf field map annotations = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. The deletion time. It is only populated as a response to a + * Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. The deletion time. It is only populated as a response to a + * Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * Output only. Email address of the authenticated creator. + * + * Generated from protobuf field string creator = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getCreator() + { + return $this->creator; + } + + /** + * Output only. Email address of the authenticated creator. + * + * Generated from protobuf field string creator = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setCreator($var) + { + GPBUtil::checkString($var, True); + $this->creator = $var; + + return $this; + } + + /** + * Output only. Email address of the last authenticated modifier. + * + * Generated from protobuf field string last_modifier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLastModifier() + { + return $this->last_modifier; + } + + /** + * Output only. Email address of the last authenticated modifier. + * + * Generated from protobuf field string last_modifier = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLastModifier($var) + { + GPBUtil::checkString($var, True); + $this->last_modifier = $var; + + return $this; + } + + /** + * Arbitrary identifier for the API client. + * + * Generated from protobuf field string client = 12; + * @return string + */ + public function getClient() + { + return $this->client; + } + + /** + * Arbitrary identifier for the API client. + * + * Generated from protobuf field string client = 12; + * @param string $var + * @return $this + */ + public function setClient($var) + { + GPBUtil::checkString($var, True); + $this->client = $var; + + return $this; + } + + /** + * Arbitrary version identifier for the API client. + * + * Generated from protobuf field string client_version = 13; + * @return string + */ + public function getClientVersion() + { + return $this->client_version; + } + + /** + * Arbitrary version identifier for the API client. + * + * Generated from protobuf field string client_version = 13; + * @param string $var + * @return $this + */ + public function setClientVersion($var) + { + GPBUtil::checkString($var, True); + $this->client_version = $var; + + return $this; + } + + /** + * The launch stage as defined by [Google Cloud Platform + * Launch Stages](https://cloud.google.com/terms/launch-stages). + * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + * is assumed. + * Set the launch stage to a preview stage on input to allow use of preview + * features in that stage. On read (or output), describes whether the resource + * uses preview features. + *

+ * For example, if ALPHA is provided as input, but only BETA and GA-level + * features are used, this field will be BETA on output. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 14; + * @return int + */ + public function getLaunchStage() + { + return $this->launch_stage; + } + + /** + * The launch stage as defined by [Google Cloud Platform + * Launch Stages](https://cloud.google.com/terms/launch-stages). + * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + * is assumed. + * Set the launch stage to a preview stage on input to allow use of preview + * features in that stage. On read (or output), describes whether the resource + * uses preview features. + *

+ * For example, if ALPHA is provided as input, but only BETA and GA-level + * features are used, this field will be BETA on output. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 14; + * @param int $var + * @return $this + */ + public function setLaunchStage($var) + { + GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); + $this->launch_stage = $var; + + return $this; + } + + /** + * Settings for the Binary Authorization feature. + * + * Generated from protobuf field .google.cloud.run.v2.BinaryAuthorization binary_authorization = 15; + * @return \Google\Cloud\Run\V2\BinaryAuthorization|null + */ + public function getBinaryAuthorization() + { + return $this->binary_authorization; + } + + public function hasBinaryAuthorization() + { + return isset($this->binary_authorization); + } + + public function clearBinaryAuthorization() + { + unset($this->binary_authorization); + } + + /** + * Settings for the Binary Authorization feature. + * + * Generated from protobuf field .google.cloud.run.v2.BinaryAuthorization binary_authorization = 15; + * @param \Google\Cloud\Run\V2\BinaryAuthorization $var + * @return $this + */ + public function setBinaryAuthorization($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\BinaryAuthorization::class); + $this->binary_authorization = $var; + + return $this; + } + + /** + * Required. The template used to create executions for this Job. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionTemplate template = 16 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Run\V2\ExecutionTemplate|null + */ + public function getTemplate() + { + return $this->template; + } + + public function hasTemplate() + { + return isset($this->template); + } + + public function clearTemplate() + { + unset($this->template); + } + + /** + * Required. The template used to create executions for this Job. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionTemplate template = 16 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Run\V2\ExecutionTemplate $var + * @return $this + */ + public function setTemplate($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ExecutionTemplate::class); + $this->template = $var; + + return $this; + } + + /** + * Output only. The generation of this Job. See comments in `reconciling` for + * additional information on reconciliation process in Cloud Run. + * + * Generated from protobuf field int64 observed_generation = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getObservedGeneration() + { + return $this->observed_generation; + } + + /** + * Output only. The generation of this Job. See comments in `reconciling` for + * additional information on reconciliation process in Cloud Run. + * + * Generated from protobuf field int64 observed_generation = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setObservedGeneration($var) + { + GPBUtil::checkInt64($var); + $this->observed_generation = $var; + + return $this; + } + + /** + * Output only. The Condition of this Job, containing its readiness status, + * and detailed error information in case it did not reach the desired state. + * + * Generated from protobuf field .google.cloud.run.v2.Condition terminal_condition = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Run\V2\Condition|null + */ + public function getTerminalCondition() + { + return $this->terminal_condition; + } + + public function hasTerminalCondition() + { + return isset($this->terminal_condition); + } + + public function clearTerminalCondition() + { + unset($this->terminal_condition); + } + + /** + * Output only. The Condition of this Job, containing its readiness status, + * and detailed error information in case it did not reach the desired state. + * + * Generated from protobuf field .google.cloud.run.v2.Condition terminal_condition = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Run\V2\Condition $var + * @return $this + */ + public function setTerminalCondition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Condition::class); + $this->terminal_condition = $var; + + return $this; + } + + /** + * Output only. The Conditions of all other associated sub-resources. They + * contain additional diagnostics information in case the Job does not reach + * its desired state. See comments in `reconciling` for additional information + * on reconciliation process in Cloud Run. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConditions() + { + return $this->conditions; + } + + /** + * Output only. The Conditions of all other associated sub-resources. They + * contain additional diagnostics information in case the Job does not reach + * its desired state. See comments in `reconciling` for additional information + * on reconciliation process in Cloud Run. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConditions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Condition::class); + $this->conditions = $arr; + + return $this; + } + + /** + * Output only. Number of executions created for this job. + * + * Generated from protobuf field int32 execution_count = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getExecutionCount() + { + return $this->execution_count; + } + + /** + * Output only. Number of executions created for this job. + * + * Generated from protobuf field int32 execution_count = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setExecutionCount($var) + { + GPBUtil::checkInt32($var); + $this->execution_count = $var; + + return $this; + } + + /** + * Output only. Name of the last created execution. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionReference latest_created_execution = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Run\V2\ExecutionReference|null + */ + public function getLatestCreatedExecution() + { + return $this->latest_created_execution; + } + + public function hasLatestCreatedExecution() + { + return isset($this->latest_created_execution); + } + + public function clearLatestCreatedExecution() + { + unset($this->latest_created_execution); + } + + /** + * Output only. Name of the last created execution. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionReference latest_created_execution = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Run\V2\ExecutionReference $var + * @return $this + */ + public function setLatestCreatedExecution($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ExecutionReference::class); + $this->latest_created_execution = $var; + + return $this; + } + + /** + * Output only. Returns true if the Job is currently being acted upon by the + * system to bring it into the desired state. + * When a new Job is created, or an existing one is updated, Cloud Run + * will asynchronously perform all necessary steps to bring the Job to the + * desired state. This process is called reconciliation. + * While reconciliation is in process, `observed_generation` and + * `latest_succeeded_execution`, will have transient values that might + * mismatch the intended state: Once reconciliation is over (and this field is + * false), there are two possible outcomes: reconciliation succeeded and the + * state matches the Job, or there was an error, and reconciliation failed. + * This state can be found in `terminal_condition.state`. + * If reconciliation succeeded, the following fields will match: + * `observed_generation` and `generation`, `latest_succeeded_execution` and + * `latest_created_execution`. + * If reconciliation failed, `observed_generation` and + * `latest_succeeded_execution` will have the state of the last succeeded + * execution or empty for newly created Job. Additional information on the + * failure can be found in `terminal_condition` and `conditions`. + * + * Generated from protobuf field bool reconciling = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Returns true if the Job is currently being acted upon by the + * system to bring it into the desired state. + * When a new Job is created, or an existing one is updated, Cloud Run + * will asynchronously perform all necessary steps to bring the Job to the + * desired state. This process is called reconciliation. + * While reconciliation is in process, `observed_generation` and + * `latest_succeeded_execution`, will have transient values that might + * mismatch the intended state: Once reconciliation is over (and this field is + * false), there are two possible outcomes: reconciliation succeeded and the + * state matches the Job, or there was an error, and reconciliation failed. + * This state can be found in `terminal_condition.state`. + * If reconciliation succeeded, the following fields will match: + * `observed_generation` and `generation`, `latest_succeeded_execution` and + * `latest_created_execution`. + * If reconciliation failed, `observed_generation` and + * `latest_succeeded_execution` will have the state of the last succeeded + * execution or empty for newly created Job. Additional information on the + * failure can be found in `terminal_condition` and `conditions`. + * + * Generated from protobuf field bool reconciling = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * A unique string used as a suffix creating a new execution. The Job will + * become ready when the execution is successfully started. + * The sum of job name and token length must be fewer than 63 characters. + * + * Generated from protobuf field string start_execution_token = 26; + * @return string + */ + public function getStartExecutionToken() + { + return $this->readOneof(26); + } + + public function hasStartExecutionToken() + { + return $this->hasOneof(26); + } + + /** + * A unique string used as a suffix creating a new execution. The Job will + * become ready when the execution is successfully started. + * The sum of job name and token length must be fewer than 63 characters. + * + * Generated from protobuf field string start_execution_token = 26; + * @param string $var + * @return $this + */ + public function setStartExecutionToken($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(26, $var); + + return $this; + } + + /** + * A unique string used as a suffix for creating a new execution. The Job + * will become ready when the execution is successfully completed. + * The sum of job name and token length must be fewer than 63 characters. + * + * Generated from protobuf field string run_execution_token = 27; + * @return string + */ + public function getRunExecutionToken() + { + return $this->readOneof(27); + } + + public function hasRunExecutionToken() + { + return $this->hasOneof(27); + } + + /** + * A unique string used as a suffix for creating a new execution. The Job + * will become ready when the execution is successfully completed. + * The sum of job name and token length must be fewer than 63 characters. + * + * Generated from protobuf field string run_execution_token = 27; + * @param string $var + * @return $this + */ + public function setRunExecutionToken($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(27, $var); + + return $this; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * @return string + */ + public function getCreateExecution() + { + return $this->whichOneof("create_execution"); + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsRequest.php new file mode 100644 index 000000000000..909879ad84ea --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsRequest.php @@ -0,0 +1,202 @@ +google.cloud.run.v2.ListExecutionsRequest + */ +class ListExecutionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Execution from which the Executions should be listed. + * To list all Executions across Jobs, use "-" instead of Job name. + * Format: `projects/{project}/locations/{location}/jobs/{job}`, where + * `{project}` can be project id or number. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of Executions to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token received from a previous call to ListExecutions. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + */ + protected $show_deleted = false; + + /** + * @param string $parent Required. The Execution from which the Executions should be listed. + * To list all Executions across Jobs, use "-" instead of Job name. + * Format: `projects/{project}/locations/{location}/jobs/{job}`, where + * `{project}` can be project id or number. Please see + * {@see ExecutionsClient::jobName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\ListExecutionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The Execution from which the Executions should be listed. + * To list all Executions across Jobs, use "-" instead of Job name. + * Format: `projects/{project}/locations/{location}/jobs/{job}`, where + * `{project}` can be project id or number. + * @type int $page_size + * Maximum number of Executions to return in this call. + * @type string $page_token + * A page token received from a previous call to ListExecutions. + * All other parameters must match. + * @type bool $show_deleted + * If true, returns deleted (but unexpired) resources along with active ones. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Execution::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Execution from which the Executions should be listed. + * To list all Executions across Jobs, use "-" instead of Job name. + * Format: `projects/{project}/locations/{location}/jobs/{job}`, where + * `{project}` can be project id or number. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The Execution from which the Executions should be listed. + * To list all Executions across Jobs, use "-" instead of Job name. + * Format: `projects/{project}/locations/{location}/jobs/{job}`, where + * `{project}` can be project id or number. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Maximum number of Executions to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of Executions to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token received from a previous call to ListExecutions. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token received from a previous call to ListExecutions. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @return bool + */ + public function getShowDeleted() + { + return $this->show_deleted; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @param bool $var + * @return $this + */ + public function setShowDeleted($var) + { + GPBUtil::checkBool($var); + $this->show_deleted = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsResponse.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsResponse.php new file mode 100644 index 000000000000..66ffa08a98f2 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListExecutionsResponse.php @@ -0,0 +1,105 @@ +google.cloud.run.v2.ListExecutionsResponse + */ +class ListExecutionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The resulting list of Executions. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Execution executions = 1; + */ + private $executions; + /** + * A token indicating there are more items than page_size. Use it in the next + * ListExecutions request to continue. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Run\V2\Execution>|\Google\Protobuf\Internal\RepeatedField $executions + * The resulting list of Executions. + * @type string $next_page_token + * A token indicating there are more items than page_size. Use it in the next + * ListExecutions request to continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Execution::initOnce(); + parent::__construct($data); + } + + /** + * The resulting list of Executions. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Execution executions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExecutions() + { + return $this->executions; + } + + /** + * The resulting list of Executions. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Execution executions = 1; + * @param array<\Google\Cloud\Run\V2\Execution>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExecutions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Execution::class); + $this->executions = $arr; + + return $this; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListExecutions request to continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListExecutions request to continue. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsRequest.php new file mode 100644 index 000000000000..076ac55e2e82 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsRequest.php @@ -0,0 +1,197 @@ +google.cloud.run.v2.ListJobsRequest + */ +class ListJobsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location and project to list resources on. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of Jobs to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token received from a previous call to ListJobs. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + */ + protected $show_deleted = false; + + /** + * @param string $parent Required. The location and project to list resources on. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. Please see + * {@see JobsClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\ListJobsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location and project to list resources on. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * @type int $page_size + * Maximum number of Jobs to return in this call. + * @type string $page_token + * A page token received from a previous call to ListJobs. + * All other parameters must match. + * @type bool $show_deleted + * If true, returns deleted (but unexpired) resources along with active ones. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location and project to list resources on. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The location and project to list resources on. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Maximum number of Jobs to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of Jobs to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token received from a previous call to ListJobs. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token received from a previous call to ListJobs. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @return bool + */ + public function getShowDeleted() + { + return $this->show_deleted; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @param bool $var + * @return $this + */ + public function setShowDeleted($var) + { + GPBUtil::checkBool($var); + $this->show_deleted = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsResponse.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsResponse.php new file mode 100644 index 000000000000..1d0b4c4b6c6c --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListJobsResponse.php @@ -0,0 +1,105 @@ +google.cloud.run.v2.ListJobsResponse + */ +class ListJobsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The resulting list of Jobs. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Job jobs = 1; + */ + private $jobs; + /** + * A token indicating there are more items than page_size. Use it in the next + * ListJobs request to continue. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Run\V2\Job>|\Google\Protobuf\Internal\RepeatedField $jobs + * The resulting list of Jobs. + * @type string $next_page_token + * A token indicating there are more items than page_size. Use it in the next + * ListJobs request to continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * The resulting list of Jobs. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Job jobs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getJobs() + { + return $this->jobs; + } + + /** + * The resulting list of Jobs. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Job jobs = 1; + * @param array<\Google\Cloud\Run\V2\Job>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setJobs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Job::class); + $this->jobs = $arr; + + return $this; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListJobs request to continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListJobs request to continue. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsRequest.php new file mode 100644 index 000000000000..01cde2b85c98 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsRequest.php @@ -0,0 +1,202 @@ +google.cloud.run.v2.ListRevisionsRequest + */ +class ListRevisionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Service from which the Revisions should be listed. + * To list all Revisions across Services, use "-" instead of Service name. + * Format: + * projects/{project}/locations/{location}/services/{service} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of revisions to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token received from a previous call to ListRevisions. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + */ + protected $show_deleted = false; + + /** + * @param string $parent Required. The Service from which the Revisions should be listed. + * To list all Revisions across Services, use "-" instead of Service name. + * Format: + * projects/{project}/locations/{location}/services/{service} + * Please see {@see RevisionsClient::serviceName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\ListRevisionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The Service from which the Revisions should be listed. + * To list all Revisions across Services, use "-" instead of Service name. + * Format: + * projects/{project}/locations/{location}/services/{service} + * @type int $page_size + * Maximum number of revisions to return in this call. + * @type string $page_token + * A page token received from a previous call to ListRevisions. + * All other parameters must match. + * @type bool $show_deleted + * If true, returns deleted (but unexpired) resources along with active ones. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Revision::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Service from which the Revisions should be listed. + * To list all Revisions across Services, use "-" instead of Service name. + * Format: + * projects/{project}/locations/{location}/services/{service} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The Service from which the Revisions should be listed. + * To list all Revisions across Services, use "-" instead of Service name. + * Format: + * projects/{project}/locations/{location}/services/{service} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Maximum number of revisions to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of revisions to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token received from a previous call to ListRevisions. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token received from a previous call to ListRevisions. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @return bool + */ + public function getShowDeleted() + { + return $this->show_deleted; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @param bool $var + * @return $this + */ + public function setShowDeleted($var) + { + GPBUtil::checkBool($var); + $this->show_deleted = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsResponse.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsResponse.php new file mode 100644 index 000000000000..e4a2db90f4f3 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListRevisionsResponse.php @@ -0,0 +1,105 @@ +google.cloud.run.v2.ListRevisionsResponse + */ +class ListRevisionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The resulting list of Revisions. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Revision revisions = 1; + */ + private $revisions; + /** + * A token indicating there are more items than page_size. Use it in the next + * ListRevisions request to continue. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Run\V2\Revision>|\Google\Protobuf\Internal\RepeatedField $revisions + * The resulting list of Revisions. + * @type string $next_page_token + * A token indicating there are more items than page_size. Use it in the next + * ListRevisions request to continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Revision::initOnce(); + parent::__construct($data); + } + + /** + * The resulting list of Revisions. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Revision revisions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRevisions() + { + return $this->revisions; + } + + /** + * The resulting list of Revisions. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Revision revisions = 1; + * @param array<\Google\Cloud\Run\V2\Revision>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRevisions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Revision::class); + $this->revisions = $arr; + + return $this; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListRevisions request to continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListRevisions request to continue. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesRequest.php new file mode 100644 index 000000000000..1cd78b619338 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesRequest.php @@ -0,0 +1,202 @@ +google.cloud.run.v2.ListServicesRequest + */ +class ListServicesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location and project to list resources on. + * Location must be a valid Google Cloud region, and cannot be the "-" + * wildcard. Format: projects/{project}/locations/{location}, where {project} + * can be project id or number. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of Services to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token received from a previous call to ListServices. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + */ + protected $show_deleted = false; + + /** + * @param string $parent Required. The location and project to list resources on. + * Location must be a valid Google Cloud region, and cannot be the "-" + * wildcard. Format: projects/{project}/locations/{location}, where {project} + * can be project id or number. Please see + * {@see ServicesClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\ListServicesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The location and project to list resources on. + * Location must be a valid Google Cloud region, and cannot be the "-" + * wildcard. Format: projects/{project}/locations/{location}, where {project} + * can be project id or number. + * @type int $page_size + * Maximum number of Services to return in this call. + * @type string $page_token + * A page token received from a previous call to ListServices. + * All other parameters must match. + * @type bool $show_deleted + * If true, returns deleted (but unexpired) resources along with active ones. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location and project to list resources on. + * Location must be a valid Google Cloud region, and cannot be the "-" + * wildcard. Format: projects/{project}/locations/{location}, where {project} + * can be project id or number. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The location and project to list resources on. + * Location must be a valid Google Cloud region, and cannot be the "-" + * wildcard. Format: projects/{project}/locations/{location}, where {project} + * can be project id or number. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Maximum number of Services to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of Services to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token received from a previous call to ListServices. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token received from a previous call to ListServices. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @return bool + */ + public function getShowDeleted() + { + return $this->show_deleted; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @param bool $var + * @return $this + */ + public function setShowDeleted($var) + { + GPBUtil::checkBool($var); + $this->show_deleted = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesResponse.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesResponse.php new file mode 100644 index 000000000000..06cdb054df84 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListServicesResponse.php @@ -0,0 +1,105 @@ +google.cloud.run.v2.ListServicesResponse + */ +class ListServicesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The resulting list of Services. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Service services = 1; + */ + private $services; + /** + * A token indicating there are more items than page_size. Use it in the next + * ListServices request to continue. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Run\V2\Service>|\Google\Protobuf\Internal\RepeatedField $services + * The resulting list of Services. + * @type string $next_page_token + * A token indicating there are more items than page_size. Use it in the next + * ListServices request to continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); + parent::__construct($data); + } + + /** + * The resulting list of Services. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Service services = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServices() + { + return $this->services; + } + + /** + * The resulting list of Services. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Service services = 1; + * @param array<\Google\Cloud\Run\V2\Service>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Service::class); + $this->services = $arr; + + return $this; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListServices request to continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListServices request to continue. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksRequest.php new file mode 100644 index 000000000000..421799f38195 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksRequest.php @@ -0,0 +1,202 @@ +google.cloud.run.v2.ListTasksRequest + */ +class ListTasksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Execution from which the Tasks should be listed. + * To list all Tasks across Executions of a Job, use "-" instead of Execution + * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Maximum number of Tasks to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token received from a previous call to ListTasks. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + */ + protected $show_deleted = false; + + /** + * @param string $parent Required. The Execution from which the Tasks should be listed. + * To list all Tasks across Executions of a Job, use "-" instead of Execution + * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * Please see {@see TasksClient::executionName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\ListTasksRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The Execution from which the Tasks should be listed. + * To list all Tasks across Executions of a Job, use "-" instead of Execution + * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * @type int $page_size + * Maximum number of Tasks to return in this call. + * @type string $page_token + * A page token received from a previous call to ListTasks. + * All other parameters must match. + * @type bool $show_deleted + * If true, returns deleted (but unexpired) resources along with active ones. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Task::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Execution from which the Tasks should be listed. + * To list all Tasks across Executions of a Job, use "-" instead of Execution + * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The Execution from which the Tasks should be listed. + * To list all Tasks across Executions of a Job, use "-" instead of Execution + * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Maximum number of Tasks to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Maximum number of Tasks to return in this call. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token received from a previous call to ListTasks. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token received from a previous call to ListTasks. + * All other parameters must match. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @return bool + */ + public function getShowDeleted() + { + return $this->show_deleted; + } + + /** + * If true, returns deleted (but unexpired) resources along with active ones. + * + * Generated from protobuf field bool show_deleted = 4; + * @param bool $var + * @return $this + */ + public function setShowDeleted($var) + { + GPBUtil::checkBool($var); + $this->show_deleted = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksResponse.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksResponse.php new file mode 100644 index 000000000000..17804baa0f8d --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ListTasksResponse.php @@ -0,0 +1,105 @@ +google.cloud.run.v2.ListTasksResponse + */ +class ListTasksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The resulting list of Tasks. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Task tasks = 1; + */ + private $tasks; + /** + * A token indicating there are more items than page_size. Use it in the next + * ListTasks request to continue. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Run\V2\Task>|\Google\Protobuf\Internal\RepeatedField $tasks + * The resulting list of Tasks. + * @type string $next_page_token + * A token indicating there are more items than page_size. Use it in the next + * ListTasks request to continue. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Task::initOnce(); + parent::__construct($data); + } + + /** + * The resulting list of Tasks. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Task tasks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTasks() + { + return $this->tasks; + } + + /** + * The resulting list of Tasks. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Task tasks = 1; + * @param array<\Google\Cloud\Run\V2\Task>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTasks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Task::class); + $this->tasks = $arr; + + return $this; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListTasks request to continue. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token indicating there are more items than page_size. Use it in the next + * ListTasks request to continue. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NFSVolumeSource.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NFSVolumeSource.php new file mode 100644 index 000000000000..d77c34e73b2d --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NFSVolumeSource.php @@ -0,0 +1,135 @@ +google.cloud.run.v2.NFSVolumeSource + */ +class NFSVolumeSource extends \Google\Protobuf\Internal\Message +{ + /** + * Hostname or IP address of the NFS server + * + * Generated from protobuf field string server = 1; + */ + protected $server = ''; + /** + * Path that is exported by the NFS server. + * + * Generated from protobuf field string path = 2; + */ + protected $path = ''; + /** + * If true, the volume will be mounted as read only for all mounts. + * + * Generated from protobuf field bool read_only = 3; + */ + protected $read_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $server + * Hostname or IP address of the NFS server + * @type string $path + * Path that is exported by the NFS server. + * @type bool $read_only + * If true, the volume will be mounted as read only for all mounts. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Hostname or IP address of the NFS server + * + * Generated from protobuf field string server = 1; + * @return string + */ + public function getServer() + { + return $this->server; + } + + /** + * Hostname or IP address of the NFS server + * + * Generated from protobuf field string server = 1; + * @param string $var + * @return $this + */ + public function setServer($var) + { + GPBUtil::checkString($var, True); + $this->server = $var; + + return $this; + } + + /** + * Path that is exported by the NFS server. + * + * Generated from protobuf field string path = 2; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Path that is exported by the NFS server. + * + * Generated from protobuf field string path = 2; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + + /** + * If true, the volume will be mounted as read only for all mounts. + * + * Generated from protobuf field bool read_only = 3; + * @return bool + */ + public function getReadOnly() + { + return $this->read_only; + } + + /** + * If true, the volume will be mounted as read only for all mounts. + * + * Generated from protobuf field bool read_only = 3; + * @param bool $var + * @return $this + */ + public function setReadOnly($var) + { + GPBUtil::checkBool($var); + $this->read_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NodeSelector.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NodeSelector.php new file mode 100644 index 000000000000..54fd94337d57 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/NodeSelector.php @@ -0,0 +1,67 @@ +google.cloud.run.v2.NodeSelector + */ +class NodeSelector extends \Google\Protobuf\Internal\Message +{ + /** + * Required. GPU accelerator type to attach to an instance. + * + * Generated from protobuf field string accelerator = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $accelerator = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $accelerator + * Required. GPU accelerator type to attach to an instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. GPU accelerator type to attach to an instance. + * + * Generated from protobuf field string accelerator = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAccelerator() + { + return $this->accelerator; + } + + /** + * Required. GPU accelerator type to attach to an instance. + * + * Generated from protobuf field string accelerator = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAccelerator($var) + { + GPBUtil::checkString($var, True); + $this->accelerator = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Probe.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Probe.php new file mode 100644 index 000000000000..07da4f964c37 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Probe.php @@ -0,0 +1,319 @@ +google.cloud.run.v2.Probe + */ +class Probe extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Number of seconds after the container has started before the + * probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum + * value for liveness probe is 3600. Maximum value for startup probe is 240. + * + * Generated from protobuf field int32 initial_delay_seconds = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $initial_delay_seconds = 0; + /** + * Optional. Number of seconds after which the probe times out. + * Defaults to 1 second. Minimum value is 1. Maximum value is 3600. + * Must be smaller than period_seconds. + * + * Generated from protobuf field int32 timeout_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $timeout_seconds = 0; + /** + * Optional. How often (in seconds) to perform the probe. + * Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe + * is 3600. Maximum value for startup probe is 240. + * Must be greater or equal than timeout_seconds. + * + * Generated from protobuf field int32 period_seconds = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $period_seconds = 0; + /** + * Optional. Minimum consecutive failures for the probe to be considered + * failed after having succeeded. Defaults to 3. Minimum value is 1. + * + * Generated from protobuf field int32 failure_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $failure_threshold = 0; + protected $probe_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $initial_delay_seconds + * Optional. Number of seconds after the container has started before the + * probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum + * value for liveness probe is 3600. Maximum value for startup probe is 240. + * @type int $timeout_seconds + * Optional. Number of seconds after which the probe times out. + * Defaults to 1 second. Minimum value is 1. Maximum value is 3600. + * Must be smaller than period_seconds. + * @type int $period_seconds + * Optional. How often (in seconds) to perform the probe. + * Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe + * is 3600. Maximum value for startup probe is 240. + * Must be greater or equal than timeout_seconds. + * @type int $failure_threshold + * Optional. Minimum consecutive failures for the probe to be considered + * failed after having succeeded. Defaults to 3. Minimum value is 1. + * @type \Google\Cloud\Run\V2\HTTPGetAction $http_get + * Optional. HTTPGet specifies the http request to perform. + * Exactly one of httpGet, tcpSocket, or grpc must be specified. + * @type \Google\Cloud\Run\V2\TCPSocketAction $tcp_socket + * Optional. TCPSocket specifies an action involving a TCP port. + * Exactly one of httpGet, tcpSocket, or grpc must be specified. + * @type \Google\Cloud\Run\V2\GRPCAction $grpc + * Optional. GRPC specifies an action involving a gRPC port. + * Exactly one of httpGet, tcpSocket, or grpc must be specified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Number of seconds after the container has started before the + * probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum + * value for liveness probe is 3600. Maximum value for startup probe is 240. + * + * Generated from protobuf field int32 initial_delay_seconds = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getInitialDelaySeconds() + { + return $this->initial_delay_seconds; + } + + /** + * Optional. Number of seconds after the container has started before the + * probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum + * value for liveness probe is 3600. Maximum value for startup probe is 240. + * + * Generated from protobuf field int32 initial_delay_seconds = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setInitialDelaySeconds($var) + { + GPBUtil::checkInt32($var); + $this->initial_delay_seconds = $var; + + return $this; + } + + /** + * Optional. Number of seconds after which the probe times out. + * Defaults to 1 second. Minimum value is 1. Maximum value is 3600. + * Must be smaller than period_seconds. + * + * Generated from protobuf field int32 timeout_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTimeoutSeconds() + { + return $this->timeout_seconds; + } + + /** + * Optional. Number of seconds after which the probe times out. + * Defaults to 1 second. Minimum value is 1. Maximum value is 3600. + * Must be smaller than period_seconds. + * + * Generated from protobuf field int32 timeout_seconds = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTimeoutSeconds($var) + { + GPBUtil::checkInt32($var); + $this->timeout_seconds = $var; + + return $this; + } + + /** + * Optional. How often (in seconds) to perform the probe. + * Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe + * is 3600. Maximum value for startup probe is 240. + * Must be greater or equal than timeout_seconds. + * + * Generated from protobuf field int32 period_seconds = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPeriodSeconds() + { + return $this->period_seconds; + } + + /** + * Optional. How often (in seconds) to perform the probe. + * Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe + * is 3600. Maximum value for startup probe is 240. + * Must be greater or equal than timeout_seconds. + * + * Generated from protobuf field int32 period_seconds = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPeriodSeconds($var) + { + GPBUtil::checkInt32($var); + $this->period_seconds = $var; + + return $this; + } + + /** + * Optional. Minimum consecutive failures for the probe to be considered + * failed after having succeeded. Defaults to 3. Minimum value is 1. + * + * Generated from protobuf field int32 failure_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getFailureThreshold() + { + return $this->failure_threshold; + } + + /** + * Optional. Minimum consecutive failures for the probe to be considered + * failed after having succeeded. Defaults to 3. Minimum value is 1. + * + * Generated from protobuf field int32 failure_threshold = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setFailureThreshold($var) + { + GPBUtil::checkInt32($var); + $this->failure_threshold = $var; + + return $this; + } + + /** + * Optional. HTTPGet specifies the http request to perform. + * Exactly one of httpGet, tcpSocket, or grpc must be specified. + * + * Generated from protobuf field .google.cloud.run.v2.HTTPGetAction http_get = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\HTTPGetAction|null + */ + public function getHttpGet() + { + return $this->readOneof(5); + } + + public function hasHttpGet() + { + return $this->hasOneof(5); + } + + /** + * Optional. HTTPGet specifies the http request to perform. + * Exactly one of httpGet, tcpSocket, or grpc must be specified. + * + * Generated from protobuf field .google.cloud.run.v2.HTTPGetAction http_get = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\HTTPGetAction $var + * @return $this + */ + public function setHttpGet($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\HTTPGetAction::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Optional. TCPSocket specifies an action involving a TCP port. + * Exactly one of httpGet, tcpSocket, or grpc must be specified. + * + * Generated from protobuf field .google.cloud.run.v2.TCPSocketAction tcp_socket = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\TCPSocketAction|null + */ + public function getTcpSocket() + { + return $this->readOneof(6); + } + + public function hasTcpSocket() + { + return $this->hasOneof(6); + } + + /** + * Optional. TCPSocket specifies an action involving a TCP port. + * Exactly one of httpGet, tcpSocket, or grpc must be specified. + * + * Generated from protobuf field .google.cloud.run.v2.TCPSocketAction tcp_socket = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\TCPSocketAction $var + * @return $this + */ + public function setTcpSocket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\TCPSocketAction::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Optional. GRPC specifies an action involving a gRPC port. + * Exactly one of httpGet, tcpSocket, or grpc must be specified. + * + * Generated from protobuf field .google.cloud.run.v2.GRPCAction grpc = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\GRPCAction|null + */ + public function getGrpc() + { + return $this->readOneof(7); + } + + public function hasGrpc() + { + return $this->hasOneof(7); + } + + /** + * Optional. GRPC specifies an action involving a gRPC port. + * Exactly one of httpGet, tcpSocket, or grpc must be specified. + * + * Generated from protobuf field .google.cloud.run.v2.GRPCAction grpc = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\GRPCAction $var + * @return $this + */ + public function setGrpc($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\GRPCAction::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * @return string + */ + public function getProbeType() + { + return $this->whichOneof("probe_type"); + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ResourceRequirements.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ResourceRequirements.php new file mode 100644 index 000000000000..9ba7760c5021 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ResourceRequirements.php @@ -0,0 +1,175 @@ +google.cloud.run.v2.ResourceRequirements + */ +class ResourceRequirements extends \Google\Protobuf\Internal\Message +{ + /** + * Only `memory` and `cpu` keys in the map are supported. + *

Notes: + * * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 + * CPU requires at least 2Gi of memory. For more information, go to + * https://cloud.google.com/run/docs/configuring/cpu. + * * For supported 'memory' values and syntax, go to + * https://cloud.google.com/run/docs/configuring/memory-limits + * + * Generated from protobuf field map limits = 1; + */ + private $limits; + /** + * Determines whether CPU is only allocated during requests (true by default). + * However, if ResourceRequirements is set, the caller must explicitly + * set this field to true to preserve the default behavior. + * + * Generated from protobuf field bool cpu_idle = 2; + */ + protected $cpu_idle = false; + /** + * Determines whether CPU should be boosted on startup of a new container + * instance above the requested CPU threshold, this can help reduce cold-start + * latency. + * + * Generated from protobuf field bool startup_cpu_boost = 3; + */ + protected $startup_cpu_boost = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $limits + * Only `memory` and `cpu` keys in the map are supported. + *

Notes: + * * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 + * CPU requires at least 2Gi of memory. For more information, go to + * https://cloud.google.com/run/docs/configuring/cpu. + * * For supported 'memory' values and syntax, go to + * https://cloud.google.com/run/docs/configuring/memory-limits + * @type bool $cpu_idle + * Determines whether CPU is only allocated during requests (true by default). + * However, if ResourceRequirements is set, the caller must explicitly + * set this field to true to preserve the default behavior. + * @type bool $startup_cpu_boost + * Determines whether CPU should be boosted on startup of a new container + * instance above the requested CPU threshold, this can help reduce cold-start + * latency. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Only `memory` and `cpu` keys in the map are supported. + *

Notes: + * * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 + * CPU requires at least 2Gi of memory. For more information, go to + * https://cloud.google.com/run/docs/configuring/cpu. + * * For supported 'memory' values and syntax, go to + * https://cloud.google.com/run/docs/configuring/memory-limits + * + * Generated from protobuf field map limits = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLimits() + { + return $this->limits; + } + + /** + * Only `memory` and `cpu` keys in the map are supported. + *

Notes: + * * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 + * CPU requires at least 2Gi of memory. For more information, go to + * https://cloud.google.com/run/docs/configuring/cpu. + * * For supported 'memory' values and syntax, go to + * https://cloud.google.com/run/docs/configuring/memory-limits + * + * Generated from protobuf field map limits = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLimits($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->limits = $arr; + + return $this; + } + + /** + * Determines whether CPU is only allocated during requests (true by default). + * However, if ResourceRequirements is set, the caller must explicitly + * set this field to true to preserve the default behavior. + * + * Generated from protobuf field bool cpu_idle = 2; + * @return bool + */ + public function getCpuIdle() + { + return $this->cpu_idle; + } + + /** + * Determines whether CPU is only allocated during requests (true by default). + * However, if ResourceRequirements is set, the caller must explicitly + * set this field to true to preserve the default behavior. + * + * Generated from protobuf field bool cpu_idle = 2; + * @param bool $var + * @return $this + */ + public function setCpuIdle($var) + { + GPBUtil::checkBool($var); + $this->cpu_idle = $var; + + return $this; + } + + /** + * Determines whether CPU should be boosted on startup of a new container + * instance above the requested CPU threshold, this can help reduce cold-start + * latency. + * + * Generated from protobuf field bool startup_cpu_boost = 3; + * @return bool + */ + public function getStartupCpuBoost() + { + return $this->startup_cpu_boost; + } + + /** + * Determines whether CPU should be boosted on startup of a new container + * instance above the requested CPU threshold, this can help reduce cold-start + * latency. + * + * Generated from protobuf field bool startup_cpu_boost = 3; + * @param bool $var + * @return $this + */ + public function setStartupCpuBoost($var) + { + GPBUtil::checkBool($var); + $this->startup_cpu_boost = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Revision.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Revision.php new file mode 100644 index 000000000000..f3bdf65355ab --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Revision.php @@ -0,0 +1,1373 @@ +google.cloud.run.v2.Revision + */ +class Revision extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique name of this Revision. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. Server assigned unique identifier for the Revision. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generation = 0; + /** + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $labels; + /** + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $annotations; + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_time = null; + /** + * The least stable launch stage needed to create this resource, as defined by + * [Google Cloud Platform Launch + * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports + * `ALPHA`, `BETA`, and `GA`. + *

Note that this value might not be what was used + * as input. For example, if ALPHA was provided as input in the parent + * resource, but only BETA and GA-level features are were, this field will be + * BETA. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 10; + */ + protected $launch_stage = 0; + /** + * Output only. The name of the parent service. + * + * Generated from protobuf field string service = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $service = ''; + /** + * Scaling settings for this revision. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionScaling scaling = 12; + */ + protected $scaling = null; + /** + * VPC Access configuration for this Revision. For more information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 13; + */ + protected $vpc_access = null; + /** + * Sets the maximum number of requests that each serving instance can receive. + * + * Generated from protobuf field int32 max_instance_request_concurrency = 34; + */ + protected $max_instance_request_concurrency = 0; + /** + * Max allowed time for an instance to respond to a request. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 15; + */ + protected $timeout = null; + /** + * Email address of the IAM service account associated with the revision of + * the service. The service account represents the identity of the running + * revision, and determines what permissions the revision has. + * + * Generated from protobuf field string service_account = 16; + */ + protected $service_account = ''; + /** + * Holds the single container that defines the unit of execution for this + * Revision. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 17; + */ + private $containers; + /** + * A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 18; + */ + private $volumes; + /** + * The execution environment being used to host this Revision. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 20; + */ + protected $execution_environment = 0; + /** + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 21 [(.google.api.resource_reference) = { + */ + protected $encryption_key = ''; + /** + * Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 22; + */ + protected $service_mesh = null; + /** + * The action to take if the encryption key is revoked. + * + * Generated from protobuf field .google.cloud.run.v2.EncryptionKeyRevocationAction encryption_key_revocation_action = 23; + */ + protected $encryption_key_revocation_action = 0; + /** + * If encryption_key_revocation_action is SHUTDOWN, the duration before + * shutting down all instances. The minimum increment is 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration encryption_key_shutdown_duration = 24; + */ + protected $encryption_key_shutdown_duration = null; + /** + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Service.reconciling` for additional information + * on reconciliation process in Cloud Run. + * + * Generated from protobuf field bool reconciling = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Output only. The Condition of this Revision, containing its readiness + * status, and detailed error information in case it did not reach a serving + * state. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $conditions; + /** + * Output only. The generation of this Revision currently serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * + * Generated from protobuf field int64 observed_generation = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $observed_generation = 0; + /** + * Output only. The Google Console URI to obtain logs for the Revision. + * + * Generated from protobuf field string log_uri = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $log_uri = ''; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 37 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = false; + /** + * Enable session affinity. + * + * Generated from protobuf field bool session_affinity = 38; + */ + protected $session_affinity = false; + /** + * Output only. The current effective scaling settings for the revision. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionScalingStatus scaling_status = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $scaling_status = null; + /** + * The node selector for the revision. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 40; + */ + protected $node_selector = null; + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The unique name of this Revision. + * @type string $uid + * Output only. Server assigned unique identifier for the Revision. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * @type int|string $generation + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The creation time. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last-modified time. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * @type int $launch_stage + * The least stable launch stage needed to create this resource, as defined by + * [Google Cloud Platform Launch + * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports + * `ALPHA`, `BETA`, and `GA`. + *

Note that this value might not be what was used + * as input. For example, if ALPHA was provided as input in the parent + * resource, but only BETA and GA-level features are were, this field will be + * BETA. + * @type string $service + * Output only. The name of the parent service. + * @type \Google\Cloud\Run\V2\RevisionScaling $scaling + * Scaling settings for this revision. + * @type \Google\Cloud\Run\V2\VpcAccess $vpc_access + * VPC Access configuration for this Revision. For more information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * @type int $max_instance_request_concurrency + * Sets the maximum number of requests that each serving instance can receive. + * @type \Google\Protobuf\Duration $timeout + * Max allowed time for an instance to respond to a request. + * @type string $service_account + * Email address of the IAM service account associated with the revision of + * the service. The service account represents the identity of the running + * revision, and determines what permissions the revision has. + * @type array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $containers + * Holds the single container that defines the unit of execution for this + * Revision. + * @type array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes + * A list of Volumes to make available to containers. + * @type int $execution_environment + * The execution environment being used to host this Revision. + * @type string $encryption_key + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * @type \Google\Cloud\Run\V2\ServiceMesh $service_mesh + * Enables service mesh connectivity. + * @type int $encryption_key_revocation_action + * The action to take if the encryption key is revoked. + * @type \Google\Protobuf\Duration $encryption_key_shutdown_duration + * If encryption_key_revocation_action is SHUTDOWN, the duration before + * shutting down all instances. The minimum increment is 1 hour. + * @type bool $reconciling + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Service.reconciling` for additional information + * on reconciliation process in Cloud Run. + * @type array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $conditions + * Output only. The Condition of this Revision, containing its readiness + * status, and detailed error information in case it did not reach a serving + * state. + * @type int|string $observed_generation + * Output only. The generation of this Revision currently serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * @type string $log_uri + * Output only. The Google Console URI to obtain logs for the Revision. + * @type bool $satisfies_pzs + * Output only. Reserved for future use. + * @type bool $session_affinity + * Enable session affinity. + * @type \Google\Cloud\Run\V2\RevisionScalingStatus $scaling_status + * Output only. The current effective scaling settings for the revision. + * @type \Google\Cloud\Run\V2\NodeSelector $node_selector + * The node selector for the revision. + * @type string $etag + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Revision::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique name of this Revision. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The unique name of this Revision. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Server assigned unique identifier for the Revision. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Server assigned unique identifier for the Revision. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getGeneration() + { + return $this->generation; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setGeneration($var) + { + GPBUtil::checkInt64($var); + $this->generation = $var; + + return $this; + } + + /** + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * The least stable launch stage needed to create this resource, as defined by + * [Google Cloud Platform Launch + * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports + * `ALPHA`, `BETA`, and `GA`. + *

Note that this value might not be what was used + * as input. For example, if ALPHA was provided as input in the parent + * resource, but only BETA and GA-level features are were, this field will be + * BETA. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 10; + * @return int + */ + public function getLaunchStage() + { + return $this->launch_stage; + } + + /** + * The least stable launch stage needed to create this resource, as defined by + * [Google Cloud Platform Launch + * Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports + * `ALPHA`, `BETA`, and `GA`. + *

Note that this value might not be what was used + * as input. For example, if ALPHA was provided as input in the parent + * resource, but only BETA and GA-level features are were, this field will be + * BETA. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 10; + * @param int $var + * @return $this + */ + public function setLaunchStage($var) + { + GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); + $this->launch_stage = $var; + + return $this; + } + + /** + * Output only. The name of the parent service. + * + * Generated from protobuf field string service = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * Output only. The name of the parent service. + * + * Generated from protobuf field string service = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * Scaling settings for this revision. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionScaling scaling = 12; + * @return \Google\Cloud\Run\V2\RevisionScaling|null + */ + public function getScaling() + { + return $this->scaling; + } + + public function hasScaling() + { + return isset($this->scaling); + } + + public function clearScaling() + { + unset($this->scaling); + } + + /** + * Scaling settings for this revision. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionScaling scaling = 12; + * @param \Google\Cloud\Run\V2\RevisionScaling $var + * @return $this + */ + public function setScaling($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\RevisionScaling::class); + $this->scaling = $var; + + return $this; + } + + /** + * VPC Access configuration for this Revision. For more information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 13; + * @return \Google\Cloud\Run\V2\VpcAccess|null + */ + public function getVpcAccess() + { + return $this->vpc_access; + } + + public function hasVpcAccess() + { + return isset($this->vpc_access); + } + + public function clearVpcAccess() + { + unset($this->vpc_access); + } + + /** + * VPC Access configuration for this Revision. For more information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 13; + * @param \Google\Cloud\Run\V2\VpcAccess $var + * @return $this + */ + public function setVpcAccess($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\VpcAccess::class); + $this->vpc_access = $var; + + return $this; + } + + /** + * Sets the maximum number of requests that each serving instance can receive. + * + * Generated from protobuf field int32 max_instance_request_concurrency = 34; + * @return int + */ + public function getMaxInstanceRequestConcurrency() + { + return $this->max_instance_request_concurrency; + } + + /** + * Sets the maximum number of requests that each serving instance can receive. + * + * Generated from protobuf field int32 max_instance_request_concurrency = 34; + * @param int $var + * @return $this + */ + public function setMaxInstanceRequestConcurrency($var) + { + GPBUtil::checkInt32($var); + $this->max_instance_request_concurrency = $var; + + return $this; + } + + /** + * Max allowed time for an instance to respond to a request. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 15; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * Max allowed time for an instance to respond to a request. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 15; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + + /** + * Email address of the IAM service account associated with the revision of + * the service. The service account represents the identity of the running + * revision, and determines what permissions the revision has. + * + * Generated from protobuf field string service_account = 16; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Email address of the IAM service account associated with the revision of + * the service. The service account represents the identity of the running + * revision, and determines what permissions the revision has. + * + * Generated from protobuf field string service_account = 16; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Holds the single container that defines the unit of execution for this + * Revision. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 17; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContainers() + { + return $this->containers; + } + + /** + * Holds the single container that defines the unit of execution for this + * Revision. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 17; + * @param array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContainers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Container::class); + $this->containers = $arr; + + return $this; + } + + /** + * A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 18; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumes() + { + return $this->volumes; + } + + /** + * A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 18; + * @param array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Volume::class); + $this->volumes = $arr; + + return $this; + } + + /** + * The execution environment being used to host this Revision. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 20; + * @return int + */ + public function getExecutionEnvironment() + { + return $this->execution_environment; + } + + /** + * The execution environment being used to host this Revision. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 20; + * @param int $var + * @return $this + */ + public function setExecutionEnvironment($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ExecutionEnvironment::class); + $this->execution_environment = $var; + + return $this; + } + + /** + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 21 [(.google.api.resource_reference) = { + * @return string + */ + public function getEncryptionKey() + { + return $this->encryption_key; + } + + /** + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 21 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setEncryptionKey($var) + { + GPBUtil::checkString($var, True); + $this->encryption_key = $var; + + return $this; + } + + /** + * Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 22; + * @return \Google\Cloud\Run\V2\ServiceMesh|null + */ + public function getServiceMesh() + { + return $this->service_mesh; + } + + public function hasServiceMesh() + { + return isset($this->service_mesh); + } + + public function clearServiceMesh() + { + unset($this->service_mesh); + } + + /** + * Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 22; + * @param \Google\Cloud\Run\V2\ServiceMesh $var + * @return $this + */ + public function setServiceMesh($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ServiceMesh::class); + $this->service_mesh = $var; + + return $this; + } + + /** + * The action to take if the encryption key is revoked. + * + * Generated from protobuf field .google.cloud.run.v2.EncryptionKeyRevocationAction encryption_key_revocation_action = 23; + * @return int + */ + public function getEncryptionKeyRevocationAction() + { + return $this->encryption_key_revocation_action; + } + + /** + * The action to take if the encryption key is revoked. + * + * Generated from protobuf field .google.cloud.run.v2.EncryptionKeyRevocationAction encryption_key_revocation_action = 23; + * @param int $var + * @return $this + */ + public function setEncryptionKeyRevocationAction($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\EncryptionKeyRevocationAction::class); + $this->encryption_key_revocation_action = $var; + + return $this; + } + + /** + * If encryption_key_revocation_action is SHUTDOWN, the duration before + * shutting down all instances. The minimum increment is 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration encryption_key_shutdown_duration = 24; + * @return \Google\Protobuf\Duration|null + */ + public function getEncryptionKeyShutdownDuration() + { + return $this->encryption_key_shutdown_duration; + } + + public function hasEncryptionKeyShutdownDuration() + { + return isset($this->encryption_key_shutdown_duration); + } + + public function clearEncryptionKeyShutdownDuration() + { + unset($this->encryption_key_shutdown_duration); + } + + /** + * If encryption_key_revocation_action is SHUTDOWN, the duration before + * shutting down all instances. The minimum increment is 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration encryption_key_shutdown_duration = 24; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setEncryptionKeyShutdownDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->encryption_key_shutdown_duration = $var; + + return $this; + } + + /** + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Service.reconciling` for additional information + * on reconciliation process in Cloud Run. + * + * Generated from protobuf field bool reconciling = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Service.reconciling` for additional information + * on reconciliation process in Cloud Run. + * + * Generated from protobuf field bool reconciling = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Output only. The Condition of this Revision, containing its readiness + * status, and detailed error information in case it did not reach a serving + * state. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConditions() + { + return $this->conditions; + } + + /** + * Output only. The Condition of this Revision, containing its readiness + * status, and detailed error information in case it did not reach a serving + * state. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConditions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Condition::class); + $this->conditions = $arr; + + return $this; + } + + /** + * Output only. The generation of this Revision currently serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * + * Generated from protobuf field int64 observed_generation = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getObservedGeneration() + { + return $this->observed_generation; + } + + /** + * Output only. The generation of this Revision currently serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * + * Generated from protobuf field int64 observed_generation = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setObservedGeneration($var) + { + GPBUtil::checkInt64($var); + $this->observed_generation = $var; + + return $this; + } + + /** + * Output only. The Google Console URI to obtain logs for the Revision. + * + * Generated from protobuf field string log_uri = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLogUri() + { + return $this->log_uri; + } + + /** + * Output only. The Google Console URI to obtain logs for the Revision. + * + * Generated from protobuf field string log_uri = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLogUri($var) + { + GPBUtil::checkString($var, True); + $this->log_uri = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 37 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 37 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Enable session affinity. + * + * Generated from protobuf field bool session_affinity = 38; + * @return bool + */ + public function getSessionAffinity() + { + return $this->session_affinity; + } + + /** + * Enable session affinity. + * + * Generated from protobuf field bool session_affinity = 38; + * @param bool $var + * @return $this + */ + public function setSessionAffinity($var) + { + GPBUtil::checkBool($var); + $this->session_affinity = $var; + + return $this; + } + + /** + * Output only. The current effective scaling settings for the revision. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionScalingStatus scaling_status = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Run\V2\RevisionScalingStatus|null + */ + public function getScalingStatus() + { + return $this->scaling_status; + } + + public function hasScalingStatus() + { + return isset($this->scaling_status); + } + + public function clearScalingStatus() + { + unset($this->scaling_status); + } + + /** + * Output only. The current effective scaling settings for the revision. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionScalingStatus scaling_status = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Run\V2\RevisionScalingStatus $var + * @return $this + */ + public function setScalingStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\RevisionScalingStatus::class); + $this->scaling_status = $var; + + return $this; + } + + /** + * The node selector for the revision. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 40; + * @return \Google\Cloud\Run\V2\NodeSelector|null + */ + public function getNodeSelector() + { + return $this->node_selector; + } + + public function hasNodeSelector() + { + return isset($this->node_selector); + } + + public function clearNodeSelector() + { + unset($this->node_selector); + } + + /** + * The node selector for the revision. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 40; + * @param \Google\Cloud\Run\V2\NodeSelector $var + * @return $this + */ + public function setNodeSelector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\NodeSelector::class); + $this->node_selector = $var; + + return $this; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScaling.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScaling.php new file mode 100644 index 000000000000..5536c70fe0a4 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScaling.php @@ -0,0 +1,117 @@ +google.cloud.run.v2.RevisionScaling + */ +class RevisionScaling extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Minimum number of serving instances that this resource should + * have. + * + * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $min_instance_count = 0; + /** + * Optional. Maximum number of serving instances that this resource should + * have. When unspecified, the field is set to the server default value of + * 100. For more information see + * https://cloud.google.com/run/docs/configuring/max-instances + * + * Generated from protobuf field int32 max_instance_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_instance_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $min_instance_count + * Optional. Minimum number of serving instances that this resource should + * have. + * @type int $max_instance_count + * Optional. Maximum number of serving instances that this resource should + * have. When unspecified, the field is set to the server default value of + * 100. For more information see + * https://cloud.google.com/run/docs/configuring/max-instances + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Minimum number of serving instances that this resource should + * have. + * + * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMinInstanceCount() + { + return $this->min_instance_count; + } + + /** + * Optional. Minimum number of serving instances that this resource should + * have. + * + * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMinInstanceCount($var) + { + GPBUtil::checkInt32($var); + $this->min_instance_count = $var; + + return $this; + } + + /** + * Optional. Maximum number of serving instances that this resource should + * have. When unspecified, the field is set to the server default value of + * 100. For more information see + * https://cloud.google.com/run/docs/configuring/max-instances + * + * Generated from protobuf field int32 max_instance_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMaxInstanceCount() + { + return $this->max_instance_count; + } + + /** + * Optional. Maximum number of serving instances that this resource should + * have. When unspecified, the field is set to the server default value of + * 100. For more information see + * https://cloud.google.com/run/docs/configuring/max-instances + * + * Generated from protobuf field int32 max_instance_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMaxInstanceCount($var) + { + GPBUtil::checkInt32($var); + $this->max_instance_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScalingStatus.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScalingStatus.php new file mode 100644 index 000000000000..fff365b91e71 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionScalingStatus.php @@ -0,0 +1,67 @@ +google.cloud.run.v2.RevisionScalingStatus + */ +class RevisionScalingStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The current number of min instances provisioned for this revision. + * + * Generated from protobuf field int32 desired_min_instance_count = 1; + */ + protected $desired_min_instance_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $desired_min_instance_count + * The current number of min instances provisioned for this revision. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Status::initOnce(); + parent::__construct($data); + } + + /** + * The current number of min instances provisioned for this revision. + * + * Generated from protobuf field int32 desired_min_instance_count = 1; + * @return int + */ + public function getDesiredMinInstanceCount() + { + return $this->desired_min_instance_count; + } + + /** + * The current number of min instances provisioned for this revision. + * + * Generated from protobuf field int32 desired_min_instance_count = 1; + * @param int $var + * @return $this + */ + public function setDesiredMinInstanceCount($var) + { + GPBUtil::checkInt32($var); + $this->desired_min_instance_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionTemplate.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionTemplate.php new file mode 100644 index 000000000000..36d1686c1e8b --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RevisionTemplate.php @@ -0,0 +1,822 @@ +google.cloud.run.v2.RevisionTemplate + */ +class RevisionTemplate extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The unique name for the revision. If this field is omitted, it + * will be automatically generated based on the Service name. + * + * Generated from protobuf field string revision = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $revision = ''; + /** + * Optional. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 RevisionTemplate. + * + * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. Unstructured key value map that may be set by external tools to + * store and arbitrary metadata. They are not queryable and should be + * preserved when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system annotations in v1 now + * have a corresponding field in v2 RevisionTemplate. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * + * Generated from protobuf field map annotations = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; + /** + * Optional. Scaling settings for this Revision. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionScaling scaling = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $scaling = null; + /** + * Optional. VPC Access configuration to use for this Revision. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $vpc_access = null; + /** + * Optional. Max allowed time for an instance to respond to a request. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $timeout = null; + /** + * Optional. Email address of the IAM service account associated with the + * revision of the service. The service account represents the identity of the + * running revision, and determines what permissions the revision has. If not + * provided, the revision will use the project's default service account. + * + * Generated from protobuf field string service_account = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_account = ''; + /** + * Holds the single container that defines the unit of execution for this + * Revision. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 10; + */ + private $containers; + /** + * Optional. A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $volumes; + /** + * Optional. The sandbox environment to host this Revision. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $execution_environment = 0; + /** + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 14 [(.google.api.resource_reference) = { + */ + protected $encryption_key = ''; + /** + * Optional. Sets the maximum number of requests that each serving instance + * can receive. If not specified or 0, concurrency defaults to 80 when + * requested `CPU >= 1` and defaults to 1 when requested `CPU < 1`. + * + * Generated from protobuf field int32 max_instance_request_concurrency = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_instance_request_concurrency = 0; + /** + * Optional. Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_mesh = null; + /** + * Optional. The action to take if the encryption key is revoked. + * + * Generated from protobuf field .google.cloud.run.v2.EncryptionKeyRevocationAction encryption_key_revocation_action = 17 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption_key_revocation_action = 0; + /** + * Optional. If encryption_key_revocation_action is SHUTDOWN, the duration + * before shutting down all instances. The minimum increment is 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration encryption_key_shutdown_duration = 18 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption_key_shutdown_duration = null; + /** + * Optional. Enable session affinity. + * + * Generated from protobuf field bool session_affinity = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $session_affinity = false; + /** + * Optional. Disables health checking containers during deployment. + * + * Generated from protobuf field bool health_check_disabled = 20 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $health_check_disabled = false; + /** + * Optional. The node selector for the revision template. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $node_selector = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $revision + * Optional. The unique name for the revision. If this field is omitted, it + * will be automatically generated based on the Service name. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 RevisionTemplate. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. Unstructured key value map that may be set by external tools to + * store and arbitrary metadata. They are not queryable and should be + * preserved when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system annotations in v1 now + * have a corresponding field in v2 RevisionTemplate. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * @type \Google\Cloud\Run\V2\RevisionScaling $scaling + * Optional. Scaling settings for this Revision. + * @type \Google\Cloud\Run\V2\VpcAccess $vpc_access + * Optional. VPC Access configuration to use for this Revision. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * @type \Google\Protobuf\Duration $timeout + * Optional. Max allowed time for an instance to respond to a request. + * @type string $service_account + * Optional. Email address of the IAM service account associated with the + * revision of the service. The service account represents the identity of the + * running revision, and determines what permissions the revision has. If not + * provided, the revision will use the project's default service account. + * @type array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $containers + * Holds the single container that defines the unit of execution for this + * Revision. + * @type array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes + * Optional. A list of Volumes to make available to containers. + * @type int $execution_environment + * Optional. The sandbox environment to host this Revision. + * @type string $encryption_key + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * @type int $max_instance_request_concurrency + * Optional. Sets the maximum number of requests that each serving instance + * can receive. If not specified or 0, concurrency defaults to 80 when + * requested `CPU >= 1` and defaults to 1 when requested `CPU < 1`. + * @type \Google\Cloud\Run\V2\ServiceMesh $service_mesh + * Optional. Enables service mesh connectivity. + * @type int $encryption_key_revocation_action + * Optional. The action to take if the encryption key is revoked. + * @type \Google\Protobuf\Duration $encryption_key_shutdown_duration + * Optional. If encryption_key_revocation_action is SHUTDOWN, the duration + * before shutting down all instances. The minimum increment is 1 hour. + * @type bool $session_affinity + * Optional. Enable session affinity. + * @type bool $health_check_disabled + * Optional. Disables health checking containers during deployment. + * @type \Google\Cloud\Run\V2\NodeSelector $node_selector + * Optional. The node selector for the revision template. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\RevisionTemplate::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The unique name for the revision. If this field is omitted, it + * will be automatically generated based on the Service name. + * + * Generated from protobuf field string revision = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getRevision() + { + return $this->revision; + } + + /** + * Optional. The unique name for the revision. If this field is omitted, it + * will be automatically generated based on the Service name. + * + * Generated from protobuf field string revision = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setRevision($var) + { + GPBUtil::checkString($var, True); + $this->revision = $var; + + return $this; + } + + /** + * Optional. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 RevisionTemplate. + * + * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 RevisionTemplate. + * + * Generated from protobuf field map labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. Unstructured key value map that may be set by external tools to + * store and arbitrary metadata. They are not queryable and should be + * preserved when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system annotations in v1 now + * have a corresponding field in v2 RevisionTemplate. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * + * Generated from protobuf field map annotations = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. Unstructured key value map that may be set by external tools to + * store and arbitrary metadata. They are not queryable and should be + * preserved when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system annotations in v1 now + * have a corresponding field in v2 RevisionTemplate. + *

This field follows Kubernetes annotations' namespacing, limits, and + * rules. + * + * Generated from protobuf field map annotations = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Optional. Scaling settings for this Revision. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionScaling scaling = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\RevisionScaling|null + */ + public function getScaling() + { + return $this->scaling; + } + + public function hasScaling() + { + return isset($this->scaling); + } + + public function clearScaling() + { + unset($this->scaling); + } + + /** + * Optional. Scaling settings for this Revision. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionScaling scaling = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\RevisionScaling $var + * @return $this + */ + public function setScaling($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\RevisionScaling::class); + $this->scaling = $var; + + return $this; + } + + /** + * Optional. VPC Access configuration to use for this Revision. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\VpcAccess|null + */ + public function getVpcAccess() + { + return $this->vpc_access; + } + + public function hasVpcAccess() + { + return isset($this->vpc_access); + } + + public function clearVpcAccess() + { + unset($this->vpc_access); + } + + /** + * Optional. VPC Access configuration to use for this Revision. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\VpcAccess $var + * @return $this + */ + public function setVpcAccess($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\VpcAccess::class); + $this->vpc_access = $var; + + return $this; + } + + /** + * Optional. Max allowed time for an instance to respond to a request. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * Optional. Max allowed time for an instance to respond to a request. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + + /** + * Optional. Email address of the IAM service account associated with the + * revision of the service. The service account represents the identity of the + * running revision, and determines what permissions the revision has. If not + * provided, the revision will use the project's default service account. + * + * Generated from protobuf field string service_account = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Optional. Email address of the IAM service account associated with the + * revision of the service. The service account represents the identity of the + * running revision, and determines what permissions the revision has. If not + * provided, the revision will use the project's default service account. + * + * Generated from protobuf field string service_account = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Holds the single container that defines the unit of execution for this + * Revision. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContainers() + { + return $this->containers; + } + + /** + * Holds the single container that defines the unit of execution for this + * Revision. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 10; + * @param array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContainers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Container::class); + $this->containers = $arr; + + return $this; + } + + /** + * Optional. A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumes() + { + return $this->volumes; + } + + /** + * Optional. A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Volume::class); + $this->volumes = $arr; + + return $this; + } + + /** + * Optional. The sandbox environment to host this Revision. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getExecutionEnvironment() + { + return $this->execution_environment; + } + + /** + * Optional. The sandbox environment to host this Revision. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setExecutionEnvironment($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ExecutionEnvironment::class); + $this->execution_environment = $var; + + return $this; + } + + /** + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 14 [(.google.api.resource_reference) = { + * @return string + */ + public function getEncryptionKey() + { + return $this->encryption_key; + } + + /** + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 14 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setEncryptionKey($var) + { + GPBUtil::checkString($var, True); + $this->encryption_key = $var; + + return $this; + } + + /** + * Optional. Sets the maximum number of requests that each serving instance + * can receive. If not specified or 0, concurrency defaults to 80 when + * requested `CPU >= 1` and defaults to 1 when requested `CPU < 1`. + * + * Generated from protobuf field int32 max_instance_request_concurrency = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMaxInstanceRequestConcurrency() + { + return $this->max_instance_request_concurrency; + } + + /** + * Optional. Sets the maximum number of requests that each serving instance + * can receive. If not specified or 0, concurrency defaults to 80 when + * requested `CPU >= 1` and defaults to 1 when requested `CPU < 1`. + * + * Generated from protobuf field int32 max_instance_request_concurrency = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMaxInstanceRequestConcurrency($var) + { + GPBUtil::checkInt32($var); + $this->max_instance_request_concurrency = $var; + + return $this; + } + + /** + * Optional. Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\ServiceMesh|null + */ + public function getServiceMesh() + { + return $this->service_mesh; + } + + public function hasServiceMesh() + { + return isset($this->service_mesh); + } + + public function clearServiceMesh() + { + unset($this->service_mesh); + } + + /** + * Optional. Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\ServiceMesh $var + * @return $this + */ + public function setServiceMesh($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ServiceMesh::class); + $this->service_mesh = $var; + + return $this; + } + + /** + * Optional. The action to take if the encryption key is revoked. + * + * Generated from protobuf field .google.cloud.run.v2.EncryptionKeyRevocationAction encryption_key_revocation_action = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getEncryptionKeyRevocationAction() + { + return $this->encryption_key_revocation_action; + } + + /** + * Optional. The action to take if the encryption key is revoked. + * + * Generated from protobuf field .google.cloud.run.v2.EncryptionKeyRevocationAction encryption_key_revocation_action = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setEncryptionKeyRevocationAction($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\EncryptionKeyRevocationAction::class); + $this->encryption_key_revocation_action = $var; + + return $this; + } + + /** + * Optional. If encryption_key_revocation_action is SHUTDOWN, the duration + * before shutting down all instances. The minimum increment is 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration encryption_key_shutdown_duration = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getEncryptionKeyShutdownDuration() + { + return $this->encryption_key_shutdown_duration; + } + + public function hasEncryptionKeyShutdownDuration() + { + return isset($this->encryption_key_shutdown_duration); + } + + public function clearEncryptionKeyShutdownDuration() + { + unset($this->encryption_key_shutdown_duration); + } + + /** + * Optional. If encryption_key_revocation_action is SHUTDOWN, the duration + * before shutting down all instances. The minimum increment is 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration encryption_key_shutdown_duration = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setEncryptionKeyShutdownDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->encryption_key_shutdown_duration = $var; + + return $this; + } + + /** + * Optional. Enable session affinity. + * + * Generated from protobuf field bool session_affinity = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getSessionAffinity() + { + return $this->session_affinity; + } + + /** + * Optional. Enable session affinity. + * + * Generated from protobuf field bool session_affinity = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setSessionAffinity($var) + { + GPBUtil::checkBool($var); + $this->session_affinity = $var; + + return $this; + } + + /** + * Optional. Disables health checking containers during deployment. + * + * Generated from protobuf field bool health_check_disabled = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getHealthCheckDisabled() + { + return $this->health_check_disabled; + } + + /** + * Optional. Disables health checking containers during deployment. + * + * Generated from protobuf field bool health_check_disabled = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setHealthCheckDisabled($var) + { + GPBUtil::checkBool($var); + $this->health_check_disabled = $var; + + return $this; + } + + /** + * Optional. The node selector for the revision template. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\NodeSelector|null + */ + public function getNodeSelector() + { + return $this->node_selector; + } + + public function hasNodeSelector() + { + return isset($this->node_selector); + } + + public function clearNodeSelector() + { + unset($this->node_selector); + } + + /** + * Optional. The node selector for the revision template. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\NodeSelector $var + * @return $this + */ + public function setNodeSelector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\NodeSelector::class); + $this->node_selector = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest.php new file mode 100644 index 000000000000..bf51806e3bcb --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest.php @@ -0,0 +1,215 @@ +google.cloud.run.v2.RunJobRequest + */ +class RunJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + */ + protected $validate_only = false; + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + */ + protected $etag = ''; + /** + * Overrides specification for a given execution of a job. If provided, + * overrides will be applied to update the execution or task spec. + * + * Generated from protobuf field .google.cloud.run.v2.RunJobRequest.Overrides overrides = 4; + */ + protected $overrides = null; + + /** + * @param string $name Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. Please see + * {@see JobsClient::jobName()} for help formatting this field. + * + * @return \Google\Cloud\Run\V2\RunJobRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * @type bool $validate_only + * Indicates that the request should be validated without actually + * deleting any resources. + * @type string $etag + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * @type \Google\Cloud\Run\V2\RunJobRequest\Overrides $overrides + * Overrides specification for a given execution of a job. If provided, + * overrides will be applied to update the execution or task spec. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated without actually + * deleting any resources. + * + * Generated from protobuf field bool validate_only = 2; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 3; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Overrides specification for a given execution of a job. If provided, + * overrides will be applied to update the execution or task spec. + * + * Generated from protobuf field .google.cloud.run.v2.RunJobRequest.Overrides overrides = 4; + * @return \Google\Cloud\Run\V2\RunJobRequest\Overrides|null + */ + public function getOverrides() + { + return $this->overrides; + } + + public function hasOverrides() + { + return isset($this->overrides); + } + + public function clearOverrides() + { + unset($this->overrides); + } + + /** + * Overrides specification for a given execution of a job. If provided, + * overrides will be applied to update the execution or task spec. + * + * Generated from protobuf field .google.cloud.run.v2.RunJobRequest.Overrides overrides = 4; + * @param \Google\Cloud\Run\V2\RunJobRequest\Overrides $var + * @return $this + */ + public function setOverrides($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\RunJobRequest\Overrides::class); + $this->overrides = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides.php new file mode 100644 index 000000000000..60098e2ce07b --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides.php @@ -0,0 +1,160 @@ +google.cloud.run.v2.RunJobRequest.Overrides + */ +class Overrides extends \Google\Protobuf\Internal\Message +{ + /** + * Per container override specification. + * + * Generated from protobuf field repeated .google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride container_overrides = 1; + */ + private $container_overrides; + /** + * Optional. The desired number of tasks the execution should run. Will + * replace existing task_count value. + * + * Generated from protobuf field int32 task_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $task_count = 0; + /** + * Duration in seconds the task may be active before the system will + * actively try to mark it failed and kill associated containers. Will + * replace existing timeout_seconds value. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 4; + */ + protected $timeout = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Run\V2\RunJobRequest\Overrides\ContainerOverride>|\Google\Protobuf\Internal\RepeatedField $container_overrides + * Per container override specification. + * @type int $task_count + * Optional. The desired number of tasks the execution should run. Will + * replace existing task_count value. + * @type \Google\Protobuf\Duration $timeout + * Duration in seconds the task may be active before the system will + * actively try to mark it failed and kill associated containers. Will + * replace existing timeout_seconds value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * Per container override specification. + * + * Generated from protobuf field repeated .google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride container_overrides = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContainerOverrides() + { + return $this->container_overrides; + } + + /** + * Per container override specification. + * + * Generated from protobuf field repeated .google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride container_overrides = 1; + * @param array<\Google\Cloud\Run\V2\RunJobRequest\Overrides\ContainerOverride>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContainerOverrides($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\RunJobRequest\Overrides\ContainerOverride::class); + $this->container_overrides = $arr; + + return $this; + } + + /** + * Optional. The desired number of tasks the execution should run. Will + * replace existing task_count value. + * + * Generated from protobuf field int32 task_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTaskCount() + { + return $this->task_count; + } + + /** + * Optional. The desired number of tasks the execution should run. Will + * replace existing task_count value. + * + * Generated from protobuf field int32 task_count = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTaskCount($var) + { + GPBUtil::checkInt32($var); + $this->task_count = $var; + + return $this; + } + + /** + * Duration in seconds the task may be active before the system will + * actively try to mark it failed and kill associated containers. Will + * replace existing timeout_seconds value. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * Duration in seconds the task may be active before the system will + * actively try to mark it failed and kill associated containers. Will + * replace existing timeout_seconds value. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Overrides::class, \Google\Cloud\Run\V2\RunJobRequest_Overrides::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides/ContainerOverride.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides/ContainerOverride.php new file mode 100644 index 000000000000..9d002dff8c09 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/RunJobRequest/Overrides/ContainerOverride.php @@ -0,0 +1,180 @@ +google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + */ +class ContainerOverride extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the container specified as a DNS_LABEL. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Optional. Arguments to the entrypoint. Will replace existing args for + * override. + * + * Generated from protobuf field repeated string args = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $args; + /** + * List of environment variables to set in the container. Will be merged + * with existing env for override. + * + * Generated from protobuf field repeated .google.cloud.run.v2.EnvVar env = 3; + */ + private $env; + /** + * Optional. True if the intention is to clear out existing args list. + * + * Generated from protobuf field bool clear_args = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $clear_args = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the container specified as a DNS_LABEL. + * @type array|\Google\Protobuf\Internal\RepeatedField $args + * Optional. Arguments to the entrypoint. Will replace existing args for + * override. + * @type array<\Google\Cloud\Run\V2\EnvVar>|\Google\Protobuf\Internal\RepeatedField $env + * List of environment variables to set in the container. Will be merged + * with existing env for override. + * @type bool $clear_args + * Optional. True if the intention is to clear out existing args list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * The name of the container specified as a DNS_LABEL. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the container specified as a DNS_LABEL. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Arguments to the entrypoint. Will replace existing args for + * override. + * + * Generated from protobuf field repeated string args = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getArgs() + { + return $this->args; + } + + /** + * Optional. Arguments to the entrypoint. Will replace existing args for + * override. + * + * Generated from protobuf field repeated string args = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setArgs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->args = $arr; + + return $this; + } + + /** + * List of environment variables to set in the container. Will be merged + * with existing env for override. + * + * Generated from protobuf field repeated .google.cloud.run.v2.EnvVar env = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEnv() + { + return $this->env; + } + + /** + * List of environment variables to set in the container. Will be merged + * with existing env for override. + * + * Generated from protobuf field repeated .google.cloud.run.v2.EnvVar env = 3; + * @param array<\Google\Cloud\Run\V2\EnvVar>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEnv($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\EnvVar::class); + $this->env = $arr; + + return $this; + } + + /** + * Optional. True if the intention is to clear out existing args list. + * + * Generated from protobuf field bool clear_args = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getClearArgs() + { + return $this->clear_args; + } + + /** + * Optional. True if the intention is to clear out existing args list. + * + * Generated from protobuf field bool clear_args = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setClearArgs($var) + { + GPBUtil::checkBool($var); + $this->clear_args = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ContainerOverride::class, \Google\Cloud\Run\V2\RunJobRequest_Overrides_ContainerOverride::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretKeySelector.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretKeySelector.php new file mode 100644 index 000000000000..060822bb2454 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretKeySelector.php @@ -0,0 +1,121 @@ +google.cloud.run.v2.SecretKeySelector + */ +class SecretKeySelector extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the secret in Cloud Secret Manager. + * Format: {secret_name} if the secret is in the same project. + * projects/{project}/secrets/{secret_name} if the secret is + * in a different project. + * + * Generated from protobuf field string secret = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $secret = ''; + /** + * The Cloud Secret Manager secret version. + * Can be 'latest' for the latest version, an integer for a specific version, + * or a version alias. + * + * Generated from protobuf field string version = 2 [(.google.api.resource_reference) = { + */ + protected $version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $secret + * Required. The name of the secret in Cloud Secret Manager. + * Format: {secret_name} if the secret is in the same project. + * projects/{project}/secrets/{secret_name} if the secret is + * in a different project. + * @type string $version + * The Cloud Secret Manager secret version. + * Can be 'latest' for the latest version, an integer for a specific version, + * or a version alias. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the secret in Cloud Secret Manager. + * Format: {secret_name} if the secret is in the same project. + * projects/{project}/secrets/{secret_name} if the secret is + * in a different project. + * + * Generated from protobuf field string secret = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSecret() + { + return $this->secret; + } + + /** + * Required. The name of the secret in Cloud Secret Manager. + * Format: {secret_name} if the secret is in the same project. + * projects/{project}/secrets/{secret_name} if the secret is + * in a different project. + * + * Generated from protobuf field string secret = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSecret($var) + { + GPBUtil::checkString($var, True); + $this->secret = $var; + + return $this; + } + + /** + * The Cloud Secret Manager secret version. + * Can be 'latest' for the latest version, an integer for a specific version, + * or a version alias. + * + * Generated from protobuf field string version = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * The Cloud Secret Manager secret version. + * Can be 'latest' for the latest version, an integer for a specific version, + * or a version alias. + * + * Generated from protobuf field string version = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretVolumeSource.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretVolumeSource.php new file mode 100644 index 000000000000..1007b817c053 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SecretVolumeSource.php @@ -0,0 +1,217 @@ +google.cloud.run.v2.SecretVolumeSource + */ +class SecretVolumeSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the secret in Cloud Secret Manager. + * Format: {secret} if the secret is in the same project. + * projects/{project}/secrets/{secret} if the secret is + * in a different project. + * + * Generated from protobuf field string secret = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $secret = ''; + /** + * If unspecified, the volume will expose a file whose name is the + * secret, relative to VolumeMount.mount_path. + * If specified, the key will be used as the version to fetch from Cloud + * Secret Manager and the path will be the name of the file exposed in the + * volume. When items are defined, they must specify a path and a version. + * + * Generated from protobuf field repeated .google.cloud.run.v2.VersionToPath items = 2; + */ + private $items; + /** + * Integer representation of mode bits to use on created files by default. + * Must be a value between 0000 and 0777 (octal), defaulting to 0444. + * Directories within the path are not affected by this setting. + * Notes + * * Internally, a umask of 0222 will be applied to any non-zero value. + * * This is an integer representation of the mode bits. So, the octal + * integer value should look exactly as the chmod numeric notation with a + * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) + * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or + * 493 (base-10). + * * This might be in conflict with other options that affect the + * file mode, like fsGroup, and the result can be other mode bits set. + * This might be in conflict with other options that affect the + * file mode, like fsGroup, and as a result, other mode bits could be set. + * + * Generated from protobuf field int32 default_mode = 3; + */ + protected $default_mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $secret + * Required. The name of the secret in Cloud Secret Manager. + * Format: {secret} if the secret is in the same project. + * projects/{project}/secrets/{secret} if the secret is + * in a different project. + * @type array<\Google\Cloud\Run\V2\VersionToPath>|\Google\Protobuf\Internal\RepeatedField $items + * If unspecified, the volume will expose a file whose name is the + * secret, relative to VolumeMount.mount_path. + * If specified, the key will be used as the version to fetch from Cloud + * Secret Manager and the path will be the name of the file exposed in the + * volume. When items are defined, they must specify a path and a version. + * @type int $default_mode + * Integer representation of mode bits to use on created files by default. + * Must be a value between 0000 and 0777 (octal), defaulting to 0444. + * Directories within the path are not affected by this setting. + * Notes + * * Internally, a umask of 0222 will be applied to any non-zero value. + * * This is an integer representation of the mode bits. So, the octal + * integer value should look exactly as the chmod numeric notation with a + * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) + * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or + * 493 (base-10). + * * This might be in conflict with other options that affect the + * file mode, like fsGroup, and the result can be other mode bits set. + * This might be in conflict with other options that affect the + * file mode, like fsGroup, and as a result, other mode bits could be set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the secret in Cloud Secret Manager. + * Format: {secret} if the secret is in the same project. + * projects/{project}/secrets/{secret} if the secret is + * in a different project. + * + * Generated from protobuf field string secret = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSecret() + { + return $this->secret; + } + + /** + * Required. The name of the secret in Cloud Secret Manager. + * Format: {secret} if the secret is in the same project. + * projects/{project}/secrets/{secret} if the secret is + * in a different project. + * + * Generated from protobuf field string secret = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSecret($var) + { + GPBUtil::checkString($var, True); + $this->secret = $var; + + return $this; + } + + /** + * If unspecified, the volume will expose a file whose name is the + * secret, relative to VolumeMount.mount_path. + * If specified, the key will be used as the version to fetch from Cloud + * Secret Manager and the path will be the name of the file exposed in the + * volume. When items are defined, they must specify a path and a version. + * + * Generated from protobuf field repeated .google.cloud.run.v2.VersionToPath items = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * If unspecified, the volume will expose a file whose name is the + * secret, relative to VolumeMount.mount_path. + * If specified, the key will be used as the version to fetch from Cloud + * Secret Manager and the path will be the name of the file exposed in the + * volume. When items are defined, they must specify a path and a version. + * + * Generated from protobuf field repeated .google.cloud.run.v2.VersionToPath items = 2; + * @param array<\Google\Cloud\Run\V2\VersionToPath>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\VersionToPath::class); + $this->items = $arr; + + return $this; + } + + /** + * Integer representation of mode bits to use on created files by default. + * Must be a value between 0000 and 0777 (octal), defaulting to 0444. + * Directories within the path are not affected by this setting. + * Notes + * * Internally, a umask of 0222 will be applied to any non-zero value. + * * This is an integer representation of the mode bits. So, the octal + * integer value should look exactly as the chmod numeric notation with a + * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) + * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or + * 493 (base-10). + * * This might be in conflict with other options that affect the + * file mode, like fsGroup, and the result can be other mode bits set. + * This might be in conflict with other options that affect the + * file mode, like fsGroup, and as a result, other mode bits could be set. + * + * Generated from protobuf field int32 default_mode = 3; + * @return int + */ + public function getDefaultMode() + { + return $this->default_mode; + } + + /** + * Integer representation of mode bits to use on created files by default. + * Must be a value between 0000 and 0777 (octal), defaulting to 0444. + * Directories within the path are not affected by this setting. + * Notes + * * Internally, a umask of 0222 will be applied to any non-zero value. + * * This is an integer representation of the mode bits. So, the octal + * integer value should look exactly as the chmod numeric notation with a + * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) + * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or + * 493 (base-10). + * * This might be in conflict with other options that affect the + * file mode, like fsGroup, and the result can be other mode bits set. + * This might be in conflict with other options that affect the + * file mode, like fsGroup, and as a result, other mode bits could be set. + * + * Generated from protobuf field int32 default_mode = 3; + * @param int $var + * @return $this + */ + public function setDefaultMode($var) + { + GPBUtil::checkInt32($var); + $this->default_mode = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Service.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Service.php new file mode 100644 index 000000000000..685077c47a29 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Service.php @@ -0,0 +1,1609 @@ +google.cloud.run.v2.Service + */ +class Service extends \Google\Protobuf\Internal\Message +{ + /** + * The fully qualified name of this Service. In CreateServiceRequest, this + * field is ignored, and instead composed from CreateServiceRequest.parent and + * CreateServiceRequest.service_id. + * Format: + * projects/{project}/locations/{location}/services/{service_id} + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * User-provided description of the Service. This field currently has a + * 512-character limit. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * Output only. Server assigned unique identifier for the trigger. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * Please note that unlike v1, this is an int64 value. As with most Google + * APIs, its JSON representation will be a `string` instead of an `integer`. + * + * Generated from protobuf field int64 generation = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generation = 0; + /** + * Optional. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 Service. + * + * Generated from protobuf field map labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. Unstructured key value map that may be set by external tools to + * store and arbitrary metadata. They are not queryable and should be + * preserved when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected in new resources. All system + * annotations in v1 now have a corresponding field in v2 Service. + *

This field follows Kubernetes + * annotations' namespacing, limits, and rules. + * + * Generated from protobuf field map annotations = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. The deletion time. It is only populated as a response to a + * Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_time = null; + /** + * Output only. Email address of the authenticated creator. + * + * Generated from protobuf field string creator = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $creator = ''; + /** + * Output only. Email address of the last authenticated modifier. + * + * Generated from protobuf field string last_modifier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_modifier = ''; + /** + * Arbitrary identifier for the API client. + * + * Generated from protobuf field string client = 13; + */ + protected $client = ''; + /** + * Arbitrary version identifier for the API client. + * + * Generated from protobuf field string client_version = 14; + */ + protected $client_version = ''; + /** + * Optional. Provides the ingress settings for this Service. On output, + * returns the currently observed ingress settings, or + * INGRESS_TRAFFIC_UNSPECIFIED if no revision is active. + * + * Generated from protobuf field .google.cloud.run.v2.IngressTraffic ingress = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ingress = 0; + /** + * Optional. The launch stage as defined by [Google Cloud Platform + * Launch Stages](https://cloud.google.com/terms/launch-stages). + * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + * is assumed. + * Set the launch stage to a preview stage on input to allow use of preview + * features in that stage. On read (or output), describes whether the resource + * uses preview features. + *

+ * For example, if ALPHA is provided as input, but only BETA and GA-level + * features are used, this field will be BETA on output. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $launch_stage = 0; + /** + * Optional. Settings for the Binary Authorization feature. + * + * Generated from protobuf field .google.cloud.run.v2.BinaryAuthorization binary_authorization = 17 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $binary_authorization = null; + /** + * Required. The template used to create revisions for this Service. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionTemplate template = 18 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $template = null; + /** + * Optional. Specifies how to distribute traffic over a collection of + * Revisions belonging to the Service. If traffic is empty or not provided, + * defaults to 100% traffic to the latest `Ready` Revision. + * + * Generated from protobuf field repeated .google.cloud.run.v2.TrafficTarget traffic = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $traffic; + /** + * Optional. Specifies service-level scaling settings + * + * Generated from protobuf field .google.cloud.run.v2.ServiceScaling scaling = 20 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $scaling = null; + /** + * Optional. Disables IAM permission check for run.routes.invoke for callers + * of this service. This feature is available by invitation only. For more + * information, visit + * https://cloud.google.com/run/docs/securing/managing-access#invoker_check. + * + * Generated from protobuf field bool invoker_iam_disabled = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $invoker_iam_disabled = false; + /** + * Optional. Disables public resolution of the default URI of this service. + * + * Generated from protobuf field bool default_uri_disabled = 22 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $default_uri_disabled = false; + /** + * Output only. All URLs serving traffic for this Service. + * + * Generated from protobuf field repeated string urls = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $urls; + /** + * One or more custom audiences that you want this service to support. Specify + * each custom audience as the full URL in a string. The custom audiences are + * encoded in the token and used to authenticate requests. For more + * information, see + * https://cloud.google.com/run/docs/configuring/custom-audiences. + * + * Generated from protobuf field repeated string custom_audiences = 37; + */ + private $custom_audiences; + /** + * Output only. The generation of this Service currently serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. Please note that unlike v1, this is an int64 value. + * As with most Google APIs, its JSON representation will be a `string` + * instead of an `integer`. + * + * Generated from protobuf field int64 observed_generation = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $observed_generation = 0; + /** + * Output only. The Condition of this Service, containing its readiness + * status, and detailed error information in case it did not reach a serving + * state. See comments in `reconciling` for additional information on + * reconciliation process in Cloud Run. + * + * Generated from protobuf field .google.cloud.run.v2.Condition terminal_condition = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $terminal_condition = null; + /** + * Output only. The Conditions of all other associated sub-resources. They + * contain additional diagnostics information in case the Service does not + * reach its Serving state. See comments in `reconciling` for additional + * information on reconciliation process in Cloud Run. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $conditions; + /** + * Output only. Name of the latest revision that is serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * + * Generated from protobuf field string latest_ready_revision = 33 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $latest_ready_revision = ''; + /** + * Output only. Name of the last created revision. See comments in + * `reconciling` for additional information on reconciliation process in Cloud + * Run. + * + * Generated from protobuf field string latest_created_revision = 34 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $latest_created_revision = ''; + /** + * Output only. Detailed status information for corresponding traffic targets. + * See comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * + * Generated from protobuf field repeated .google.cloud.run.v2.TrafficTargetStatus traffic_statuses = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $traffic_statuses; + /** + * Output only. The main URI in which this Service is serving traffic. + * + * Generated from protobuf field string uri = 36 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uri = ''; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = false; + /** + * Output only. Returns true if the Service is currently being acted upon by + * the system to bring it into the desired state. + * When a new Service is created, or an existing one is updated, Cloud Run + * will asynchronously perform all necessary steps to bring the Service to the + * desired serving state. This process is called reconciliation. + * While reconciliation is in process, `observed_generation`, + * `latest_ready_revison`, `traffic_statuses`, and `uri` will have transient + * values that might mismatch the intended state: Once reconciliation is over + * (and this field is false), there are two possible outcomes: reconciliation + * succeeded and the serving state matches the Service, or there was an error, + * and reconciliation failed. This state can be found in + * `terminal_condition.state`. + * If reconciliation succeeded, the following fields will match: `traffic` and + * `traffic_statuses`, `observed_generation` and `generation`, + * `latest_ready_revision` and `latest_created_revision`. + * If reconciliation failed, `traffic_statuses`, `observed_generation`, and + * `latest_ready_revision` will have the state of the last serving revision, + * or empty for newly created Services. Additional information on the failure + * can be found in `terminal_condition` and `conditions`. + * + * Generated from protobuf field bool reconciling = 98 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The fully qualified name of this Service. In CreateServiceRequest, this + * field is ignored, and instead composed from CreateServiceRequest.parent and + * CreateServiceRequest.service_id. + * Format: + * projects/{project}/locations/{location}/services/{service_id} + * @type string $description + * User-provided description of the Service. This field currently has a + * 512-character limit. + * @type string $uid + * Output only. Server assigned unique identifier for the trigger. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * @type int|string $generation + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * Please note that unlike v1, this is an int64 value. As with most Google + * APIs, its JSON representation will be a `string` instead of an `integer`. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 Service. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. Unstructured key value map that may be set by external tools to + * store and arbitrary metadata. They are not queryable and should be + * preserved when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected in new resources. All system + * annotations in v1 now have a corresponding field in v2 Service. + *

This field follows Kubernetes + * annotations' namespacing, limits, and rules. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The creation time. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last-modified time. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. The deletion time. It is only populated as a response to a + * Delete request. + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. + * @type string $creator + * Output only. Email address of the authenticated creator. + * @type string $last_modifier + * Output only. Email address of the last authenticated modifier. + * @type string $client + * Arbitrary identifier for the API client. + * @type string $client_version + * Arbitrary version identifier for the API client. + * @type int $ingress + * Optional. Provides the ingress settings for this Service. On output, + * returns the currently observed ingress settings, or + * INGRESS_TRAFFIC_UNSPECIFIED if no revision is active. + * @type int $launch_stage + * Optional. The launch stage as defined by [Google Cloud Platform + * Launch Stages](https://cloud.google.com/terms/launch-stages). + * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + * is assumed. + * Set the launch stage to a preview stage on input to allow use of preview + * features in that stage. On read (or output), describes whether the resource + * uses preview features. + *

+ * For example, if ALPHA is provided as input, but only BETA and GA-level + * features are used, this field will be BETA on output. + * @type \Google\Cloud\Run\V2\BinaryAuthorization $binary_authorization + * Optional. Settings for the Binary Authorization feature. + * @type \Google\Cloud\Run\V2\RevisionTemplate $template + * Required. The template used to create revisions for this Service. + * @type array<\Google\Cloud\Run\V2\TrafficTarget>|\Google\Protobuf\Internal\RepeatedField $traffic + * Optional. Specifies how to distribute traffic over a collection of + * Revisions belonging to the Service. If traffic is empty or not provided, + * defaults to 100% traffic to the latest `Ready` Revision. + * @type \Google\Cloud\Run\V2\ServiceScaling $scaling + * Optional. Specifies service-level scaling settings + * @type bool $invoker_iam_disabled + * Optional. Disables IAM permission check for run.routes.invoke for callers + * of this service. This feature is available by invitation only. For more + * information, visit + * https://cloud.google.com/run/docs/securing/managing-access#invoker_check. + * @type bool $default_uri_disabled + * Optional. Disables public resolution of the default URI of this service. + * @type array|\Google\Protobuf\Internal\RepeatedField $urls + * Output only. All URLs serving traffic for this Service. + * @type array|\Google\Protobuf\Internal\RepeatedField $custom_audiences + * One or more custom audiences that you want this service to support. Specify + * each custom audience as the full URL in a string. The custom audiences are + * encoded in the token and used to authenticate requests. For more + * information, see + * https://cloud.google.com/run/docs/configuring/custom-audiences. + * @type int|string $observed_generation + * Output only. The generation of this Service currently serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. Please note that unlike v1, this is an int64 value. + * As with most Google APIs, its JSON representation will be a `string` + * instead of an `integer`. + * @type \Google\Cloud\Run\V2\Condition $terminal_condition + * Output only. The Condition of this Service, containing its readiness + * status, and detailed error information in case it did not reach a serving + * state. See comments in `reconciling` for additional information on + * reconciliation process in Cloud Run. + * @type array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $conditions + * Output only. The Conditions of all other associated sub-resources. They + * contain additional diagnostics information in case the Service does not + * reach its Serving state. See comments in `reconciling` for additional + * information on reconciliation process in Cloud Run. + * @type string $latest_ready_revision + * Output only. Name of the latest revision that is serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * @type string $latest_created_revision + * Output only. Name of the last created revision. See comments in + * `reconciling` for additional information on reconciliation process in Cloud + * Run. + * @type array<\Google\Cloud\Run\V2\TrafficTargetStatus>|\Google\Protobuf\Internal\RepeatedField $traffic_statuses + * Output only. Detailed status information for corresponding traffic targets. + * See comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * @type string $uri + * Output only. The main URI in which this Service is serving traffic. + * @type bool $satisfies_pzs + * Output only. Reserved for future use. + * @type bool $reconciling + * Output only. Returns true if the Service is currently being acted upon by + * the system to bring it into the desired state. + * When a new Service is created, or an existing one is updated, Cloud Run + * will asynchronously perform all necessary steps to bring the Service to the + * desired serving state. This process is called reconciliation. + * While reconciliation is in process, `observed_generation`, + * `latest_ready_revison`, `traffic_statuses`, and `uri` will have transient + * values that might mismatch the intended state: Once reconciliation is over + * (and this field is false), there are two possible outcomes: reconciliation + * succeeded and the serving state matches the Service, or there was an error, + * and reconciliation failed. This state can be found in + * `terminal_condition.state`. + * If reconciliation succeeded, the following fields will match: `traffic` and + * `traffic_statuses`, `observed_generation` and `generation`, + * `latest_ready_revision` and `latest_created_revision`. + * If reconciliation failed, `traffic_statuses`, `observed_generation`, and + * `latest_ready_revision` will have the state of the last serving revision, + * or empty for newly created Services. Additional information on the failure + * can be found in `terminal_condition` and `conditions`. + * @type string $etag + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); + parent::__construct($data); + } + + /** + * The fully qualified name of this Service. In CreateServiceRequest, this + * field is ignored, and instead composed from CreateServiceRequest.parent and + * CreateServiceRequest.service_id. + * Format: + * projects/{project}/locations/{location}/services/{service_id} + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The fully qualified name of this Service. In CreateServiceRequest, this + * field is ignored, and instead composed from CreateServiceRequest.parent and + * CreateServiceRequest.service_id. + * Format: + * projects/{project}/locations/{location}/services/{service_id} + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * User-provided description of the Service. This field currently has a + * 512-character limit. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * User-provided description of the Service. This field currently has a + * 512-character limit. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. Server assigned unique identifier for the trigger. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Server assigned unique identifier for the trigger. The value + * is a UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * Please note that unlike v1, this is an int64 value. As with most Google + * APIs, its JSON representation will be a `string` instead of an `integer`. + * + * Generated from protobuf field int64 generation = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getGeneration() + { + return $this->generation; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * Please note that unlike v1, this is an int64 value. As with most Google + * APIs, its JSON representation will be a `string` instead of an `integer`. + * + * Generated from protobuf field int64 generation = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setGeneration($var) + { + GPBUtil::checkInt64($var); + $this->generation = $var; + + return $this; + } + + /** + * Optional. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 Service. + * + * Generated from protobuf field map labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels. + *

Cloud Run API v2 does not support labels with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected. All system labels in v1 now have a + * corresponding field in v2 Service. + * + * Generated from protobuf field map labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. Unstructured key value map that may be set by external tools to + * store and arbitrary metadata. They are not queryable and should be + * preserved when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected in new resources. All system + * annotations in v1 now have a corresponding field in v2 Service. + *

This field follows Kubernetes + * annotations' namespacing, limits, and rules. + * + * Generated from protobuf field map annotations = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. Unstructured key value map that may be set by external tools to + * store and arbitrary metadata. They are not queryable and should be + * preserved when modifying objects. + *

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + * `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + * namespaces, and they will be rejected in new resources. All system + * annotations in v1 now have a corresponding field in v2 Service. + *

This field follows Kubernetes + * annotations' namespacing, limits, and rules. + * + * Generated from protobuf field map annotations = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. The deletion time. It is only populated as a response to a + * Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. The deletion time. It is only populated as a response to a + * Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * Output only. Email address of the authenticated creator. + * + * Generated from protobuf field string creator = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getCreator() + { + return $this->creator; + } + + /** + * Output only. Email address of the authenticated creator. + * + * Generated from protobuf field string creator = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setCreator($var) + { + GPBUtil::checkString($var, True); + $this->creator = $var; + + return $this; + } + + /** + * Output only. Email address of the last authenticated modifier. + * + * Generated from protobuf field string last_modifier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLastModifier() + { + return $this->last_modifier; + } + + /** + * Output only. Email address of the last authenticated modifier. + * + * Generated from protobuf field string last_modifier = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLastModifier($var) + { + GPBUtil::checkString($var, True); + $this->last_modifier = $var; + + return $this; + } + + /** + * Arbitrary identifier for the API client. + * + * Generated from protobuf field string client = 13; + * @return string + */ + public function getClient() + { + return $this->client; + } + + /** + * Arbitrary identifier for the API client. + * + * Generated from protobuf field string client = 13; + * @param string $var + * @return $this + */ + public function setClient($var) + { + GPBUtil::checkString($var, True); + $this->client = $var; + + return $this; + } + + /** + * Arbitrary version identifier for the API client. + * + * Generated from protobuf field string client_version = 14; + * @return string + */ + public function getClientVersion() + { + return $this->client_version; + } + + /** + * Arbitrary version identifier for the API client. + * + * Generated from protobuf field string client_version = 14; + * @param string $var + * @return $this + */ + public function setClientVersion($var) + { + GPBUtil::checkString($var, True); + $this->client_version = $var; + + return $this; + } + + /** + * Optional. Provides the ingress settings for this Service. On output, + * returns the currently observed ingress settings, or + * INGRESS_TRAFFIC_UNSPECIFIED if no revision is active. + * + * Generated from protobuf field .google.cloud.run.v2.IngressTraffic ingress = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getIngress() + { + return $this->ingress; + } + + /** + * Optional. Provides the ingress settings for this Service. On output, + * returns the currently observed ingress settings, or + * INGRESS_TRAFFIC_UNSPECIFIED if no revision is active. + * + * Generated from protobuf field .google.cloud.run.v2.IngressTraffic ingress = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setIngress($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\IngressTraffic::class); + $this->ingress = $var; + + return $this; + } + + /** + * Optional. The launch stage as defined by [Google Cloud Platform + * Launch Stages](https://cloud.google.com/terms/launch-stages). + * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + * is assumed. + * Set the launch stage to a preview stage on input to allow use of preview + * features in that stage. On read (or output), describes whether the resource + * uses preview features. + *

+ * For example, if ALPHA is provided as input, but only BETA and GA-level + * features are used, this field will be BETA on output. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getLaunchStage() + { + return $this->launch_stage; + } + + /** + * Optional. The launch stage as defined by [Google Cloud Platform + * Launch Stages](https://cloud.google.com/terms/launch-stages). + * Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + * is assumed. + * Set the launch stage to a preview stage on input to allow use of preview + * features in that stage. On read (or output), describes whether the resource + * uses preview features. + *

+ * For example, if ALPHA is provided as input, but only BETA and GA-level + * features are used, this field will be BETA on output. + * + * Generated from protobuf field .google.api.LaunchStage launch_stage = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setLaunchStage($var) + { + GPBUtil::checkEnum($var, \Google\Api\LaunchStage::class); + $this->launch_stage = $var; + + return $this; + } + + /** + * Optional. Settings for the Binary Authorization feature. + * + * Generated from protobuf field .google.cloud.run.v2.BinaryAuthorization binary_authorization = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\BinaryAuthorization|null + */ + public function getBinaryAuthorization() + { + return $this->binary_authorization; + } + + public function hasBinaryAuthorization() + { + return isset($this->binary_authorization); + } + + public function clearBinaryAuthorization() + { + unset($this->binary_authorization); + } + + /** + * Optional. Settings for the Binary Authorization feature. + * + * Generated from protobuf field .google.cloud.run.v2.BinaryAuthorization binary_authorization = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\BinaryAuthorization $var + * @return $this + */ + public function setBinaryAuthorization($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\BinaryAuthorization::class); + $this->binary_authorization = $var; + + return $this; + } + + /** + * Required. The template used to create revisions for this Service. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionTemplate template = 18 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Run\V2\RevisionTemplate|null + */ + public function getTemplate() + { + return $this->template; + } + + public function hasTemplate() + { + return isset($this->template); + } + + public function clearTemplate() + { + unset($this->template); + } + + /** + * Required. The template used to create revisions for this Service. + * + * Generated from protobuf field .google.cloud.run.v2.RevisionTemplate template = 18 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Run\V2\RevisionTemplate $var + * @return $this + */ + public function setTemplate($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\RevisionTemplate::class); + $this->template = $var; + + return $this; + } + + /** + * Optional. Specifies how to distribute traffic over a collection of + * Revisions belonging to the Service. If traffic is empty or not provided, + * defaults to 100% traffic to the latest `Ready` Revision. + * + * Generated from protobuf field repeated .google.cloud.run.v2.TrafficTarget traffic = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTraffic() + { + return $this->traffic; + } + + /** + * Optional. Specifies how to distribute traffic over a collection of + * Revisions belonging to the Service. If traffic is empty or not provided, + * defaults to 100% traffic to the latest `Ready` Revision. + * + * Generated from protobuf field repeated .google.cloud.run.v2.TrafficTarget traffic = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Run\V2\TrafficTarget>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTraffic($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\TrafficTarget::class); + $this->traffic = $arr; + + return $this; + } + + /** + * Optional. Specifies service-level scaling settings + * + * Generated from protobuf field .google.cloud.run.v2.ServiceScaling scaling = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\ServiceScaling|null + */ + public function getScaling() + { + return $this->scaling; + } + + public function hasScaling() + { + return isset($this->scaling); + } + + public function clearScaling() + { + unset($this->scaling); + } + + /** + * Optional. Specifies service-level scaling settings + * + * Generated from protobuf field .google.cloud.run.v2.ServiceScaling scaling = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\ServiceScaling $var + * @return $this + */ + public function setScaling($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ServiceScaling::class); + $this->scaling = $var; + + return $this; + } + + /** + * Optional. Disables IAM permission check for run.routes.invoke for callers + * of this service. This feature is available by invitation only. For more + * information, visit + * https://cloud.google.com/run/docs/securing/managing-access#invoker_check. + * + * Generated from protobuf field bool invoker_iam_disabled = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getInvokerIamDisabled() + { + return $this->invoker_iam_disabled; + } + + /** + * Optional. Disables IAM permission check for run.routes.invoke for callers + * of this service. This feature is available by invitation only. For more + * information, visit + * https://cloud.google.com/run/docs/securing/managing-access#invoker_check. + * + * Generated from protobuf field bool invoker_iam_disabled = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setInvokerIamDisabled($var) + { + GPBUtil::checkBool($var); + $this->invoker_iam_disabled = $var; + + return $this; + } + + /** + * Optional. Disables public resolution of the default URI of this service. + * + * Generated from protobuf field bool default_uri_disabled = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDefaultUriDisabled() + { + return $this->default_uri_disabled; + } + + /** + * Optional. Disables public resolution of the default URI of this service. + * + * Generated from protobuf field bool default_uri_disabled = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDefaultUriDisabled($var) + { + GPBUtil::checkBool($var); + $this->default_uri_disabled = $var; + + return $this; + } + + /** + * Output only. All URLs serving traffic for this Service. + * + * Generated from protobuf field repeated string urls = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUrls() + { + return $this->urls; + } + + /** + * Output only. All URLs serving traffic for this Service. + * + * Generated from protobuf field repeated string urls = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUrls($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->urls = $arr; + + return $this; + } + + /** + * One or more custom audiences that you want this service to support. Specify + * each custom audience as the full URL in a string. The custom audiences are + * encoded in the token and used to authenticate requests. For more + * information, see + * https://cloud.google.com/run/docs/configuring/custom-audiences. + * + * Generated from protobuf field repeated string custom_audiences = 37; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomAudiences() + { + return $this->custom_audiences; + } + + /** + * One or more custom audiences that you want this service to support. Specify + * each custom audience as the full URL in a string. The custom audiences are + * encoded in the token and used to authenticate requests. For more + * information, see + * https://cloud.google.com/run/docs/configuring/custom-audiences. + * + * Generated from protobuf field repeated string custom_audiences = 37; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomAudiences($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->custom_audiences = $arr; + + return $this; + } + + /** + * Output only. The generation of this Service currently serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. Please note that unlike v1, this is an int64 value. + * As with most Google APIs, its JSON representation will be a `string` + * instead of an `integer`. + * + * Generated from protobuf field int64 observed_generation = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getObservedGeneration() + { + return $this->observed_generation; + } + + /** + * Output only. The generation of this Service currently serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. Please note that unlike v1, this is an int64 value. + * As with most Google APIs, its JSON representation will be a `string` + * instead of an `integer`. + * + * Generated from protobuf field int64 observed_generation = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setObservedGeneration($var) + { + GPBUtil::checkInt64($var); + $this->observed_generation = $var; + + return $this; + } + + /** + * Output only. The Condition of this Service, containing its readiness + * status, and detailed error information in case it did not reach a serving + * state. See comments in `reconciling` for additional information on + * reconciliation process in Cloud Run. + * + * Generated from protobuf field .google.cloud.run.v2.Condition terminal_condition = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Run\V2\Condition|null + */ + public function getTerminalCondition() + { + return $this->terminal_condition; + } + + public function hasTerminalCondition() + { + return isset($this->terminal_condition); + } + + public function clearTerminalCondition() + { + unset($this->terminal_condition); + } + + /** + * Output only. The Condition of this Service, containing its readiness + * status, and detailed error information in case it did not reach a serving + * state. See comments in `reconciling` for additional information on + * reconciliation process in Cloud Run. + * + * Generated from protobuf field .google.cloud.run.v2.Condition terminal_condition = 31 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Run\V2\Condition $var + * @return $this + */ + public function setTerminalCondition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Condition::class); + $this->terminal_condition = $var; + + return $this; + } + + /** + * Output only. The Conditions of all other associated sub-resources. They + * contain additional diagnostics information in case the Service does not + * reach its Serving state. See comments in `reconciling` for additional + * information on reconciliation process in Cloud Run. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConditions() + { + return $this->conditions; + } + + /** + * Output only. The Conditions of all other associated sub-resources. They + * contain additional diagnostics information in case the Service does not + * reach its Serving state. See comments in `reconciling` for additional + * information on reconciliation process in Cloud Run. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConditions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Condition::class); + $this->conditions = $arr; + + return $this; + } + + /** + * Output only. Name of the latest revision that is serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * + * Generated from protobuf field string latest_ready_revision = 33 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestReadyRevision() + { + return $this->latest_ready_revision; + } + + /** + * Output only. Name of the latest revision that is serving traffic. See + * comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * + * Generated from protobuf field string latest_ready_revision = 33 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestReadyRevision($var) + { + GPBUtil::checkString($var, True); + $this->latest_ready_revision = $var; + + return $this; + } + + /** + * Output only. Name of the last created revision. See comments in + * `reconciling` for additional information on reconciliation process in Cloud + * Run. + * + * Generated from protobuf field string latest_created_revision = 34 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getLatestCreatedRevision() + { + return $this->latest_created_revision; + } + + /** + * Output only. Name of the last created revision. See comments in + * `reconciling` for additional information on reconciliation process in Cloud + * Run. + * + * Generated from protobuf field string latest_created_revision = 34 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setLatestCreatedRevision($var) + { + GPBUtil::checkString($var, True); + $this->latest_created_revision = $var; + + return $this; + } + + /** + * Output only. Detailed status information for corresponding traffic targets. + * See comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * + * Generated from protobuf field repeated .google.cloud.run.v2.TrafficTargetStatus traffic_statuses = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTrafficStatuses() + { + return $this->traffic_statuses; + } + + /** + * Output only. Detailed status information for corresponding traffic targets. + * See comments in `reconciling` for additional information on reconciliation + * process in Cloud Run. + * + * Generated from protobuf field repeated .google.cloud.run.v2.TrafficTargetStatus traffic_statuses = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Run\V2\TrafficTargetStatus>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTrafficStatuses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\TrafficTargetStatus::class); + $this->traffic_statuses = $arr; + + return $this; + } + + /** + * Output only. The main URI in which this Service is serving traffic. + * + * Generated from protobuf field string uri = 36 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Output only. The main URI in which this Service is serving traffic. + * + * Generated from protobuf field string uri = 36 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 38 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Output only. Returns true if the Service is currently being acted upon by + * the system to bring it into the desired state. + * When a new Service is created, or an existing one is updated, Cloud Run + * will asynchronously perform all necessary steps to bring the Service to the + * desired serving state. This process is called reconciliation. + * While reconciliation is in process, `observed_generation`, + * `latest_ready_revison`, `traffic_statuses`, and `uri` will have transient + * values that might mismatch the intended state: Once reconciliation is over + * (and this field is false), there are two possible outcomes: reconciliation + * succeeded and the serving state matches the Service, or there was an error, + * and reconciliation failed. This state can be found in + * `terminal_condition.state`. + * If reconciliation succeeded, the following fields will match: `traffic` and + * `traffic_statuses`, `observed_generation` and `generation`, + * `latest_ready_revision` and `latest_created_revision`. + * If reconciliation failed, `traffic_statuses`, `observed_generation`, and + * `latest_ready_revision` will have the state of the last serving revision, + * or empty for newly created Services. Additional information on the failure + * can be found in `terminal_condition` and `conditions`. + * + * Generated from protobuf field bool reconciling = 98 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Returns true if the Service is currently being acted upon by + * the system to bring it into the desired state. + * When a new Service is created, or an existing one is updated, Cloud Run + * will asynchronously perform all necessary steps to bring the Service to the + * desired serving state. This process is called reconciliation. + * While reconciliation is in process, `observed_generation`, + * `latest_ready_revison`, `traffic_statuses`, and `uri` will have transient + * values that might mismatch the intended state: Once reconciliation is over + * (and this field is false), there are two possible outcomes: reconciliation + * succeeded and the serving state matches the Service, or there was an error, + * and reconciliation failed. This state can be found in + * `terminal_condition.state`. + * If reconciliation succeeded, the following fields will match: `traffic` and + * `traffic_statuses`, `observed_generation` and `generation`, + * `latest_ready_revision` and `latest_created_revision`. + * If reconciliation failed, `traffic_statuses`, `observed_generation`, and + * `latest_ready_revision` will have the state of the last serving revision, + * or empty for newly created Services. Additional information on the failure + * can be found in `terminal_condition` and `conditions`. + * + * Generated from protobuf field bool reconciling = 98 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceMesh.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceMesh.php new file mode 100644 index 000000000000..19cd1b0263c1 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceMesh.php @@ -0,0 +1,76 @@ +google.cloud.run.v2.ServiceMesh + */ +class ServiceMesh extends \Google\Protobuf\Internal\Message +{ + /** + * The Mesh resource name. Format: + * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can + * be project id or number. + * + * Generated from protobuf field string mesh = 1 [(.google.api.resource_reference) = { + */ + protected $mesh = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $mesh + * The Mesh resource name. Format: + * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can + * be project id or number. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); + parent::__construct($data); + } + + /** + * The Mesh resource name. Format: + * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can + * be project id or number. + * + * Generated from protobuf field string mesh = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getMesh() + { + return $this->mesh; + } + + /** + * The Mesh resource name. Format: + * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can + * be project id or number. + * + * Generated from protobuf field string mesh = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setMesh($var) + { + GPBUtil::checkString($var, True); + $this->mesh = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling.php new file mode 100644 index 000000000000..7fa643373a05 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling.php @@ -0,0 +1,162 @@ +google.cloud.run.v2.ServiceScaling + */ +class ServiceScaling extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. total min instances for the service. This number of instances is + * divided among all revisions with specified traffic based on the percent + * of traffic they are receiving. + * + * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $min_instance_count = 0; + /** + * Optional. The scaling mode for the service. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceScaling.ScalingMode scaling_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $scaling_mode = 0; + /** + * Optional. total instance count for the service in manual scaling mode. This + * number of instances is divided among all revisions with specified traffic + * based on the percent of traffic they are receiving. + * + * Generated from protobuf field optional int32 manual_instance_count = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $manual_instance_count = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $min_instance_count + * Optional. total min instances for the service. This number of instances is + * divided among all revisions with specified traffic based on the percent + * of traffic they are receiving. + * @type int $scaling_mode + * Optional. The scaling mode for the service. + * @type int $manual_instance_count + * Optional. total instance count for the service in manual scaling mode. This + * number of instances is divided among all revisions with specified traffic + * based on the percent of traffic they are receiving. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); + parent::__construct($data); + } + + /** + * Optional. total min instances for the service. This number of instances is + * divided among all revisions with specified traffic based on the percent + * of traffic they are receiving. + * + * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMinInstanceCount() + { + return $this->min_instance_count; + } + + /** + * Optional. total min instances for the service. This number of instances is + * divided among all revisions with specified traffic based on the percent + * of traffic they are receiving. + * + * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMinInstanceCount($var) + { + GPBUtil::checkInt32($var); + $this->min_instance_count = $var; + + return $this; + } + + /** + * Optional. The scaling mode for the service. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceScaling.ScalingMode scaling_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getScalingMode() + { + return $this->scaling_mode; + } + + /** + * Optional. The scaling mode for the service. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceScaling.ScalingMode scaling_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setScalingMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ServiceScaling\ScalingMode::class); + $this->scaling_mode = $var; + + return $this; + } + + /** + * Optional. total instance count for the service in manual scaling mode. This + * number of instances is divided among all revisions with specified traffic + * based on the percent of traffic they are receiving. + * + * Generated from protobuf field optional int32 manual_instance_count = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getManualInstanceCount() + { + return isset($this->manual_instance_count) ? $this->manual_instance_count : 0; + } + + public function hasManualInstanceCount() + { + return isset($this->manual_instance_count); + } + + public function clearManualInstanceCount() + { + unset($this->manual_instance_count); + } + + /** + * Optional. total instance count for the service in manual scaling mode. This + * number of instances is divided among all revisions with specified traffic + * based on the percent of traffic they are receiving. + * + * Generated from protobuf field optional int32 manual_instance_count = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setManualInstanceCount($var) + { + GPBUtil::checkInt32($var); + $this->manual_instance_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling/ScalingMode.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling/ScalingMode.php new file mode 100644 index 000000000000..58d181ecc828 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/ServiceScaling/ScalingMode.php @@ -0,0 +1,65 @@ +google.cloud.run.v2.ServiceScaling.ScalingMode + */ +class ScalingMode +{ + /** + * Unspecified. + * + * Generated from protobuf enum SCALING_MODE_UNSPECIFIED = 0; + */ + const SCALING_MODE_UNSPECIFIED = 0; + /** + * Scale based on traffic between min and max instances. + * + * Generated from protobuf enum AUTOMATIC = 1; + */ + const AUTOMATIC = 1; + /** + * Scale to exactly min instances and ignore max instances. + * + * Generated from protobuf enum MANUAL = 2; + */ + const MANUAL = 2; + + private static $valueToName = [ + self::SCALING_MODE_UNSPECIFIED => 'SCALING_MODE_UNSPECIFIED', + self::AUTOMATIC => 'AUTOMATIC', + self::MANUAL => 'MANUAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ScalingMode::class, \Google\Cloud\Run\V2\ServiceScaling_ScalingMode::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/StorageSource.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/StorageSource.php new file mode 100644 index 000000000000..a577d719f1a5 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/StorageSource.php @@ -0,0 +1,155 @@ +google.cloud.run.v2.StorageSource + */ +class StorageSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Google Cloud Storage bucket containing the source (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $bucket = ''; + /** + * Required. Google Cloud Storage object containing the source. + * This object must be a gzipped archive file (`.tar.gz`) containing source to + * build. + * + * Generated from protobuf field string object = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $object = ''; + /** + * Optional. Google Cloud Storage generation for the object. If the generation + * is omitted, the latest generation will be used. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $generation = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bucket + * Required. Google Cloud Storage bucket containing the source (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * @type string $object + * Required. Google Cloud Storage object containing the source. + * This object must be a gzipped archive file (`.tar.gz`) containing source to + * build. + * @type int|string $generation + * Optional. Google Cloud Storage generation for the object. If the generation + * is omitted, the latest generation will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + + /** + * Required. Google Cloud Storage bucket containing the source (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBucket() + { + return $this->bucket; + } + + /** + * Required. Google Cloud Storage bucket containing the source (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkString($var, True); + $this->bucket = $var; + + return $this; + } + + /** + * Required. Google Cloud Storage object containing the source. + * This object must be a gzipped archive file (`.tar.gz`) containing source to + * build. + * + * Generated from protobuf field string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getObject() + { + return $this->object; + } + + /** + * Required. Google Cloud Storage object containing the source. + * This object must be a gzipped archive file (`.tar.gz`) containing source to + * build. + * + * Generated from protobuf field string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setObject($var) + { + GPBUtil::checkString($var, True); + $this->object = $var; + + return $this; + } + + /** + * Optional. Google Cloud Storage generation for the object. If the generation + * is omitted, the latest generation will be used. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getGeneration() + { + return $this->generation; + } + + /** + * Optional. Google Cloud Storage generation for the object. If the generation + * is omitted, the latest generation will be used. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setGeneration($var) + { + GPBUtil::checkInt64($var); + $this->generation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest.php new file mode 100644 index 000000000000..cb260e21eed3 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest.php @@ -0,0 +1,356 @@ +google.cloud.run.v2.SubmitBuildRequest + */ +class SubmitBuildRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location to build in. Location must be a region, + * e.g., 'us-central1' or 'global' if the global builder is to be used. + * Format: + * `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. Artifact Registry URI to store the built image. + * + * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $image_uri = ''; + /** + * Optional. The service account to use for the build. If not set, the default + * Cloud Build service account for the project will be used. + * + * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_account = ''; + /** + * Optional. Name of the Cloud Build Custom Worker Pool that should be used to + * build the function. The format of this field is + * `projects/{project}/locations/{region}/workerPools/{workerPool}` where + * `{project}` and `{region}` are the project id and region respectively where + * the worker pool is defined and `{workerPool}` is the short name of the + * worker pool. + * + * Generated from protobuf field string worker_pool = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $worker_pool = ''; + /** + * Optional. Additional tags to annotate the build. + * + * Generated from protobuf field repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $tags; + protected $source; + protected $build_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location to build in. Location must be a region, + * e.g., 'us-central1' or 'global' if the global builder is to be used. + * Format: + * `projects/{project}/locations/{location}` + * @type \Google\Cloud\Run\V2\StorageSource $storage_source + * Required. Source for the build. + * @type string $image_uri + * Required. Artifact Registry URI to store the built image. + * @type \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild $buildpack_build + * Build the source using Buildpacks. + * @type \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild $docker_build + * Build the source using Docker. This means the source has a Dockerfile. + * @type string $service_account + * Optional. The service account to use for the build. If not set, the default + * Cloud Build service account for the project will be used. + * @type string $worker_pool + * Optional. Name of the Cloud Build Custom Worker Pool that should be used to + * build the function. The format of this field is + * `projects/{project}/locations/{region}/workerPools/{workerPool}` where + * `{project}` and `{region}` are the project id and region respectively where + * the worker pool is defined and `{workerPool}` is the short name of the + * worker pool. + * @type array|\Google\Protobuf\Internal\RepeatedField $tags + * Optional. Additional tags to annotate the build. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location to build in. Location must be a region, + * e.g., 'us-central1' or 'global' if the global builder is to be used. + * Format: + * `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location to build in. Location must be a region, + * e.g., 'us-central1' or 'global' if the global builder is to be used. + * Format: + * `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Source for the build. + * + * Generated from protobuf field .google.cloud.run.v2.StorageSource storage_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Run\V2\StorageSource|null + */ + public function getStorageSource() + { + return $this->readOneof(2); + } + + public function hasStorageSource() + { + return $this->hasOneof(2); + } + + /** + * Required. Source for the build. + * + * Generated from protobuf field .google.cloud.run.v2.StorageSource storage_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Run\V2\StorageSource $var + * @return $this + */ + public function setStorageSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\StorageSource::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Required. Artifact Registry URI to store the built image. + * + * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getImageUri() + { + return $this->image_uri; + } + + /** + * Required. Artifact Registry URI to store the built image. + * + * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setImageUri($var) + { + GPBUtil::checkString($var, True); + $this->image_uri = $var; + + return $this; + } + + /** + * Build the source using Buildpacks. + * + * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild buildpack_build = 4; + * @return \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild|null + */ + public function getBuildpackBuild() + { + return $this->readOneof(4); + } + + public function hasBuildpackBuild() + { + return $this->hasOneof(4); + } + + /** + * Build the source using Buildpacks. + * + * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild buildpack_build = 4; + * @param \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild $var + * @return $this + */ + public function setBuildpackBuild($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Build the source using Docker. This means the source has a Dockerfile. + * + * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.DockerBuild docker_build = 5; + * @return \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild|null + */ + public function getDockerBuild() + { + return $this->readOneof(5); + } + + public function hasDockerBuild() + { + return $this->hasOneof(5); + } + + /** + * Build the source using Docker. This means the source has a Dockerfile. + * + * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.DockerBuild docker_build = 5; + * @param \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild $var + * @return $this + */ + public function setDockerBuild($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Optional. The service account to use for the build. If not set, the default + * Cloud Build service account for the project will be used. + * + * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Optional. The service account to use for the build. If not set, the default + * Cloud Build service account for the project will be used. + * + * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Optional. Name of the Cloud Build Custom Worker Pool that should be used to + * build the function. The format of this field is + * `projects/{project}/locations/{region}/workerPools/{workerPool}` where + * `{project}` and `{region}` are the project id and region respectively where + * the worker pool is defined and `{workerPool}` is the short name of the + * worker pool. + * + * Generated from protobuf field string worker_pool = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getWorkerPool() + { + return $this->worker_pool; + } + + /** + * Optional. Name of the Cloud Build Custom Worker Pool that should be used to + * build the function. The format of this field is + * `projects/{project}/locations/{region}/workerPools/{workerPool}` where + * `{project}` and `{region}` are the project id and region respectively where + * the worker pool is defined and `{workerPool}` is the short name of the + * worker pool. + * + * Generated from protobuf field string worker_pool = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setWorkerPool($var) + { + GPBUtil::checkString($var, True); + $this->worker_pool = $var; + + return $this; + } + + /** + * Optional. Additional tags to annotate the build. + * + * Generated from protobuf field repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTags() + { + return $this->tags; + } + + /** + * Optional. Additional tags to annotate the build. + * + * Generated from protobuf field repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tags = $arr; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + + /** + * @return string + */ + public function getBuildType() + { + return $this->whichOneof("build_type"); + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/BuildpacksBuild.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/BuildpacksBuild.php new file mode 100644 index 000000000000..7cedb432a08a --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/BuildpacksBuild.php @@ -0,0 +1,273 @@ +google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + */ +class BuildpacksBuild extends \Google\Protobuf\Internal\Message +{ + /** + * The runtime name, e.g. 'go113'. Leave blank for generic builds. + * + * Generated from protobuf field string runtime = 1 [deprecated = true]; + * @deprecated + */ + protected $runtime = ''; + /** + * Optional. Name of the function target if the source is a function source. + * Required for function builds. + * + * Generated from protobuf field string function_target = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $function_target = ''; + /** + * Optional. cache_image_uri is the GCR/AR URL where the cache image will be + * stored. cache_image_uri is optional and omitting it will disable caching. + * This URL must be stable across builds. It is used to derive a + * build-specific temporary URL by substituting the tag with the build ID. + * The build will clean up the temporary image on a best-effort basis. + * + * Generated from protobuf field string cache_image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $cache_image_uri = ''; + /** + * Optional. The base image used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $base_image = ''; + /** + * Optional. User-provided build-time environment variables. + * + * Generated from protobuf field map environment_variables = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $environment_variables; + /** + * Optional. Whether or not the application container will be enrolled in + * automatic base image updates. When true, the application will be built on + * a scratch base image, so the base layers can be appended at run time. + * + * Generated from protobuf field bool enable_automatic_updates = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_automatic_updates = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $runtime + * The runtime name, e.g. 'go113'. Leave blank for generic builds. + * @type string $function_target + * Optional. Name of the function target if the source is a function source. + * Required for function builds. + * @type string $cache_image_uri + * Optional. cache_image_uri is the GCR/AR URL where the cache image will be + * stored. cache_image_uri is optional and omitting it will disable caching. + * This URL must be stable across builds. It is used to derive a + * build-specific temporary URL by substituting the tag with the build ID. + * The build will clean up the temporary image on a best-effort basis. + * @type string $base_image + * Optional. The base image used to opt into automatic base image updates. + * @type array|\Google\Protobuf\Internal\MapField $environment_variables + * Optional. User-provided build-time environment variables. + * @type bool $enable_automatic_updates + * Optional. Whether or not the application container will be enrolled in + * automatic base image updates. When true, the application will be built on + * a scratch base image, so the base layers can be appended at run time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + + /** + * The runtime name, e.g. 'go113'. Leave blank for generic builds. + * + * Generated from protobuf field string runtime = 1 [deprecated = true]; + * @return string + * @deprecated + */ + public function getRuntime() + { + @trigger_error('runtime is deprecated.', E_USER_DEPRECATED); + return $this->runtime; + } + + /** + * The runtime name, e.g. 'go113'. Leave blank for generic builds. + * + * Generated from protobuf field string runtime = 1 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setRuntime($var) + { + @trigger_error('runtime is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->runtime = $var; + + return $this; + } + + /** + * Optional. Name of the function target if the source is a function source. + * Required for function builds. + * + * Generated from protobuf field string function_target = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFunctionTarget() + { + return $this->function_target; + } + + /** + * Optional. Name of the function target if the source is a function source. + * Required for function builds. + * + * Generated from protobuf field string function_target = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFunctionTarget($var) + { + GPBUtil::checkString($var, True); + $this->function_target = $var; + + return $this; + } + + /** + * Optional. cache_image_uri is the GCR/AR URL where the cache image will be + * stored. cache_image_uri is optional and omitting it will disable caching. + * This URL must be stable across builds. It is used to derive a + * build-specific temporary URL by substituting the tag with the build ID. + * The build will clean up the temporary image on a best-effort basis. + * + * Generated from protobuf field string cache_image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCacheImageUri() + { + return $this->cache_image_uri; + } + + /** + * Optional. cache_image_uri is the GCR/AR URL where the cache image will be + * stored. cache_image_uri is optional and omitting it will disable caching. + * This URL must be stable across builds. It is used to derive a + * build-specific temporary URL by substituting the tag with the build ID. + * The build will clean up the temporary image on a best-effort basis. + * + * Generated from protobuf field string cache_image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCacheImageUri($var) + { + GPBUtil::checkString($var, True); + $this->cache_image_uri = $var; + + return $this; + } + + /** + * Optional. The base image used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getBaseImage() + { + return $this->base_image; + } + + /** + * Optional. The base image used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setBaseImage($var) + { + GPBUtil::checkString($var, True); + $this->base_image = $var; + + return $this; + } + + /** + * Optional. User-provided build-time environment variables. + * + * Generated from protobuf field map environment_variables = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getEnvironmentVariables() + { + return $this->environment_variables; + } + + /** + * Optional. User-provided build-time environment variables. + * + * Generated from protobuf field map environment_variables = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setEnvironmentVariables($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->environment_variables = $arr; + + return $this; + } + + /** + * Optional. Whether or not the application container will be enrolled in + * automatic base image updates. When true, the application will be built on + * a scratch base image, so the base layers can be appended at run time. + * + * Generated from protobuf field bool enable_automatic_updates = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableAutomaticUpdates() + { + return $this->enable_automatic_updates; + } + + /** + * Optional. Whether or not the application container will be enrolled in + * automatic base image updates. When true, the application will be built on + * a scratch base image, so the base layers can be appended at run time. + * + * Generated from protobuf field bool enable_automatic_updates = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableAutomaticUpdates($var) + { + GPBUtil::checkBool($var); + $this->enable_automatic_updates = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BuildpacksBuild::class, \Google\Cloud\Run\V2\SubmitBuildRequest_BuildpacksBuild::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/DockerBuild.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/DockerBuild.php new file mode 100644 index 000000000000..9089c3fd5f03 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildRequest/DockerBuild.php @@ -0,0 +1,36 @@ +google.cloud.run.v2.SubmitBuildRequest.DockerBuild + */ +class DockerBuild extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DockerBuild::class, \Google\Cloud\Run\V2\SubmitBuildRequest_DockerBuild::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildResponse.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildResponse.php new file mode 100644 index 000000000000..42440dbfebd4 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/SubmitBuildResponse.php @@ -0,0 +1,149 @@ +google.cloud.run.v2.SubmitBuildResponse + */ +class SubmitBuildResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Cloud Build operation to be polled via CloudBuild API. + * + * Generated from protobuf field .google.longrunning.Operation build_operation = 1; + */ + protected $build_operation = null; + /** + * URI of the base builder image in Artifact Registry being used in the build. + * Used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image_uri = 2; + */ + protected $base_image_uri = ''; + /** + * Warning message for the base image. + * + * Generated from protobuf field string base_image_warning = 3; + */ + protected $base_image_warning = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\LongRunning\Operation $build_operation + * Cloud Build operation to be polled via CloudBuild API. + * @type string $base_image_uri + * URI of the base builder image in Artifact Registry being used in the build. + * Used to opt into automatic base image updates. + * @type string $base_image_warning + * Warning message for the base image. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + + /** + * Cloud Build operation to be polled via CloudBuild API. + * + * Generated from protobuf field .google.longrunning.Operation build_operation = 1; + * @return \Google\LongRunning\Operation|null + */ + public function getBuildOperation() + { + return $this->build_operation; + } + + public function hasBuildOperation() + { + return isset($this->build_operation); + } + + public function clearBuildOperation() + { + unset($this->build_operation); + } + + /** + * Cloud Build operation to be polled via CloudBuild API. + * + * Generated from protobuf field .google.longrunning.Operation build_operation = 1; + * @param \Google\LongRunning\Operation $var + * @return $this + */ + public function setBuildOperation($var) + { + GPBUtil::checkMessage($var, \Google\LongRunning\Operation::class); + $this->build_operation = $var; + + return $this; + } + + /** + * URI of the base builder image in Artifact Registry being used in the build. + * Used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image_uri = 2; + * @return string + */ + public function getBaseImageUri() + { + return $this->base_image_uri; + } + + /** + * URI of the base builder image in Artifact Registry being used in the build. + * Used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image_uri = 2; + * @param string $var + * @return $this + */ + public function setBaseImageUri($var) + { + GPBUtil::checkString($var, True); + $this->base_image_uri = $var; + + return $this; + } + + /** + * Warning message for the base image. + * + * Generated from protobuf field string base_image_warning = 3; + * @return string + */ + public function getBaseImageWarning() + { + return $this->base_image_warning; + } + + /** + * Warning message for the base image. + * + * Generated from protobuf field string base_image_warning = 3; + * @param string $var + * @return $this + */ + public function setBaseImageWarning($var) + { + GPBUtil::checkString($var, True); + $this->base_image_warning = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TCPSocketAction.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TCPSocketAction.php new file mode 100644 index 000000000000..52828310dc64 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TCPSocketAction.php @@ -0,0 +1,75 @@ +google.cloud.run.v2.TCPSocketAction + */ +class TCPSocketAction extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Port number to access on the container. Must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * + * Generated from protobuf field int32 port = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $port = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $port + * Optional. Port number to access on the container. Must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Port number to access on the container. Must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * + * Generated from protobuf field int32 port = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPort() + { + return $this->port; + } + + /** + * Optional. Port number to access on the container. Must be in the range 1 to + * 65535. If not specified, defaults to the exposed port of the container, + * which is the value of container.ports[0].containerPort. + * + * Generated from protobuf field int32 port = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Task.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Task.php new file mode 100644 index 000000000000..6fe2768394c2 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Task.php @@ -0,0 +1,1339 @@ +google.cloud.run.v2.Task + */ +class Task extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique name of this Task. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. Server assigned unique identifier for the Task. The value is a + * UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $generation = 0; + /** + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $labels; + /** + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $annotations; + /** + * Output only. Represents time when the task was created by the system. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Represents time when the task was scheduled to run by the + * system. It is not guaranteed to be set in happens-before order across + * separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp scheduled_time = 34 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $scheduled_time = null; + /** + * Output only. Represents time when the task started to run. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + /** + * Output only. Represents time when the Task was completed. It is not + * guaranteed to be set in happens-before order across separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp completion_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $completion_time = null; + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_time = null; + /** + * Output only. The name of the parent Job. + * + * Generated from protobuf field string job = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $job = ''; + /** + * Output only. The name of the parent Execution. + * + * Generated from protobuf field string execution = 13 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $execution = ''; + /** + * Holds the single container that defines the unit of execution for this + * task. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 14; + */ + private $containers; + /** + * A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 15; + */ + private $volumes; + /** + * Number of retries allowed per Task, before marking this Task failed. + * + * Generated from protobuf field int32 max_retries = 16; + */ + protected $max_retries = 0; + /** + * Max allowed time duration the Task may be active before the system will + * actively try to mark it failed and kill associated containers. This applies + * per attempt of a task, meaning each retry can run for the full timeout. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 17; + */ + protected $timeout = null; + /** + * Email address of the IAM service account associated with the Task of a + * Job. The service account represents the identity of the + * running task, and determines what permissions the task has. If + * not provided, the task will use the project's default service account. + * + * Generated from protobuf field string service_account = 18; + */ + protected $service_account = ''; + /** + * The execution environment being used to host this Task. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 20; + */ + protected $execution_environment = 0; + /** + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Job.reconciling` for additional information on + * reconciliation process in Cloud Run. + * + * Generated from protobuf field bool reconciling = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Output only. The Condition of this Task, containing its readiness status, + * and detailed error information in case it did not reach the desired state. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $conditions; + /** + * Output only. The generation of this Task. See comments in `Job.reconciling` + * for additional information on reconciliation process in Cloud Run. + * + * Generated from protobuf field int64 observed_generation = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $observed_generation = 0; + /** + * Output only. Index of the Task, unique per execution, and beginning at 0. + * + * Generated from protobuf field int32 index = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $index = 0; + /** + * Output only. The number of times this Task was retried. + * Tasks are retried when they fail up to the maxRetries limit. + * + * Generated from protobuf field int32 retried = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $retried = 0; + /** + * Output only. Result of the last attempt of this Task. + * + * Generated from protobuf field .google.cloud.run.v2.TaskAttemptResult last_attempt_result = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_attempt_result = null; + /** + * Output only. A reference to a customer managed encryption key (CMEK) to use + * to encrypt this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 28 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $encryption_key = ''; + /** + * Output only. VPC Access configuration to use for this Task. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 29 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $vpc_access = null; + /** + * Output only. URI where logs for this execution can be found in Cloud + * Console. + * + * Generated from protobuf field string log_uri = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $log_uri = ''; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzs = false; + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The unique name of this Task. + * @type string $uid + * Output only. Server assigned unique identifier for the Task. The value is a + * UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * @type int|string $generation + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Represents time when the task was created by the system. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * @type \Google\Protobuf\Timestamp $scheduled_time + * Output only. Represents time when the task was scheduled to run by the + * system. It is not guaranteed to be set in happens-before order across + * separate operations. + * @type \Google\Protobuf\Timestamp $start_time + * Output only. Represents time when the task started to run. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * @type \Google\Protobuf\Timestamp $completion_time + * Output only. Represents time when the Task was completed. It is not + * guaranteed to be set in happens-before order across separate operations. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last-modified time. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * @type string $job + * Output only. The name of the parent Job. + * @type string $execution + * Output only. The name of the parent Execution. + * @type array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $containers + * Holds the single container that defines the unit of execution for this + * task. + * @type array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes + * A list of Volumes to make available to containers. + * @type int $max_retries + * Number of retries allowed per Task, before marking this Task failed. + * @type \Google\Protobuf\Duration $timeout + * Max allowed time duration the Task may be active before the system will + * actively try to mark it failed and kill associated containers. This applies + * per attempt of a task, meaning each retry can run for the full timeout. + * @type string $service_account + * Email address of the IAM service account associated with the Task of a + * Job. The service account represents the identity of the + * running task, and determines what permissions the task has. If + * not provided, the task will use the project's default service account. + * @type int $execution_environment + * The execution environment being used to host this Task. + * @type bool $reconciling + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Job.reconciling` for additional information on + * reconciliation process in Cloud Run. + * @type array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $conditions + * Output only. The Condition of this Task, containing its readiness status, + * and detailed error information in case it did not reach the desired state. + * @type int|string $observed_generation + * Output only. The generation of this Task. See comments in `Job.reconciling` + * for additional information on reconciliation process in Cloud Run. + * @type int $index + * Output only. Index of the Task, unique per execution, and beginning at 0. + * @type int $retried + * Output only. The number of times this Task was retried. + * Tasks are retried when they fail up to the maxRetries limit. + * @type \Google\Cloud\Run\V2\TaskAttemptResult $last_attempt_result + * Output only. Result of the last attempt of this Task. + * @type string $encryption_key + * Output only. A reference to a customer managed encryption key (CMEK) to use + * to encrypt this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * @type \Google\Cloud\Run\V2\VpcAccess $vpc_access + * Output only. VPC Access configuration to use for this Task. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * @type string $log_uri + * Output only. URI where logs for this execution can be found in Cloud + * Console. + * @type bool $satisfies_pzs + * Output only. Reserved for future use. + * @type string $etag + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Task::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique name of this Task. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The unique name of this Task. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Server assigned unique identifier for the Task. The value is a + * UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Server assigned unique identifier for the Task. The value is a + * UUID4 string and guaranteed to remain unchanged until the resource is + * deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getGeneration() + { + return $this->generation; + } + + /** + * Output only. A number that monotonically increases every time the user + * modifies the desired state. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setGeneration($var) + { + GPBUtil::checkInt64($var); + $this->generation = $var; + + return $this; + } + + /** + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Output only. Unstructured key value map that can be used to organize and + * categorize objects. User-provided labels are shared with Google's billing + * system, so they can be used to filter, or break down billing charges by + * team, component, environment, state, etc. For more information, visit + * https://cloud.google.com/resource-manager/docs/creating-managing-labels or + * https://cloud.google.com/run/docs/configuring/labels + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Output only. Unstructured key value map that may + * be set by external tools to store and arbitrary metadata. + * They are not queryable and should be preserved + * when modifying objects. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. Represents time when the task was created by the system. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Represents time when the task was created by the system. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Represents time when the task was scheduled to run by the + * system. It is not guaranteed to be set in happens-before order across + * separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp scheduled_time = 34 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getScheduledTime() + { + return $this->scheduled_time; + } + + public function hasScheduledTime() + { + return isset($this->scheduled_time); + } + + public function clearScheduledTime() + { + unset($this->scheduled_time); + } + + /** + * Output only. Represents time when the task was scheduled to run by the + * system. It is not guaranteed to be set in happens-before order across + * separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp scheduled_time = 34 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setScheduledTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->scheduled_time = $var; + + return $this; + } + + /** + * Output only. Represents time when the task started to run. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. Represents time when the task started to run. + * It is not guaranteed to be set in happens-before order across separate + * operations. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. Represents time when the Task was completed. It is not + * guaranteed to be set in happens-before order across separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp completion_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCompletionTime() + { + return $this->completion_time; + } + + public function hasCompletionTime() + { + return isset($this->completion_time); + } + + public function clearCompletionTime() + { + unset($this->completion_time); + } + + /** + * Output only. Represents time when the Task was completed. It is not + * guaranteed to be set in happens-before order across separate operations. + * + * Generated from protobuf field .google.protobuf.Timestamp completion_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCompletionTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->completion_time = $var; + + return $this; + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. For a deleted resource, the deletion time. It is only + * populated as a response to a Delete request. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. For a deleted resource, the time after which it will be + * permamently deleted. It is only populated as a response to a Delete + * request. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * Output only. The name of the parent Job. + * + * Generated from protobuf field string job = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getJob() + { + return $this->job; + } + + /** + * Output only. The name of the parent Job. + * + * Generated from protobuf field string job = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setJob($var) + { + GPBUtil::checkString($var, True); + $this->job = $var; + + return $this; + } + + /** + * Output only. The name of the parent Execution. + * + * Generated from protobuf field string execution = 13 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getExecution() + { + return $this->execution; + } + + /** + * Output only. The name of the parent Execution. + * + * Generated from protobuf field string execution = 13 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setExecution($var) + { + GPBUtil::checkString($var, True); + $this->execution = $var; + + return $this; + } + + /** + * Holds the single container that defines the unit of execution for this + * task. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 14; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContainers() + { + return $this->containers; + } + + /** + * Holds the single container that defines the unit of execution for this + * task. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 14; + * @param array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContainers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Container::class); + $this->containers = $arr; + + return $this; + } + + /** + * A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 15; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumes() + { + return $this->volumes; + } + + /** + * A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 15; + * @param array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Volume::class); + $this->volumes = $arr; + + return $this; + } + + /** + * Number of retries allowed per Task, before marking this Task failed. + * + * Generated from protobuf field int32 max_retries = 16; + * @return int + */ + public function getMaxRetries() + { + return $this->max_retries; + } + + /** + * Number of retries allowed per Task, before marking this Task failed. + * + * Generated from protobuf field int32 max_retries = 16; + * @param int $var + * @return $this + */ + public function setMaxRetries($var) + { + GPBUtil::checkInt32($var); + $this->max_retries = $var; + + return $this; + } + + /** + * Max allowed time duration the Task may be active before the system will + * actively try to mark it failed and kill associated containers. This applies + * per attempt of a task, meaning each retry can run for the full timeout. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 17; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * Max allowed time duration the Task may be active before the system will + * actively try to mark it failed and kill associated containers. This applies + * per attempt of a task, meaning each retry can run for the full timeout. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 17; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + + /** + * Email address of the IAM service account associated with the Task of a + * Job. The service account represents the identity of the + * running task, and determines what permissions the task has. If + * not provided, the task will use the project's default service account. + * + * Generated from protobuf field string service_account = 18; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Email address of the IAM service account associated with the Task of a + * Job. The service account represents the identity of the + * running task, and determines what permissions the task has. If + * not provided, the task will use the project's default service account. + * + * Generated from protobuf field string service_account = 18; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * The execution environment being used to host this Task. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 20; + * @return int + */ + public function getExecutionEnvironment() + { + return $this->execution_environment; + } + + /** + * The execution environment being used to host this Task. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 20; + * @param int $var + * @return $this + */ + public function setExecutionEnvironment($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ExecutionEnvironment::class); + $this->execution_environment = $var; + + return $this; + } + + /** + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Job.reconciling` for additional information on + * reconciliation process in Cloud Run. + * + * Generated from protobuf field bool reconciling = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Indicates whether the resource's reconciliation is still in + * progress. See comments in `Job.reconciling` for additional information on + * reconciliation process in Cloud Run. + * + * Generated from protobuf field bool reconciling = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Output only. The Condition of this Task, containing its readiness status, + * and detailed error information in case it did not reach the desired state. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConditions() + { + return $this->conditions; + } + + /** + * Output only. The Condition of this Task, containing its readiness status, + * and detailed error information in case it did not reach the desired state. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Condition conditions = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Run\V2\Condition>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConditions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Condition::class); + $this->conditions = $arr; + + return $this; + } + + /** + * Output only. The generation of this Task. See comments in `Job.reconciling` + * for additional information on reconciliation process in Cloud Run. + * + * Generated from protobuf field int64 observed_generation = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getObservedGeneration() + { + return $this->observed_generation; + } + + /** + * Output only. The generation of this Task. See comments in `Job.reconciling` + * for additional information on reconciliation process in Cloud Run. + * + * Generated from protobuf field int64 observed_generation = 23 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setObservedGeneration($var) + { + GPBUtil::checkInt64($var); + $this->observed_generation = $var; + + return $this; + } + + /** + * Output only. Index of the Task, unique per execution, and beginning at 0. + * + * Generated from protobuf field int32 index = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getIndex() + { + return $this->index; + } + + /** + * Output only. Index of the Task, unique per execution, and beginning at 0. + * + * Generated from protobuf field int32 index = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkInt32($var); + $this->index = $var; + + return $this; + } + + /** + * Output only. The number of times this Task was retried. + * Tasks are retried when they fail up to the maxRetries limit. + * + * Generated from protobuf field int32 retried = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getRetried() + { + return $this->retried; + } + + /** + * Output only. The number of times this Task was retried. + * Tasks are retried when they fail up to the maxRetries limit. + * + * Generated from protobuf field int32 retried = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setRetried($var) + { + GPBUtil::checkInt32($var); + $this->retried = $var; + + return $this; + } + + /** + * Output only. Result of the last attempt of this Task. + * + * Generated from protobuf field .google.cloud.run.v2.TaskAttemptResult last_attempt_result = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Run\V2\TaskAttemptResult|null + */ + public function getLastAttemptResult() + { + return $this->last_attempt_result; + } + + public function hasLastAttemptResult() + { + return isset($this->last_attempt_result); + } + + public function clearLastAttemptResult() + { + unset($this->last_attempt_result); + } + + /** + * Output only. Result of the last attempt of this Task. + * + * Generated from protobuf field .google.cloud.run.v2.TaskAttemptResult last_attempt_result = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Run\V2\TaskAttemptResult $var + * @return $this + */ + public function setLastAttemptResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\TaskAttemptResult::class); + $this->last_attempt_result = $var; + + return $this; + } + + /** + * Output only. A reference to a customer managed encryption key (CMEK) to use + * to encrypt this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 28 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getEncryptionKey() + { + return $this->encryption_key; + } + + /** + * Output only. A reference to a customer managed encryption key (CMEK) to use + * to encrypt this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 28 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setEncryptionKey($var) + { + GPBUtil::checkString($var, True); + $this->encryption_key = $var; + + return $this; + } + + /** + * Output only. VPC Access configuration to use for this Task. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 29 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Run\V2\VpcAccess|null + */ + public function getVpcAccess() + { + return $this->vpc_access; + } + + public function hasVpcAccess() + { + return isset($this->vpc_access); + } + + public function clearVpcAccess() + { + unset($this->vpc_access); + } + + /** + * Output only. VPC Access configuration to use for this Task. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 29 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Run\V2\VpcAccess $var + * @return $this + */ + public function setVpcAccess($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\VpcAccess::class); + $this->vpc_access = $var; + + return $this; + } + + /** + * Output only. URI where logs for this execution can be found in Cloud + * Console. + * + * Generated from protobuf field string log_uri = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLogUri() + { + return $this->log_uri; + } + + /** + * Output only. URI where logs for this execution can be found in Cloud + * Console. + * + * Generated from protobuf field string log_uri = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLogUri($var) + { + GPBUtil::checkString($var, True); + $this->log_uri = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzs() + { + return $this->satisfies_pzs; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field bool satisfies_pzs = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Output only. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskAttemptResult.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskAttemptResult.php new file mode 100644 index 000000000000..26a5923b91a0 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskAttemptResult.php @@ -0,0 +1,127 @@ +google.cloud.run.v2.TaskAttemptResult + */ +class TaskAttemptResult extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The status of this attempt. + * If the status code is OK, then the attempt succeeded. + * + * Generated from protobuf field .google.rpc.Status status = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status = null; + /** + * Output only. The exit code of this attempt. + * This may be unset if the container was unable to exit cleanly with a code + * due to some other failure. + * See status field for possible failure details. + * + * Generated from protobuf field int32 exit_code = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $exit_code = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Rpc\Status $status + * Output only. The status of this attempt. + * If the status code is OK, then the attempt succeeded. + * @type int $exit_code + * Output only. The exit code of this attempt. + * This may be unset if the container was unable to exit cleanly with a code + * due to some other failure. + * See status field for possible failure details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Task::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The status of this attempt. + * If the status code is OK, then the attempt succeeded. + * + * Generated from protobuf field .google.rpc.Status status = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Rpc\Status|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * Output only. The status of this attempt. + * If the status code is OK, then the attempt succeeded. + * + * Generated from protobuf field .google.rpc.Status status = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->status = $var; + + return $this; + } + + /** + * Output only. The exit code of this attempt. + * This may be unset if the container was unable to exit cleanly with a code + * due to some other failure. + * See status field for possible failure details. + * + * Generated from protobuf field int32 exit_code = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getExitCode() + { + return $this->exit_code; + } + + /** + * Output only. The exit code of this attempt. + * This may be unset if the container was unable to exit cleanly with a code + * due to some other failure. + * See status field for possible failure details. + * + * Generated from protobuf field int32 exit_code = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setExitCode($var) + { + GPBUtil::checkInt32($var); + $this->exit_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskTemplate.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskTemplate.php new file mode 100644 index 000000000000..900f4f9ed2be --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TaskTemplate.php @@ -0,0 +1,381 @@ +google.cloud.run.v2.TaskTemplate + */ +class TaskTemplate extends \Google\Protobuf\Internal\Message +{ + /** + * Holds the single container that defines the unit of execution for this + * task. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 1; + */ + private $containers; + /** + * Optional. A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $volumes; + /** + * Optional. Max allowed time duration the Task may be active before the + * system will actively try to mark it failed and kill associated containers. + * This applies per attempt of a task, meaning each retry can run for the full + * timeout. Defaults to 600 seconds. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $timeout = null; + /** + * Optional. Email address of the IAM service account associated with the Task + * of a Job. The service account represents the identity of the running task, + * and determines what permissions the task has. If not provided, the task + * will use the project's default service account. + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_account = ''; + /** + * Optional. The execution environment being used to host this Task. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $execution_environment = 0; + /** + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 7 [(.google.api.resource_reference) = { + */ + protected $encryption_key = ''; + /** + * Optional. VPC Access configuration to use for this Task. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $vpc_access = null; + protected $retries; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $containers + * Holds the single container that defines the unit of execution for this + * task. + * @type array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes + * Optional. A list of Volumes to make available to containers. + * @type int $max_retries + * Number of retries allowed per Task, before marking this Task failed. + * Defaults to 3. + * @type \Google\Protobuf\Duration $timeout + * Optional. Max allowed time duration the Task may be active before the + * system will actively try to mark it failed and kill associated containers. + * This applies per attempt of a task, meaning each retry can run for the full + * timeout. Defaults to 600 seconds. + * @type string $service_account + * Optional. Email address of the IAM service account associated with the Task + * of a Job. The service account represents the identity of the running task, + * and determines what permissions the task has. If not provided, the task + * will use the project's default service account. + * @type int $execution_environment + * Optional. The execution environment being used to host this Task. + * @type string $encryption_key + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * @type \Google\Cloud\Run\V2\VpcAccess $vpc_access + * Optional. VPC Access configuration to use for this Task. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\TaskTemplate::initOnce(); + parent::__construct($data); + } + + /** + * Holds the single container that defines the unit of execution for this + * task. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContainers() + { + return $this->containers; + } + + /** + * Holds the single container that defines the unit of execution for this + * task. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Container containers = 1; + * @param array<\Google\Cloud\Run\V2\Container>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContainers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Container::class); + $this->containers = $arr; + + return $this; + } + + /** + * Optional. A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumes() + { + return $this->volumes; + } + + /** + * Optional. A list of Volumes to make available to containers. + * + * Generated from protobuf field repeated .google.cloud.run.v2.Volume volumes = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Run\V2\Volume>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\Volume::class); + $this->volumes = $arr; + + return $this; + } + + /** + * Number of retries allowed per Task, before marking this Task failed. + * Defaults to 3. + * + * Generated from protobuf field int32 max_retries = 3; + * @return int + */ + public function getMaxRetries() + { + return $this->readOneof(3); + } + + public function hasMaxRetries() + { + return $this->hasOneof(3); + } + + /** + * Number of retries allowed per Task, before marking this Task failed. + * Defaults to 3. + * + * Generated from protobuf field int32 max_retries = 3; + * @param int $var + * @return $this + */ + public function setMaxRetries($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. Max allowed time duration the Task may be active before the + * system will actively try to mark it failed and kill associated containers. + * This applies per attempt of a task, meaning each retry can run for the full + * timeout. Defaults to 600 seconds. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * Optional. Max allowed time duration the Task may be active before the + * system will actively try to mark it failed and kill associated containers. + * This applies per attempt of a task, meaning each retry can run for the full + * timeout. Defaults to 600 seconds. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + + /** + * Optional. Email address of the IAM service account associated with the Task + * of a Job. The service account represents the identity of the running task, + * and determines what permissions the task has. If not provided, the task + * will use the project's default service account. + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Optional. Email address of the IAM service account associated with the Task + * of a Job. The service account represents the identity of the running task, + * and determines what permissions the task has. If not provided, the task + * will use the project's default service account. + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Optional. The execution environment being used to host this Task. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getExecutionEnvironment() + { + return $this->execution_environment; + } + + /** + * Optional. The execution environment being used to host this Task. + * + * Generated from protobuf field .google.cloud.run.v2.ExecutionEnvironment execution_environment = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setExecutionEnvironment($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ExecutionEnvironment::class); + $this->execution_environment = $var; + + return $this; + } + + /** + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 7 [(.google.api.resource_reference) = { + * @return string + */ + public function getEncryptionKey() + { + return $this->encryption_key; + } + + /** + * A reference to a customer managed encryption key (CMEK) to use to encrypt + * this container image. For more information, go to + * https://cloud.google.com/run/docs/securing/using-cmek + * + * Generated from protobuf field string encryption_key = 7 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setEncryptionKey($var) + { + GPBUtil::checkString($var, True); + $this->encryption_key = $var; + + return $this; + } + + /** + * Optional. VPC Access configuration to use for this Task. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\VpcAccess|null + */ + public function getVpcAccess() + { + return $this->vpc_access; + } + + public function hasVpcAccess() + { + return isset($this->vpc_access); + } + + public function clearVpcAccess() + { + unset($this->vpc_access); + } + + /** + * Optional. VPC Access configuration to use for this Task. For more + * information, visit + * https://cloud.google.com/run/docs/configuring/connecting-vpc. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess vpc_access = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\VpcAccess $var + * @return $this + */ + public function setVpcAccess($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\VpcAccess::class); + $this->vpc_access = $var; + + return $this; + } + + /** + * @return string + */ + public function getRetries() + { + return $this->whichOneof("retries"); + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTarget.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTarget.php new file mode 100644 index 000000000000..b4264dd3a661 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTarget.php @@ -0,0 +1,182 @@ +google.cloud.run.v2.TrafficTarget + */ +class TrafficTarget extends \Google\Protobuf\Internal\Message +{ + /** + * The allocation type for this traffic target. + * + * Generated from protobuf field .google.cloud.run.v2.TrafficTargetAllocationType type = 1; + */ + protected $type = 0; + /** + * Revision to which to send this portion of traffic, if traffic allocation is + * by revision. + * + * Generated from protobuf field string revision = 2 [(.google.api.resource_reference) = { + */ + protected $revision = ''; + /** + * Specifies percent of the traffic to this Revision. + * This defaults to zero if unspecified. + * + * Generated from protobuf field int32 percent = 3; + */ + protected $percent = 0; + /** + * Indicates a string to be part of the URI to exclusively reference this + * target. + * + * Generated from protobuf field string tag = 4; + */ + protected $tag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * The allocation type for this traffic target. + * @type string $revision + * Revision to which to send this portion of traffic, if traffic allocation is + * by revision. + * @type int $percent + * Specifies percent of the traffic to this Revision. + * This defaults to zero if unspecified. + * @type string $tag + * Indicates a string to be part of the URI to exclusively reference this + * target. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\TrafficTarget::initOnce(); + parent::__construct($data); + } + + /** + * The allocation type for this traffic target. + * + * Generated from protobuf field .google.cloud.run.v2.TrafficTargetAllocationType type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The allocation type for this traffic target. + * + * Generated from protobuf field .google.cloud.run.v2.TrafficTargetAllocationType type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\TrafficTargetAllocationType::class); + $this->type = $var; + + return $this; + } + + /** + * Revision to which to send this portion of traffic, if traffic allocation is + * by revision. + * + * Generated from protobuf field string revision = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getRevision() + { + return $this->revision; + } + + /** + * Revision to which to send this portion of traffic, if traffic allocation is + * by revision. + * + * Generated from protobuf field string revision = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setRevision($var) + { + GPBUtil::checkString($var, True); + $this->revision = $var; + + return $this; + } + + /** + * Specifies percent of the traffic to this Revision. + * This defaults to zero if unspecified. + * + * Generated from protobuf field int32 percent = 3; + * @return int + */ + public function getPercent() + { + return $this->percent; + } + + /** + * Specifies percent of the traffic to this Revision. + * This defaults to zero if unspecified. + * + * Generated from protobuf field int32 percent = 3; + * @param int $var + * @return $this + */ + public function setPercent($var) + { + GPBUtil::checkInt32($var); + $this->percent = $var; + + return $this; + } + + /** + * Indicates a string to be part of the URI to exclusively reference this + * target. + * + * Generated from protobuf field string tag = 4; + * @return string + */ + public function getTag() + { + return $this->tag; + } + + /** + * Indicates a string to be part of the URI to exclusively reference this + * target. + * + * Generated from protobuf field string tag = 4; + * @param string $var + * @return $this + */ + public function setTag($var) + { + GPBUtil::checkString($var, True); + $this->tag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetAllocationType.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetAllocationType.php new file mode 100644 index 000000000000..f8b35045a421 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetAllocationType.php @@ -0,0 +1,61 @@ +google.cloud.run.v2.TrafficTargetAllocationType + */ +class TrafficTargetAllocationType +{ + /** + * Unspecified instance allocation type. + * + * Generated from protobuf enum TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED = 0; + */ + const TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED = 0; + /** + * Allocates instances to the Service's latest ready Revision. + * + * Generated from protobuf enum TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST = 1; + */ + const TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST = 1; + /** + * Allocates instances to a Revision by name. + * + * Generated from protobuf enum TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION = 2; + */ + const TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION = 2; + + private static $valueToName = [ + self::TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED => 'TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED', + self::TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST => 'TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST', + self::TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION => 'TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetStatus.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetStatus.php new file mode 100644 index 000000000000..b03251c15e89 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/TrafficTargetStatus.php @@ -0,0 +1,203 @@ +google.cloud.run.v2.TrafficTargetStatus + */ +class TrafficTargetStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The allocation type for this traffic target. + * + * Generated from protobuf field .google.cloud.run.v2.TrafficTargetAllocationType type = 1; + */ + protected $type = 0; + /** + * Revision to which this traffic is sent. + * + * Generated from protobuf field string revision = 2 [(.google.api.resource_reference) = { + */ + protected $revision = ''; + /** + * Specifies percent of the traffic to this Revision. + * + * Generated from protobuf field int32 percent = 3; + */ + protected $percent = 0; + /** + * Indicates the string used in the URI to exclusively reference this target. + * + * Generated from protobuf field string tag = 4; + */ + protected $tag = ''; + /** + * Displays the target URI. + * + * Generated from protobuf field string uri = 5; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * The allocation type for this traffic target. + * @type string $revision + * Revision to which this traffic is sent. + * @type int $percent + * Specifies percent of the traffic to this Revision. + * @type string $tag + * Indicates the string used in the URI to exclusively reference this target. + * @type string $uri + * Displays the target URI. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\TrafficTarget::initOnce(); + parent::__construct($data); + } + + /** + * The allocation type for this traffic target. + * + * Generated from protobuf field .google.cloud.run.v2.TrafficTargetAllocationType type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The allocation type for this traffic target. + * + * Generated from protobuf field .google.cloud.run.v2.TrafficTargetAllocationType type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\TrafficTargetAllocationType::class); + $this->type = $var; + + return $this; + } + + /** + * Revision to which this traffic is sent. + * + * Generated from protobuf field string revision = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getRevision() + { + return $this->revision; + } + + /** + * Revision to which this traffic is sent. + * + * Generated from protobuf field string revision = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setRevision($var) + { + GPBUtil::checkString($var, True); + $this->revision = $var; + + return $this; + } + + /** + * Specifies percent of the traffic to this Revision. + * + * Generated from protobuf field int32 percent = 3; + * @return int + */ + public function getPercent() + { + return $this->percent; + } + + /** + * Specifies percent of the traffic to this Revision. + * + * Generated from protobuf field int32 percent = 3; + * @param int $var + * @return $this + */ + public function setPercent($var) + { + GPBUtil::checkInt32($var); + $this->percent = $var; + + return $this; + } + + /** + * Indicates the string used in the URI to exclusively reference this target. + * + * Generated from protobuf field string tag = 4; + * @return string + */ + public function getTag() + { + return $this->tag; + } + + /** + * Indicates the string used in the URI to exclusively reference this target. + * + * Generated from protobuf field string tag = 4; + * @param string $var + * @return $this + */ + public function setTag($var) + { + GPBUtil::checkString($var, True); + $this->tag = $var; + + return $this; + } + + /** + * Displays the target URI. + * + * Generated from protobuf field string uri = 5; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Displays the target URI. + * + * Generated from protobuf field string uri = 5; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateJobRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateJobRequest.php new file mode 100644 index 000000000000..69d8b8afba13 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateJobRequest.php @@ -0,0 +1,170 @@ +google.cloud.run.v2.UpdateJobRequest + */ +class UpdateJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Job to be updated. + * + * Generated from protobuf field .google.cloud.run.v2.Job job = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $job = null; + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + * + * Generated from protobuf field bool validate_only = 3; + */ + protected $validate_only = false; + /** + * Optional. If set to true, and if the Job does not exist, it will create a + * new one. Caller must have both create and update permissions for this call + * if this is set to true. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * @param \Google\Cloud\Run\V2\Job $job Required. The Job to be updated. + * + * @return \Google\Cloud\Run\V2\UpdateJobRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Run\V2\Job $job): self + { + return (new self()) + ->setJob($job); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Run\V2\Job $job + * Required. The Job to be updated. + * @type bool $validate_only + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + * @type bool $allow_missing + * Optional. If set to true, and if the Job does not exist, it will create a + * new one. Caller must have both create and update permissions for this call + * if this is set to true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Job::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Job to be updated. + * + * Generated from protobuf field .google.cloud.run.v2.Job job = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Run\V2\Job|null + */ + public function getJob() + { + return $this->job; + } + + public function hasJob() + { + return isset($this->job); + } + + public function clearJob() + { + unset($this->job); + } + + /** + * Required. The Job to be updated. + * + * Generated from protobuf field .google.cloud.run.v2.Job job = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Run\V2\Job $var + * @return $this + */ + public function setJob($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Job::class); + $this->job = $var; + + return $this; + } + + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + * + * Generated from protobuf field bool validate_only = 3; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + * + * Generated from protobuf field bool validate_only = 3; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If set to true, and if the Job does not exist, it will create a + * new one. Caller must have both create and update permissions for this call + * if this is set to true. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, and if the Job does not exist, it will create a + * new one. Caller must have both create and update permissions for this call + * if this is set to true. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateServiceRequest.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateServiceRequest.php new file mode 100644 index 000000000000..0aa1548695fa --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/UpdateServiceRequest.php @@ -0,0 +1,229 @@ +google.cloud.run.v2.UpdateServiceRequest + */ +class UpdateServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. The Service to be updated. + * + * Generated from protobuf field .google.cloud.run.v2.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service = null; + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + * + * Generated from protobuf field bool validate_only = 3; + */ + protected $validate_only = false; + /** + * Optional. If set to true, and if the Service does not exist, it will create + * a new one. The caller must have 'run.services.create' permissions if this + * is set to true and the Service does not exist. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + + /** + * @param \Google\Cloud\Run\V2\Service $service Required. The Service to be updated. + * + * @return \Google\Cloud\Run\V2\UpdateServiceRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Run\V2\Service $service): self + { + return (new self()) + ->setService($service); + } + + /** + * @param \Google\Cloud\Run\V2\Service $service Required. The Service to be updated. + * @param \Google\Protobuf\FieldMask $updateMask Optional. The list of fields to be updated. + * + * @return \Google\Cloud\Run\V2\UpdateServiceRequest + * + * @experimental + */ + public static function buildFromServiceUpdateMask(\Google\Cloud\Run\V2\Service $service, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setService($service) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. The list of fields to be updated. + * @type \Google\Cloud\Run\V2\Service $service + * Required. The Service to be updated. + * @type bool $validate_only + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + * @type bool $allow_missing + * Optional. If set to true, and if the Service does not exist, it will create + * a new one. The caller must have 'run.services.create' permissions if this + * is set to true and the Service does not exist. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Service::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The Service to be updated. + * + * Generated from protobuf field .google.cloud.run.v2.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Run\V2\Service|null + */ + public function getService() + { + return $this->service; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * Required. The Service to be updated. + * + * Generated from protobuf field .google.cloud.run.v2.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Run\V2\Service $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\Service::class); + $this->service = $var; + + return $this; + } + + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + * + * Generated from protobuf field bool validate_only = 3; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + * + * Generated from protobuf field bool validate_only = 3; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If set to true, and if the Service does not exist, it will create + * a new one. The caller must have 'run.services.create' permissions if this + * is set to true and the Service does not exist. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, and if the Service does not exist, it will create + * a new one. The caller must have 'run.services.create' permissions if this + * is set to true and the Service does not exist. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VersionToPath.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VersionToPath.php new file mode 100644 index 000000000000..0bb46774d607 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VersionToPath.php @@ -0,0 +1,188 @@ +google.cloud.run.v2.VersionToPath + */ +class VersionToPath extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The relative path of the secret in the container. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $path = ''; + /** + * The Cloud Secret Manager secret version. + * Can be 'latest' for the latest value, or an integer or a secret alias for a + * specific version. + * + * Generated from protobuf field string version = 2; + */ + protected $version = ''; + /** + * Integer octal mode bits to use on this file, must be a value between + * 01 and 0777 (octal). If 0 or not set, the Volume's default mode will be + * used. + * Notes + * * Internally, a umask of 0222 will be applied to any non-zero value. + * * This is an integer representation of the mode bits. So, the octal + * integer value should look exactly as the chmod numeric notation with a + * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) + * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or + * 493 (base-10). + * * This might be in conflict with other options that affect the + * file mode, like fsGroup, and the result can be other mode bits set. + * + * Generated from protobuf field int32 mode = 3; + */ + protected $mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $path + * Required. The relative path of the secret in the container. + * @type string $version + * The Cloud Secret Manager secret version. + * Can be 'latest' for the latest value, or an integer or a secret alias for a + * specific version. + * @type int $mode + * Integer octal mode bits to use on this file, must be a value between + * 01 and 0777 (octal). If 0 or not set, the Volume's default mode will be + * used. + * Notes + * * Internally, a umask of 0222 will be applied to any non-zero value. + * * This is an integer representation of the mode bits. So, the octal + * integer value should look exactly as the chmod numeric notation with a + * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) + * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or + * 493 (base-10). + * * This might be in conflict with other options that affect the + * file mode, like fsGroup, and the result can be other mode bits set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The relative path of the secret in the container. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Required. The relative path of the secret in the container. + * + * Generated from protobuf field string path = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + + /** + * The Cloud Secret Manager secret version. + * Can be 'latest' for the latest value, or an integer or a secret alias for a + * specific version. + * + * Generated from protobuf field string version = 2; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * The Cloud Secret Manager secret version. + * Can be 'latest' for the latest value, or an integer or a secret alias for a + * specific version. + * + * Generated from protobuf field string version = 2; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * Integer octal mode bits to use on this file, must be a value between + * 01 and 0777 (octal). If 0 or not set, the Volume's default mode will be + * used. + * Notes + * * Internally, a umask of 0222 will be applied to any non-zero value. + * * This is an integer representation of the mode bits. So, the octal + * integer value should look exactly as the chmod numeric notation with a + * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) + * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or + * 493 (base-10). + * * This might be in conflict with other options that affect the + * file mode, like fsGroup, and the result can be other mode bits set. + * + * Generated from protobuf field int32 mode = 3; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * Integer octal mode bits to use on this file, must be a value between + * 01 and 0777 (octal). If 0 or not set, the Volume's default mode will be + * used. + * Notes + * * Internally, a umask of 0222 will be applied to any non-zero value. + * * This is an integer representation of the mode bits. So, the octal + * integer value should look exactly as the chmod numeric notation with a + * leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) + * or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or + * 493 (base-10). + * * This might be in conflict with other options that affect the + * file mode, like fsGroup, and the result can be other mode bits set. + * + * Generated from protobuf field int32 mode = 3; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkInt32($var); + $this->mode = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Volume.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Volume.php new file mode 100644 index 000000000000..0614cda4f015 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/Volume.php @@ -0,0 +1,247 @@ +google.cloud.run.v2.Volume + */ +class Volume extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Volume's name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + protected $volume_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Volume's name. + * @type \Google\Cloud\Run\V2\SecretVolumeSource $secret + * Secret represents a secret that should populate this volume. + * @type \Google\Cloud\Run\V2\CloudSqlInstance $cloud_sql_instance + * For Cloud SQL volumes, contains the specific instances that should be + * mounted. Visit https://cloud.google.com/sql/docs/mysql/connect-run for + * more information on how to connect Cloud SQL and Cloud Run. + * @type \Google\Cloud\Run\V2\EmptyDirVolumeSource $empty_dir + * Ephemeral storage used as a shared volume. + * @type \Google\Cloud\Run\V2\NFSVolumeSource $nfs + * For NFS Voumes, contains the path to the nfs Volume + * @type \Google\Cloud\Run\V2\GCSVolumeSource $gcs + * Persistent storage backed by a Google Cloud Storage bucket. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Required. Volume's name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Volume's name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Secret represents a secret that should populate this volume. + * + * Generated from protobuf field .google.cloud.run.v2.SecretVolumeSource secret = 2; + * @return \Google\Cloud\Run\V2\SecretVolumeSource|null + */ + public function getSecret() + { + return $this->readOneof(2); + } + + public function hasSecret() + { + return $this->hasOneof(2); + } + + /** + * Secret represents a secret that should populate this volume. + * + * Generated from protobuf field .google.cloud.run.v2.SecretVolumeSource secret = 2; + * @param \Google\Cloud\Run\V2\SecretVolumeSource $var + * @return $this + */ + public function setSecret($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\SecretVolumeSource::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * For Cloud SQL volumes, contains the specific instances that should be + * mounted. Visit https://cloud.google.com/sql/docs/mysql/connect-run for + * more information on how to connect Cloud SQL and Cloud Run. + * + * Generated from protobuf field .google.cloud.run.v2.CloudSqlInstance cloud_sql_instance = 3; + * @return \Google\Cloud\Run\V2\CloudSqlInstance|null + */ + public function getCloudSqlInstance() + { + return $this->readOneof(3); + } + + public function hasCloudSqlInstance() + { + return $this->hasOneof(3); + } + + /** + * For Cloud SQL volumes, contains the specific instances that should be + * mounted. Visit https://cloud.google.com/sql/docs/mysql/connect-run for + * more information on how to connect Cloud SQL and Cloud Run. + * + * Generated from protobuf field .google.cloud.run.v2.CloudSqlInstance cloud_sql_instance = 3; + * @param \Google\Cloud\Run\V2\CloudSqlInstance $var + * @return $this + */ + public function setCloudSqlInstance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\CloudSqlInstance::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Ephemeral storage used as a shared volume. + * + * Generated from protobuf field .google.cloud.run.v2.EmptyDirVolumeSource empty_dir = 4; + * @return \Google\Cloud\Run\V2\EmptyDirVolumeSource|null + */ + public function getEmptyDir() + { + return $this->readOneof(4); + } + + public function hasEmptyDir() + { + return $this->hasOneof(4); + } + + /** + * Ephemeral storage used as a shared volume. + * + * Generated from protobuf field .google.cloud.run.v2.EmptyDirVolumeSource empty_dir = 4; + * @param \Google\Cloud\Run\V2\EmptyDirVolumeSource $var + * @return $this + */ + public function setEmptyDir($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\EmptyDirVolumeSource::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * For NFS Voumes, contains the path to the nfs Volume + * + * Generated from protobuf field .google.cloud.run.v2.NFSVolumeSource nfs = 5; + * @return \Google\Cloud\Run\V2\NFSVolumeSource|null + */ + public function getNfs() + { + return $this->readOneof(5); + } + + public function hasNfs() + { + return $this->hasOneof(5); + } + + /** + * For NFS Voumes, contains the path to the nfs Volume + * + * Generated from protobuf field .google.cloud.run.v2.NFSVolumeSource nfs = 5; + * @param \Google\Cloud\Run\V2\NFSVolumeSource $var + * @return $this + */ + public function setNfs($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\NFSVolumeSource::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Persistent storage backed by a Google Cloud Storage bucket. + * + * Generated from protobuf field .google.cloud.run.v2.GCSVolumeSource gcs = 6; + * @return \Google\Cloud\Run\V2\GCSVolumeSource|null + */ + public function getGcs() + { + return $this->readOneof(6); + } + + public function hasGcs() + { + return $this->hasOneof(6); + } + + /** + * Persistent storage backed by a Google Cloud Storage bucket. + * + * Generated from protobuf field .google.cloud.run.v2.GCSVolumeSource gcs = 6; + * @param \Google\Cloud\Run\V2\GCSVolumeSource $var + * @return $this + */ + public function setGcs($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\GCSVolumeSource::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getVolumeType() + { + return $this->whichOneof("volume_type"); + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VolumeMount.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VolumeMount.php new file mode 100644 index 000000000000..979b27f20847 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VolumeMount.php @@ -0,0 +1,117 @@ +google.cloud.run.v2.VolumeMount + */ +class VolumeMount extends \Google\Protobuf\Internal\Message +{ + /** + * Required. This must match the Name of a Volume. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. Path within the container at which the volume should be mounted. + * Must not contain ':'. For Cloud SQL volumes, it can be left empty, or must + * otherwise be `/cloudsql`. All instances defined in the Volume will be + * available as `/cloudsql/[instance]`. For more information on Cloud SQL + * volumes, visit https://cloud.google.com/sql/docs/mysql/connect-run + * + * Generated from protobuf field string mount_path = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $mount_path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. This must match the Name of a Volume. + * @type string $mount_path + * Required. Path within the container at which the volume should be mounted. + * Must not contain ':'. For Cloud SQL volumes, it can be left empty, or must + * otherwise be `/cloudsql`. All instances defined in the Volume will be + * available as `/cloudsql/[instance]`. For more information on Cloud SQL + * volumes, visit https://cloud.google.com/sql/docs/mysql/connect-run + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\K8SMin::initOnce(); + parent::__construct($data); + } + + /** + * Required. This must match the Name of a Volume. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. This must match the Name of a Volume. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Path within the container at which the volume should be mounted. + * Must not contain ':'. For Cloud SQL volumes, it can be left empty, or must + * otherwise be `/cloudsql`. All instances defined in the Volume will be + * available as `/cloudsql/[instance]`. For more information on Cloud SQL + * volumes, visit https://cloud.google.com/sql/docs/mysql/connect-run + * + * Generated from protobuf field string mount_path = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getMountPath() + { + return $this->mount_path; + } + + /** + * Required. Path within the container at which the volume should be mounted. + * Must not contain ':'. For Cloud SQL volumes, it can be left empty, or must + * otherwise be `/cloudsql`. All instances defined in the Volume will be + * available as `/cloudsql/[instance]`. For more information on Cloud SQL + * volumes, visit https://cloud.google.com/sql/docs/mysql/connect-run + * + * Generated from protobuf field string mount_path = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setMountPath($var) + { + GPBUtil::checkString($var, True); + $this->mount_path = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess.php new file mode 100644 index 000000000000..2edc5d9e89bc --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess.php @@ -0,0 +1,160 @@ +google.cloud.run.v2.VpcAccess + */ +class VpcAccess extends \Google\Protobuf\Internal\Message +{ + /** + * VPC Access connector name. + * Format: `projects/{project}/locations/{location}/connectors/{connector}`, + * where `{project}` can be project id or number. + * For more information on sending traffic to a VPC network via a connector, + * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. + * + * Generated from protobuf field string connector = 1 [(.google.api.resource_reference) = { + */ + protected $connector = ''; + /** + * Optional. Traffic VPC egress settings. If not provided, it defaults to + * PRIVATE_RANGES_ONLY. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess.VpcEgress egress = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $egress = 0; + /** + * Optional. Direct VPC egress settings. Currently only single network + * interface is supported. + * + * Generated from protobuf field repeated .google.cloud.run.v2.VpcAccess.NetworkInterface network_interfaces = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $network_interfaces; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $connector + * VPC Access connector name. + * Format: `projects/{project}/locations/{location}/connectors/{connector}`, + * where `{project}` can be project id or number. + * For more information on sending traffic to a VPC network via a connector, + * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. + * @type int $egress + * Optional. Traffic VPC egress settings. If not provided, it defaults to + * PRIVATE_RANGES_ONLY. + * @type array<\Google\Cloud\Run\V2\VpcAccess\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $network_interfaces + * Optional. Direct VPC egress settings. Currently only single network + * interface is supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); + parent::__construct($data); + } + + /** + * VPC Access connector name. + * Format: `projects/{project}/locations/{location}/connectors/{connector}`, + * where `{project}` can be project id or number. + * For more information on sending traffic to a VPC network via a connector, + * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. + * + * Generated from protobuf field string connector = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getConnector() + { + return $this->connector; + } + + /** + * VPC Access connector name. + * Format: `projects/{project}/locations/{location}/connectors/{connector}`, + * where `{project}` can be project id or number. + * For more information on sending traffic to a VPC network via a connector, + * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. + * + * Generated from protobuf field string connector = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConnector($var) + { + GPBUtil::checkString($var, True); + $this->connector = $var; + + return $this; + } + + /** + * Optional. Traffic VPC egress settings. If not provided, it defaults to + * PRIVATE_RANGES_ONLY. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess.VpcEgress egress = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getEgress() + { + return $this->egress; + } + + /** + * Optional. Traffic VPC egress settings. If not provided, it defaults to + * PRIVATE_RANGES_ONLY. + * + * Generated from protobuf field .google.cloud.run.v2.VpcAccess.VpcEgress egress = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setEgress($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\VpcAccess\VpcEgress::class); + $this->egress = $var; + + return $this; + } + + /** + * Optional. Direct VPC egress settings. Currently only single network + * interface is supported. + * + * Generated from protobuf field repeated .google.cloud.run.v2.VpcAccess.NetworkInterface network_interfaces = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkInterfaces() + { + return $this->network_interfaces; + } + + /** + * Optional. Direct VPC egress settings. Currently only single network + * interface is supported. + * + * Generated from protobuf field repeated .google.cloud.run.v2.VpcAccess.NetworkInterface network_interfaces = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Run\V2\VpcAccess\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkInterfaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Run\V2\VpcAccess\NetworkInterface::class); + $this->network_interfaces = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/NetworkInterface.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/NetworkInterface.php new file mode 100644 index 000000000000..41428271a60d --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/NetworkInterface.php @@ -0,0 +1,170 @@ +google.cloud.run.v2.VpcAccess.NetworkInterface + */ +class NetworkInterface extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The VPC network that the Cloud Run resource will be able to + * send traffic to. At least one of network or subnetwork must be specified. + * If both network and subnetwork are specified, the given VPC subnetwork + * must belong to the given VPC network. If network is not specified, it + * will be looked up from the subnetwork. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $network = ''; + /** + * Optional. The VPC subnetwork that the Cloud Run resource will get IPs + * from. At least one of network or subnetwork must be specified. If both + * network and subnetwork are specified, the given VPC subnetwork must + * belong to the given VPC network. If subnetwork is not specified, the + * subnetwork with the same name with the network will be used. + * + * Generated from protobuf field string subnetwork = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subnetwork = ''; + /** + * Optional. Network tags applied to this Cloud Run resource. + * + * Generated from protobuf field repeated string tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $tags; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Optional. The VPC network that the Cloud Run resource will be able to + * send traffic to. At least one of network or subnetwork must be specified. + * If both network and subnetwork are specified, the given VPC subnetwork + * must belong to the given VPC network. If network is not specified, it + * will be looked up from the subnetwork. + * @type string $subnetwork + * Optional. The VPC subnetwork that the Cloud Run resource will get IPs + * from. At least one of network or subnetwork must be specified. If both + * network and subnetwork are specified, the given VPC subnetwork must + * belong to the given VPC network. If subnetwork is not specified, the + * subnetwork with the same name with the network will be used. + * @type array|\Google\Protobuf\Internal\RepeatedField $tags + * Optional. Network tags applied to this Cloud Run resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The VPC network that the Cloud Run resource will be able to + * send traffic to. At least one of network or subnetwork must be specified. + * If both network and subnetwork are specified, the given VPC subnetwork + * must belong to the given VPC network. If network is not specified, it + * will be looked up from the subnetwork. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Optional. The VPC network that the Cloud Run resource will be able to + * send traffic to. At least one of network or subnetwork must be specified. + * If both network and subnetwork are specified, the given VPC subnetwork + * must belong to the given VPC network. If network is not specified, it + * will be looked up from the subnetwork. + * + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Optional. The VPC subnetwork that the Cloud Run resource will get IPs + * from. At least one of network or subnetwork must be specified. If both + * network and subnetwork are specified, the given VPC subnetwork must + * belong to the given VPC network. If subnetwork is not specified, the + * subnetwork with the same name with the network will be used. + * + * Generated from protobuf field string subnetwork = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSubnetwork() + { + return $this->subnetwork; + } + + /** + * Optional. The VPC subnetwork that the Cloud Run resource will get IPs + * from. At least one of network or subnetwork must be specified. If both + * network and subnetwork are specified, the given VPC subnetwork must + * belong to the given VPC network. If subnetwork is not specified, the + * subnetwork with the same name with the network will be used. + * + * Generated from protobuf field string subnetwork = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + + /** + * Optional. Network tags applied to this Cloud Run resource. + * + * Generated from protobuf field repeated string tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTags() + { + return $this->tags; + } + + /** + * Optional. Network tags applied to this Cloud Run resource. + * + * Generated from protobuf field repeated string tags = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tags = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NetworkInterface::class, \Google\Cloud\Run\V2\VpcAccess_NetworkInterface::class); + diff --git a/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/VpcEgress.php b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/VpcEgress.php new file mode 100644 index 000000000000..b6178c267b92 --- /dev/null +++ b/owl-bot-staging/Run/v2/proto/src/Google/Cloud/Run/V2/VpcAccess/VpcEgress.php @@ -0,0 +1,64 @@ +google.cloud.run.v2.VpcAccess.VpcEgress + */ +class VpcEgress +{ + /** + * Unspecified + * + * Generated from protobuf enum VPC_EGRESS_UNSPECIFIED = 0; + */ + const VPC_EGRESS_UNSPECIFIED = 0; + /** + * All outbound traffic is routed through the VPC connector. + * + * Generated from protobuf enum ALL_TRAFFIC = 1; + */ + const ALL_TRAFFIC = 1; + /** + * Only private IP ranges are routed through the VPC connector. + * + * Generated from protobuf enum PRIVATE_RANGES_ONLY = 2; + */ + const PRIVATE_RANGES_ONLY = 2; + + private static $valueToName = [ + self::VPC_EGRESS_UNSPECIFIED => 'VPC_EGRESS_UNSPECIFIED', + self::ALL_TRAFFIC => 'ALL_TRAFFIC', + self::PRIVATE_RANGES_ONLY => 'PRIVATE_RANGES_ONLY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(VpcEgress::class, \Google\Cloud\Run\V2\VpcAccess_VpcEgress::class); + diff --git a/owl-bot-staging/Run/v2/samples/V2/BuildsClient/submit_build.php b/owl-bot-staging/Run/v2/samples/V2/BuildsClient/submit_build.php new file mode 100644 index 000000000000..efba13142139 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/BuildsClient/submit_build.php @@ -0,0 +1,94 @@ +setBucket($storageSourceBucket) + ->setObject($storageSourceObject); + $request = (new SubmitBuildRequest()) + ->setParent($parent) + ->setStorageSource($storageSource) + ->setImageUri($imageUri); + + // Call the API and handle any network failures. + try { + /** @var SubmitBuildResponse $response */ + $response = $buildsClient->submitBuild($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + $storageSourceBucket = '[BUCKET]'; + $storageSourceObject = '[OBJECT]'; + $imageUri = '[IMAGE_URI]'; + + submit_build_sample($parent, $storageSourceBucket, $storageSourceObject, $imageUri); +} +// [END run_v2_generated_Builds_SubmitBuild_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/cancel_execution.php b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/cancel_execution.php new file mode 100644 index 000000000000..64c82c0f8776 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/cancel_execution.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $executionsClient->cancelExecution($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Execution $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ExecutionsClient::executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + + cancel_execution_sample($formattedName); +} +// [END run_v2_generated_Executions_CancelExecution_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/delete_execution.php b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/delete_execution.php new file mode 100644 index 000000000000..1e5eeab289dd --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/delete_execution.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $executionsClient->deleteExecution($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Execution $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ExecutionsClient::executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + + delete_execution_sample($formattedName); +} +// [END run_v2_generated_Executions_DeleteExecution_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/get_execution.php b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/get_execution.php new file mode 100644 index 000000000000..1151abf84be0 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/get_execution.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Execution $response */ + $response = $executionsClient->getExecution($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ExecutionsClient::executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + + get_execution_sample($formattedName); +} +// [END run_v2_generated_Executions_GetExecution_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/list_executions.php b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/list_executions.php new file mode 100644 index 000000000000..9e3230df26c5 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ExecutionsClient/list_executions.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $executionsClient->listExecutions($request); + + /** @var Execution $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ExecutionsClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + + list_executions_sample($formattedParent); +} +// [END run_v2_generated_Executions_ListExecutions_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/create_job.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/create_job.php new file mode 100644 index 000000000000..40327f792c08 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/JobsClient/create_job.php @@ -0,0 +1,97 @@ +setTemplate($jobTemplateTemplate); + $job = (new Job()) + ->setTemplate($jobTemplate); + $request = (new CreateJobRequest()) + ->setParent($formattedParent) + ->setJob($job) + ->setJobId($jobId); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $jobsClient->createJob($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Job $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = JobsClient::locationName('[PROJECT]', '[LOCATION]'); + $jobId = '[JOB_ID]'; + + create_job_sample($formattedParent, $jobId); +} +// [END run_v2_generated_Jobs_CreateJob_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/delete_job.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/delete_job.php new file mode 100644 index 000000000000..c62edc4aa313 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/JobsClient/delete_job.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $jobsClient->deleteJob($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Job $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = JobsClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + + delete_job_sample($formattedName); +} +// [END run_v2_generated_Jobs_DeleteJob_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/get_iam_policy.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/get_iam_policy.php new file mode 100644 index 000000000000..ec63bee9b4e0 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/JobsClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $jobsClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END run_v2_generated_Jobs_GetIamPolicy_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/get_job.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/get_job.php new file mode 100644 index 000000000000..e7913654919b --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/JobsClient/get_job.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Job $response */ + $response = $jobsClient->getJob($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = JobsClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + + get_job_sample($formattedName); +} +// [END run_v2_generated_Jobs_GetJob_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/list_jobs.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/list_jobs.php new file mode 100644 index 000000000000..5098a79046c9 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/JobsClient/list_jobs.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $jobsClient->listJobs($request); + + /** @var Job $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = JobsClient::locationName('[PROJECT]', '[LOCATION]'); + + list_jobs_sample($formattedParent); +} +// [END run_v2_generated_Jobs_ListJobs_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/run_job.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/run_job.php new file mode 100644 index 000000000000..839082beaab7 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/JobsClient/run_job.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $jobsClient->runJob($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Execution $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = JobsClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + + run_job_sample($formattedName); +} +// [END run_v2_generated_Jobs_RunJob_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/set_iam_policy.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/set_iam_policy.php new file mode 100644 index 000000000000..cd9a9bfc4f4b --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/JobsClient/set_iam_policy.php @@ -0,0 +1,74 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $jobsClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END run_v2_generated_Jobs_SetIamPolicy_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/test_iam_permissions.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/test_iam_permissions.php new file mode 100644 index 000000000000..49060c33d083 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/JobsClient/test_iam_permissions.php @@ -0,0 +1,80 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $jobsClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END run_v2_generated_Jobs_TestIamPermissions_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/JobsClient/update_job.php b/owl-bot-staging/Run/v2/samples/V2/JobsClient/update_job.php new file mode 100644 index 000000000000..2851843e2e32 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/JobsClient/update_job.php @@ -0,0 +1,77 @@ +setTemplate($jobTemplateTemplate); + $job = (new Job()) + ->setTemplate($jobTemplate); + $request = (new UpdateJobRequest()) + ->setJob($job); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $jobsClient->updateJob($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Job $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END run_v2_generated_Jobs_UpdateJob_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/delete_revision.php b/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/delete_revision.php new file mode 100644 index 000000000000..396f1693cfbc --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/delete_revision.php @@ -0,0 +1,90 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $revisionsClient->deleteRevision($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Revision $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RevisionsClient::revisionName( + '[PROJECT]', + '[LOCATION]', + '[SERVICE]', + '[REVISION]' + ); + + delete_revision_sample($formattedName); +} +// [END run_v2_generated_Revisions_DeleteRevision_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/get_revision.php b/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/get_revision.php new file mode 100644 index 000000000000..02c8bdec4bac --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/get_revision.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Revision $response */ + $response = $revisionsClient->getRevision($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = RevisionsClient::revisionName( + '[PROJECT]', + '[LOCATION]', + '[SERVICE]', + '[REVISION]' + ); + + get_revision_sample($formattedName); +} +// [END run_v2_generated_Revisions_GetRevision_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/list_revisions.php b/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/list_revisions.php new file mode 100644 index 000000000000..3326bafd47df --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/RevisionsClient/list_revisions.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $revisionsClient->listRevisions($request); + + /** @var Revision $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = RevisionsClient::serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + + list_revisions_sample($formattedParent); +} +// [END run_v2_generated_Revisions_ListRevisions_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/create_service.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/create_service.php new file mode 100644 index 000000000000..4fc72ae86ea3 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/create_service.php @@ -0,0 +1,95 @@ +setTemplate($serviceTemplate); + $request = (new CreateServiceRequest()) + ->setParent($formattedParent) + ->setService($service) + ->setServiceId($serviceId); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $servicesClient->createService($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Service $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ServicesClient::locationName('[PROJECT]', '[LOCATION]'); + $serviceId = '[SERVICE_ID]'; + + create_service_sample($formattedParent, $serviceId); +} +// [END run_v2_generated_Services_CreateService_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/delete_service.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/delete_service.php new file mode 100644 index 000000000000..483cd74a5861 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/delete_service.php @@ -0,0 +1,87 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $servicesClient->deleteService($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Service $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ServicesClient::serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + + delete_service_sample($formattedName); +} +// [END run_v2_generated_Services_DeleteService_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_iam_policy.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_iam_policy.php new file mode 100644 index 000000000000..b7b0f1d416be --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $servicesClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END run_v2_generated_Services_GetIamPolicy_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_service.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_service.php new file mode 100644 index 000000000000..c76820b3ff85 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/get_service.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Service $response */ + $response = $servicesClient->getService($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ServicesClient::serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + + get_service_sample($formattedName); +} +// [END run_v2_generated_Services_GetService_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/list_services.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/list_services.php new file mode 100644 index 000000000000..2d88c7f1c0a5 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/list_services.php @@ -0,0 +1,79 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $servicesClient->listServices($request); + + /** @var Service $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ServicesClient::locationName('[PROJECT]', '[LOCATION]'); + + list_services_sample($formattedParent); +} +// [END run_v2_generated_Services_ListServices_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/set_iam_policy.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/set_iam_policy.php new file mode 100644 index 000000000000..90386eccb59e --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/set_iam_policy.php @@ -0,0 +1,74 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $servicesClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END run_v2_generated_Services_SetIamPolicy_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/test_iam_permissions.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/test_iam_permissions.php new file mode 100644 index 000000000000..5b5144e3f93b --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/test_iam_permissions.php @@ -0,0 +1,80 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $servicesClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END run_v2_generated_Services_TestIamPermissions_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/ServicesClient/update_service.php b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/update_service.php new file mode 100644 index 000000000000..ca153e68ad39 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/ServicesClient/update_service.php @@ -0,0 +1,74 @@ +setTemplate($serviceTemplate); + $request = (new UpdateServiceRequest()) + ->setService($service); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $servicesClient->updateService($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Service $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END run_v2_generated_Services_UpdateService_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/TasksClient/get_task.php b/owl-bot-staging/Run/v2/samples/V2/TasksClient/get_task.php new file mode 100644 index 000000000000..bb37335118ee --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/TasksClient/get_task.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Task $response */ + $response = $tasksClient->getTask($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = TasksClient::taskName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]', '[TASK]'); + + get_task_sample($formattedName); +} +// [END run_v2_generated_Tasks_GetTask_sync] diff --git a/owl-bot-staging/Run/v2/samples/V2/TasksClient/list_tasks.php b/owl-bot-staging/Run/v2/samples/V2/TasksClient/list_tasks.php new file mode 100644 index 000000000000..1b4ebdbc40d4 --- /dev/null +++ b/owl-bot-staging/Run/v2/samples/V2/TasksClient/list_tasks.php @@ -0,0 +1,79 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $tasksClient->listTasks($request); + + /** @var Task $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = TasksClient::executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + + list_tasks_sample($formattedParent); +} +// [END run_v2_generated_Tasks_ListTasks_sync] diff --git a/owl-bot-staging/Run/v2/src/V2/Client/BuildsClient.php b/owl-bot-staging/Run/v2/src/V2/Client/BuildsClient.php new file mode 100644 index 000000000000..27fed011a81d --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/Client/BuildsClient.php @@ -0,0 +1,239 @@ + submitBuildAsync(SubmitBuildRequest $request, array $optionalArgs = []) + */ +final class BuildsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.run.v2.Builds'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'run.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'run.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/builds_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/builds_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/builds_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/builds_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a worker_pool + * resource. + * + * @param string $project + * @param string $location + * @param string $workerPool + * + * @return string The formatted worker_pool resource. + */ + public static function workerPoolName(string $project, string $location, string $workerPool): string + { + return self::getPathTemplate('workerPool')->render([ + 'project' => $project, + 'location' => $location, + 'worker_pool' => $workerPool, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - workerPool: projects/{project}/locations/{location}/workerPools/{worker_pool} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'run.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Submits a build in a given project. + * + * The async variant is {@see BuildsClient::submitBuildAsync()} . + * + * @example samples/V2/BuildsClient/submit_build.php + * + * @param SubmitBuildRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SubmitBuildResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function submitBuild(SubmitBuildRequest $request, array $callOptions = []): SubmitBuildResponse + { + return $this->startApiCall('SubmitBuild', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/Client/ExecutionsClient.php b/owl-bot-staging/Run/v2/src/V2/Client/ExecutionsClient.php new file mode 100644 index 000000000000..3fb00b53f088 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/Client/ExecutionsClient.php @@ -0,0 +1,401 @@ + cancelExecutionAsync(CancelExecutionRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteExecutionAsync(DeleteExecutionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getExecutionAsync(GetExecutionRequest $request, array $optionalArgs = []) + * @method PromiseInterface listExecutionsAsync(ListExecutionsRequest $request, array $optionalArgs = []) + */ +final class ExecutionsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.run.v2.Executions'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'run.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'run.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/executions_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/executions_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/executions_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/executions_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a execution + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * @param string $execution + * + * @return string The formatted execution resource. + */ + public static function executionName(string $project, string $location, string $job, string $execution): string + { + return self::getPathTemplate('execution')->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + 'execution' => $execution, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a job + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * + * @return string The formatted job resource. + */ + public static function jobName(string $project, string $location, string $job): string + { + return self::getPathTemplate('job')->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - execution: projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * - job: projects/{project}/locations/{location}/jobs/{job} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'run.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Cancels an Execution. + * + * The async variant is {@see ExecutionsClient::cancelExecutionAsync()} . + * + * @example samples/V2/ExecutionsClient/cancel_execution.php + * + * @param CancelExecutionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function cancelExecution(CancelExecutionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CancelExecution', $request, $callOptions)->wait(); + } + + /** + * Deletes an Execution. + * + * The async variant is {@see ExecutionsClient::deleteExecutionAsync()} . + * + * @example samples/V2/ExecutionsClient/delete_execution.php + * + * @param DeleteExecutionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteExecution(DeleteExecutionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteExecution', $request, $callOptions)->wait(); + } + + /** + * Gets information about an Execution. + * + * The async variant is {@see ExecutionsClient::getExecutionAsync()} . + * + * @example samples/V2/ExecutionsClient/get_execution.php + * + * @param GetExecutionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Execution + * + * @throws ApiException Thrown if the API call fails. + */ + public function getExecution(GetExecutionRequest $request, array $callOptions = []): Execution + { + return $this->startApiCall('GetExecution', $request, $callOptions)->wait(); + } + + /** + * Lists Executions from a Job. Results are sorted by creation time, + * descending. + * + * The async variant is {@see ExecutionsClient::listExecutionsAsync()} . + * + * @example samples/V2/ExecutionsClient/list_executions.php + * + * @param ListExecutionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listExecutions(ListExecutionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListExecutions', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/Client/JobsClient.php b/owl-bot-staging/Run/v2/src/V2/Client/JobsClient.php new file mode 100644 index 000000000000..dcb427e85e1d --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/Client/JobsClient.php @@ -0,0 +1,693 @@ + createJobAsync(CreateJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteJobAsync(DeleteJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getJobAsync(GetJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface listJobsAsync(ListJobsRequest $request, array $optionalArgs = []) + * @method PromiseInterface runJobAsync(RunJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateJobAsync(UpdateJobRequest $request, array $optionalArgs = []) + */ +final class JobsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.run.v2.Jobs'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'run.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'run.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/jobs_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/jobs_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/jobs_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/jobs_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a connector + * resource. + * + * @param string $project + * @param string $location + * @param string $connector + * + * @return string The formatted connector resource. + */ + public static function connectorName(string $project, string $location, string $connector): string + { + return self::getPathTemplate('connector')->render([ + 'project' => $project, + 'location' => $location, + 'connector' => $connector, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a crypto_key + * resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * + * @return string The formatted crypto_key resource. + */ + public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string + { + return self::getPathTemplate('cryptoKey')->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a execution + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * @param string $execution + * + * @return string The formatted execution resource. + */ + public static function executionName(string $project, string $location, string $job, string $execution): string + { + return self::getPathTemplate('execution')->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + 'execution' => $execution, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a job + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * + * @return string The formatted job resource. + */ + public static function jobName(string $project, string $location, string $job): string + { + return self::getPathTemplate('job')->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * location_policy resource. + * + * @param string $location + * + * @return string The formatted location_policy resource. + */ + public static function locationPolicyName(string $location): string + { + return self::getPathTemplate('locationPolicy')->render([ + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a policy + * resource. + * + * @param string $project + * + * @return string The formatted policy resource. + */ + public static function policyName(string $project): string + { + return self::getPathTemplate('policy')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_policy resource. + * + * @param string $project + * + * @return string The formatted project_policy resource. + */ + public static function projectPolicyName(string $project): string + { + return self::getPathTemplate('projectPolicy')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a secret + * resource. + * + * @param string $project + * @param string $secret + * + * @return string The formatted secret resource. + */ + public static function secretName(string $project, string $secret): string + { + return self::getPathTemplate('secret')->render([ + 'project' => $project, + 'secret' => $secret, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * secret_version resource. + * + * @param string $project + * @param string $secret + * @param string $version + * + * @return string The formatted secret_version resource. + */ + public static function secretVersionName(string $project, string $secret, string $version): string + { + return self::getPathTemplate('secretVersion')->render([ + 'project' => $project, + 'secret' => $secret, + 'version' => $version, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - connector: projects/{project}/locations/{location}/connectors/{connector} + * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} + * - execution: projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * - job: projects/{project}/locations/{location}/jobs/{job} + * - location: projects/{project}/locations/{location} + * - locationPolicy: locations/{location}/policy + * - policy: projects/{project}/policy + * - projectPolicy: projects/{project}/policy + * - secret: projects/{project}/secrets/{secret} + * - secretVersion: projects/{project}/secrets/{secret}/versions/{version} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'run.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a Job. + * + * The async variant is {@see JobsClient::createJobAsync()} . + * + * @example samples/V2/JobsClient/create_job.php + * + * @param CreateJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createJob(CreateJobRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateJob', $request, $callOptions)->wait(); + } + + /** + * Deletes a Job. + * + * The async variant is {@see JobsClient::deleteJobAsync()} . + * + * @example samples/V2/JobsClient/delete_job.php + * + * @param DeleteJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteJob(DeleteJobRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteJob', $request, $callOptions)->wait(); + } + + /** + * Gets the IAM Access Control policy currently in effect for the given Job. + * This result does not include any inherited policies. + * + * The async variant is {@see JobsClient::getIamPolicyAsync()} . + * + * @example samples/V2/JobsClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Gets information about a Job. + * + * The async variant is {@see JobsClient::getJobAsync()} . + * + * @example samples/V2/JobsClient/get_job.php + * + * @param GetJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Job + * + * @throws ApiException Thrown if the API call fails. + */ + public function getJob(GetJobRequest $request, array $callOptions = []): Job + { + return $this->startApiCall('GetJob', $request, $callOptions)->wait(); + } + + /** + * Lists Jobs. Results are sorted by creation time, descending. + * + * The async variant is {@see JobsClient::listJobsAsync()} . + * + * @example samples/V2/JobsClient/list_jobs.php + * + * @param ListJobsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listJobs(ListJobsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListJobs', $request, $callOptions); + } + + /** + * Triggers creation of a new Execution of this Job. + * + * The async variant is {@see JobsClient::runJobAsync()} . + * + * @example samples/V2/JobsClient/run_job.php + * + * @param RunJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function runJob(RunJobRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RunJob', $request, $callOptions)->wait(); + } + + /** + * Sets the IAM Access control policy for the specified Job. Overwrites + * any existing policy. + * + * The async variant is {@see JobsClient::setIamPolicyAsync()} . + * + * @example samples/V2/JobsClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified Project. + * + * There are no permissions required for making this API call. + * + * The async variant is {@see JobsClient::testIamPermissionsAsync()} . + * + * @example samples/V2/JobsClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Updates a Job. + * + * The async variant is {@see JobsClient::updateJobAsync()} . + * + * @example samples/V2/JobsClient/update_job.php + * + * @param UpdateJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateJob(UpdateJobRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateJob', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/Client/RevisionsClient.php b/owl-bot-staging/Run/v2/src/V2/Client/RevisionsClient.php new file mode 100644 index 000000000000..1797ab185458 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/Client/RevisionsClient.php @@ -0,0 +1,373 @@ + deleteRevisionAsync(DeleteRevisionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getRevisionAsync(GetRevisionRequest $request, array $optionalArgs = []) + * @method PromiseInterface listRevisionsAsync(ListRevisionsRequest $request, array $optionalArgs = []) + */ +final class RevisionsClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.run.v2.Revisions'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'run.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'run.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/revisions_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/revisions_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/revisions_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/revisions_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a revision + * resource. + * + * @param string $project + * @param string $location + * @param string $service + * @param string $revision + * + * @return string The formatted revision resource. + */ + public static function revisionName(string $project, string $location, string $service, string $revision): string + { + return self::getPathTemplate('revision')->render([ + 'project' => $project, + 'location' => $location, + 'service' => $service, + 'revision' => $revision, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a service + * resource. + * + * @param string $project + * @param string $location + * @param string $service + * + * @return string The formatted service resource. + */ + public static function serviceName(string $project, string $location, string $service): string + { + return self::getPathTemplate('service')->render([ + 'project' => $project, + 'location' => $location, + 'service' => $service, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - revision: projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * - service: projects/{project}/locations/{location}/services/{service} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'run.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes a Revision. + * + * The async variant is {@see RevisionsClient::deleteRevisionAsync()} . + * + * @example samples/V2/RevisionsClient/delete_revision.php + * + * @param DeleteRevisionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteRevision(DeleteRevisionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteRevision', $request, $callOptions)->wait(); + } + + /** + * Gets information about a Revision. + * + * The async variant is {@see RevisionsClient::getRevisionAsync()} . + * + * @example samples/V2/RevisionsClient/get_revision.php + * + * @param GetRevisionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Revision + * + * @throws ApiException Thrown if the API call fails. + */ + public function getRevision(GetRevisionRequest $request, array $callOptions = []): Revision + { + return $this->startApiCall('GetRevision', $request, $callOptions)->wait(); + } + + /** + * Lists Revisions from a given Service, or from a given location. Results + * are sorted by creation time, descending. + * + * The async variant is {@see RevisionsClient::listRevisionsAsync()} . + * + * @example samples/V2/RevisionsClient/list_revisions.php + * + * @param ListRevisionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listRevisions(ListRevisionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListRevisions', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/Client/ServicesClient.php b/owl-bot-staging/Run/v2/src/V2/Client/ServicesClient.php new file mode 100644 index 000000000000..7ac324890aea --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/Client/ServicesClient.php @@ -0,0 +1,686 @@ + createServiceAsync(CreateServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteServiceAsync(DeleteServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getServiceAsync(GetServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface listServicesAsync(ListServicesRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateServiceAsync(UpdateServiceRequest $request, array $optionalArgs = []) + */ +final class ServicesClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.run.v2.Services'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'run.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'run.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/services_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/services_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/services_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/services_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a connector + * resource. + * + * @param string $project + * @param string $location + * @param string $connector + * + * @return string The formatted connector resource. + */ + public static function connectorName(string $project, string $location, string $connector): string + { + return self::getPathTemplate('connector')->render([ + 'project' => $project, + 'location' => $location, + 'connector' => $connector, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a crypto_key + * resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * + * @return string The formatted crypto_key resource. + */ + public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string + { + return self::getPathTemplate('cryptoKey')->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * location_policy resource. + * + * @param string $location + * + * @return string The formatted location_policy resource. + */ + public static function locationPolicyName(string $location): string + { + return self::getPathTemplate('locationPolicy')->render([ + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a mesh + * resource. + * + * @param string $project + * @param string $location + * @param string $mesh + * + * @return string The formatted mesh resource. + */ + public static function meshName(string $project, string $location, string $mesh): string + { + return self::getPathTemplate('mesh')->render([ + 'project' => $project, + 'location' => $location, + 'mesh' => $mesh, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a policy + * resource. + * + * @param string $project + * + * @return string The formatted policy resource. + */ + public static function policyName(string $project): string + { + return self::getPathTemplate('policy')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_policy resource. + * + * @param string $project + * + * @return string The formatted project_policy resource. + */ + public static function projectPolicyName(string $project): string + { + return self::getPathTemplate('projectPolicy')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a revision + * resource. + * + * @param string $project + * @param string $location + * @param string $service + * @param string $revision + * + * @return string The formatted revision resource. + */ + public static function revisionName(string $project, string $location, string $service, string $revision): string + { + return self::getPathTemplate('revision')->render([ + 'project' => $project, + 'location' => $location, + 'service' => $service, + 'revision' => $revision, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a secret + * resource. + * + * @param string $project + * @param string $secret + * + * @return string The formatted secret resource. + */ + public static function secretName(string $project, string $secret): string + { + return self::getPathTemplate('secret')->render([ + 'project' => $project, + 'secret' => $secret, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * secret_version resource. + * + * @param string $project + * @param string $secret + * @param string $version + * + * @return string The formatted secret_version resource. + */ + public static function secretVersionName(string $project, string $secret, string $version): string + { + return self::getPathTemplate('secretVersion')->render([ + 'project' => $project, + 'secret' => $secret, + 'version' => $version, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a service + * resource. + * + * @param string $project + * @param string $location + * @param string $service + * + * @return string The formatted service resource. + */ + public static function serviceName(string $project, string $location, string $service): string + { + return self::getPathTemplate('service')->render([ + 'project' => $project, + 'location' => $location, + 'service' => $service, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - connector: projects/{project}/locations/{location}/connectors/{connector} + * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} + * - location: projects/{project}/locations/{location} + * - locationPolicy: locations/{location}/policy + * - mesh: projects/{project}/locations/{location}/meshes/{mesh} + * - policy: projects/{project}/policy + * - projectPolicy: projects/{project}/policy + * - revision: projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * - secret: projects/{project}/secrets/{secret} + * - secretVersion: projects/{project}/secrets/{secret}/versions/{version} + * - service: projects/{project}/locations/{location}/services/{service} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'run.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new Service in a given project and location. + * + * The async variant is {@see ServicesClient::createServiceAsync()} . + * + * @example samples/V2/ServicesClient/create_service.php + * + * @param CreateServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createService(CreateServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateService', $request, $callOptions)->wait(); + } + + /** + * Deletes a Service. + * This will cause the Service to stop serving traffic and will delete all + * revisions. + * + * The async variant is {@see ServicesClient::deleteServiceAsync()} . + * + * @example samples/V2/ServicesClient/delete_service.php + * + * @param DeleteServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteService(DeleteServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteService', $request, $callOptions)->wait(); + } + + /** + * Gets the IAM Access Control policy currently in effect for the given + * Cloud Run Service. This result does not include any inherited policies. + * + * The async variant is {@see ServicesClient::getIamPolicyAsync()} . + * + * @example samples/V2/ServicesClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Gets information about a Service. + * + * The async variant is {@see ServicesClient::getServiceAsync()} . + * + * @example samples/V2/ServicesClient/get_service.php + * + * @param GetServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Service + * + * @throws ApiException Thrown if the API call fails. + */ + public function getService(GetServiceRequest $request, array $callOptions = []): Service + { + return $this->startApiCall('GetService', $request, $callOptions)->wait(); + } + + /** + * Lists Services. Results are sorted by creation time, descending. + * + * The async variant is {@see ServicesClient::listServicesAsync()} . + * + * @example samples/V2/ServicesClient/list_services.php + * + * @param ListServicesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listServices(ListServicesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListServices', $request, $callOptions); + } + + /** + * Sets the IAM Access control policy for the specified Service. Overwrites + * any existing policy. + * + * The async variant is {@see ServicesClient::setIamPolicyAsync()} . + * + * @example samples/V2/ServicesClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified Project. + * + * There are no permissions required for making this API call. + * + * The async variant is {@see ServicesClient::testIamPermissionsAsync()} . + * + * @example samples/V2/ServicesClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Updates a Service. + * + * The async variant is {@see ServicesClient::updateServiceAsync()} . + * + * @example samples/V2/ServicesClient/update_service.php + * + * @param UpdateServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateService(UpdateServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateService', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/Client/TasksClient.php b/owl-bot-staging/Run/v2/src/V2/Client/TasksClient.php new file mode 100644 index 000000000000..8bd5dcfa9b4a --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/Client/TasksClient.php @@ -0,0 +1,294 @@ + getTaskAsync(GetTaskRequest $request, array $optionalArgs = []) + * @method PromiseInterface listTasksAsync(ListTasksRequest $request, array $optionalArgs = []) + */ +final class TasksClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.run.v2.Tasks'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'run.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'run.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/tasks_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/tasks_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/tasks_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/tasks_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a execution + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * @param string $execution + * + * @return string The formatted execution resource. + */ + public static function executionName(string $project, string $location, string $job, string $execution): string + { + return self::getPathTemplate('execution')->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + 'execution' => $execution, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a task + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * @param string $execution + * @param string $task + * + * @return string The formatted task resource. + */ + public static function taskName(string $project, string $location, string $job, string $execution, string $task): string + { + return self::getPathTemplate('task')->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + 'execution' => $execution, + 'task' => $task, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - execution: projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * - task: projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'run.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Gets information about a Task. + * + * The async variant is {@see TasksClient::getTaskAsync()} . + * + * @example samples/V2/TasksClient/get_task.php + * + * @param GetTaskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Task + * + * @throws ApiException Thrown if the API call fails. + */ + public function getTask(GetTaskRequest $request, array $callOptions = []): Task + { + return $this->startApiCall('GetTask', $request, $callOptions)->wait(); + } + + /** + * Lists Tasks from an Execution of a Job. + * + * The async variant is {@see TasksClient::listTasksAsync()} . + * + * @example samples/V2/TasksClient/list_tasks.php + * + * @param ListTasksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listTasks(ListTasksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListTasks', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/gapic_metadata.json b/owl-bot-staging/Run/v2/src/V2/gapic_metadata.json new file mode 100644 index 000000000000..2bf7b36f81c0 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/gapic_metadata.json @@ -0,0 +1,198 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.run.v2", + "libraryPackage": "Google\\Cloud\\Run\\V2", + "services": { + "Builds": { + "clients": { + "grpc": { + "libraryClient": "BuildsGapicClient", + "rpcs": { + "SubmitBuild": { + "methods": [ + "submitBuild" + ] + } + } + } + } + }, + "Executions": { + "clients": { + "grpc": { + "libraryClient": "ExecutionsGapicClient", + "rpcs": { + "CancelExecution": { + "methods": [ + "cancelExecution" + ] + }, + "DeleteExecution": { + "methods": [ + "deleteExecution" + ] + }, + "GetExecution": { + "methods": [ + "getExecution" + ] + }, + "ListExecutions": { + "methods": [ + "listExecutions" + ] + } + } + } + } + }, + "Jobs": { + "clients": { + "grpc": { + "libraryClient": "JobsGapicClient", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "ListJobs": { + "methods": [ + "listJobs" + ] + }, + "RunJob": { + "methods": [ + "runJob" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateJob": { + "methods": [ + "updateJob" + ] + } + } + } + } + }, + "Revisions": { + "clients": { + "grpc": { + "libraryClient": "RevisionsGapicClient", + "rpcs": { + "DeleteRevision": { + "methods": [ + "deleteRevision" + ] + }, + "GetRevision": { + "methods": [ + "getRevision" + ] + }, + "ListRevisions": { + "methods": [ + "listRevisions" + ] + } + } + } + } + }, + "Services": { + "clients": { + "grpc": { + "libraryClient": "ServicesGapicClient", + "rpcs": { + "CreateService": { + "methods": [ + "createService" + ] + }, + "DeleteService": { + "methods": [ + "deleteService" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetService": { + "methods": [ + "getService" + ] + }, + "ListServices": { + "methods": [ + "listServices" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "UpdateService": { + "methods": [ + "updateService" + ] + } + } + } + } + }, + "Tasks": { + "clients": { + "grpc": { + "libraryClient": "TasksGapicClient", + "rpcs": { + "GetTask": { + "methods": [ + "getTask" + ] + }, + "ListTasks": { + "methods": [ + "listTasks" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Run/v2/src/V2/resources/builds_client_config.json b/owl-bot-staging/Run/v2/src/V2/resources/builds_client_config.json new file mode 100644 index 000000000000..b09e6e721847 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/builds_client_config.json @@ -0,0 +1,27 @@ +{ + "interfaces": { + "google.cloud.run.v2.Builds": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "SubmitBuild": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/resources/builds_descriptor_config.php b/owl-bot-staging/Run/v2/src/V2/resources/builds_descriptor_config.php new file mode 100644 index 000000000000..5cb8ed8624cb --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/builds_descriptor_config.php @@ -0,0 +1,43 @@ + [ + 'google.cloud.run.v2.Builds' => [ + 'SubmitBuild' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Run\V2\SubmitBuildResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'workerPool' => 'projects/{project}/locations/{location}/workerPools/{worker_pool}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/builds_rest_client_config.php b/owl-bot-staging/Run/v2/src/V2/resources/builds_rest_client_config.php new file mode 100644 index 000000000000..5654061ec5f6 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/builds_rest_client_config.php @@ -0,0 +1,88 @@ + [ + 'google.cloud.run.v2.Builds' => [ + 'SubmitBuild' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/builds:submit', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'WaitOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/executions_client_config.json b/owl-bot-staging/Run/v2/src/V2/resources/executions_client_config.json new file mode 100644 index 000000000000..2ca1a996052f --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/executions_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.cloud.run.v2.Executions": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "CancelExecution": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteExecution": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetExecution": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListExecutions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/resources/executions_descriptor_config.php b/owl-bot-staging/Run/v2/src/V2/resources/executions_descriptor_config.php new file mode 100644 index 000000000000..eef9c8872f7b --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/executions_descriptor_config.php @@ -0,0 +1,102 @@ + [ + 'google.cloud.run.v2.Executions' => [ + 'CancelExecution' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Execution', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Execution', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteExecution' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Execution', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Execution', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetExecution' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Run\V2\Execution', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListExecutions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getExecutions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Run\V2\ListExecutionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'execution' => 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}', + 'job' => 'projects/{project}/locations/{location}/jobs/{job}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/executions_rest_client_config.php b/owl-bot-staging/Run/v2/src/V2/resources/executions_rest_client_config.php new file mode 100644 index 000000000000..d057b806912f --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/executions_rest_client_config.php @@ -0,0 +1,121 @@ + [ + 'google.cloud.run.v2.Executions' => [ + 'CancelExecution' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*/executions/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteExecution' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*/executions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetExecution' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*/executions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListExecutions' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/jobs/*}/executions', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'WaitOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/jobs_client_config.json b/owl-bot-staging/Run/v2/src/V2/resources/jobs_client_config.json new file mode 100644 index 000000000000..c5f5321be6c1 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/jobs_client_config.json @@ -0,0 +1,67 @@ +{ + "interfaces": { + "google.cloud.run.v2.Jobs": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "CreateJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListJobs": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "RunJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/resources/jobs_descriptor_config.php b/owl-bot-staging/Run/v2/src/V2/resources/jobs_descriptor_config.php new file mode 100644 index 000000000000..dabd773405ac --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/jobs_descriptor_config.php @@ -0,0 +1,191 @@ + [ + 'google.cloud.run.v2.Jobs' => [ + 'CreateJob' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Job', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Job', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [], + ], + ], + ], + 'DeleteJob' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Job', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Job', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [], + ], + ], + ], + 'RunJob' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Execution', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Execution', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [], + ], + ], + ], + 'UpdateJob' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Job', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Job', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getJob', + 'getName', + ], + 'matchers' => [], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'GetJob' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Run\V2\Job', + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [], + ], + ], + ], + 'ListJobs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getJobs', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Run\V2\ListJobsResponse', + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'templateMap' => [ + 'connector' => 'projects/{project}/locations/{location}/connectors/{connector}', + 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}', + 'execution' => 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}', + 'job' => 'projects/{project}/locations/{location}/jobs/{job}', + 'location' => 'projects/{project}/locations/{location}', + 'locationPolicy' => 'locations/{location}/policy', + 'policy' => 'projects/{project}/policy', + 'projectPolicy' => 'projects/{project}/policy', + 'secret' => 'projects/{project}/secrets/{secret}', + 'secretVersion' => 'projects/{project}/secrets/{secret}/versions/{version}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/jobs_rest_client_config.php b/owl-bot-staging/Run/v2/src/V2/resources/jobs_rest_client_config.php new file mode 100644 index 000000000000..51959869ee19 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/jobs_rest_client_config.php @@ -0,0 +1,184 @@ + [ + 'google.cloud.run.v2.Jobs' => [ + 'CreateJob' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/jobs', + 'body' => 'job', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'job_id', + ], + ], + 'DeleteJob' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{resource=projects/*/locations/*/jobs/*}:getIamPolicy', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetJob' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListJobs' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/jobs', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RunJob' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*}:run', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/locations/*/jobs/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/locations/*/jobs/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateJob' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{job.name=projects/*/locations/*/jobs/*}', + 'body' => 'job', + 'placeholders' => [ + 'job.name' => [ + 'getters' => [ + 'getJob', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'WaitOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/revisions_client_config.json b/owl-bot-staging/Run/v2/src/V2/resources/revisions_client_config.json new file mode 100644 index 000000000000..ba39cada8bc5 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/revisions_client_config.json @@ -0,0 +1,37 @@ +{ + "interfaces": { + "google.cloud.run.v2.Revisions": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "DeleteRevision": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetRevision": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListRevisions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/resources/revisions_descriptor_config.php b/owl-bot-staging/Run/v2/src/V2/resources/revisions_descriptor_config.php new file mode 100644 index 000000000000..a2b139922fc9 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/revisions_descriptor_config.php @@ -0,0 +1,86 @@ + [ + 'google.cloud.run.v2.Revisions' => [ + 'DeleteRevision' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Revision', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Revision', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [], + ], + ], + ], + 'GetRevision' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Run\V2\Revision', + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [], + ], + ], + ], + 'ListRevisions' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getRevisions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Run\V2\ListRevisionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [], + ], + ], + ], + 'templateMap' => [ + 'revision' => 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}', + 'service' => 'projects/{project}/locations/{location}/services/{service}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/revisions_rest_client_config.php b/owl-bot-staging/Run/v2/src/V2/resources/revisions_rest_client_config.php new file mode 100644 index 000000000000..525cc8b31399 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/revisions_rest_client_config.php @@ -0,0 +1,109 @@ + [ + 'google.cloud.run.v2.Revisions' => [ + 'DeleteRevision' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/services/*/revisions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetRevision' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/services/*/revisions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListRevisions' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/services/*}/revisions', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'WaitOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/services_client_config.json b/owl-bot-staging/Run/v2/src/V2/resources/services_client_config.json new file mode 100644 index 000000000000..53e3bc1d5fa5 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/services_client_config.json @@ -0,0 +1,94 @@ +{ + "interfaces": { + "google.cloud.run.v2.Services": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_codes": [], + "no_retry_2_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 10000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 10000, + "total_timeout_millis": 10000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 15000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 15000, + "total_timeout_millis": 15000 + }, + "no_retry_2_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 10000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 10000, + "total_timeout_millis": 10000 + } + }, + "methods": { + "CreateService": { + "timeout_millis": 15000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteService": { + "timeout_millis": 10000, + "retry_codes_name": "no_retry_2_codes", + "retry_params_name": "no_retry_2_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetService": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListServices": { + "timeout_millis": 10000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateService": { + "timeout_millis": 15000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/resources/services_descriptor_config.php b/owl-bot-staging/Run/v2/src/V2/resources/services_descriptor_config.php new file mode 100644 index 000000000000..3264c3a5d624 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/services_descriptor_config.php @@ -0,0 +1,172 @@ + [ + 'google.cloud.run.v2.Services' => [ + 'CreateService' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Service', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Service', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [], + ], + ], + ], + 'DeleteService' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Service', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Service', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [], + ], + ], + ], + 'UpdateService' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Run\V2\Service', + 'metadataReturnType' => '\Google\Cloud\Run\V2\Service', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getService', + 'getName', + ], + 'matchers' => [], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'GetService' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Run\V2\Service', + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getName', + ], + 'matchers' => [], + ], + ], + ], + 'ListServices' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getServices', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Run\V2\ListServicesResponse', + 'headerParams' => [ + [ + 'keyName' => 'location', + 'fieldAccessors' => [ + 'getParent', + ], + 'matchers' => [], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'templateMap' => [ + 'connector' => 'projects/{project}/locations/{location}/connectors/{connector}', + 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}', + 'location' => 'projects/{project}/locations/{location}', + 'locationPolicy' => 'locations/{location}/policy', + 'mesh' => 'projects/{project}/locations/{location}/meshes/{mesh}', + 'policy' => 'projects/{project}/policy', + 'projectPolicy' => 'projects/{project}/policy', + 'revision' => 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}', + 'secret' => 'projects/{project}/secrets/{secret}', + 'secretVersion' => 'projects/{project}/secrets/{secret}/versions/{version}', + 'service' => 'projects/{project}/locations/{location}/services/{service}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/services_rest_client_config.php b/owl-bot-staging/Run/v2/src/V2/resources/services_rest_client_config.php new file mode 100644 index 000000000000..4ab42dd22480 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/services_rest_client_config.php @@ -0,0 +1,172 @@ + [ + 'google.cloud.run.v2.Services' => [ + 'CreateService' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/services', + 'body' => 'service', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'service_id', + ], + ], + 'DeleteService' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/services/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{resource=projects/*/locations/*/services/*}:getIamPolicy', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetService' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/services/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListServices' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/services', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/locations/*/services/*}:setIamPolicy', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{resource=projects/*/locations/*/services/*}:testIamPermissions', + 'body' => '*', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'UpdateService' => [ + 'method' => 'patch', + 'uriTemplate' => '/v2/{service.name=projects/*/locations/*/services/*}', + 'body' => 'service', + 'placeholders' => [ + 'service.name' => [ + 'getters' => [ + 'getService', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'WaitOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/tasks_client_config.json b/owl-bot-staging/Run/v2/src/V2/resources/tasks_client_config.json new file mode 100644 index 000000000000..60a75305960e --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/tasks_client_config.json @@ -0,0 +1,32 @@ +{ + "interfaces": { + "google.cloud.run.v2.Tasks": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "GetTask": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListTasks": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Run/v2/src/V2/resources/tasks_descriptor_config.php b/owl-bot-staging/Run/v2/src/V2/resources/tasks_descriptor_config.php new file mode 100644 index 000000000000..4a057bedbd7f --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/tasks_descriptor_config.php @@ -0,0 +1,64 @@ + [ + 'google.cloud.run.v2.Tasks' => [ + 'GetTask' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Run\V2\Task', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListTasks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTasks', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Run\V2\ListTasksResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'execution' => 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}', + 'task' => 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Run/v2/src/V2/resources/tasks_rest_client_config.php b/owl-bot-staging/Run/v2/src/V2/resources/tasks_rest_client_config.php new file mode 100644 index 000000000000..b822ceb44355 --- /dev/null +++ b/owl-bot-staging/Run/v2/src/V2/resources/tasks_rest_client_config.php @@ -0,0 +1,98 @@ + [ + 'google.cloud.run.v2.Tasks' => [ + 'GetTask' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/jobs/*/executions/*/tasks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListTasks' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*/jobs/*/executions/*}/tasks', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'WaitOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/BuildsClientTest.php b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/BuildsClientTest.php new file mode 100644 index 000000000000..da407d675069 --- /dev/null +++ b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/BuildsClientTest.php @@ -0,0 +1,192 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return BuildsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BuildsClient($options); + } + + /** @test */ + public function submitBuildTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $baseImageUri = 'baseImageUri2088954010'; + $baseImageWarning = 'baseImageWarning-2033873974'; + $expectedResponse = new SubmitBuildResponse(); + $expectedResponse->setBaseImageUri($baseImageUri); + $expectedResponse->setBaseImageWarning($baseImageWarning); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $storageSource = new StorageSource(); + $storageSourceBucket = 'storageSourceBucket608605184'; + $storageSource->setBucket($storageSourceBucket); + $storageSourceObject = 'storageSourceObject963439957'; + $storageSource->setObject($storageSourceObject); + $imageUri = 'imageUri-877823864'; + $request = (new SubmitBuildRequest()) + ->setParent($parent) + ->setStorageSource($storageSource) + ->setImageUri($imageUri); + $response = $gapicClient->submitBuild($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Builds/SubmitBuild', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getStorageSource(); + $this->assertProtobufEquals($storageSource, $actualValue); + $actualValue = $actualRequestObject->getImageUri(); + $this->assertProtobufEquals($imageUri, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function submitBuildExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $storageSource = new StorageSource(); + $storageSourceBucket = 'storageSourceBucket608605184'; + $storageSource->setBucket($storageSourceBucket); + $storageSourceObject = 'storageSourceObject963439957'; + $storageSource->setObject($storageSourceObject); + $imageUri = 'imageUri-877823864'; + $request = (new SubmitBuildRequest()) + ->setParent($parent) + ->setStorageSource($storageSource) + ->setImageUri($imageUri); + try { + $gapicClient->submitBuild($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function submitBuildAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $baseImageUri = 'baseImageUri2088954010'; + $baseImageWarning = 'baseImageWarning-2033873974'; + $expectedResponse = new SubmitBuildResponse(); + $expectedResponse->setBaseImageUri($baseImageUri); + $expectedResponse->setBaseImageWarning($baseImageWarning); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $storageSource = new StorageSource(); + $storageSourceBucket = 'storageSourceBucket608605184'; + $storageSource->setBucket($storageSourceBucket); + $storageSourceObject = 'storageSourceObject963439957'; + $storageSource->setObject($storageSourceObject); + $imageUri = 'imageUri-877823864'; + $request = (new SubmitBuildRequest()) + ->setParent($parent) + ->setStorageSource($storageSource) + ->setImageUri($imageUri); + $response = $gapicClient->submitBuildAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Builds/SubmitBuild', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getStorageSource(); + $this->assertProtobufEquals($storageSource, $actualValue); + $actualValue = $actualRequestObject->getImageUri(); + $this->assertProtobufEquals($imageUri, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/ExecutionsClientTest.php b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/ExecutionsClientTest.php new file mode 100644 index 000000000000..16abbe3de83e --- /dev/null +++ b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/ExecutionsClientTest.php @@ -0,0 +1,638 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ExecutionsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ExecutionsClient($options); + } + + /** @test */ + public function cancelExecutionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/cancelExecutionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $job = 'job105405'; + $parallelism = 635164956; + $taskCount = 1297805781; + $reconciling = false; + $observedGeneration = 900833007; + $runningCount = 261439119; + $succeededCount = 633694641; + $failedCount = 2013829491; + $cancelledCount = 1921113249; + $retriedCount = 1654679545; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Execution(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setJob($job); + $expectedResponse->setParallelism($parallelism); + $expectedResponse->setTaskCount($taskCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setRunningCount($runningCount); + $expectedResponse->setSucceededCount($succeededCount); + $expectedResponse->setFailedCount($failedCount); + $expectedResponse->setCancelledCount($cancelledCount); + $expectedResponse->setRetriedCount($retriedCount); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/cancelExecutionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + $request = (new CancelExecutionRequest()) + ->setName($formattedName); + $response = $gapicClient->cancelExecution($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Executions/CancelExecution', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/cancelExecutionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function cancelExecutionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/cancelExecutionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + $request = (new CancelExecutionRequest()) + ->setName($formattedName); + $response = $gapicClient->cancelExecution($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/cancelExecutionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExecutionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteExecutionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $job = 'job105405'; + $parallelism = 635164956; + $taskCount = 1297805781; + $reconciling = false; + $observedGeneration = 900833007; + $runningCount = 261439119; + $succeededCount = 633694641; + $failedCount = 2013829491; + $cancelledCount = 1921113249; + $retriedCount = 1654679545; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Execution(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setJob($job); + $expectedResponse->setParallelism($parallelism); + $expectedResponse->setTaskCount($taskCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setRunningCount($runningCount); + $expectedResponse->setSucceededCount($succeededCount); + $expectedResponse->setFailedCount($failedCount); + $expectedResponse->setCancelledCount($cancelledCount); + $expectedResponse->setRetriedCount($retriedCount); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteExecutionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + $request = (new DeleteExecutionRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteExecution($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Executions/DeleteExecution', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteExecutionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExecutionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteExecutionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + $request = (new DeleteExecutionRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteExecution($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteExecutionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getExecutionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $job = 'job105405'; + $parallelism = 635164956; + $taskCount = 1297805781; + $reconciling = false; + $observedGeneration = 900833007; + $runningCount = 261439119; + $succeededCount = 633694641; + $failedCount = 2013829491; + $cancelledCount = 1921113249; + $retriedCount = 1654679545; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $etag = 'etag3123477'; + $expectedResponse = new Execution(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setJob($job); + $expectedResponse->setParallelism($parallelism); + $expectedResponse->setTaskCount($taskCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setRunningCount($runningCount); + $expectedResponse->setSucceededCount($succeededCount); + $expectedResponse->setFailedCount($failedCount); + $expectedResponse->setCancelledCount($cancelledCount); + $expectedResponse->setRetriedCount($retriedCount); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + $request = (new GetExecutionRequest()) + ->setName($formattedName); + $response = $gapicClient->getExecution($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Executions/GetExecution', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getExecutionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + $request = (new GetExecutionRequest()) + ->setName($formattedName); + try { + $gapicClient->getExecution($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listExecutionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $executionsElement = new Execution(); + $executions = [ + $executionsElement, + ]; + $expectedResponse = new ListExecutionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setExecutions($executions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new ListExecutionsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listExecutions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getExecutions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Executions/ListExecutions', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listExecutionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new ListExecutionsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listExecutions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function cancelExecutionAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/cancelExecutionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $job = 'job105405'; + $parallelism = 635164956; + $taskCount = 1297805781; + $reconciling = false; + $observedGeneration = 900833007; + $runningCount = 261439119; + $succeededCount = 633694641; + $failedCount = 2013829491; + $cancelledCount = 1921113249; + $retriedCount = 1654679545; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Execution(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setJob($job); + $expectedResponse->setParallelism($parallelism); + $expectedResponse->setTaskCount($taskCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setRunningCount($runningCount); + $expectedResponse->setSucceededCount($succeededCount); + $expectedResponse->setFailedCount($failedCount); + $expectedResponse->setCancelledCount($cancelledCount); + $expectedResponse->setRetriedCount($retriedCount); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/cancelExecutionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + $request = (new CancelExecutionRequest()) + ->setName($formattedName); + $response = $gapicClient->cancelExecutionAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Executions/CancelExecution', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/cancelExecutionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/JobsClientTest.php b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/JobsClientTest.php new file mode 100644 index 000000000000..d8b665ac4466 --- /dev/null +++ b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/JobsClientTest.php @@ -0,0 +1,1170 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return JobsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new JobsClient($options); + } + + /** @test */ + public function createJobTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $observedGeneration = 900833007; + $executionCount = 1646136616; + $reconciling = false; + $satisfiesPzs = false; + $startExecutionToken = 'startExecutionToken-1179087819'; + $etag = 'etag3123477'; + $expectedResponse = new Job(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setExecutionCount($executionCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setStartExecutionToken($startExecutionToken); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createJobTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $job = new Job(); + $jobTemplate = new ExecutionTemplate(); + $templateTemplate = new TaskTemplate(); + $jobTemplate->setTemplate($templateTemplate); + $job->setTemplate($jobTemplate); + $jobId = 'jobId-1154752291'; + $request = (new CreateJobRequest()) + ->setParent($formattedParent) + ->setJob($job) + ->setJobId($jobId); + $response = $gapicClient->createJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Jobs/CreateJob', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getJob(); + $this->assertProtobufEquals($job, $actualValue); + $actualValue = $actualApiRequestObject->getJobId(); + $this->assertProtobufEquals($jobId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createJobTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createJobExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $job = new Job(); + $jobTemplate = new ExecutionTemplate(); + $templateTemplate = new TaskTemplate(); + $jobTemplate->setTemplate($templateTemplate); + $job->setTemplate($jobTemplate); + $jobId = 'jobId-1154752291'; + $request = (new CreateJobRequest()) + ->setParent($formattedParent) + ->setJob($job) + ->setJobId($jobId); + $response = $gapicClient->createJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createJobTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteJobTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $observedGeneration = 900833007; + $executionCount = 1646136616; + $reconciling = false; + $satisfiesPzs = false; + $startExecutionToken = 'startExecutionToken-1179087819'; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Job(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setExecutionCount($executionCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setStartExecutionToken($startExecutionToken); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteJobTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new DeleteJobRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Jobs/DeleteJob', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteJobTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteJobExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new DeleteJobRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteJobTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Jobs/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $observedGeneration = 900833007; + $executionCount = 1646136616; + $reconciling = false; + $satisfiesPzs = false; + $startExecutionToken = 'startExecutionToken-1179087819'; + $etag = 'etag3123477'; + $expectedResponse = new Job(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setExecutionCount($executionCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setStartExecutionToken($startExecutionToken); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new GetJobRequest()) + ->setName($formattedName); + $response = $gapicClient->getJob($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Jobs/GetJob', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getJobExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new GetJobRequest()) + ->setName($formattedName); + try { + $gapicClient->getJob($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listJobsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $jobsElement = new Job(); + $jobs = [ + $jobsElement, + ]; + $expectedResponse = new ListJobsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setJobs($jobs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListJobsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listJobs($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getJobs()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Jobs/ListJobs', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listJobsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListJobsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listJobs($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runJobTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/runJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $job = 'job105405'; + $parallelism = 635164956; + $taskCount = 1297805781; + $reconciling = false; + $observedGeneration = 900833007; + $runningCount = 261439119; + $succeededCount = 633694641; + $failedCount = 2013829491; + $cancelledCount = 1921113249; + $retriedCount = 1654679545; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Execution(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setJob($job); + $expectedResponse->setParallelism($parallelism); + $expectedResponse->setTaskCount($taskCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setRunningCount($runningCount); + $expectedResponse->setSucceededCount($succeededCount); + $expectedResponse->setFailedCount($failedCount); + $expectedResponse->setCancelledCount($cancelledCount); + $expectedResponse->setRetriedCount($retriedCount); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/runJobTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new RunJobRequest()) + ->setName($formattedName); + $response = $gapicClient->runJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Jobs/RunJob', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/runJobTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function runJobExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/runJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new RunJobRequest()) + ->setName($formattedName); + $response = $gapicClient->runJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/runJobTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Jobs/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Jobs/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateJobTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $observedGeneration = 900833007; + $executionCount = 1646136616; + $reconciling = false; + $satisfiesPzs = false; + $startExecutionToken = 'startExecutionToken-1179087819'; + $etag = 'etag3123477'; + $expectedResponse = new Job(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setExecutionCount($executionCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setStartExecutionToken($startExecutionToken); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateJobTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $job = new Job(); + $jobTemplate = new ExecutionTemplate(); + $templateTemplate = new TaskTemplate(); + $jobTemplate->setTemplate($templateTemplate); + $job->setTemplate($jobTemplate); + $request = (new UpdateJobRequest()) + ->setJob($job); + $response = $gapicClient->updateJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Jobs/UpdateJob', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getJob(); + $this->assertProtobufEquals($job, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateJobTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateJobExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $job = new Job(); + $jobTemplate = new ExecutionTemplate(); + $templateTemplate = new TaskTemplate(); + $jobTemplate->setTemplate($templateTemplate); + $job->setTemplate($jobTemplate); + $request = (new UpdateJobRequest()) + ->setJob($job); + $response = $gapicClient->updateJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateJobTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createJobAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $observedGeneration = 900833007; + $executionCount = 1646136616; + $reconciling = false; + $satisfiesPzs = false; + $startExecutionToken = 'startExecutionToken-1179087819'; + $etag = 'etag3123477'; + $expectedResponse = new Job(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setExecutionCount($executionCount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setStartExecutionToken($startExecutionToken); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createJobTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $job = new Job(); + $jobTemplate = new ExecutionTemplate(); + $templateTemplate = new TaskTemplate(); + $jobTemplate->setTemplate($templateTemplate); + $job->setTemplate($jobTemplate); + $jobId = 'jobId-1154752291'; + $request = (new CreateJobRequest()) + ->setParent($formattedParent) + ->setJob($job) + ->setJobId($jobId); + $response = $gapicClient->createJobAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Jobs/CreateJob', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getJob(); + $this->assertProtobufEquals($job, $actualValue); + $actualValue = $actualApiRequestObject->getJobId(); + $this->assertProtobufEquals($jobId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createJobTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/RevisionsClientTest.php b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/RevisionsClientTest.php new file mode 100644 index 000000000000..30d2f22dcac0 --- /dev/null +++ b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/RevisionsClientTest.php @@ -0,0 +1,466 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RevisionsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RevisionsClient($options); + } + + /** @test */ + public function deleteRevisionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteRevisionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $service = 'service1984153269'; + $maxInstanceRequestConcurrency = 117250100; + $serviceAccount = 'serviceAccount-1948028253'; + $encryptionKey = 'encryptionKey-1122344029'; + $reconciling = false; + $observedGeneration = 900833007; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $sessionAffinity = false; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Revision(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setService($service); + $expectedResponse->setMaxInstanceRequestConcurrency($maxInstanceRequestConcurrency); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setEncryptionKey($encryptionKey); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSessionAffinity($sessionAffinity); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteRevisionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->revisionName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[REVISION]'); + $request = (new DeleteRevisionRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteRevision($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Revisions/DeleteRevision', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteRevisionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteRevisionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteRevisionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->revisionName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[REVISION]'); + $request = (new DeleteRevisionRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteRevision($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteRevisionTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getRevisionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $service = 'service1984153269'; + $maxInstanceRequestConcurrency = 117250100; + $serviceAccount = 'serviceAccount-1948028253'; + $encryptionKey = 'encryptionKey-1122344029'; + $reconciling = false; + $observedGeneration = 900833007; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $sessionAffinity = false; + $etag = 'etag3123477'; + $expectedResponse = new Revision(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setService($service); + $expectedResponse->setMaxInstanceRequestConcurrency($maxInstanceRequestConcurrency); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setEncryptionKey($encryptionKey); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSessionAffinity($sessionAffinity); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->revisionName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[REVISION]'); + $request = (new GetRevisionRequest()) + ->setName($formattedName); + $response = $gapicClient->getRevision($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Revisions/GetRevision', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRevisionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->revisionName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[REVISION]'); + $request = (new GetRevisionRequest()) + ->setName($formattedName); + try { + $gapicClient->getRevision($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listRevisionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $revisionsElement = new Revision(); + $revisions = [ + $revisionsElement, + ]; + $expectedResponse = new ListRevisionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRevisions($revisions); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + $request = (new ListRevisionsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listRevisions($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getRevisions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Revisions/ListRevisions', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listRevisionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + $request = (new ListRevisionsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listRevisions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteRevisionAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteRevisionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $service = 'service1984153269'; + $maxInstanceRequestConcurrency = 117250100; + $serviceAccount = 'serviceAccount-1948028253'; + $encryptionKey = 'encryptionKey-1122344029'; + $reconciling = false; + $observedGeneration = 900833007; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $sessionAffinity = false; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Revision(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setService($service); + $expectedResponse->setMaxInstanceRequestConcurrency($maxInstanceRequestConcurrency); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setEncryptionKey($encryptionKey); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSessionAffinity($sessionAffinity); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteRevisionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->revisionName('[PROJECT]', '[LOCATION]', '[SERVICE]', '[REVISION]'); + $request = (new DeleteRevisionRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteRevisionAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Revisions/DeleteRevision', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteRevisionTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/ServicesClientTest.php b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/ServicesClientTest.php new file mode 100644 index 000000000000..c642d0821e40 --- /dev/null +++ b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/ServicesClientTest.php @@ -0,0 +1,1044 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ServicesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ServicesClient($options); + } + + /** @test */ + public function createServiceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createServiceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; + $defaultUriDisabled = false; + $observedGeneration = 900833007; + $latestReadyRevision = 'latestReadyRevision-853854545'; + $latestCreatedRevision = 'latestCreatedRevision452370698'; + $uri = 'uri116076'; + $satisfiesPzs = false; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Service(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); + $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setLatestReadyRevision($latestReadyRevision); + $expectedResponse->setLatestCreatedRevision($latestCreatedRevision); + $expectedResponse->setUri($uri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createServiceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $service = new Service(); + $serviceTemplate = new RevisionTemplate(); + $service->setTemplate($serviceTemplate); + $serviceId = 'serviceId-1724763419'; + $request = (new CreateServiceRequest()) + ->setParent($formattedParent) + ->setService($service) + ->setServiceId($serviceId); + $response = $gapicClient->createService($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Services/CreateService', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getService(); + $this->assertProtobufEquals($service, $actualValue); + $actualValue = $actualApiRequestObject->getServiceId(); + $this->assertProtobufEquals($serviceId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createServiceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createServiceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createServiceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $service = new Service(); + $serviceTemplate = new RevisionTemplate(); + $service->setTemplate($serviceTemplate); + $serviceId = 'serviceId-1724763419'; + $request = (new CreateServiceRequest()) + ->setParent($formattedParent) + ->setService($service) + ->setServiceId($serviceId); + $response = $gapicClient->createService($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createServiceTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteServiceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteServiceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; + $defaultUriDisabled = false; + $observedGeneration = 900833007; + $latestReadyRevision = 'latestReadyRevision-853854545'; + $latestCreatedRevision = 'latestCreatedRevision452370698'; + $uri = 'uri116076'; + $satisfiesPzs = false; + $reconciling = false; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Service(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); + $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setLatestReadyRevision($latestReadyRevision); + $expectedResponse->setLatestCreatedRevision($latestCreatedRevision); + $expectedResponse->setUri($uri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteServiceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + $request = (new DeleteServiceRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteService($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Services/DeleteService', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteServiceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteServiceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteServiceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + $request = (new DeleteServiceRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteService($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteServiceTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Services/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getServiceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; + $defaultUriDisabled = false; + $observedGeneration = 900833007; + $latestReadyRevision = 'latestReadyRevision-853854545'; + $latestCreatedRevision = 'latestCreatedRevision452370698'; + $uri = 'uri116076'; + $satisfiesPzs = false; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Service(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); + $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setLatestReadyRevision($latestReadyRevision); + $expectedResponse->setLatestCreatedRevision($latestCreatedRevision); + $expectedResponse->setUri($uri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + $request = (new GetServiceRequest()) + ->setName($formattedName); + $response = $gapicClient->getService($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Services/GetService', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getServiceExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->serviceName('[PROJECT]', '[LOCATION]', '[SERVICE]'); + $request = (new GetServiceRequest()) + ->setName($formattedName); + try { + $gapicClient->getService($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listServicesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $servicesElement = new Service(); + $services = [ + $servicesElement, + ]; + $expectedResponse = new ListServicesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setServices($services); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListServicesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listServices($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getServices()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Services/ListServices', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listServicesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListServicesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listServices($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Services/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Services/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateServiceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateServiceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; + $defaultUriDisabled = false; + $observedGeneration = 900833007; + $latestReadyRevision = 'latestReadyRevision-853854545'; + $latestCreatedRevision = 'latestCreatedRevision452370698'; + $uri = 'uri116076'; + $satisfiesPzs = false; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Service(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); + $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setLatestReadyRevision($latestReadyRevision); + $expectedResponse->setLatestCreatedRevision($latestCreatedRevision); + $expectedResponse->setUri($uri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateServiceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $service = new Service(); + $serviceTemplate = new RevisionTemplate(); + $service->setTemplate($serviceTemplate); + $request = (new UpdateServiceRequest()) + ->setService($service); + $response = $gapicClient->updateService($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Services/UpdateService', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getService(); + $this->assertProtobufEquals($service, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateServiceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateServiceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateServiceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $service = new Service(); + $serviceTemplate = new RevisionTemplate(); + $service->setTemplate($serviceTemplate); + $request = (new UpdateServiceRequest()) + ->setService($service); + $response = $gapicClient->updateService($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateServiceTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createServiceAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createServiceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $uid = 'uid115792'; + $generation = 305703192; + $creator = 'creator1028554796'; + $lastModifier = 'lastModifier-28366240'; + $client = 'client-1357712437'; + $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; + $defaultUriDisabled = false; + $observedGeneration = 900833007; + $latestReadyRevision = 'latestReadyRevision-853854545'; + $latestCreatedRevision = 'latestCreatedRevision452370698'; + $uri = 'uri116076'; + $satisfiesPzs = false; + $reconciling = false; + $etag = 'etag3123477'; + $expectedResponse = new Service(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setCreator($creator); + $expectedResponse->setLastModifier($lastModifier); + $expectedResponse->setClient($client); + $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); + $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setLatestReadyRevision($latestReadyRevision); + $expectedResponse->setLatestCreatedRevision($latestCreatedRevision); + $expectedResponse->setUri($uri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createServiceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $service = new Service(); + $serviceTemplate = new RevisionTemplate(); + $service->setTemplate($serviceTemplate); + $serviceId = 'serviceId-1724763419'; + $request = (new CreateServiceRequest()) + ->setParent($formattedParent) + ->setService($service) + ->setServiceId($serviceId); + $response = $gapicClient->createServiceAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Services/CreateService', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getService(); + $this->assertProtobufEquals($service, $actualValue); + $actualValue = $actualApiRequestObject->getServiceId(); + $this->assertProtobufEquals($serviceId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createServiceTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Run/v2/tests/Unit/V2/Client/TasksClientTest.php b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/TasksClientTest.php new file mode 100644 index 000000000000..2809f1bd76e8 --- /dev/null +++ b/owl-bot-staging/Run/v2/tests/Unit/V2/Client/TasksClientTest.php @@ -0,0 +1,285 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TasksClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TasksClient($options); + } + + /** @test */ + public function getTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $job = 'job105405'; + $execution = 'execution-1090974952'; + $maxRetries = 1129288043; + $serviceAccount = 'serviceAccount-1948028253'; + $reconciling = false; + $observedGeneration = 900833007; + $index = 100346066; + $retried = 1098377527; + $encryptionKey = 'encryptionKey-1122344029'; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $etag = 'etag3123477'; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setJob($job); + $expectedResponse->setExecution($execution); + $expectedResponse->setMaxRetries($maxRetries); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setIndex($index); + $expectedResponse->setRetried($retried); + $expectedResponse->setEncryptionKey($encryptionKey); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]', '[TASK]'); + $request = (new GetTaskRequest()) + ->setName($formattedName); + $response = $gapicClient->getTask($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Tasks/GetTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTaskExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]', '[TASK]'); + $request = (new GetTaskRequest()) + ->setName($formattedName); + try { + $gapicClient->getTask($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTasksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $tasksElement = new Task(); + $tasks = [ + $tasksElement, + ]; + $expectedResponse = new ListTasksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTasks($tasks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + $request = (new ListTasksRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listTasks($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTasks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Tasks/ListTasks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listTasksExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]'); + $request = (new ListTasksRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listTasks($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTaskAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $generation = 305703192; + $job = 'job105405'; + $execution = 'execution-1090974952'; + $maxRetries = 1129288043; + $serviceAccount = 'serviceAccount-1948028253'; + $reconciling = false; + $observedGeneration = 900833007; + $index = 100346066; + $retried = 1098377527; + $encryptionKey = 'encryptionKey-1122344029'; + $logUri = 'logUri342054385'; + $satisfiesPzs = false; + $etag = 'etag3123477'; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setGeneration($generation); + $expectedResponse->setJob($job); + $expectedResponse->setExecution($execution); + $expectedResponse->setMaxRetries($maxRetries); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setObservedGeneration($observedGeneration); + $expectedResponse->setIndex($index); + $expectedResponse->setRetried($retried); + $expectedResponse->setEncryptionKey($encryptionKey); + $expectedResponse->setLogUri($logUri); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[JOB]', '[EXECUTION]', '[TASK]'); + $request = (new GetTaskRequest()) + ->setName($formattedName); + $response = $gapicClient->getTaskAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Tasks/GetTask', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +}