From f05b101d74ddd0154be1e209de3ffcf146c228a6 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 2 Mar 2023 07:14:37 +0000 Subject: [PATCH 1/2] feat: added StatusEvent.task_state docs: updated comments PiperOrigin-RevId: 513426000 Source-Link: https://github.com/googleapis/googleapis/commit/3f95ea2d86b8e826350897efac1674d6784b4030 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b191b40b95e42eeea8d0bccf91dd1d1ba8a61fb1 Copy-Tag: eyJwIjoiQmF0Y2gvLk93bEJvdC55YW1sIiwiaCI6ImIxOTFiNDBiOTVlNDJlZWVhOGQwYmNjZjkxZGQxZDFiYThhNjFmYjEifQ== --- .../Google/Cloud/Batch/V1/Batch.php | 91 ++ .../GPBMetadata/Google/Cloud/Batch/V1/Job.php | Bin 0 -> 5386 bytes .../Google/Cloud/Batch/V1/Task.php | Bin 0 -> 3688 bytes .../Google/Cloud/Batch/V1/Volume.php | Bin 0 -> 1026 bytes .../Cloud/Batch/V1/AllocationPolicy.php | 262 +++++ .../Batch/V1/AllocationPolicy/Accelerator.php | 147 +++ .../V1/AllocationPolicy/AttachedDisk.php | 153 +++ .../Cloud/Batch/V1/AllocationPolicy/Disk.php | 298 ++++++ .../V1/AllocationPolicy/InstancePolicy.php | 271 ++++++ .../InstancePolicyOrTemplate.php | 163 ++++ .../V1/AllocationPolicy/LocationPolicy.php | 112 +++ .../V1/AllocationPolicy/NetworkInterface.php | 202 ++++ .../V1/AllocationPolicy/NetworkPolicy.php | 70 ++ .../V1/AllocationPolicy/ProvisioningModel.php | 75 ++ .../Batch/V1/AllocationPolicy_Accelerator.php | 16 + .../V1/AllocationPolicy_AttachedDisk.php | 16 + .../Cloud/Batch/V1/AllocationPolicy_Disk.php | 16 + .../V1/AllocationPolicy_InstancePolicy.php | 16 + ...ocationPolicy_InstancePolicyOrTemplate.php | 16 + .../V1/AllocationPolicy_LocationPolicy.php | 16 + .../V1/AllocationPolicy_NetworkInterface.php | 16 + .../V1/AllocationPolicy_NetworkPolicy.php | 16 + .../V1/AllocationPolicy_ProvisioningModel.php | 16 + .../Cloud/Batch/V1/BatchServiceGrpcClient.php | 127 +++ .../Google/Cloud/Batch/V1/ComputeResource.php | 135 +++ .../Cloud/Batch/V1/CreateJobRequest.php | 251 +++++ .../Cloud/Batch/V1/DeleteJobRequest.php | 175 ++++ .../src/Google/Cloud/Batch/V1/Environment.php | 158 +++ .../Cloud/Batch/V1/Environment/KMSEnvMap.php | 102 ++ .../Cloud/Batch/V1/Environment_KMSEnvMap.php | 16 + .../proto/src/Google/Cloud/Batch/V1/GCS.php | 71 ++ .../Google/Cloud/Batch/V1/GetJobRequest.php | 67 ++ .../Google/Cloud/Batch/V1/GetTaskRequest.php | 67 ++ .../proto/src/Google/Cloud/Batch/V1/Job.php | 513 ++++++++++ .../Google/Cloud/Batch/V1/JobNotification.php | 131 +++ .../Batch/V1/JobNotification/Message.php | 140 +++ .../Cloud/Batch/V1/JobNotification/Type.php | 64 ++ .../Batch/V1/JobNotification_Message.php | 16 + .../Cloud/Batch/V1/JobNotification_Type.php | 16 + .../src/Google/Cloud/Batch/V1/JobStatus.php | 183 ++++ .../Batch/V1/JobStatus/InstanceStatus.php | 182 ++++ .../Google/Cloud/Batch/V1/JobStatus/State.php | 94 ++ .../Batch/V1/JobStatus/TaskGroupStatus.php | 108 +++ .../Batch/V1/JobStatus_InstanceStatus.php | 16 + .../Google/Cloud/Batch/V1/JobStatus_State.php | 16 + .../Batch/V1/JobStatus_TaskGroupStatus.php | 16 + .../Google/Cloud/Batch/V1/LifecyclePolicy.php | 128 +++ .../Cloud/Batch/V1/LifecyclePolicy/Action.php | 64 ++ .../V1/LifecyclePolicy/ActionCondition.php | 82 ++ .../Cloud/Batch/V1/LifecyclePolicy_Action.php | 16 + .../V1/LifecyclePolicy_ActionCondition.php | 16 + .../Google/Cloud/Batch/V1/ListJobsRequest.php | 169 ++++ .../Cloud/Batch/V1/ListJobsResponse.php | 135 +++ .../Cloud/Batch/V1/ListTasksRequest.php | 185 ++++ .../Cloud/Batch/V1/ListTasksResponse.php | 135 +++ .../src/Google/Cloud/Batch/V1/LogsPolicy.php | 110 +++ .../Cloud/Batch/V1/LogsPolicy/Destination.php | 64 ++ .../Cloud/Batch/V1/LogsPolicy_Destination.php | 16 + .../proto/src/Google/Cloud/Batch/V1/NFS.php | 101 ++ .../Cloud/Batch/V1/OperationMetadata.php | 307 ++++++ .../src/Google/Cloud/Batch/V1/Runnable.php | 372 +++++++ .../Cloud/Batch/V1/Runnable/Barrier.php | 74 ++ .../Cloud/Batch/V1/Runnable/Container.php | 352 +++++++ .../Google/Cloud/Batch/V1/Runnable/Script.php | 147 +++ .../Cloud/Batch/V1/Runnable_Barrier.php | 16 + .../Cloud/Batch/V1/Runnable_Container.php | 16 + .../Google/Cloud/Batch/V1/Runnable_Script.php | 16 + .../Google/Cloud/Batch/V1/ServiceAccount.php | 117 +++ .../src/Google/Cloud/Batch/V1/StatusEvent.php | 223 +++++ .../proto/src/Google/Cloud/Batch/V1/Task.php | 123 +++ .../Google/Cloud/Batch/V1/TaskExecution.php | 72 ++ .../src/Google/Cloud/Batch/V1/TaskGroup.php | 388 ++++++++ .../src/Google/Cloud/Batch/V1/TaskSpec.php | 412 ++++++++ .../src/Google/Cloud/Batch/V1/TaskStatus.php | 101 ++ .../Cloud/Batch/V1/TaskStatus/State.php | 85 ++ .../Cloud/Batch/V1/TaskStatus_State.php | 16 + .../src/Google/Cloud/Batch/V1/Volume.php | 256 +++++ .../V1/BatchServiceClient/create_job.php | 77 ++ .../V1/BatchServiceClient/delete_job.php | 62 ++ .../samples/V1/BatchServiceClient/get_job.php | 66 ++ .../V1/BatchServiceClient/get_location.php | 53 + .../V1/BatchServiceClient/get_task.php | 72 ++ .../V1/BatchServiceClient/list_jobs.php | 58 ++ .../V1/BatchServiceClient/list_locations.php | 58 ++ .../V1/BatchServiceClient/list_tasks.php | 78 ++ .../Batch/v1/src/V1/BatchServiceClient.php | 34 + .../src/V1/Gapic/BatchServiceGapicClient.php | 910 ++++++++++++++++++ .../Batch/v1/src/V1/gapic_metadata.json | 58 ++ .../batch_service_client_config.json | 84 ++ .../batch_service_descriptor_config.php | 48 + .../batch_service_rest_client_config.php | 147 +++ .../tests/Unit/V1/BatchServiceClientTest.php | 628 ++++++++++++ 92 files changed, 11399 insertions(+) create mode 100644 owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Batch.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Job.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Task.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Volume.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Accelerator.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/AttachedDisk.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Disk.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicy.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicyOrTemplate.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/LocationPolicy.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkInterface.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkPolicy.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/ProvisioningModel.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_Accelerator.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_AttachedDisk.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_Disk.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_InstancePolicy.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_InstancePolicyOrTemplate.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_LocationPolicy.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_NetworkInterface.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_NetworkPolicy.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_ProvisioningModel.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/BatchServiceGrpcClient.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ComputeResource.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/CreateJobRequest.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/DeleteJobRequest.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment/KMSEnvMap.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment_KMSEnvMap.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GCS.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetJobRequest.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetTaskRequest.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Job.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Message.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Type.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification_Message.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification_Type.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/InstanceStatus.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/State.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/TaskGroupStatus.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus_InstanceStatus.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus_State.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus_TaskGroupStatus.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/Action.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/ActionCondition.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy_Action.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy_ActionCondition.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListJobsRequest.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListJobsResponse.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksRequest.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksResponse.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy/Destination.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy_Destination.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/NFS.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/OperationMetadata.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Barrier.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Container.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Script.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable_Barrier.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable_Container.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable_Script.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ServiceAccount.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/StatusEvent.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Task.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskExecution.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskGroup.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskSpec.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus/State.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus_State.php create mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Volume.php create mode 100644 owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/create_job.php create mode 100644 owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/delete_job.php create mode 100644 owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_job.php create mode 100644 owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_location.php create mode 100644 owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_task.php create mode 100644 owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_jobs.php create mode 100644 owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_locations.php create mode 100644 owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_tasks.php create mode 100644 owl-bot-staging/Batch/v1/src/V1/BatchServiceClient.php create mode 100644 owl-bot-staging/Batch/v1/src/V1/Gapic/BatchServiceGapicClient.php create mode 100644 owl-bot-staging/Batch/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/Batch/v1/src/V1/resources/batch_service_client_config.json create mode 100644 owl-bot-staging/Batch/v1/src/V1/resources/batch_service_descriptor_config.php create mode 100644 owl-bot-staging/Batch/v1/src/V1/resources/batch_service_rest_client_config.php create mode 100644 owl-bot-staging/Batch/v1/tests/Unit/V1/BatchServiceClientTest.php diff --git a/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Batch.php b/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Batch.php new file mode 100644 index 000000000000..08b6865323ca --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Batch.php @@ -0,0 +1,91 @@ +internalAddGeneratedFile( + ' + +!google/cloud/batch/v1/batch.protogoogle.cloud.batch.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/cloud/batch/v1/job.proto google/cloud/batch/v1/task.proto#google/longrunning/operations.protogoogle/protobuf/empty.protogoogle/protobuf/timestamp.proto" +CreateJobRequest0 +parent ( B AAbatch.googleapis.com/Job +job_id ( , +job ( 2.google.cloud.batch.v1.JobBA + +request_id ( BA"? + GetJobRequest. +name ( B AA +batch.googleapis.com/Job"N +DeleteJobRequest +name (  +reason ( BA + +request_id ( BA"X +ListJobsRequest +parent (  +filter (  + page_size ( + +page_token ( "j +ListJobsResponse( +jobs ( 2.google.cloud.batch.v1.Job +next_page_token (  + unreachable ( " +ListTasksRequest6 +parent ( B&AA +batch.googleapis.com/TaskGroup +filter (  + page_size ( + +page_token ( "m +ListTasksResponse* +tasks ( 2.google.cloud.batch.v1.Task +next_page_token (  + unreachable ( "A +GetTaskRequest/ +name ( B!AA +batch.googleapis.com/Task" +OperationMetadata4 + create_time ( 2.google.protobuf.TimestampBA1 +end_time ( 2.google.protobuf.TimestampBA +target ( BA +verb ( BA +status_message ( BA# +requested_cancellation (BA + api_version ( BA2 + BatchService + CreateJob\'.google.cloud.batch.v1.CreateJobRequest.google.cloud.batch.v1.Job"I/"(/v1/{parent=projects/*/locations/*}/jobs:jobAparent,job,job_id +GetJob$.google.cloud.batch.v1.GetJobRequest.google.cloud.batch.v1.Job"7*(/v1/{name=projects/*/locations/*/jobs/*}Aname + DeleteJob\'.google.cloud.batch.v1.DeleteJobRequest.google.longrunning.Operation"z**(/v1/{name=projects/*/locations/*/jobs/*}AnameA@ +google.protobuf.Empty\'google.cloud.batch.v1.OperationMetadata +ListJobs&.google.cloud.batch.v1.ListJobsRequest\'.google.cloud.batch.v1.ListJobsResponse"9*(/v1/{parent=projects/*/locations/*}/jobsAparent +GetTask%.google.cloud.batch.v1.GetTaskRequest.google.cloud.batch.v1.Task"L?=/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}Aname + ListTasks\'.google.cloud.batch.v1.ListTasksRequest(.google.cloud.batch.v1.ListTasksResponse"N?=/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasksAparentHAbatch.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB +com.google.cloud.batch.v1B +BatchProtoPZ/cloud.google.com/go/batch/apiv1/batchpb;batchpbGCBGoogle.Cloud.Batch.V1Google\\Cloud\\Batch\\V1Google::Cloud::Batch::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Job.php b/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Job.php new file mode 100644 index 0000000000000000000000000000000000000000..562591488590b5ab3a61109d35752f9ca8eae616 GIT binary patch literal 5386 zcmbtYTXWmS6%I*V$U}*u;7e#`#zvU5Rwgl6F^QYdaU9-6(UwR?q}*wTGbjkIC|DqX zU;#O*M>FkfpZXj6)=ppgANtgX&a}Uvj~V}lKJ@G^08z9UQ>`9E5;))4-E+Qk+pnHD z#}0fTH;F}D%_AducqV(tM0Q-;vvu2)hyKwKab?|}IEG1FMV9Lwx!vi@je4v9K0>MO zyE-Y$W7{5^q^O&=KPnD2Pd_f6ZWmwJLxt-Cu(S!Gj;0g2*{$vqPaA2THfVC#pvGW> zDuWH4Z$ARiO^s6dsXc^OAmg9o4^2atsi%4P@u5Lg!!kTWGmYQit{=-snn?-b-jqG^ zE!{J0OJ;zMrIW3XWTBJEe(2bE%ExlJkuEzp9(vHSJmOlKIj9q=yN2W0ZWl$%!k_%n%KS28ivc}UU&ed4%z6W0$ zfwL;3QRJH)?)1|iv;h(O-1j$@Yq72@P}ncU@%CVu*Bjh7n5UKscPcim4uXqgl~*; z@#!Z?$3=1&-dQezj}uZE(rh>C*tLC!=9c8dR=OlBSDsX1PHr+mravxKVN)|rTjw5B z9UH^&EVqhk)1|@vIVvgv3uvxeriA)vD>qW+^658Yi(LGvx6?{7{hCat<;n#DP(D66^KQH_x1~7G= zDx^mks)ogh!grD>J$S1f6wI$72?w$!|1vH3z1($f;}!MpWFuit7{`mIh|J#6>7 zjaqA`)u?CRLHK%YuX9*e_d3mHtKH1Tq$DhLEB)PUyztvqNJTV3Vl6XbiAc(neuR&L zR|@+e(wDH#U_MpJDX~0?n`EI>m~%{lZ7@-(aa9cdYz{Em=tVSA5fMdLbA3w<6G(2E z^X*QkC*pRPbMyaHmCqX)T0;!>Gd+NxbCzy;_D*0s51?q^&|0@O? zQJM-4wFfJ@?K7XmxKF;CqwxyU3Jpq)!-bivkTL?Jg-$NMRpDhbvk;wDIX^@bEJXAA z)R_WjUxGZDj_P#j8q^WzV~Z4C!7}?rq+77r>sR`XnGgb4`S!4Jh~X5&G?MDob{qA> zJ^UG$(y)4P*lx49O7M4wwOXT5$9GE-!geYxCbul*;AXwC*WmHlYOCFYPV=DA>t$C8 z|B1r}ntwWvF)m_nNByDd*^Z$H8SDwHV%?|OSmdyDNtti_X?4oJK;{1ygVo?W2JKQr z^GxaE1vT|CG9;Fy$xHQxJya=A7p%-Ko-Uq1hQT@i1)kO8%>2U1NG-f25>DY6Eb)!p zglzwp-C1v;6Q6dfs&Hg&x6*EM$K3|0U+F!Yc^)tPum;)Lh?RCB8K!q`{B-Hz91G1t zv6_k66;!m|bj*l4|IMPR!q5?_I&Pm#9Fy_%YuKQ~JvDTqYB~?_pcVMZ9MwG`T@k`k zE$Td0cv|>$4(!dtO|>CAuxb(SrR|;sozLfsYH16YI9C2+$jsR6j_9sll93vEK_swL z{ySJ=$xhmUWn;o3fo00n?mLnMNor{hJ+?ib{@Js&DUPQQvPy9vG#R+zHtIu>ml!&EUBnaAzGIKRWcCbx+wkXS|Ig|fu403bBc^6h3 zF+#8r<{G)?vPR_3d$7q}j%|(V1=&LMjQr(~@L>}+#2zAC{uhu9BDEDp2n(Vx==r#X zaR*qZ!e@dmcj2~WtK@reS)dw@s*OfC9|qjZ6Ij2L0;E1jfrg7<3|p2j7PWVvGTQ4k zr-8z+Ve`#KtpIniRzGj`u(8G>ukLrSjL)$zSc8Dgb+6m$V{fnl>Fz2qVoVtm+s9uJ}-(WCgxG}0_NN{@4Fl1!HE*A)})UO9rX6Y`N;dWtRhH3zXG z+a^cjWX8A5$Ncj`5i&Ey5VIzkXoeYdSs9$Jb=x7L!%bEH6oWfB5nk2js@g02Ku48^!}TZfw$N$1@sP-XtQjq|qhd zGWi32>3`@WzoO6m3w`5}$G&%_XLlvXF>wRULo6NbclKPqbI$I=$L^jB*W?DZsiy~Y zAooXdut#Ora{|Y3EV&=<>`+fOoS|!4)Kg@+wkfwZyK=qO>|RBv?}VN~Re9HOb}d>o zEGHZk`+8vP6%W>nf$r}sTp56^52^3!29+D_$_pCk13l1t4UX$o8Ln4hxZd{q0|3L) zeP8Y(9^QhCe{R^fOhfhqJ;0yqrmvZ{8JN0d{(^RI$UC~_Qv`mzb|C>!6<-a%@SPxsGo4nsz`vTeo^O>KmTv29DRprK-A1gK@x^WbJ0OEmLRi z$ZNtzRsG1w4LR^aI=Q z98&d@;p33hLSzX>@_#_PCT2g-hwjN(o`u_w%qZsN!C)NXCrG@taZp%@ZovBsa4O@- zs^Fx;IjL|?DhKQN!pT%U;6V{&&0mhzaOxr%ii61W==+uF??LRISWwu6nwnzZUT}X?)SS&wdFY+BMGGORyJUl*zCWUSmX4opW<54f@kY=xxtiriY zx7@93FI$~#bU|)mTYjiZbO+r`c%XrzHEd^|IAspHi6j`6uP( zbNnzz7D4K~tXAvw8os6rf6qZ?E3|FBZ&C6HIpf%YZeoAtQOK5V&M-5^DAgG7^bENV z^P+b}>HqpPaEEs~M5?gR*FDd~edjp~X6ACdaYd|0a2|-cYdaoAE@2Kuv^iBXjPrfn z*x&V>&>nDxahYzt)KoR9lh{#^p3alBZCnnQh;YN018R3a;o!Pz&|?SY_)#Oz0Vypii*vx>@Z85TtQ z@X^i`)*}iWmz9vuZIH-ixX`y8gB6#UDw<7$*N(TJlhDQt+b8tdxWP&Vl<=Kh9D%rI zkjpYj{tnEG^pGW(bM;_P)H%i*-vd<4lPo z(uNfQ$Gq4BJgVV9VIwYEy8Bs*us#Jk{}n6?-D452#&}HlXlH6IU3d)hkqH-ol&jt5 zW^1ZVF9B@TyIVhL-E!v{c4}gx~X z04|B6hZwxNYx)XSN|A5yBetYh)Cm0I+vw@Ah;4!&vQQR39u{9YeSF9Nhx|<4!0zdy zAYk*FwNh8eBhg{uw-jV2SU_qZ9q69PYF&hBHjgJ@%65$5JSIQDicbwZv1&)k#PGZ~ zBNmg&IvhHsvI*y@ZD2da+sA}fcC5*kZheB*XD>Rq$qU`hW7`_Pu!f3+*Nz$ zh4jH|6(^M2e-Qoto=i2Wm3PV22ER-x{J5`F*kwxDUjH+e_o7=?bj`wh)`w(HKvb1u pRF#8Nb$h)(&!^>`8{?DrEpd67xa+WLFpU%LIeewKk{rSzz`wA-aP|NI literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Volume.php b/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Volume.php new file mode 100644 index 0000000000000000000000000000000000000000..fa8ca8061c1c73d2e747bfcc335cfc3d120737af GIT binary patch literal 1026 zcmaiz-Hy^g6vqXW$Pm52kkq|8;wB45OIYuUXk>A5FI-66aABH|VK~4fZKs(|N!0K% zUT%C6U&O?xa6Yfp5*D99Z4go^lwcx)MZQ|0 z1SaB?M<{)O(FD#X7w~R$cJV}8Gm%S%0jz~sN7!YN$d}y(RczDU_PSdUq^r_mm!LeDyYt6rvNd_8)2mMD}7jlvOT zO!8C-In~l2Sfkosnu)YKMOl-Mub}OE41ya?4nWBquU7|BskXjC9R1ukugn_{2z?q`t&0XE-+~cvWqw>2QOPSmcSCr&MjcyC$lo4_r*7 zW^b8y4=U~2@II+J;#$v0Mb~dU)B%)Rl(yGe;}NM#jD_CrZy#}3clTj|n3g^{zV})Ych{nzou*s^Z|^c)^o#RbSr;B&mYWW8-$L$N$o*OG z$5lKm=r8cs{QoL@&JqOH69m>21hd|vYJaDfNBiABcSv0$@UQe)r2}n8c7*%}XQevv literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy.php new file mode 100644 index 000000000000..20b0362ee475 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy.php @@ -0,0 +1,262 @@ +google.cloud.batch.v1.AllocationPolicy + */ +class AllocationPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Location where compute resources should be allocated for the Job. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + */ + protected $location = null; + /** + * Describe instances that can be created by this AllocationPolicy. + * Only instances[0] is supported now. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + */ + private $instances; + /** + * Service account that VMs will run as. + * + * Generated from protobuf field .google.cloud.batch.v1.ServiceAccount service_account = 9; + */ + protected $service_account = null; + /** + * Labels applied to all VM instances and other resources + * created by AllocationPolicy. + * Labels could be user provided or system generated. + * You can assign up to 64 labels. [Google Compute Engine label + * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) + * apply. + * Label names that start with "goog-" or "google-" are reserved. + * + * Generated from protobuf field map labels = 6; + */ + private $labels; + /** + * The network policy. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + */ + protected $network = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Batch\V1\AllocationPolicy\LocationPolicy $location + * Location where compute resources should be allocated for the Job. + * @type array<\Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicyOrTemplate>|\Google\Protobuf\Internal\RepeatedField $instances + * Describe instances that can be created by this AllocationPolicy. + * Only instances[0] is supported now. + * @type \Google\Cloud\Batch\V1\ServiceAccount $service_account + * Service account that VMs will run as. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels applied to all VM instances and other resources + * created by AllocationPolicy. + * Labels could be user provided or system generated. + * You can assign up to 64 labels. [Google Compute Engine label + * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) + * apply. + * Label names that start with "goog-" or "google-" are reserved. + * @type \Google\Cloud\Batch\V1\AllocationPolicy\NetworkPolicy $network + * The network policy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Location where compute resources should be allocated for the Job. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + * @return \Google\Cloud\Batch\V1\AllocationPolicy\LocationPolicy|null + */ + public function getLocation() + { + return $this->location; + } + + public function hasLocation() + { + return isset($this->location); + } + + public function clearLocation() + { + unset($this->location); + } + + /** + * Location where compute resources should be allocated for the Job. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; + * @param \Google\Cloud\Batch\V1\AllocationPolicy\LocationPolicy $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\LocationPolicy::class); + $this->location = $var; + + return $this; + } + + /** + * Describe instances that can be created by this AllocationPolicy. + * Only instances[0] is supported now. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * Describe instances that can be created by this AllocationPolicy. + * Only instances[0] is supported now. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; + * @param array<\Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicyOrTemplate>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicyOrTemplate::class); + $this->instances = $arr; + + return $this; + } + + /** + * Service account that VMs will run as. + * + * Generated from protobuf field .google.cloud.batch.v1.ServiceAccount service_account = 9; + * @return \Google\Cloud\Batch\V1\ServiceAccount|null + */ + public function getServiceAccount() + { + return $this->service_account; + } + + public function hasServiceAccount() + { + return isset($this->service_account); + } + + public function clearServiceAccount() + { + unset($this->service_account); + } + + /** + * Service account that VMs will run as. + * + * Generated from protobuf field .google.cloud.batch.v1.ServiceAccount service_account = 9; + * @param \Google\Cloud\Batch\V1\ServiceAccount $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\ServiceAccount::class); + $this->service_account = $var; + + return $this; + } + + /** + * Labels applied to all VM instances and other resources + * created by AllocationPolicy. + * Labels could be user provided or system generated. + * You can assign up to 64 labels. [Google Compute Engine label + * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) + * apply. + * Label names that start with "goog-" or "google-" are reserved. + * + * Generated from protobuf field map labels = 6; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels applied to all VM instances and other resources + * created by AllocationPolicy. + * Labels could be user provided or system generated. + * You can assign up to 64 labels. [Google Compute Engine label + * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) + * apply. + * Label names that start with "goog-" or "google-" are reserved. + * + * Generated from protobuf field map labels = 6; + * @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; + } + + /** + * The network policy. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + * @return \Google\Cloud\Batch\V1\AllocationPolicy\NetworkPolicy|null + */ + public function getNetwork() + { + return $this->network; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * The network policy. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; + * @param \Google\Cloud\Batch\V1\AllocationPolicy\NetworkPolicy $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\NetworkPolicy::class); + $this->network = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Accelerator.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Accelerator.php new file mode 100644 index 000000000000..ce0e80128600 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Accelerator.php @@ -0,0 +1,147 @@ +google.cloud.batch.v1.AllocationPolicy.Accelerator + */ +class Accelerator extends \Google\Protobuf\Internal\Message +{ + /** + * The accelerator type. For example, "nvidia-tesla-t4". + * See `gcloud compute accelerator-types list`. + * + * Generated from protobuf field string type = 1; + */ + protected $type = ''; + /** + * The number of accelerators of this type. + * + * Generated from protobuf field int64 count = 2; + */ + protected $count = 0; + /** + * Deprecated: please use instances[0].install_gpu_drivers instead. + * + * Generated from protobuf field bool install_gpu_drivers = 3 [deprecated = true]; + * @deprecated + */ + protected $install_gpu_drivers = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type + * The accelerator type. For example, "nvidia-tesla-t4". + * See `gcloud compute accelerator-types list`. + * @type int|string $count + * The number of accelerators of this type. + * @type bool $install_gpu_drivers + * Deprecated: please use instances[0].install_gpu_drivers instead. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * The accelerator type. For example, "nvidia-tesla-t4". + * See `gcloud compute accelerator-types list`. + * + * Generated from protobuf field string type = 1; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The accelerator type. For example, "nvidia-tesla-t4". + * See `gcloud compute accelerator-types list`. + * + * 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; + } + + /** + * The number of accelerators of this type. + * + * Generated from protobuf field int64 count = 2; + * @return int|string + */ + public function getCount() + { + return $this->count; + } + + /** + * The number of accelerators of this type. + * + * Generated from protobuf field int64 count = 2; + * @param int|string $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkInt64($var); + $this->count = $var; + + return $this; + } + + /** + * Deprecated: please use instances[0].install_gpu_drivers instead. + * + * Generated from protobuf field bool install_gpu_drivers = 3 [deprecated = true]; + * @return bool + * @deprecated + */ + public function getInstallGpuDrivers() + { + @trigger_error('install_gpu_drivers is deprecated.', E_USER_DEPRECATED); + return $this->install_gpu_drivers; + } + + /** + * Deprecated: please use instances[0].install_gpu_drivers instead. + * + * Generated from protobuf field bool install_gpu_drivers = 3 [deprecated = true]; + * @param bool $var + * @return $this + * @deprecated + */ + public function setInstallGpuDrivers($var) + { + @trigger_error('install_gpu_drivers is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkBool($var); + $this->install_gpu_drivers = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Accelerator::class, \Google\Cloud\Batch\V1\AllocationPolicy_Accelerator::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/AttachedDisk.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/AttachedDisk.php new file mode 100644 index 000000000000..d57b97912d09 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/AttachedDisk.php @@ -0,0 +1,153 @@ +google.cloud.batch.v1.AllocationPolicy.AttachedDisk + */ +class AttachedDisk extends \Google\Protobuf\Internal\Message +{ + /** + * Device name that the guest operating system will see. + * It is used by Runnable.volumes field to mount disks. So please specify + * the device_name if you want Batch to help mount the disk, and it should + * match the device_name field in volumes. + * + * Generated from protobuf field string device_name = 3; + */ + protected $device_name = ''; + protected $attached; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Batch\V1\AllocationPolicy\Disk $new_disk + * @type string $existing_disk + * Name of an existing PD. + * @type string $device_name + * Device name that the guest operating system will see. + * It is used by Runnable.volumes field to mount disks. So please specify + * the device_name if you want Batch to help mount the disk, and it should + * match the device_name field in volumes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; + * @return \Google\Cloud\Batch\V1\AllocationPolicy\Disk|null + */ + public function getNewDisk() + { + return $this->readOneof(1); + } + + public function hasNewDisk() + { + return $this->hasOneof(1); + } + + /** + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; + * @param \Google\Cloud\Batch\V1\AllocationPolicy\Disk $var + * @return $this + */ + public function setNewDisk($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\Disk::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Name of an existing PD. + * + * Generated from protobuf field string existing_disk = 2; + * @return string + */ + public function getExistingDisk() + { + return $this->readOneof(2); + } + + public function hasExistingDisk() + { + return $this->hasOneof(2); + } + + /** + * Name of an existing PD. + * + * Generated from protobuf field string existing_disk = 2; + * @param string $var + * @return $this + */ + public function setExistingDisk($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Device name that the guest operating system will see. + * It is used by Runnable.volumes field to mount disks. So please specify + * the device_name if you want Batch to help mount the disk, and it should + * match the device_name field in volumes. + * + * Generated from protobuf field string device_name = 3; + * @return string + */ + public function getDeviceName() + { + return $this->device_name; + } + + /** + * Device name that the guest operating system will see. + * It is used by Runnable.volumes field to mount disks. So please specify + * the device_name if you want Batch to help mount the disk, and it should + * match the device_name field in volumes. + * + * Generated from protobuf field string device_name = 3; + * @param string $var + * @return $this + */ + public function setDeviceName($var) + { + GPBUtil::checkString($var, True); + $this->device_name = $var; + + return $this; + } + + /** + * @return string + */ + public function getAttached() + { + return $this->whichOneof("attached"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AttachedDisk::class, \Google\Cloud\Batch\V1\AllocationPolicy_AttachedDisk::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Disk.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Disk.php new file mode 100644 index 000000000000..72f07c40c715 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Disk.php @@ -0,0 +1,298 @@ +google.cloud.batch.v1.AllocationPolicy.Disk + */ +class Disk extends \Google\Protobuf\Internal\Message +{ + /** + * Disk type as shown in `gcloud compute disk-types list`. + * For example, local SSD uses type "local-ssd". + * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" + * or "pd-standard". + * + * Generated from protobuf field string type = 1; + */ + protected $type = ''; + /** + * Disk size in GB. + * For persistent disk, this field is ignored if `data_source` is `image` or + * `snapshot`. + * For local SSD, size_gb should be a multiple of 375GB, + * otherwise, the final size will be the next greater multiple of 375 GB. + * For boot disk, Batch will calculate the boot disk size based on source + * image and task requirements if you do not speicify the size. + * If both this field and the boot_disk_mib field in task spec's + * compute_resource are defined, Batch will only honor this field. + * + * Generated from protobuf field int64 size_gb = 2; + */ + protected $size_gb = 0; + /** + * Local SSDs are available through both "SCSI" and "NVMe" interfaces. + * If not indicated, "NVMe" will be the default one for local ssds. + * We only support "SCSI" for persistent disks now. + * + * Generated from protobuf field string disk_interface = 6; + */ + protected $disk_interface = ''; + protected $data_source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $image + * Name of a public or custom image used as the data source. + * For example, the following are all valid URLs: + * (1) Specify the image by its family name: + * projects/{project}/global/images/family/{image_family} + * (2) Specify the image version: + * projects/{project}/global/images/{image_version} + * You can also use Batch customized image in short names. + * The following image values are supported for a boot disk: + * "batch-debian": use Batch Debian images. + * "batch-centos": use Batch CentOS images. + * "batch-cos": use Batch Container-Optimized images. + * @type string $snapshot + * Name of a snapshot used as the data source. + * @type string $type + * Disk type as shown in `gcloud compute disk-types list`. + * For example, local SSD uses type "local-ssd". + * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" + * or "pd-standard". + * @type int|string $size_gb + * Disk size in GB. + * For persistent disk, this field is ignored if `data_source` is `image` or + * `snapshot`. + * For local SSD, size_gb should be a multiple of 375GB, + * otherwise, the final size will be the next greater multiple of 375 GB. + * For boot disk, Batch will calculate the boot disk size based on source + * image and task requirements if you do not speicify the size. + * If both this field and the boot_disk_mib field in task spec's + * compute_resource are defined, Batch will only honor this field. + * @type string $disk_interface + * Local SSDs are available through both "SCSI" and "NVMe" interfaces. + * If not indicated, "NVMe" will be the default one for local ssds. + * We only support "SCSI" for persistent disks now. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Name of a public or custom image used as the data source. + * For example, the following are all valid URLs: + * (1) Specify the image by its family name: + * projects/{project}/global/images/family/{image_family} + * (2) Specify the image version: + * projects/{project}/global/images/{image_version} + * You can also use Batch customized image in short names. + * The following image values are supported for a boot disk: + * "batch-debian": use Batch Debian images. + * "batch-centos": use Batch CentOS images. + * "batch-cos": use Batch Container-Optimized images. + * + * Generated from protobuf field string image = 4; + * @return string + */ + public function getImage() + { + return $this->readOneof(4); + } + + public function hasImage() + { + return $this->hasOneof(4); + } + + /** + * Name of a public or custom image used as the data source. + * For example, the following are all valid URLs: + * (1) Specify the image by its family name: + * projects/{project}/global/images/family/{image_family} + * (2) Specify the image version: + * projects/{project}/global/images/{image_version} + * You can also use Batch customized image in short names. + * The following image values are supported for a boot disk: + * "batch-debian": use Batch Debian images. + * "batch-centos": use Batch CentOS images. + * "batch-cos": use Batch Container-Optimized images. + * + * Generated from protobuf field string image = 4; + * @param string $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Name of a snapshot used as the data source. + * + * Generated from protobuf field string snapshot = 5; + * @return string + */ + public function getSnapshot() + { + return $this->readOneof(5); + } + + public function hasSnapshot() + { + return $this->hasOneof(5); + } + + /** + * Name of a snapshot used as the data source. + * + * Generated from protobuf field string snapshot = 5; + * @param string $var + * @return $this + */ + public function setSnapshot($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Disk type as shown in `gcloud compute disk-types list`. + * For example, local SSD uses type "local-ssd". + * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" + * or "pd-standard". + * + * Generated from protobuf field string type = 1; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Disk type as shown in `gcloud compute disk-types list`. + * For example, local SSD uses type "local-ssd". + * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" + * or "pd-standard". + * + * 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; + } + + /** + * Disk size in GB. + * For persistent disk, this field is ignored if `data_source` is `image` or + * `snapshot`. + * For local SSD, size_gb should be a multiple of 375GB, + * otherwise, the final size will be the next greater multiple of 375 GB. + * For boot disk, Batch will calculate the boot disk size based on source + * image and task requirements if you do not speicify the size. + * If both this field and the boot_disk_mib field in task spec's + * compute_resource are defined, Batch will only honor this field. + * + * Generated from protobuf field int64 size_gb = 2; + * @return int|string + */ + public function getSizeGb() + { + return $this->size_gb; + } + + /** + * Disk size in GB. + * For persistent disk, this field is ignored if `data_source` is `image` or + * `snapshot`. + * For local SSD, size_gb should be a multiple of 375GB, + * otherwise, the final size will be the next greater multiple of 375 GB. + * For boot disk, Batch will calculate the boot disk size based on source + * image and task requirements if you do not speicify the size. + * If both this field and the boot_disk_mib field in task spec's + * compute_resource are defined, Batch will only honor this field. + * + * Generated from protobuf field int64 size_gb = 2; + * @param int|string $var + * @return $this + */ + public function setSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->size_gb = $var; + + return $this; + } + + /** + * Local SSDs are available through both "SCSI" and "NVMe" interfaces. + * If not indicated, "NVMe" will be the default one for local ssds. + * We only support "SCSI" for persistent disks now. + * + * Generated from protobuf field string disk_interface = 6; + * @return string + */ + public function getDiskInterface() + { + return $this->disk_interface; + } + + /** + * Local SSDs are available through both "SCSI" and "NVMe" interfaces. + * If not indicated, "NVMe" will be the default one for local ssds. + * We only support "SCSI" for persistent disks now. + * + * Generated from protobuf field string disk_interface = 6; + * @param string $var + * @return $this + */ + public function setDiskInterface($var) + { + GPBUtil::checkString($var, True); + $this->disk_interface = $var; + + return $this; + } + + /** + * @return string + */ + public function getDataSource() + { + return $this->whichOneof("data_source"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Disk::class, \Google\Cloud\Batch\V1\AllocationPolicy_Disk::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicy.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicy.php new file mode 100644 index 000000000000..5be6f1b9036a --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicy.php @@ -0,0 +1,271 @@ +google.cloud.batch.v1.AllocationPolicy.InstancePolicy + */ +class InstancePolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The Compute Engine machine type. + * + * Generated from protobuf field string machine_type = 2; + */ + protected $machine_type = ''; + /** + * The minimum CPU platform. + * See + * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. + * Not yet implemented. + * + * Generated from protobuf field string min_cpu_platform = 3; + */ + protected $min_cpu_platform = ''; + /** + * The provisioning model. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 4; + */ + protected $provisioning_model = 0; + /** + * The accelerators attached to each VM instance. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + */ + private $accelerators; + /** + * Book disk to be created and attached to each VM by this InstancePolicy. + * Boot disk will be deleted when the VM is deleted. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + */ + protected $boot_disk = null; + /** + * Non-boot disks to be attached for each VM created by this InstancePolicy. + * New disks will be deleted when the VM is deleted. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + */ + private $disks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $machine_type + * The Compute Engine machine type. + * @type string $min_cpu_platform + * The minimum CPU platform. + * See + * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. + * Not yet implemented. + * @type int $provisioning_model + * The provisioning model. + * @type array<\Google\Cloud\Batch\V1\AllocationPolicy\Accelerator>|\Google\Protobuf\Internal\RepeatedField $accelerators + * The accelerators attached to each VM instance. + * @type \Google\Cloud\Batch\V1\AllocationPolicy\Disk $boot_disk + * Book disk to be created and attached to each VM by this InstancePolicy. + * Boot disk will be deleted when the VM is deleted. + * @type array<\Google\Cloud\Batch\V1\AllocationPolicy\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $disks + * Non-boot disks to be attached for each VM created by this InstancePolicy. + * New disks will be deleted when the VM is deleted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * The Compute Engine machine type. + * + * Generated from protobuf field string machine_type = 2; + * @return string + */ + public function getMachineType() + { + return $this->machine_type; + } + + /** + * The Compute Engine machine type. + * + * Generated from protobuf field string machine_type = 2; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + + /** + * The minimum CPU platform. + * See + * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. + * Not yet implemented. + * + * Generated from protobuf field string min_cpu_platform = 3; + * @return string + */ + public function getMinCpuPlatform() + { + return $this->min_cpu_platform; + } + + /** + * The minimum CPU platform. + * See + * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. + * Not yet implemented. + * + * Generated from protobuf field string min_cpu_platform = 3; + * @param string $var + * @return $this + */ + public function setMinCpuPlatform($var) + { + GPBUtil::checkString($var, True); + $this->min_cpu_platform = $var; + + return $this; + } + + /** + * The provisioning model. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 4; + * @return int + */ + public function getProvisioningModel() + { + return $this->provisioning_model; + } + + /** + * The provisioning model. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 4; + * @param int $var + * @return $this + */ + public function setProvisioningModel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\AllocationPolicy\ProvisioningModel::class); + $this->provisioning_model = $var; + + return $this; + } + + /** + * The accelerators attached to each VM instance. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccelerators() + { + return $this->accelerators; + } + + /** + * The accelerators attached to each VM instance. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; + * @param array<\Google\Cloud\Batch\V1\AllocationPolicy\Accelerator>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccelerators($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\AllocationPolicy\Accelerator::class); + $this->accelerators = $arr; + + return $this; + } + + /** + * Book disk to be created and attached to each VM by this InstancePolicy. + * Boot disk will be deleted when the VM is deleted. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + * @return \Google\Cloud\Batch\V1\AllocationPolicy\Disk|null + */ + public function getBootDisk() + { + return $this->boot_disk; + } + + public function hasBootDisk() + { + return isset($this->boot_disk); + } + + public function clearBootDisk() + { + unset($this->boot_disk); + } + + /** + * Book disk to be created and attached to each VM by this InstancePolicy. + * Boot disk will be deleted when the VM is deleted. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; + * @param \Google\Cloud\Batch\V1\AllocationPolicy\Disk $var + * @return $this + */ + public function setBootDisk($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\Disk::class); + $this->boot_disk = $var; + + return $this; + } + + /** + * Non-boot disks to be attached for each VM created by this InstancePolicy. + * New disks will be deleted when the VM is deleted. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisks() + { + return $this->disks; + } + + /** + * Non-boot disks to be attached for each VM created by this InstancePolicy. + * New disks will be deleted when the VM is deleted. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; + * @param array<\Google\Cloud\Batch\V1\AllocationPolicy\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\AllocationPolicy\AttachedDisk::class); + $this->disks = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InstancePolicy::class, \Google\Cloud\Batch\V1\AllocationPolicy_InstancePolicy::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicyOrTemplate.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicyOrTemplate.php new file mode 100644 index 000000000000..daf830b8540d --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicyOrTemplate.php @@ -0,0 +1,163 @@ +google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + */ +class InstancePolicyOrTemplate extends \Google\Protobuf\Internal\Message +{ + /** + * Set this field true if users want Batch to help fetch drivers from a + * third party location and install them for GPUs specified in + * policy.accelerators or instance_template on their behalf. Default is + * false. + * + * Generated from protobuf field bool install_gpu_drivers = 3; + */ + protected $install_gpu_drivers = false; + protected $policy_template; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicy $policy + * InstancePolicy. + * @type string $instance_template + * Name of an instance template used to create VMs. + * Named the field as 'instance_template' instead of 'template' to avoid + * c++ keyword conflict. + * @type bool $install_gpu_drivers + * Set this field true if users want Batch to help fetch drivers from a + * third party location and install them for GPUs specified in + * policy.accelerators or instance_template on their behalf. Default is + * false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * InstancePolicy. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; + * @return \Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicy|null + */ + public function getPolicy() + { + return $this->readOneof(1); + } + + public function hasPolicy() + { + return $this->hasOneof(1); + } + + /** + * InstancePolicy. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; + * @param \Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicy $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicy::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Name of an instance template used to create VMs. + * Named the field as 'instance_template' instead of 'template' to avoid + * c++ keyword conflict. + * + * Generated from protobuf field string instance_template = 2; + * @return string + */ + public function getInstanceTemplate() + { + return $this->readOneof(2); + } + + public function hasInstanceTemplate() + { + return $this->hasOneof(2); + } + + /** + * Name of an instance template used to create VMs. + * Named the field as 'instance_template' instead of 'template' to avoid + * c++ keyword conflict. + * + * Generated from protobuf field string instance_template = 2; + * @param string $var + * @return $this + */ + public function setInstanceTemplate($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Set this field true if users want Batch to help fetch drivers from a + * third party location and install them for GPUs specified in + * policy.accelerators or instance_template on their behalf. Default is + * false. + * + * Generated from protobuf field bool install_gpu_drivers = 3; + * @return bool + */ + public function getInstallGpuDrivers() + { + return $this->install_gpu_drivers; + } + + /** + * Set this field true if users want Batch to help fetch drivers from a + * third party location and install them for GPUs specified in + * policy.accelerators or instance_template on their behalf. Default is + * false. + * + * Generated from protobuf field bool install_gpu_drivers = 3; + * @param bool $var + * @return $this + */ + public function setInstallGpuDrivers($var) + { + GPBUtil::checkBool($var); + $this->install_gpu_drivers = $var; + + return $this; + } + + /** + * @return string + */ + public function getPolicyTemplate() + { + return $this->whichOneof("policy_template"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InstancePolicyOrTemplate::class, \Google\Cloud\Batch\V1\AllocationPolicy_InstancePolicyOrTemplate::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/LocationPolicy.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/LocationPolicy.php new file mode 100644 index 000000000000..4a0711636785 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/LocationPolicy.php @@ -0,0 +1,112 @@ +google.cloud.batch.v1.AllocationPolicy.LocationPolicy + */ +class LocationPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * A list of allowed location names represented by internal URLs. + * Each location can be a region or a zone. + * Only one region or multiple zones in one region is supported now. + * For example, + * ["regions/us-central1"] allow VMs in any zones in region us-central1. + * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs + * in zones us-central1-a and us-central1-c. + * All locations end up in different regions would cause errors. + * For example, + * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", + * "zones/us-west1-a"] contains 2 regions "us-central1" and + * "us-west1". An error is expected in this case. + * + * Generated from protobuf field repeated string allowed_locations = 1; + */ + private $allowed_locations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_locations + * A list of allowed location names represented by internal URLs. + * Each location can be a region or a zone. + * Only one region or multiple zones in one region is supported now. + * For example, + * ["regions/us-central1"] allow VMs in any zones in region us-central1. + * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs + * in zones us-central1-a and us-central1-c. + * All locations end up in different regions would cause errors. + * For example, + * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", + * "zones/us-west1-a"] contains 2 regions "us-central1" and + * "us-west1". An error is expected in this case. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * A list of allowed location names represented by internal URLs. + * Each location can be a region or a zone. + * Only one region or multiple zones in one region is supported now. + * For example, + * ["regions/us-central1"] allow VMs in any zones in region us-central1. + * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs + * in zones us-central1-a and us-central1-c. + * All locations end up in different regions would cause errors. + * For example, + * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", + * "zones/us-west1-a"] contains 2 regions "us-central1" and + * "us-west1". An error is expected in this case. + * + * Generated from protobuf field repeated string allowed_locations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowedLocations() + { + return $this->allowed_locations; + } + + /** + * A list of allowed location names represented by internal URLs. + * Each location can be a region or a zone. + * Only one region or multiple zones in one region is supported now. + * For example, + * ["regions/us-central1"] allow VMs in any zones in region us-central1. + * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs + * in zones us-central1-a and us-central1-c. + * All locations end up in different regions would cause errors. + * For example, + * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", + * "zones/us-west1-a"] contains 2 regions "us-central1" and + * "us-west1". An error is expected in this case. + * + * Generated from protobuf field repeated string allowed_locations = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowedLocations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allowed_locations = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LocationPolicy::class, \Google\Cloud\Batch\V1\AllocationPolicy_LocationPolicy::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkInterface.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkInterface.php new file mode 100644 index 000000000000..bf6597d781cb --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkInterface.php @@ -0,0 +1,202 @@ +google.cloud.batch.v1.AllocationPolicy.NetworkInterface + */ +class NetworkInterface extends \Google\Protobuf\Internal\Message +{ + /** + * The URL of an existing network resource. + * You can specify the network as a full or partial URL. + * For example, the following are all valid URLs: + * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} + * projects/{project}/global/networks/{network} + * global/networks/{network} + * + * Generated from protobuf field string network = 1; + */ + protected $network = ''; + /** + * The URL of an existing subnetwork resource in the network. + * You can specify the subnetwork as a full or partial URL. + * For example, the following are all valid URLs: + * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} + * projects/{project}/regions/{region}/subnetworks/{subnetwork} + * regions/{region}/subnetworks/{subnetwork} + * + * Generated from protobuf field string subnetwork = 2; + */ + protected $subnetwork = ''; + /** + * Default is false (with an external IP address). Required if + * no external public IP address is attached to the VM. If no external + * public IP address, additional configuration is required to allow the VM + * to access Google Services. See + * https://cloud.google.com/vpc/docs/configure-private-google-access and + * https://cloud.google.com/nat/docs/gce-example#create-nat for more + * information. + * + * Generated from protobuf field bool no_external_ip_address = 3; + */ + protected $no_external_ip_address = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * The URL of an existing network resource. + * You can specify the network as a full or partial URL. + * For example, the following are all valid URLs: + * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} + * projects/{project}/global/networks/{network} + * global/networks/{network} + * @type string $subnetwork + * The URL of an existing subnetwork resource in the network. + * You can specify the subnetwork as a full or partial URL. + * For example, the following are all valid URLs: + * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} + * projects/{project}/regions/{region}/subnetworks/{subnetwork} + * regions/{region}/subnetworks/{subnetwork} + * @type bool $no_external_ip_address + * Default is false (with an external IP address). Required if + * no external public IP address is attached to the VM. If no external + * public IP address, additional configuration is required to allow the VM + * to access Google Services. See + * https://cloud.google.com/vpc/docs/configure-private-google-access and + * https://cloud.google.com/nat/docs/gce-example#create-nat for more + * information. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * The URL of an existing network resource. + * You can specify the network as a full or partial URL. + * For example, the following are all valid URLs: + * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} + * projects/{project}/global/networks/{network} + * global/networks/{network} + * + * Generated from protobuf field string network = 1; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * The URL of an existing network resource. + * You can specify the network as a full or partial URL. + * For example, the following are all valid URLs: + * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} + * projects/{project}/global/networks/{network} + * global/networks/{network} + * + * Generated from protobuf field string network = 1; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * The URL of an existing subnetwork resource in the network. + * You can specify the subnetwork as a full or partial URL. + * For example, the following are all valid URLs: + * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} + * projects/{project}/regions/{region}/subnetworks/{subnetwork} + * regions/{region}/subnetworks/{subnetwork} + * + * Generated from protobuf field string subnetwork = 2; + * @return string + */ + public function getSubnetwork() + { + return $this->subnetwork; + } + + /** + * The URL of an existing subnetwork resource in the network. + * You can specify the subnetwork as a full or partial URL. + * For example, the following are all valid URLs: + * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} + * projects/{project}/regions/{region}/subnetworks/{subnetwork} + * regions/{region}/subnetworks/{subnetwork} + * + * Generated from protobuf field string subnetwork = 2; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + + /** + * Default is false (with an external IP address). Required if + * no external public IP address is attached to the VM. If no external + * public IP address, additional configuration is required to allow the VM + * to access Google Services. See + * https://cloud.google.com/vpc/docs/configure-private-google-access and + * https://cloud.google.com/nat/docs/gce-example#create-nat for more + * information. + * + * Generated from protobuf field bool no_external_ip_address = 3; + * @return bool + */ + public function getNoExternalIpAddress() + { + return $this->no_external_ip_address; + } + + /** + * Default is false (with an external IP address). Required if + * no external public IP address is attached to the VM. If no external + * public IP address, additional configuration is required to allow the VM + * to access Google Services. See + * https://cloud.google.com/vpc/docs/configure-private-google-access and + * https://cloud.google.com/nat/docs/gce-example#create-nat for more + * information. + * + * Generated from protobuf field bool no_external_ip_address = 3; + * @param bool $var + * @return $this + */ + public function setNoExternalIpAddress($var) + { + GPBUtil::checkBool($var); + $this->no_external_ip_address = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NetworkInterface::class, \Google\Cloud\Batch\V1\AllocationPolicy_NetworkInterface::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkPolicy.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkPolicy.php new file mode 100644 index 000000000000..f402f3e8e3d2 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkPolicy.php @@ -0,0 +1,70 @@ +google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + */ +class NetworkPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Network configurations. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + */ + private $network_interfaces; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Batch\V1\AllocationPolicy\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $network_interfaces + * Network configurations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Network configurations. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkInterfaces() + { + return $this->network_interfaces; + } + + /** + * Network configurations. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; + * @param array<\Google\Cloud\Batch\V1\AllocationPolicy\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkInterfaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\AllocationPolicy\NetworkInterface::class); + $this->network_interfaces = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NetworkPolicy::class, \Google\Cloud\Batch\V1\AllocationPolicy_NetworkPolicy::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/ProvisioningModel.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/ProvisioningModel.php new file mode 100644 index 000000000000..62a6191c61cb --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/ProvisioningModel.php @@ -0,0 +1,75 @@ +google.cloud.batch.v1.AllocationPolicy.ProvisioningModel + */ +class ProvisioningModel +{ + /** + * Unspecified. + * + * Generated from protobuf enum PROVISIONING_MODEL_UNSPECIFIED = 0; + */ + const PROVISIONING_MODEL_UNSPECIFIED = 0; + /** + * Standard VM. + * + * Generated from protobuf enum STANDARD = 1; + */ + const STANDARD = 1; + /** + * SPOT VM. + * + * Generated from protobuf enum SPOT = 2; + */ + const SPOT = 2; + /** + * Preemptible VM (PVM). + * Above SPOT VM is the preferable model for preemptible VM instances: the + * old preemptible VM model (indicated by this field) is the older model, + * and has been migrated to use the SPOT model as the underlying technology. + * This old model will still be supported. + * + * Generated from protobuf enum PREEMPTIBLE = 3; + */ + const PREEMPTIBLE = 3; + + private static $valueToName = [ + self::PROVISIONING_MODEL_UNSPECIFIED => 'PROVISIONING_MODEL_UNSPECIFIED', + self::STANDARD => 'STANDARD', + self::SPOT => 'SPOT', + self::PREEMPTIBLE => 'PREEMPTIBLE', + ]; + + 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(ProvisioningModel::class, \Google\Cloud\Batch\V1\AllocationPolicy_ProvisioningModel::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_Accelerator.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_Accelerator.php new file mode 100644 index 000000000000..1e85fe74a884 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_Accelerator.php @@ -0,0 +1,16 @@ +_simpleRequest('/google.cloud.batch.v1.BatchService/CreateJob', + $argument, + ['\Google\Cloud\Batch\V1\Job', 'decode'], + $metadata, $options); + } + + /** + * Get a Job specified by its resource name. + * @param \Google\Cloud\Batch\V1\GetJobRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetJob(\Google\Cloud\Batch\V1\GetJobRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.batch.v1.BatchService/GetJob', + $argument, + ['\Google\Cloud\Batch\V1\Job', 'decode'], + $metadata, $options); + } + + /** + * Delete a Job. + * @param \Google\Cloud\Batch\V1\DeleteJobRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteJob(\Google\Cloud\Batch\V1\DeleteJobRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.batch.v1.BatchService/DeleteJob', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * List all Jobs for a project within a region. + * @param \Google\Cloud\Batch\V1\ListJobsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListJobs(\Google\Cloud\Batch\V1\ListJobsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.batch.v1.BatchService/ListJobs', + $argument, + ['\Google\Cloud\Batch\V1\ListJobsResponse', 'decode'], + $metadata, $options); + } + + /** + * Return a single Task. + * @param \Google\Cloud\Batch\V1\GetTaskRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetTask(\Google\Cloud\Batch\V1\GetTaskRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.batch.v1.BatchService/GetTask', + $argument, + ['\Google\Cloud\Batch\V1\Task', 'decode'], + $metadata, $options); + } + + /** + * List Tasks associated with a job. + * @param \Google\Cloud\Batch\V1\ListTasksRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListTasks(\Google\Cloud\Batch\V1\ListTasksRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.batch.v1.BatchService/ListTasks', + $argument, + ['\Google\Cloud\Batch\V1\ListTasksResponse', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ComputeResource.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ComputeResource.php new file mode 100644 index 000000000000..16384c01afdd --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ComputeResource.php @@ -0,0 +1,135 @@ +google.cloud.batch.v1.ComputeResource + */ +class ComputeResource extends \Google\Protobuf\Internal\Message +{ + /** + * The milliCPU count. + * + * Generated from protobuf field int64 cpu_milli = 1; + */ + protected $cpu_milli = 0; + /** + * Memory in MiB. + * + * Generated from protobuf field int64 memory_mib = 2; + */ + protected $memory_mib = 0; + /** + * Extra boot disk size in MiB for each task. + * + * Generated from protobuf field int64 boot_disk_mib = 4; + */ + protected $boot_disk_mib = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $cpu_milli + * The milliCPU count. + * @type int|string $memory_mib + * Memory in MiB. + * @type int|string $boot_disk_mib + * Extra boot disk size in MiB for each task. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * The milliCPU count. + * + * Generated from protobuf field int64 cpu_milli = 1; + * @return int|string + */ + public function getCpuMilli() + { + return $this->cpu_milli; + } + + /** + * The milliCPU count. + * + * Generated from protobuf field int64 cpu_milli = 1; + * @param int|string $var + * @return $this + */ + public function setCpuMilli($var) + { + GPBUtil::checkInt64($var); + $this->cpu_milli = $var; + + return $this; + } + + /** + * Memory in MiB. + * + * Generated from protobuf field int64 memory_mib = 2; + * @return int|string + */ + public function getMemoryMib() + { + return $this->memory_mib; + } + + /** + * Memory in MiB. + * + * Generated from protobuf field int64 memory_mib = 2; + * @param int|string $var + * @return $this + */ + public function setMemoryMib($var) + { + GPBUtil::checkInt64($var); + $this->memory_mib = $var; + + return $this; + } + + /** + * Extra boot disk size in MiB for each task. + * + * Generated from protobuf field int64 boot_disk_mib = 4; + * @return int|string + */ + public function getBootDiskMib() + { + return $this->boot_disk_mib; + } + + /** + * Extra boot disk size in MiB for each task. + * + * Generated from protobuf field int64 boot_disk_mib = 4; + * @param int|string $var + * @return $this + */ + public function setBootDiskMib($var) + { + GPBUtil::checkInt64($var); + $this->boot_disk_mib = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/CreateJobRequest.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/CreateJobRequest.php new file mode 100644 index 000000000000..5e15edb1b9ae --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/CreateJobRequest.php @@ -0,0 +1,251 @@ +google.cloud.batch.v1.CreateJobRequest + */ +class CreateJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource name where the Job will be created. + * Pattern: "projects/{project}/locations/{location}" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * ID used to uniquely identify the Job within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The job.name field in the request will be ignored and the created resource + * name of the Job will be "{parent}/jobs/{job_id}". + * + * Generated from protobuf field string job_id = 2; + */ + protected $job_id = ''; + /** + * Required. The Job to create. + * + * Generated from protobuf field .google.cloud.batch.v1.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $job = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource name where the Job will be created. + * Pattern: "projects/{project}/locations/{location}" + * @type string $job_id + * ID used to uniquely identify the Job within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The job.name field in the request will be ignored and the created resource + * name of the Job will be "{parent}/jobs/{job_id}". + * @type \Google\Cloud\Batch\V1\Job $job + * Required. The Job to create. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource name where the Job will be created. + * Pattern: "projects/{project}/locations/{location}" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource name where the Job will be created. + * Pattern: "projects/{project}/locations/{location}" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * ID used to uniquely identify the Job within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The job.name field in the request will be ignored and the created resource + * name of the Job will be "{parent}/jobs/{job_id}". + * + * Generated from protobuf field string job_id = 2; + * @return string + */ + public function getJobId() + { + return $this->job_id; + } + + /** + * ID used to uniquely identify the Job within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The job.name field in the request will be ignored and the created resource + * name of the Job will be "{parent}/jobs/{job_id}". + * + * Generated from protobuf field string job_id = 2; + * @param string $var + * @return $this + */ + public function setJobId($var) + { + GPBUtil::checkString($var, True); + $this->job_id = $var; + + return $this; + } + + /** + * Required. The Job to create. + * + * Generated from protobuf field .google.cloud.batch.v1.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Batch\V1\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 create. + * + * Generated from protobuf field .google.cloud.batch.v1.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Batch\V1\Job $var + * @return $this + */ + public function setJob($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Job::class); + $this->job = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/DeleteJobRequest.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/DeleteJobRequest.php new file mode 100644 index 000000000000..ca2d1ac3053f --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/DeleteJobRequest.php @@ -0,0 +1,175 @@ +google.cloud.batch.v1.DeleteJobRequest + */ +class DeleteJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Job name. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Optional. Reason for this deletion. + * + * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $reason = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Job name. + * @type string $reason + * Optional. Reason for this deletion. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); + parent::__construct($data); + } + + /** + * Job name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Job name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Reason for this deletion. + * + * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getReason() + { + return $this->reason; + } + + /** + * Optional. Reason for this deletion. + * + * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setReason($var) + { + GPBUtil::checkString($var, True); + $this->reason = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment.php new file mode 100644 index 000000000000..058a8d4ccc90 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment.php @@ -0,0 +1,158 @@ +google.cloud.batch.v1.Environment + */ +class Environment extends \Google\Protobuf\Internal\Message +{ + /** + * A map of environment variable names to values. + * + * Generated from protobuf field map variables = 1; + */ + private $variables; + /** + * A map of environment variable names to Secret Manager secret names. + * The VM will access the named secrets to set the value of each environment + * variable. + * + * Generated from protobuf field map secret_variables = 2; + */ + private $secret_variables; + /** + * An encrypted JSON dictionary where the key/value pairs correspond to + * environment variable names and their values. + * + * Generated from protobuf field .google.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; + */ + protected $encrypted_variables = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $variables + * A map of environment variable names to values. + * @type array|\Google\Protobuf\Internal\MapField $secret_variables + * A map of environment variable names to Secret Manager secret names. + * The VM will access the named secrets to set the value of each environment + * variable. + * @type \Google\Cloud\Batch\V1\Environment\KMSEnvMap $encrypted_variables + * An encrypted JSON dictionary where the key/value pairs correspond to + * environment variable names and their values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * A map of environment variable names to values. + * + * Generated from protobuf field map variables = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getVariables() + { + return $this->variables; + } + + /** + * A map of environment variable names to values. + * + * Generated from protobuf field map variables = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setVariables($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->variables = $arr; + + return $this; + } + + /** + * A map of environment variable names to Secret Manager secret names. + * The VM will access the named secrets to set the value of each environment + * variable. + * + * Generated from protobuf field map secret_variables = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getSecretVariables() + { + return $this->secret_variables; + } + + /** + * A map of environment variable names to Secret Manager secret names. + * The VM will access the named secrets to set the value of each environment + * variable. + * + * Generated from protobuf field map secret_variables = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setSecretVariables($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->secret_variables = $arr; + + return $this; + } + + /** + * An encrypted JSON dictionary where the key/value pairs correspond to + * environment variable names and their values. + * + * Generated from protobuf field .google.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; + * @return \Google\Cloud\Batch\V1\Environment\KMSEnvMap|null + */ + public function getEncryptedVariables() + { + return $this->encrypted_variables; + } + + public function hasEncryptedVariables() + { + return isset($this->encrypted_variables); + } + + public function clearEncryptedVariables() + { + unset($this->encrypted_variables); + } + + /** + * An encrypted JSON dictionary where the key/value pairs correspond to + * environment variable names and their values. + * + * Generated from protobuf field .google.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; + * @param \Google\Cloud\Batch\V1\Environment\KMSEnvMap $var + * @return $this + */ + public function setEncryptedVariables($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Environment\KMSEnvMap::class); + $this->encrypted_variables = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment/KMSEnvMap.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment/KMSEnvMap.php new file mode 100644 index 000000000000..91b995831e11 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment/KMSEnvMap.php @@ -0,0 +1,102 @@ +google.cloud.batch.v1.Environment.KMSEnvMap + */ +class KMSEnvMap extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the KMS key that will be used to decrypt the cipher text. + * + * Generated from protobuf field string key_name = 1; + */ + protected $key_name = ''; + /** + * The value of the cipherText response from the `encrypt` method. + * + * Generated from protobuf field string cipher_text = 2; + */ + protected $cipher_text = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key_name + * The name of the KMS key that will be used to decrypt the cipher text. + * @type string $cipher_text + * The value of the cipherText response from the `encrypt` method. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * The name of the KMS key that will be used to decrypt the cipher text. + * + * Generated from protobuf field string key_name = 1; + * @return string + */ + public function getKeyName() + { + return $this->key_name; + } + + /** + * The name of the KMS key that will be used to decrypt the cipher text. + * + * Generated from protobuf field string key_name = 1; + * @param string $var + * @return $this + */ + public function setKeyName($var) + { + GPBUtil::checkString($var, True); + $this->key_name = $var; + + return $this; + } + + /** + * The value of the cipherText response from the `encrypt` method. + * + * Generated from protobuf field string cipher_text = 2; + * @return string + */ + public function getCipherText() + { + return $this->cipher_text; + } + + /** + * The value of the cipherText response from the `encrypt` method. + * + * Generated from protobuf field string cipher_text = 2; + * @param string $var + * @return $this + */ + public function setCipherText($var) + { + GPBUtil::checkString($var, True); + $this->cipher_text = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(KMSEnvMap::class, \Google\Cloud\Batch\V1\Environment_KMSEnvMap::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment_KMSEnvMap.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment_KMSEnvMap.php new file mode 100644 index 000000000000..75085c6ee530 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment_KMSEnvMap.php @@ -0,0 +1,16 @@ +google.cloud.batch.v1.GCS + */ +class GCS extends \Google\Protobuf\Internal\Message +{ + /** + * Remote path, either a bucket name or a subdirectory of a bucket, e.g.: + * bucket_name, bucket_name/subdirectory/ + * + * Generated from protobuf field string remote_path = 1; + */ + protected $remote_path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $remote_path + * Remote path, either a bucket name or a subdirectory of a bucket, e.g.: + * bucket_name, bucket_name/subdirectory/ + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Volume::initOnce(); + parent::__construct($data); + } + + /** + * Remote path, either a bucket name or a subdirectory of a bucket, e.g.: + * bucket_name, bucket_name/subdirectory/ + * + * Generated from protobuf field string remote_path = 1; + * @return string + */ + public function getRemotePath() + { + return $this->remote_path; + } + + /** + * Remote path, either a bucket name or a subdirectory of a bucket, e.g.: + * bucket_name, bucket_name/subdirectory/ + * + * Generated from protobuf field string remote_path = 1; + * @param string $var + * @return $this + */ + public function setRemotePath($var) + { + GPBUtil::checkString($var, True); + $this->remote_path = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetJobRequest.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetJobRequest.php new file mode 100644 index 000000000000..ce1430ac4d74 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetJobRequest.php @@ -0,0 +1,67 @@ +google.cloud.batch.v1.GetJobRequest + */ +class GetJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Job name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Job name. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); + parent::__construct($data); + } + + /** + * Required. Job name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Job name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetTaskRequest.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetTaskRequest.php new file mode 100644 index 000000000000..3448bf13090a --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetTaskRequest.php @@ -0,0 +1,67 @@ +google.cloud.batch.v1.GetTaskRequest + */ +class GetTaskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Task name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Task name. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); + parent::__construct($data); + } + + /** + * Required. Task name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Task name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Job.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Job.php new file mode 100644 index 000000000000..e32bd5a11b00 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Job.php @@ -0,0 +1,513 @@ +google.cloud.batch.v1.Job + */ +class Job extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Job name. + * For example: "projects/123456/locations/us-central1/jobs/job01". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. A system generated unique ID (in UUID4 format) for the Job. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Priority of the Job. + * The valid value range is [0, 100). Default value is 0. + * Higher value indicates higher priority. + * A job with higher priority value is more likely to run earlier if all other + * requirements are satisfied. + * + * Generated from protobuf field int64 priority = 3; + */ + protected $priority = 0; + /** + * Required. TaskGroups in the Job. Only one TaskGroup is supported now. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $task_groups; + /** + * Compute resource allocation for all TaskGroups in the Job. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + */ + protected $allocation_policy = null; + /** + * Labels for the Job. Labels could be user provided or system generated. + * For example, + * "labels": { + * "department": "finance", + * "environment": "test" + * } + * You can assign up to 64 labels. [Google Compute Engine label + * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) + * apply. + * Label names that start with "goog-" or "google-" are reserved. + * + * Generated from protobuf field map labels = 8; + */ + private $labels; + /** + * Output only. Job status. It is read only for users. + * + * Generated from protobuf field .google.cloud.batch.v1.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status = null; + /** + * Output only. When the Job was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last time the Job was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Log preservation policy for the Job. + * + * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy logs_policy = 13; + */ + protected $logs_policy = null; + /** + * Notification configurations. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.JobNotification notifications = 14; + */ + private $notifications; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Job name. + * For example: "projects/123456/locations/us-central1/jobs/job01". + * @type string $uid + * Output only. A system generated unique ID (in UUID4 format) for the Job. + * @type int|string $priority + * Priority of the Job. + * The valid value range is [0, 100). Default value is 0. + * Higher value indicates higher priority. + * A job with higher priority value is more likely to run earlier if all other + * requirements are satisfied. + * @type array<\Google\Cloud\Batch\V1\TaskGroup>|\Google\Protobuf\Internal\RepeatedField $task_groups + * Required. TaskGroups in the Job. Only one TaskGroup is supported now. + * @type \Google\Cloud\Batch\V1\AllocationPolicy $allocation_policy + * Compute resource allocation for all TaskGroups in the Job. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels for the Job. Labels could be user provided or system generated. + * For example, + * "labels": { + * "department": "finance", + * "environment": "test" + * } + * You can assign up to 64 labels. [Google Compute Engine label + * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) + * apply. + * Label names that start with "goog-" or "google-" are reserved. + * @type \Google\Cloud\Batch\V1\JobStatus $status + * Output only. Job status. It is read only for users. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. When the Job was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last time the Job was updated. + * @type \Google\Cloud\Batch\V1\LogsPolicy $logs_policy + * Log preservation policy for the Job. + * @type array<\Google\Cloud\Batch\V1\JobNotification>|\Google\Protobuf\Internal\RepeatedField $notifications + * Notification configurations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Job name. + * For example: "projects/123456/locations/us-central1/jobs/job01". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Job name. + * For example: "projects/123456/locations/us-central1/jobs/job01". + * + * 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. A system generated unique ID (in UUID4 format) for the Job. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. A system generated unique ID (in UUID4 format) for the Job. + * + * 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; + } + + /** + * Priority of the Job. + * The valid value range is [0, 100). Default value is 0. + * Higher value indicates higher priority. + * A job with higher priority value is more likely to run earlier if all other + * requirements are satisfied. + * + * Generated from protobuf field int64 priority = 3; + * @return int|string + */ + public function getPriority() + { + return $this->priority; + } + + /** + * Priority of the Job. + * The valid value range is [0, 100). Default value is 0. + * Higher value indicates higher priority. + * A job with higher priority value is more likely to run earlier if all other + * requirements are satisfied. + * + * Generated from protobuf field int64 priority = 3; + * @param int|string $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt64($var); + $this->priority = $var; + + return $this; + } + + /** + * Required. TaskGroups in the Job. Only one TaskGroup is supported now. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTaskGroups() + { + return $this->task_groups; + } + + /** + * Required. TaskGroups in the Job. Only one TaskGroup is supported now. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Batch\V1\TaskGroup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTaskGroups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\TaskGroup::class); + $this->task_groups = $arr; + + return $this; + } + + /** + * Compute resource allocation for all TaskGroups in the Job. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + * @return \Google\Cloud\Batch\V1\AllocationPolicy|null + */ + public function getAllocationPolicy() + { + return $this->allocation_policy; + } + + public function hasAllocationPolicy() + { + return isset($this->allocation_policy); + } + + public function clearAllocationPolicy() + { + unset($this->allocation_policy); + } + + /** + * Compute resource allocation for all TaskGroups in the Job. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy allocation_policy = 7; + * @param \Google\Cloud\Batch\V1\AllocationPolicy $var + * @return $this + */ + public function setAllocationPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy::class); + $this->allocation_policy = $var; + + return $this; + } + + /** + * Labels for the Job. Labels could be user provided or system generated. + * For example, + * "labels": { + * "department": "finance", + * "environment": "test" + * } + * You can assign up to 64 labels. [Google Compute Engine label + * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) + * apply. + * Label names that start with "goog-" or "google-" are reserved. + * + * Generated from protobuf field map labels = 8; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels for the Job. Labels could be user provided or system generated. + * For example, + * "labels": { + * "department": "finance", + * "environment": "test" + * } + * You can assign up to 64 labels. [Google Compute Engine label + * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) + * apply. + * Label names that start with "goog-" or "google-" are reserved. + * + * Generated from protobuf field map labels = 8; + * @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. Job status. It is read only for users. + * + * Generated from protobuf field .google.cloud.batch.v1.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Batch\V1\JobStatus|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * Output only. Job status. It is read only for users. + * + * Generated from protobuf field .google.cloud.batch.v1.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Batch\V1\JobStatus $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\JobStatus::class); + $this->status = $var; + + return $this; + } + + /** + * Output only. When the Job was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.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. When the Job was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.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 time the Job was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 12 [(.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 time the Job was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 12 [(.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; + } + + /** + * Log preservation policy for the Job. + * + * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy logs_policy = 13; + * @return \Google\Cloud\Batch\V1\LogsPolicy|null + */ + public function getLogsPolicy() + { + return $this->logs_policy; + } + + public function hasLogsPolicy() + { + return isset($this->logs_policy); + } + + public function clearLogsPolicy() + { + unset($this->logs_policy); + } + + /** + * Log preservation policy for the Job. + * + * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy logs_policy = 13; + * @param \Google\Cloud\Batch\V1\LogsPolicy $var + * @return $this + */ + public function setLogsPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\LogsPolicy::class); + $this->logs_policy = $var; + + return $this; + } + + /** + * Notification configurations. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.JobNotification notifications = 14; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNotifications() + { + return $this->notifications; + } + + /** + * Notification configurations. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.JobNotification notifications = 14; + * @param array<\Google\Cloud\Batch\V1\JobNotification>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNotifications($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\JobNotification::class); + $this->notifications = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification.php new file mode 100644 index 000000000000..3c1fc88bdeab --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification.php @@ -0,0 +1,131 @@ +google.cloud.batch.v1.JobNotification + */ +class JobNotification extends \Google\Protobuf\Internal\Message +{ + /** + * The Pub/Sub topic where notifications like the job state changes + * will be published. This topic exist in the same project as the job + * and billings will be charged to this project. + * If not specified, no Pub/Sub messages will be sent. + * Topic format: `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string pubsub_topic = 1; + */ + protected $pubsub_topic = ''; + /** + * The attribute requirements of messages to be sent to this Pub/Sub topic. + * Without this field, no message will be sent. + * + * Generated from protobuf field .google.cloud.batch.v1.JobNotification.Message message = 2; + */ + protected $message = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $pubsub_topic + * The Pub/Sub topic where notifications like the job state changes + * will be published. This topic exist in the same project as the job + * and billings will be charged to this project. + * If not specified, no Pub/Sub messages will be sent. + * Topic format: `projects/{project}/topics/{topic}`. + * @type \Google\Cloud\Batch\V1\JobNotification\Message $message + * The attribute requirements of messages to be sent to this Pub/Sub topic. + * Without this field, no message will be sent. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * The Pub/Sub topic where notifications like the job state changes + * will be published. This topic exist in the same project as the job + * and billings will be charged to this project. + * If not specified, no Pub/Sub messages will be sent. + * Topic format: `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string pubsub_topic = 1; + * @return string + */ + public function getPubsubTopic() + { + return $this->pubsub_topic; + } + + /** + * The Pub/Sub topic where notifications like the job state changes + * will be published. This topic exist in the same project as the job + * and billings will be charged to this project. + * If not specified, no Pub/Sub messages will be sent. + * Topic format: `projects/{project}/topics/{topic}`. + * + * Generated from protobuf field string pubsub_topic = 1; + * @param string $var + * @return $this + */ + public function setPubsubTopic($var) + { + GPBUtil::checkString($var, True); + $this->pubsub_topic = $var; + + return $this; + } + + /** + * The attribute requirements of messages to be sent to this Pub/Sub topic. + * Without this field, no message will be sent. + * + * Generated from protobuf field .google.cloud.batch.v1.JobNotification.Message message = 2; + * @return \Google\Cloud\Batch\V1\JobNotification\Message|null + */ + public function getMessage() + { + return $this->message; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * The attribute requirements of messages to be sent to this Pub/Sub topic. + * Without this field, no message will be sent. + * + * Generated from protobuf field .google.cloud.batch.v1.JobNotification.Message message = 2; + * @param \Google\Cloud\Batch\V1\JobNotification\Message $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\JobNotification\Message::class); + $this->message = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Message.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Message.php new file mode 100644 index 000000000000..af67b119fb29 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Message.php @@ -0,0 +1,140 @@ +google.cloud.batch.v1.JobNotification.Message + */ +class Message extends \Google\Protobuf\Internal\Message +{ + /** + * The message type. + * + * Generated from protobuf field .google.cloud.batch.v1.JobNotification.Type type = 1; + */ + protected $type = 0; + /** + * The new job state. + * + * Generated from protobuf field .google.cloud.batch.v1.JobStatus.State new_job_state = 2; + */ + protected $new_job_state = 0; + /** + * The new task state. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State new_task_state = 3; + */ + protected $new_task_state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * The message type. + * @type int $new_job_state + * The new job state. + * @type int $new_task_state + * The new task state. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * The message type. + * + * Generated from protobuf field .google.cloud.batch.v1.JobNotification.Type type = 1; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The message type. + * + * Generated from protobuf field .google.cloud.batch.v1.JobNotification.Type type = 1; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\JobNotification\Type::class); + $this->type = $var; + + return $this; + } + + /** + * The new job state. + * + * Generated from protobuf field .google.cloud.batch.v1.JobStatus.State new_job_state = 2; + * @return int + */ + public function getNewJobState() + { + return $this->new_job_state; + } + + /** + * The new job state. + * + * Generated from protobuf field .google.cloud.batch.v1.JobStatus.State new_job_state = 2; + * @param int $var + * @return $this + */ + public function setNewJobState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\JobStatus\State::class); + $this->new_job_state = $var; + + return $this; + } + + /** + * The new task state. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State new_task_state = 3; + * @return int + */ + public function getNewTaskState() + { + return $this->new_task_state; + } + + /** + * The new task state. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State new_task_state = 3; + * @param int $var + * @return $this + */ + public function setNewTaskState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\TaskStatus\State::class); + $this->new_task_state = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Message::class, \Google\Cloud\Batch\V1\JobNotification_Message::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Type.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Type.php new file mode 100644 index 000000000000..28ccf868f4c0 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Type.php @@ -0,0 +1,64 @@ +google.cloud.batch.v1.JobNotification.Type + */ +class Type +{ + /** + * Unspecified. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Notify users that the job state has changed. + * + * Generated from protobuf enum JOB_STATE_CHANGED = 1; + */ + const JOB_STATE_CHANGED = 1; + /** + * Notify users that the task state has changed. + * + * Generated from protobuf enum TASK_STATE_CHANGED = 2; + */ + const TASK_STATE_CHANGED = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::JOB_STATE_CHANGED => 'JOB_STATE_CHANGED', + self::TASK_STATE_CHANGED => 'TASK_STATE_CHANGED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Batch\V1\JobNotification_Type::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification_Message.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification_Message.php new file mode 100644 index 000000000000..0e84573a896a --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification_Message.php @@ -0,0 +1,16 @@ +google.cloud.batch.v1.JobStatus + */ +class JobStatus extends \Google\Protobuf\Internal\Message +{ + /** + * Job state + * + * Generated from protobuf field .google.cloud.batch.v1.JobStatus.State state = 1; + */ + protected $state = 0; + /** + * Job status events + * + * Generated from protobuf field repeated .google.cloud.batch.v1.StatusEvent status_events = 2; + */ + private $status_events; + /** + * Aggregated task status for each TaskGroup in the Job. + * The map key is TaskGroup ID. + * + * Generated from protobuf field map task_groups = 4; + */ + private $task_groups; + /** + * The duration of time that the Job spent in status RUNNING. + * + * Generated from protobuf field .google.protobuf.Duration run_duration = 5; + */ + protected $run_duration = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * Job state + * @type array<\Google\Cloud\Batch\V1\StatusEvent>|\Google\Protobuf\Internal\RepeatedField $status_events + * Job status events + * @type array|\Google\Protobuf\Internal\MapField $task_groups + * Aggregated task status for each TaskGroup in the Job. + * The map key is TaskGroup ID. + * @type \Google\Protobuf\Duration $run_duration + * The duration of time that the Job spent in status RUNNING. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Job state + * + * Generated from protobuf field .google.cloud.batch.v1.JobStatus.State state = 1; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Job state + * + * Generated from protobuf field .google.cloud.batch.v1.JobStatus.State state = 1; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\JobStatus\State::class); + $this->state = $var; + + return $this; + } + + /** + * Job status events + * + * Generated from protobuf field repeated .google.cloud.batch.v1.StatusEvent status_events = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStatusEvents() + { + return $this->status_events; + } + + /** + * Job status events + * + * Generated from protobuf field repeated .google.cloud.batch.v1.StatusEvent status_events = 2; + * @param array<\Google\Cloud\Batch\V1\StatusEvent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStatusEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\StatusEvent::class); + $this->status_events = $arr; + + return $this; + } + + /** + * Aggregated task status for each TaskGroup in the Job. + * The map key is TaskGroup ID. + * + * Generated from protobuf field map task_groups = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTaskGroups() + { + return $this->task_groups; + } + + /** + * Aggregated task status for each TaskGroup in the Job. + * The map key is TaskGroup ID. + * + * Generated from protobuf field map task_groups = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTaskGroups($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\JobStatus\TaskGroupStatus::class); + $this->task_groups = $arr; + + return $this; + } + + /** + * The duration of time that the Job spent in status RUNNING. + * + * Generated from protobuf field .google.protobuf.Duration run_duration = 5; + * @return \Google\Protobuf\Duration|null + */ + public function getRunDuration() + { + return $this->run_duration; + } + + public function hasRunDuration() + { + return isset($this->run_duration); + } + + public function clearRunDuration() + { + unset($this->run_duration); + } + + /** + * The duration of time that the Job spent in status RUNNING. + * + * Generated from protobuf field .google.protobuf.Duration run_duration = 5; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setRunDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->run_duration = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/InstanceStatus.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/InstanceStatus.php new file mode 100644 index 000000000000..4073a44ab3bc --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/InstanceStatus.php @@ -0,0 +1,182 @@ +google.cloud.batch.v1.JobStatus.InstanceStatus + */ +class InstanceStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The Compute Engine machine type. + * + * Generated from protobuf field string machine_type = 1; + */ + protected $machine_type = ''; + /** + * The VM instance provisioning model. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 2; + */ + protected $provisioning_model = 0; + /** + * The max number of tasks can be assigned to this instance type. + * + * Generated from protobuf field int64 task_pack = 3; + */ + protected $task_pack = 0; + /** + * The VM boot disk. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + */ + protected $boot_disk = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $machine_type + * The Compute Engine machine type. + * @type int $provisioning_model + * The VM instance provisioning model. + * @type int|string $task_pack + * The max number of tasks can be assigned to this instance type. + * @type \Google\Cloud\Batch\V1\AllocationPolicy\Disk $boot_disk + * The VM boot disk. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * The Compute Engine machine type. + * + * Generated from protobuf field string machine_type = 1; + * @return string + */ + public function getMachineType() + { + return $this->machine_type; + } + + /** + * The Compute Engine machine type. + * + * Generated from protobuf field string machine_type = 1; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + + /** + * The VM instance provisioning model. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 2; + * @return int + */ + public function getProvisioningModel() + { + return $this->provisioning_model; + } + + /** + * The VM instance provisioning model. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 2; + * @param int $var + * @return $this + */ + public function setProvisioningModel($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\AllocationPolicy\ProvisioningModel::class); + $this->provisioning_model = $var; + + return $this; + } + + /** + * The max number of tasks can be assigned to this instance type. + * + * Generated from protobuf field int64 task_pack = 3; + * @return int|string + */ + public function getTaskPack() + { + return $this->task_pack; + } + + /** + * The max number of tasks can be assigned to this instance type. + * + * Generated from protobuf field int64 task_pack = 3; + * @param int|string $var + * @return $this + */ + public function setTaskPack($var) + { + GPBUtil::checkInt64($var); + $this->task_pack = $var; + + return $this; + } + + /** + * The VM boot disk. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + * @return \Google\Cloud\Batch\V1\AllocationPolicy\Disk|null + */ + public function getBootDisk() + { + return $this->boot_disk; + } + + public function hasBootDisk() + { + return isset($this->boot_disk); + } + + public function clearBootDisk() + { + unset($this->boot_disk); + } + + /** + * The VM boot disk. + * + * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; + * @param \Google\Cloud\Batch\V1\AllocationPolicy\Disk $var + * @return $this + */ + public function setBootDisk($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\Disk::class); + $this->boot_disk = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InstanceStatus::class, \Google\Cloud\Batch\V1\JobStatus_InstanceStatus::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/State.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/State.php new file mode 100644 index 000000000000..51436382ff04 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/State.php @@ -0,0 +1,94 @@ +google.cloud.batch.v1.JobStatus.State + */ +class State +{ + /** + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Job is admitted (validated and persisted) and waiting for resources. + * + * Generated from protobuf enum QUEUED = 1; + */ + const QUEUED = 1; + /** + * Job is scheduled to run as soon as resource allocation is ready. + * The resource allocation may happen at a later time but with a high + * chance to succeed. + * + * Generated from protobuf enum SCHEDULED = 2; + */ + const SCHEDULED = 2; + /** + * Resource allocation has been successful. At least one Task in the Job is + * RUNNING. + * + * Generated from protobuf enum RUNNING = 3; + */ + const RUNNING = 3; + /** + * All Tasks in the Job have finished successfully. + * + * Generated from protobuf enum SUCCEEDED = 4; + */ + const SUCCEEDED = 4; + /** + * At least one Task in the Job has failed. + * + * Generated from protobuf enum FAILED = 5; + */ + const FAILED = 5; + /** + * The Job will be deleted, but has not been deleted yet. Typically this is + * because resources used by the Job are still being cleaned up. + * + * Generated from protobuf enum DELETION_IN_PROGRESS = 6; + */ + const DELETION_IN_PROGRESS = 6; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::QUEUED => 'QUEUED', + self::SCHEDULED => 'SCHEDULED', + self::RUNNING => 'RUNNING', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + self::DELETION_IN_PROGRESS => 'DELETION_IN_PROGRESS', + ]; + + 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\Batch\V1\JobStatus_State::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/TaskGroupStatus.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/TaskGroupStatus.php new file mode 100644 index 000000000000..54e870456e18 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/TaskGroupStatus.php @@ -0,0 +1,108 @@ +google.cloud.batch.v1.JobStatus.TaskGroupStatus + */ +class TaskGroupStatus extends \Google\Protobuf\Internal\Message +{ + /** + * Count of task in each state in the TaskGroup. + * The map key is task state name. + * + * Generated from protobuf field map counts = 1; + */ + private $counts; + /** + * Status of instances allocated for the TaskGroup. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + */ + private $instances; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $counts + * Count of task in each state in the TaskGroup. + * The map key is task state name. + * @type array<\Google\Cloud\Batch\V1\JobStatus\InstanceStatus>|\Google\Protobuf\Internal\RepeatedField $instances + * Status of instances allocated for the TaskGroup. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Count of task in each state in the TaskGroup. + * The map key is task state name. + * + * Generated from protobuf field map counts = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getCounts() + { + return $this->counts; + } + + /** + * Count of task in each state in the TaskGroup. + * The map key is task state name. + * + * Generated from protobuf field map counts = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setCounts($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::INT64); + $this->counts = $arr; + + return $this; + } + + /** + * Status of instances allocated for the TaskGroup. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * Status of instances allocated for the TaskGroup. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; + * @param array<\Google\Cloud\Batch\V1\JobStatus\InstanceStatus>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\JobStatus\InstanceStatus::class); + $this->instances = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TaskGroupStatus::class, \Google\Cloud\Batch\V1\JobStatus_TaskGroupStatus::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus_InstanceStatus.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus_InstanceStatus.php new file mode 100644 index 000000000000..28ee6c70c337 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus_InstanceStatus.php @@ -0,0 +1,16 @@ +google.cloud.batch.v1.LifecyclePolicy + */ +class LifecyclePolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Action to execute when ActionCondition is true. + * When RETRY_TASK is specified, we will retry failed tasks + * if we notice any exit code match and fail tasks if no match is found. + * Likewise, when FAIL_TASK is specified, we will fail tasks + * if we notice any exit code match and retry tasks if no match is found. + * + * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; + */ + protected $action = 0; + /** + * Conditions that decide why a task failure is dealt with a specific action. + * + * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; + */ + protected $action_condition = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $action + * Action to execute when ActionCondition is true. + * When RETRY_TASK is specified, we will retry failed tasks + * if we notice any exit code match and fail tasks if no match is found. + * Likewise, when FAIL_TASK is specified, we will fail tasks + * if we notice any exit code match and retry tasks if no match is found. + * @type \Google\Cloud\Batch\V1\LifecyclePolicy\ActionCondition $action_condition + * Conditions that decide why a task failure is dealt with a specific action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * Action to execute when ActionCondition is true. + * When RETRY_TASK is specified, we will retry failed tasks + * if we notice any exit code match and fail tasks if no match is found. + * Likewise, when FAIL_TASK is specified, we will fail tasks + * if we notice any exit code match and retry tasks if no match is found. + * + * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; + * @return int + */ + public function getAction() + { + return $this->action; + } + + /** + * Action to execute when ActionCondition is true. + * When RETRY_TASK is specified, we will retry failed tasks + * if we notice any exit code match and fail tasks if no match is found. + * Likewise, when FAIL_TASK is specified, we will fail tasks + * if we notice any exit code match and retry tasks if no match is found. + * + * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; + * @param int $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\LifecyclePolicy\Action::class); + $this->action = $var; + + return $this; + } + + /** + * Conditions that decide why a task failure is dealt with a specific action. + * + * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; + * @return \Google\Cloud\Batch\V1\LifecyclePolicy\ActionCondition|null + */ + public function getActionCondition() + { + return $this->action_condition; + } + + public function hasActionCondition() + { + return isset($this->action_condition); + } + + public function clearActionCondition() + { + unset($this->action_condition); + } + + /** + * Conditions that decide why a task failure is dealt with a specific action. + * + * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; + * @param \Google\Cloud\Batch\V1\LifecyclePolicy\ActionCondition $var + * @return $this + */ + public function setActionCondition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\LifecyclePolicy\ActionCondition::class); + $this->action_condition = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/Action.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/Action.php new file mode 100644 index 000000000000..08419071bb67 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/Action.php @@ -0,0 +1,64 @@ +google.cloud.batch.v1.LifecyclePolicy.Action + */ +class Action +{ + /** + * Action unspecified. + * + * Generated from protobuf enum ACTION_UNSPECIFIED = 0; + */ + const ACTION_UNSPECIFIED = 0; + /** + * Action that tasks in the group will be scheduled to re-execute. + * + * Generated from protobuf enum RETRY_TASK = 1; + */ + const RETRY_TASK = 1; + /** + * Action that tasks in the group will be stopped immediately. + * + * Generated from protobuf enum FAIL_TASK = 2; + */ + const FAIL_TASK = 2; + + private static $valueToName = [ + self::ACTION_UNSPECIFIED => 'ACTION_UNSPECIFIED', + self::RETRY_TASK => 'RETRY_TASK', + self::FAIL_TASK => 'FAIL_TASK', + ]; + + 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(Action::class, \Google\Cloud\Batch\V1\LifecyclePolicy_Action::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/ActionCondition.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/ActionCondition.php new file mode 100644 index 000000000000..acffa97a9300 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/ActionCondition.php @@ -0,0 +1,82 @@ +google.cloud.batch.v1.LifecyclePolicy.ActionCondition + */ +class ActionCondition extends \Google\Protobuf\Internal\Message +{ + /** + * Exit codes of a task execution. + * If there are more than 1 exit codes, + * when task executes with any of the exit code in the list, + * the condition is met and the action will be executed. + * + * Generated from protobuf field repeated int32 exit_codes = 1; + */ + private $exit_codes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $exit_codes + * Exit codes of a task execution. + * If there are more than 1 exit codes, + * when task executes with any of the exit code in the list, + * the condition is met and the action will be executed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * Exit codes of a task execution. + * If there are more than 1 exit codes, + * when task executes with any of the exit code in the list, + * the condition is met and the action will be executed. + * + * Generated from protobuf field repeated int32 exit_codes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExitCodes() + { + return $this->exit_codes; + } + + /** + * Exit codes of a task execution. + * If there are more than 1 exit codes, + * when task executes with any of the exit code in the list, + * the condition is met and the action will be executed. + * + * Generated from protobuf field repeated int32 exit_codes = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExitCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->exit_codes = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ActionCondition::class, \Google\Cloud\Batch\V1\LifecyclePolicy_ActionCondition::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy_Action.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy_Action.php new file mode 100644 index 000000000000..f63ebd057b78 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy_Action.php @@ -0,0 +1,16 @@ +google.cloud.batch.v1.ListJobsRequest + */ +class ListJobsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Parent path. + * + * Generated from protobuf field string parent = 1; + */ + protected $parent = ''; + /** + * List filter. + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + /** + * Page size. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * Page token. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Parent path. + * @type string $filter + * List filter. + * @type int $page_size + * Page size. + * @type string $page_token + * Page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); + parent::__construct($data); + } + + /** + * Parent path. + * + * Generated from protobuf field string parent = 1; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Parent path. + * + * Generated from protobuf field string parent = 1; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * List filter. + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * List filter. + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Page size. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Page size. + * + * 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; + } + + /** + * Page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Page token. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListJobsResponse.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListJobsResponse.php new file mode 100644 index 000000000000..9874dbeed530 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListJobsResponse.php @@ -0,0 +1,135 @@ +google.cloud.batch.v1.ListJobsResponse + */ +class ListJobsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Jobs. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Job jobs = 1; + */ + private $jobs; + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Batch\V1\Job>|\Google\Protobuf\Internal\RepeatedField $jobs + * Jobs. + * @type string $next_page_token + * Next page token. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); + parent::__construct($data); + } + + /** + * Jobs. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Job jobs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getJobs() + { + return $this->jobs; + } + + /** + * Jobs. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Job jobs = 1; + * @param array<\Google\Cloud\Batch\V1\Job>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setJobs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\Job::class); + $this->jobs = $arr; + + return $this; + } + + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Next page token. + * + * 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; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksRequest.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksRequest.php new file mode 100644 index 000000000000..ab6b618343d7 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksRequest.php @@ -0,0 +1,185 @@ +google.cloud.batch.v1.ListTasksRequest + */ +class ListTasksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * + * Generated from protobuf field string filter = 2; + */ + protected $filter = ''; + /** + * Page size. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * Page token. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * @type string $filter + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * @type int $page_size + * Page size. + * @type string $page_token + * Page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * + * 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. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * + * 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; + } + + /** + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * + * Generated from protobuf field string filter = 2; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * + * Generated from protobuf field string filter = 2; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Page size. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Page size. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Page token. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Page token. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksResponse.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksResponse.php new file mode 100644 index 000000000000..7209c2e30a9f --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksResponse.php @@ -0,0 +1,135 @@ +google.cloud.batch.v1.ListTasksResponse + */ +class ListTasksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Tasks. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Task tasks = 1; + */ + private $tasks; + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Batch\V1\Task>|\Google\Protobuf\Internal\RepeatedField $tasks + * Tasks. + * @type string $next_page_token + * Next page token. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); + parent::__construct($data); + } + + /** + * Tasks. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Task tasks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTasks() + { + return $this->tasks; + } + + /** + * Tasks. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Task tasks = 1; + * @param array<\Google\Cloud\Batch\V1\Task>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTasks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\Task::class); + $this->tasks = $arr; + + return $this; + } + + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Next page token. + * + * 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; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy.php new file mode 100644 index 000000000000..0d9e659378b6 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy.php @@ -0,0 +1,110 @@ +google.cloud.batch.v1.LogsPolicy + */ +class LogsPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Where logs should be saved. + * + * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy.Destination destination = 1; + */ + protected $destination = 0; + /** + * The path to which logs are saved when the destination = PATH. This can be a + * local file path on the VM, or under the mount point of a Persistent Disk or + * Filestore, or a Cloud Storage path. + * + * Generated from protobuf field string logs_path = 2; + */ + protected $logs_path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $destination + * Where logs should be saved. + * @type string $logs_path + * The path to which logs are saved when the destination = PATH. This can be a + * local file path on the VM, or under the mount point of a Persistent Disk or + * Filestore, or a Cloud Storage path. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Where logs should be saved. + * + * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy.Destination destination = 1; + * @return int + */ + public function getDestination() + { + return $this->destination; + } + + /** + * Where logs should be saved. + * + * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy.Destination destination = 1; + * @param int $var + * @return $this + */ + public function setDestination($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\LogsPolicy\Destination::class); + $this->destination = $var; + + return $this; + } + + /** + * The path to which logs are saved when the destination = PATH. This can be a + * local file path on the VM, or under the mount point of a Persistent Disk or + * Filestore, or a Cloud Storage path. + * + * Generated from protobuf field string logs_path = 2; + * @return string + */ + public function getLogsPath() + { + return $this->logs_path; + } + + /** + * The path to which logs are saved when the destination = PATH. This can be a + * local file path on the VM, or under the mount point of a Persistent Disk or + * Filestore, or a Cloud Storage path. + * + * Generated from protobuf field string logs_path = 2; + * @param string $var + * @return $this + */ + public function setLogsPath($var) + { + GPBUtil::checkString($var, True); + $this->logs_path = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy/Destination.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy/Destination.php new file mode 100644 index 000000000000..1f87d09d632d --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy/Destination.php @@ -0,0 +1,64 @@ +google.cloud.batch.v1.LogsPolicy.Destination + */ +class Destination +{ + /** + * Logs are not preserved. + * + * Generated from protobuf enum DESTINATION_UNSPECIFIED = 0; + */ + const DESTINATION_UNSPECIFIED = 0; + /** + * Logs are streamed to Cloud Logging. + * + * Generated from protobuf enum CLOUD_LOGGING = 1; + */ + const CLOUD_LOGGING = 1; + /** + * Logs are saved to a file path. + * + * Generated from protobuf enum PATH = 2; + */ + const PATH = 2; + + private static $valueToName = [ + self::DESTINATION_UNSPECIFIED => 'DESTINATION_UNSPECIFIED', + self::CLOUD_LOGGING => 'CLOUD_LOGGING', + self::PATH => 'PATH', + ]; + + 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(Destination::class, \Google\Cloud\Batch\V1\LogsPolicy_Destination::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy_Destination.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy_Destination.php new file mode 100644 index 000000000000..5540f3354925 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy_Destination.php @@ -0,0 +1,16 @@ +google.cloud.batch.v1.NFS + */ +class NFS extends \Google\Protobuf\Internal\Message +{ + /** + * The IP address of the NFS. + * + * Generated from protobuf field string server = 1; + */ + protected $server = ''; + /** + * Remote source path exported from the NFS, e.g., "/share". + * + * Generated from protobuf field string remote_path = 2; + */ + protected $remote_path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $server + * The IP address of the NFS. + * @type string $remote_path + * Remote source path exported from the NFS, e.g., "/share". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Volume::initOnce(); + parent::__construct($data); + } + + /** + * The IP address of the NFS. + * + * Generated from protobuf field string server = 1; + * @return string + */ + public function getServer() + { + return $this->server; + } + + /** + * The IP address of the NFS. + * + * 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; + } + + /** + * Remote source path exported from the NFS, e.g., "/share". + * + * Generated from protobuf field string remote_path = 2; + * @return string + */ + public function getRemotePath() + { + return $this->remote_path; + } + + /** + * Remote source path exported from the NFS, e.g., "/share". + * + * Generated from protobuf field string remote_path = 2; + * @param string $var + * @return $this + */ + public function setRemotePath($var) + { + GPBUtil::checkString($var, True); + $this->remote_path = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/OperationMetadata.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/OperationMetadata.php new file mode 100644 index 000000000000..6a98d039d45c --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/OperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.batch.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.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 time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.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 time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable.php new file mode 100644 index 000000000000..14c8f5a01604 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable.php @@ -0,0 +1,372 @@ +google.cloud.batch.v1.Runnable + */ +class Runnable extends \Google\Protobuf\Internal\Message +{ + /** + * Normally, a non-zero exit status causes the Task to fail. This flag allows + * execution of other Runnables to continue instead. + * + * Generated from protobuf field bool ignore_exit_status = 3; + */ + protected $ignore_exit_status = false; + /** + * This flag allows a Runnable to continue running in the background while the + * Task executes subsequent Runnables. This is useful to provide services to + * other Runnables (or to provide debugging support tools like SSH servers). + * + * Generated from protobuf field bool background = 4; + */ + protected $background = false; + /** + * By default, after a Runnable fails, no further Runnable are executed. This + * flag indicates that this Runnable must be run even if the Task has already + * failed. This is useful for Runnables that copy output files off of the VM + * or for debugging. + * The always_run flag does not override the Task's overall max_run_duration. + * If the max_run_duration has expired then no further Runnables will execute, + * not even always_run Runnables. + * + * Generated from protobuf field bool always_run = 5; + */ + protected $always_run = false; + /** + * Environment variables for this Runnable (overrides variables set for the + * whole Task or TaskGroup). + * + * Generated from protobuf field .google.cloud.batch.v1.Environment environment = 7; + */ + protected $environment = null; + /** + * Timeout for this Runnable. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 8; + */ + protected $timeout = null; + protected $executable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Batch\V1\Runnable\Container $container + * Container runnable. + * @type \Google\Cloud\Batch\V1\Runnable\Script $script + * Script runnable. + * @type \Google\Cloud\Batch\V1\Runnable\Barrier $barrier + * Barrier runnable. + * @type bool $ignore_exit_status + * Normally, a non-zero exit status causes the Task to fail. This flag allows + * execution of other Runnables to continue instead. + * @type bool $background + * This flag allows a Runnable to continue running in the background while the + * Task executes subsequent Runnables. This is useful to provide services to + * other Runnables (or to provide debugging support tools like SSH servers). + * @type bool $always_run + * By default, after a Runnable fails, no further Runnable are executed. This + * flag indicates that this Runnable must be run even if the Task has already + * failed. This is useful for Runnables that copy output files off of the VM + * or for debugging. + * The always_run flag does not override the Task's overall max_run_duration. + * If the max_run_duration has expired then no further Runnables will execute, + * not even always_run Runnables. + * @type \Google\Cloud\Batch\V1\Environment $environment + * Environment variables for this Runnable (overrides variables set for the + * whole Task or TaskGroup). + * @type \Google\Protobuf\Duration $timeout + * Timeout for this Runnable. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * Container runnable. + * + * Generated from protobuf field .google.cloud.batch.v1.Runnable.Container container = 1; + * @return \Google\Cloud\Batch\V1\Runnable\Container|null + */ + public function getContainer() + { + return $this->readOneof(1); + } + + public function hasContainer() + { + return $this->hasOneof(1); + } + + /** + * Container runnable. + * + * Generated from protobuf field .google.cloud.batch.v1.Runnable.Container container = 1; + * @param \Google\Cloud\Batch\V1\Runnable\Container $var + * @return $this + */ + public function setContainer($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Runnable\Container::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Script runnable. + * + * Generated from protobuf field .google.cloud.batch.v1.Runnable.Script script = 2; + * @return \Google\Cloud\Batch\V1\Runnable\Script|null + */ + public function getScript() + { + return $this->readOneof(2); + } + + public function hasScript() + { + return $this->hasOneof(2); + } + + /** + * Script runnable. + * + * Generated from protobuf field .google.cloud.batch.v1.Runnable.Script script = 2; + * @param \Google\Cloud\Batch\V1\Runnable\Script $var + * @return $this + */ + public function setScript($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Runnable\Script::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Barrier runnable. + * + * Generated from protobuf field .google.cloud.batch.v1.Runnable.Barrier barrier = 6; + * @return \Google\Cloud\Batch\V1\Runnable\Barrier|null + */ + public function getBarrier() + { + return $this->readOneof(6); + } + + public function hasBarrier() + { + return $this->hasOneof(6); + } + + /** + * Barrier runnable. + * + * Generated from protobuf field .google.cloud.batch.v1.Runnable.Barrier barrier = 6; + * @param \Google\Cloud\Batch\V1\Runnable\Barrier $var + * @return $this + */ + public function setBarrier($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Runnable\Barrier::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Normally, a non-zero exit status causes the Task to fail. This flag allows + * execution of other Runnables to continue instead. + * + * Generated from protobuf field bool ignore_exit_status = 3; + * @return bool + */ + public function getIgnoreExitStatus() + { + return $this->ignore_exit_status; + } + + /** + * Normally, a non-zero exit status causes the Task to fail. This flag allows + * execution of other Runnables to continue instead. + * + * Generated from protobuf field bool ignore_exit_status = 3; + * @param bool $var + * @return $this + */ + public function setIgnoreExitStatus($var) + { + GPBUtil::checkBool($var); + $this->ignore_exit_status = $var; + + return $this; + } + + /** + * This flag allows a Runnable to continue running in the background while the + * Task executes subsequent Runnables. This is useful to provide services to + * other Runnables (or to provide debugging support tools like SSH servers). + * + * Generated from protobuf field bool background = 4; + * @return bool + */ + public function getBackground() + { + return $this->background; + } + + /** + * This flag allows a Runnable to continue running in the background while the + * Task executes subsequent Runnables. This is useful to provide services to + * other Runnables (or to provide debugging support tools like SSH servers). + * + * Generated from protobuf field bool background = 4; + * @param bool $var + * @return $this + */ + public function setBackground($var) + { + GPBUtil::checkBool($var); + $this->background = $var; + + return $this; + } + + /** + * By default, after a Runnable fails, no further Runnable are executed. This + * flag indicates that this Runnable must be run even if the Task has already + * failed. This is useful for Runnables that copy output files off of the VM + * or for debugging. + * The always_run flag does not override the Task's overall max_run_duration. + * If the max_run_duration has expired then no further Runnables will execute, + * not even always_run Runnables. + * + * Generated from protobuf field bool always_run = 5; + * @return bool + */ + public function getAlwaysRun() + { + return $this->always_run; + } + + /** + * By default, after a Runnable fails, no further Runnable are executed. This + * flag indicates that this Runnable must be run even if the Task has already + * failed. This is useful for Runnables that copy output files off of the VM + * or for debugging. + * The always_run flag does not override the Task's overall max_run_duration. + * If the max_run_duration has expired then no further Runnables will execute, + * not even always_run Runnables. + * + * Generated from protobuf field bool always_run = 5; + * @param bool $var + * @return $this + */ + public function setAlwaysRun($var) + { + GPBUtil::checkBool($var); + $this->always_run = $var; + + return $this; + } + + /** + * Environment variables for this Runnable (overrides variables set for the + * whole Task or TaskGroup). + * + * Generated from protobuf field .google.cloud.batch.v1.Environment environment = 7; + * @return \Google\Cloud\Batch\V1\Environment|null + */ + public function getEnvironment() + { + return $this->environment; + } + + public function hasEnvironment() + { + return isset($this->environment); + } + + public function clearEnvironment() + { + unset($this->environment); + } + + /** + * Environment variables for this Runnable (overrides variables set for the + * whole Task or TaskGroup). + * + * Generated from protobuf field .google.cloud.batch.v1.Environment environment = 7; + * @param \Google\Cloud\Batch\V1\Environment $var + * @return $this + */ + public function setEnvironment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Environment::class); + $this->environment = $var; + + return $this; + } + + /** + * Timeout for this Runnable. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 8; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * Timeout for this Runnable. + * + * Generated from protobuf field .google.protobuf.Duration timeout = 8; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->timeout = $var; + + return $this; + } + + /** + * @return string + */ + public function getExecutable() + { + return $this->whichOneof("executable"); + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Barrier.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Barrier.php new file mode 100644 index 000000000000..189d5e8cb44c --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Barrier.php @@ -0,0 +1,74 @@ +google.cloud.batch.v1.Runnable.Barrier + */ +class Barrier extends \Google\Protobuf\Internal\Message +{ + /** + * Barriers are identified by their index in runnable list. + * Names are not required, but if present should be an identifier. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Barriers are identified by their index in runnable list. + * Names are not required, but if present should be an identifier. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * Barriers are identified by their index in runnable list. + * Names are not required, but if present should be an identifier. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Barriers are identified by their index in runnable list. + * Names are not required, but if present should be an identifier. + * + * 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; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Barrier::class, \Google\Cloud\Batch\V1\Runnable_Barrier::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Container.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Container.php new file mode 100644 index 000000000000..c3301d6c2f2d --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Container.php @@ -0,0 +1,352 @@ +google.cloud.batch.v1.Runnable.Container + */ +class Container extends \Google\Protobuf\Internal\Message +{ + /** + * The URI to pull the container image from. + * + * Generated from protobuf field string image_uri = 1; + */ + protected $image_uri = ''; + /** + * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT + * (either in the container image or with the entrypoint field below) then + * commands are appended as arguments to the ENTRYPOINT. + * + * Generated from protobuf field repeated string commands = 2; + */ + private $commands; + /** + * Overrides the `ENTRYPOINT` specified in the container. + * + * Generated from protobuf field string entrypoint = 3; + */ + protected $entrypoint = ''; + /** + * Volumes to mount (bind mount) from the host machine files or directories + * into the container, formatted to match docker run's --volume option, + * e.g. /foo:/bar, or /foo:/bar:ro + * + * Generated from protobuf field repeated string volumes = 7; + */ + private $volumes; + /** + * Arbitrary additional options to include in the "docker run" command when + * running this container, e.g. "--network host". + * + * Generated from protobuf field string options = 8; + */ + protected $options = ''; + /** + * If set to true, external network access to and from container will be + * blocked. The container will use the default internal network + * 'goog-internal'. + * + * Generated from protobuf field bool block_external_network = 9; + */ + protected $block_external_network = false; + /** + * Optional username for logging in to a docker registry. If username + * matches `projects/*/secrets/*/versions/*` then Batch will read the + * username from the Secret Manager. + * + * Generated from protobuf field string username = 10; + */ + protected $username = ''; + /** + * Optional password for logging in to a docker registry. If password + * matches `projects/*/secrets/*/versions/*` then Batch will read the + * password from the Secret Manager; + * + * Generated from protobuf field string password = 11; + */ + protected $password = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $image_uri + * The URI to pull the container image from. + * @type array|\Google\Protobuf\Internal\RepeatedField $commands + * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT + * (either in the container image or with the entrypoint field below) then + * commands are appended as arguments to the ENTRYPOINT. + * @type string $entrypoint + * Overrides the `ENTRYPOINT` specified in the container. + * @type array|\Google\Protobuf\Internal\RepeatedField $volumes + * Volumes to mount (bind mount) from the host machine files or directories + * into the container, formatted to match docker run's --volume option, + * e.g. /foo:/bar, or /foo:/bar:ro + * @type string $options + * Arbitrary additional options to include in the "docker run" command when + * running this container, e.g. "--network host". + * @type bool $block_external_network + * If set to true, external network access to and from container will be + * blocked. The container will use the default internal network + * 'goog-internal'. + * @type string $username + * Optional username for logging in to a docker registry. If username + * matches `projects/*/secrets/*/versions/*` then Batch will read the + * username from the Secret Manager. + * @type string $password + * Optional password for logging in to a docker registry. If password + * matches `projects/*/secrets/*/versions/*` then Batch will read the + * password from the Secret Manager; + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * The URI to pull the container image from. + * + * Generated from protobuf field string image_uri = 1; + * @return string + */ + public function getImageUri() + { + return $this->image_uri; + } + + /** + * The URI to pull the container image from. + * + * Generated from protobuf field string image_uri = 1; + * @param string $var + * @return $this + */ + public function setImageUri($var) + { + GPBUtil::checkString($var, True); + $this->image_uri = $var; + + return $this; + } + + /** + * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT + * (either in the container image or with the entrypoint field below) then + * commands are appended as arguments to the ENTRYPOINT. + * + * Generated from protobuf field repeated string commands = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCommands() + { + return $this->commands; + } + + /** + * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT + * (either in the container image or with the entrypoint field below) then + * commands are appended as arguments to the ENTRYPOINT. + * + * Generated from protobuf field repeated string commands = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCommands($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->commands = $arr; + + return $this; + } + + /** + * Overrides the `ENTRYPOINT` specified in the container. + * + * Generated from protobuf field string entrypoint = 3; + * @return string + */ + public function getEntrypoint() + { + return $this->entrypoint; + } + + /** + * Overrides the `ENTRYPOINT` specified in the container. + * + * Generated from protobuf field string entrypoint = 3; + * @param string $var + * @return $this + */ + public function setEntrypoint($var) + { + GPBUtil::checkString($var, True); + $this->entrypoint = $var; + + return $this; + } + + /** + * Volumes to mount (bind mount) from the host machine files or directories + * into the container, formatted to match docker run's --volume option, + * e.g. /foo:/bar, or /foo:/bar:ro + * + * Generated from protobuf field repeated string volumes = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumes() + { + return $this->volumes; + } + + /** + * Volumes to mount (bind mount) from the host machine files or directories + * into the container, formatted to match docker run's --volume option, + * e.g. /foo:/bar, or /foo:/bar:ro + * + * Generated from protobuf field repeated string volumes = 7; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->volumes = $arr; + + return $this; + } + + /** + * Arbitrary additional options to include in the "docker run" command when + * running this container, e.g. "--network host". + * + * Generated from protobuf field string options = 8; + * @return string + */ + public function getOptions() + { + return $this->options; + } + + /** + * Arbitrary additional options to include in the "docker run" command when + * running this container, e.g. "--network host". + * + * Generated from protobuf field string options = 8; + * @param string $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkString($var, True); + $this->options = $var; + + return $this; + } + + /** + * If set to true, external network access to and from container will be + * blocked. The container will use the default internal network + * 'goog-internal'. + * + * Generated from protobuf field bool block_external_network = 9; + * @return bool + */ + public function getBlockExternalNetwork() + { + return $this->block_external_network; + } + + /** + * If set to true, external network access to and from container will be + * blocked. The container will use the default internal network + * 'goog-internal'. + * + * Generated from protobuf field bool block_external_network = 9; + * @param bool $var + * @return $this + */ + public function setBlockExternalNetwork($var) + { + GPBUtil::checkBool($var); + $this->block_external_network = $var; + + return $this; + } + + /** + * Optional username for logging in to a docker registry. If username + * matches `projects/*/secrets/*/versions/*` then Batch will read the + * username from the Secret Manager. + * + * Generated from protobuf field string username = 10; + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Optional username for logging in to a docker registry. If username + * matches `projects/*/secrets/*/versions/*` then Batch will read the + * username from the Secret Manager. + * + * Generated from protobuf field string username = 10; + * @param string $var + * @return $this + */ + public function setUsername($var) + { + GPBUtil::checkString($var, True); + $this->username = $var; + + return $this; + } + + /** + * Optional password for logging in to a docker registry. If password + * matches `projects/*/secrets/*/versions/*` then Batch will read the + * password from the Secret Manager; + * + * Generated from protobuf field string password = 11; + * @return string + */ + public function getPassword() + { + return $this->password; + } + + /** + * Optional password for logging in to a docker registry. If password + * matches `projects/*/secrets/*/versions/*` then Batch will read the + * password from the Secret Manager; + * + * Generated from protobuf field string password = 11; + * @param string $var + * @return $this + */ + public function setPassword($var) + { + GPBUtil::checkString($var, True); + $this->password = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Container::class, \Google\Cloud\Batch\V1\Runnable_Container::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Script.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Script.php new file mode 100644 index 000000000000..ea9a5725b610 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Script.php @@ -0,0 +1,147 @@ +google.cloud.batch.v1.Runnable.Script + */ +class Script extends \Google\Protobuf\Internal\Message +{ + protected $command; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $path + * Script file path on the host VM. + * To specify an interpreter, please add a `#!`(also known as + * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the + * first line of the file.(For example, to execute the script using bash, + * `#!/bin/bash` should be the first line of the file. To execute the + * script using`Python3`, `#!/usr/bin/env python3` should be the first + * line of the file.) Otherwise, the file will by default be excuted by + * `/bin/sh`. + * @type string $text + * Shell script text. + * To specify an interpreter, please add a `#!\n` at the + * beginning of the text.(For example, to execute the script using bash, + * `#!/bin/bash\n` should be added. To execute the script using`Python3`, + * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will + * by default be excuted by `/bin/sh`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * Script file path on the host VM. + * To specify an interpreter, please add a `#!`(also known as + * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the + * first line of the file.(For example, to execute the script using bash, + * `#!/bin/bash` should be the first line of the file. To execute the + * script using`Python3`, `#!/usr/bin/env python3` should be the first + * line of the file.) Otherwise, the file will by default be excuted by + * `/bin/sh`. + * + * Generated from protobuf field string path = 1; + * @return string + */ + public function getPath() + { + return $this->readOneof(1); + } + + public function hasPath() + { + return $this->hasOneof(1); + } + + /** + * Script file path on the host VM. + * To specify an interpreter, please add a `#!`(also known as + * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the + * first line of the file.(For example, to execute the script using bash, + * `#!/bin/bash` should be the first line of the file. To execute the + * script using`Python3`, `#!/usr/bin/env python3` should be the first + * line of the file.) Otherwise, the file will by default be excuted by + * `/bin/sh`. + * + * Generated from protobuf field string path = 1; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Shell script text. + * To specify an interpreter, please add a `#!\n` at the + * beginning of the text.(For example, to execute the script using bash, + * `#!/bin/bash\n` should be added. To execute the script using`Python3`, + * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will + * by default be excuted by `/bin/sh`. + * + * Generated from protobuf field string text = 2; + * @return string + */ + public function getText() + { + return $this->readOneof(2); + } + + public function hasText() + { + return $this->hasOneof(2); + } + + /** + * Shell script text. + * To specify an interpreter, please add a `#!\n` at the + * beginning of the text.(For example, to execute the script using bash, + * `#!/bin/bash\n` should be added. To execute the script using`Python3`, + * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will + * by default be excuted by `/bin/sh`. + * + * Generated from protobuf field string text = 2; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getCommand() + { + return $this->whichOneof("command"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Script::class, \Google\Cloud\Batch\V1\Runnable_Script::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable_Barrier.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable_Barrier.php new file mode 100644 index 000000000000..795138775fad --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable_Barrier.php @@ -0,0 +1,16 @@ +google.cloud.batch.v1.ServiceAccount + */ +class ServiceAccount extends \Google\Protobuf\Internal\Message +{ + /** + * Email address of the service account. If not specified, the default + * Compute Engine service account for the project will be used. If instance + * template is being used, the service account has to be specified in the + * instance template and it has to match the email field here. + * + * Generated from protobuf field string email = 1; + */ + protected $email = ''; + /** + * List of scopes to be enabled for this service account on the VM, in + * addition to the cloud-platform API scope that will be added by default. + * + * Generated from protobuf field repeated string scopes = 2; + */ + private $scopes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $email + * Email address of the service account. If not specified, the default + * Compute Engine service account for the project will be used. If instance + * template is being used, the service account has to be specified in the + * instance template and it has to match the email field here. + * @type array|\Google\Protobuf\Internal\RepeatedField $scopes + * List of scopes to be enabled for this service account on the VM, in + * addition to the cloud-platform API scope that will be added by default. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Email address of the service account. If not specified, the default + * Compute Engine service account for the project will be used. If instance + * template is being used, the service account has to be specified in the + * instance template and it has to match the email field here. + * + * Generated from protobuf field string email = 1; + * @return string + */ + public function getEmail() + { + return $this->email; + } + + /** + * Email address of the service account. If not specified, the default + * Compute Engine service account for the project will be used. If instance + * template is being used, the service account has to be specified in the + * instance template and it has to match the email field here. + * + * Generated from protobuf field string email = 1; + * @param string $var + * @return $this + */ + public function setEmail($var) + { + GPBUtil::checkString($var, True); + $this->email = $var; + + return $this; + } + + /** + * List of scopes to be enabled for this service account on the VM, in + * addition to the cloud-platform API scope that will be added by default. + * + * Generated from protobuf field repeated string scopes = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScopes() + { + return $this->scopes; + } + + /** + * List of scopes to be enabled for this service account on the VM, in + * addition to the cloud-platform API scope that will be added by default. + * + * Generated from protobuf field repeated string scopes = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->scopes = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/StatusEvent.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/StatusEvent.php new file mode 100644 index 000000000000..293cb8c7bc93 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/StatusEvent.php @@ -0,0 +1,223 @@ +google.cloud.batch.v1.StatusEvent + */ +class StatusEvent extends \Google\Protobuf\Internal\Message +{ + /** + * Type of the event. + * + * Generated from protobuf field string type = 3; + */ + protected $type = ''; + /** + * Description of the event. + * + * Generated from protobuf field string description = 1; + */ + protected $description = ''; + /** + * The time this event occurred. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 2; + */ + protected $event_time = null; + /** + * Task Execution + * + * Generated from protobuf field .google.cloud.batch.v1.TaskExecution task_execution = 4; + */ + protected $task_execution = null; + /** + * Task State + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State task_state = 5; + */ + protected $task_state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type + * Type of the event. + * @type string $description + * Description of the event. + * @type \Google\Protobuf\Timestamp $event_time + * The time this event occurred. + * @type \Google\Cloud\Batch\V1\TaskExecution $task_execution + * Task Execution + * @type int $task_state + * Task State + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * Type of the event. + * + * Generated from protobuf field string type = 3; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Type of the event. + * + * Generated from protobuf field string type = 3; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * Description of the event. + * + * Generated from protobuf field string description = 1; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Description of the event. + * + * Generated from protobuf field string description = 1; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The time this event occurred. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEventTime() + { + return $this->event_time; + } + + public function hasEventTime() + { + return isset($this->event_time); + } + + public function clearEventTime() + { + unset($this->event_time); + } + + /** + * The time this event occurred. + * + * Generated from protobuf field .google.protobuf.Timestamp event_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEventTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->event_time = $var; + + return $this; + } + + /** + * Task Execution + * + * Generated from protobuf field .google.cloud.batch.v1.TaskExecution task_execution = 4; + * @return \Google\Cloud\Batch\V1\TaskExecution|null + */ + public function getTaskExecution() + { + return $this->task_execution; + } + + public function hasTaskExecution() + { + return isset($this->task_execution); + } + + public function clearTaskExecution() + { + unset($this->task_execution); + } + + /** + * Task Execution + * + * Generated from protobuf field .google.cloud.batch.v1.TaskExecution task_execution = 4; + * @param \Google\Cloud\Batch\V1\TaskExecution $var + * @return $this + */ + public function setTaskExecution($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\TaskExecution::class); + $this->task_execution = $var; + + return $this; + } + + /** + * Task State + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State task_state = 5; + * @return int + */ + public function getTaskState() + { + return $this->task_state; + } + + /** + * Task State + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State task_state = 5; + * @param int $var + * @return $this + */ + public function setTaskState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\TaskStatus\State::class); + $this->task_state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Task.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Task.php new file mode 100644 index 000000000000..c034a667462e --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Task.php @@ -0,0 +1,123 @@ +google.cloud.batch.v1.Task + */ +class Task extends \Google\Protobuf\Internal\Message +{ + /** + * Task name. + * The name is generated from the parent TaskGroup name and 'id' field. + * For example: + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Task Status. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus status = 2; + */ + protected $status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Task name. + * The name is generated from the parent TaskGroup name and 'id' field. + * For example: + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". + * @type \Google\Cloud\Batch\V1\TaskStatus $status + * Task Status. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * Task name. + * The name is generated from the parent TaskGroup name and 'id' field. + * For example: + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Task name. + * The name is generated from the parent TaskGroup name and 'id' field. + * For example: + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". + * + * 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; + } + + /** + * Task Status. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus status = 2; + * @return \Google\Cloud\Batch\V1\TaskStatus|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * Task Status. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus status = 2; + * @param \Google\Cloud\Batch\V1\TaskStatus $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\TaskStatus::class); + $this->status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskExecution.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskExecution.php new file mode 100644 index 000000000000..f8c79be6c535 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskExecution.php @@ -0,0 +1,72 @@ +google.cloud.batch.v1.TaskExecution + */ +class TaskExecution extends \Google\Protobuf\Internal\Message +{ + /** + * When task is completed as the status of FAILED or SUCCEEDED, + * exit code is for one task execution result, default is 0 as success. + * + * Generated from protobuf field int32 exit_code = 1; + */ + protected $exit_code = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $exit_code + * When task is completed as the status of FAILED or SUCCEEDED, + * exit code is for one task execution result, default is 0 as success. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * When task is completed as the status of FAILED or SUCCEEDED, + * exit code is for one task execution result, default is 0 as success. + * + * Generated from protobuf field int32 exit_code = 1; + * @return int + */ + public function getExitCode() + { + return $this->exit_code; + } + + /** + * When task is completed as the status of FAILED or SUCCEEDED, + * exit code is for one task execution result, default is 0 as success. + * + * Generated from protobuf field int32 exit_code = 1; + * @param int $var + * @return $this + */ + public function setExitCode($var) + { + GPBUtil::checkInt32($var); + $this->exit_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskGroup.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskGroup.php new file mode 100644 index 000000000000..c1d66ac65511 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskGroup.php @@ -0,0 +1,388 @@ +google.cloud.batch.v1.TaskGroup + */ +class TaskGroup extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. TaskGroup name. + * The system generates this field based on parent Job name. + * For example: + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Required. Tasks in the group share the same task spec. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskSpec task_spec = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $task_spec = null; + /** + * Number of Tasks in the TaskGroup. + * default is 1 + * + * Generated from protobuf field int64 task_count = 4; + */ + protected $task_count = 0; + /** + * Max number of tasks that can run in parallel. + * Default to min(task_count, 1000). + * + * Generated from protobuf field int64 parallelism = 5; + */ + protected $parallelism = 0; + /** + * An array of environment variable mappings, which are passed to Tasks with + * matching indices. If task_environments is used then task_count should + * not be specified in the request (and will be ignored). Task count will be + * the length of task_environments. + * Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in + * addition to any environment variables set in task_environments, specifying + * the number of Tasks in the Task's parent TaskGroup, and the specific Task's + * index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). + * task_environments supports up to 200 entries. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Environment task_environments = 9; + */ + private $task_environments; + /** + * Max number of tasks that can be run on a VM at the same time. + * If not specified, the system will decide a value based on available + * compute resources on a VM and task requirements. + * + * Generated from protobuf field int64 task_count_per_node = 10; + */ + protected $task_count_per_node = 0; + /** + * When true, Batch will populate a file with a list of all VMs assigned to + * the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path + * of that file. Defaults to false. + * + * Generated from protobuf field bool require_hosts_file = 11; + */ + protected $require_hosts_file = false; + /** + * When true, Batch will configure SSH to allow passwordless login between + * VMs running the Batch tasks in the same TaskGroup. + * + * Generated from protobuf field bool permissive_ssh = 12; + */ + protected $permissive_ssh = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. TaskGroup name. + * The system generates this field based on parent Job name. + * For example: + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". + * @type \Google\Cloud\Batch\V1\TaskSpec $task_spec + * Required. Tasks in the group share the same task spec. + * @type int|string $task_count + * Number of Tasks in the TaskGroup. + * default is 1 + * @type int|string $parallelism + * Max number of tasks that can run in parallel. + * Default to min(task_count, 1000). + * @type array<\Google\Cloud\Batch\V1\Environment>|\Google\Protobuf\Internal\RepeatedField $task_environments + * An array of environment variable mappings, which are passed to Tasks with + * matching indices. If task_environments is used then task_count should + * not be specified in the request (and will be ignored). Task count will be + * the length of task_environments. + * Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in + * addition to any environment variables set in task_environments, specifying + * the number of Tasks in the Task's parent TaskGroup, and the specific Task's + * index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). + * task_environments supports up to 200 entries. + * @type int|string $task_count_per_node + * Max number of tasks that can be run on a VM at the same time. + * If not specified, the system will decide a value based on available + * compute resources on a VM and task requirements. + * @type bool $require_hosts_file + * When true, Batch will populate a file with a list of all VMs assigned to + * the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path + * of that file. Defaults to false. + * @type bool $permissive_ssh + * When true, Batch will configure SSH to allow passwordless login between + * VMs running the Batch tasks in the same TaskGroup. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); + parent::__construct($data); + } + + /** + * Output only. TaskGroup name. + * The system generates this field based on parent Job name. + * For example: + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. TaskGroup name. + * The system generates this field based on parent Job name. + * For example: + * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". + * + * 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; + } + + /** + * Required. Tasks in the group share the same task spec. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskSpec task_spec = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Batch\V1\TaskSpec|null + */ + public function getTaskSpec() + { + return $this->task_spec; + } + + public function hasTaskSpec() + { + return isset($this->task_spec); + } + + public function clearTaskSpec() + { + unset($this->task_spec); + } + + /** + * Required. Tasks in the group share the same task spec. + * + * Generated from protobuf field .google.cloud.batch.v1.TaskSpec task_spec = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Batch\V1\TaskSpec $var + * @return $this + */ + public function setTaskSpec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\TaskSpec::class); + $this->task_spec = $var; + + return $this; + } + + /** + * Number of Tasks in the TaskGroup. + * default is 1 + * + * Generated from protobuf field int64 task_count = 4; + * @return int|string + */ + public function getTaskCount() + { + return $this->task_count; + } + + /** + * Number of Tasks in the TaskGroup. + * default is 1 + * + * Generated from protobuf field int64 task_count = 4; + * @param int|string $var + * @return $this + */ + public function setTaskCount($var) + { + GPBUtil::checkInt64($var); + $this->task_count = $var; + + return $this; + } + + /** + * Max number of tasks that can run in parallel. + * Default to min(task_count, 1000). + * + * Generated from protobuf field int64 parallelism = 5; + * @return int|string + */ + public function getParallelism() + { + return $this->parallelism; + } + + /** + * Max number of tasks that can run in parallel. + * Default to min(task_count, 1000). + * + * Generated from protobuf field int64 parallelism = 5; + * @param int|string $var + * @return $this + */ + public function setParallelism($var) + { + GPBUtil::checkInt64($var); + $this->parallelism = $var; + + return $this; + } + + /** + * An array of environment variable mappings, which are passed to Tasks with + * matching indices. If task_environments is used then task_count should + * not be specified in the request (and will be ignored). Task count will be + * the length of task_environments. + * Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in + * addition to any environment variables set in task_environments, specifying + * the number of Tasks in the Task's parent TaskGroup, and the specific Task's + * index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). + * task_environments supports up to 200 entries. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Environment task_environments = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTaskEnvironments() + { + return $this->task_environments; + } + + /** + * An array of environment variable mappings, which are passed to Tasks with + * matching indices. If task_environments is used then task_count should + * not be specified in the request (and will be ignored). Task count will be + * the length of task_environments. + * Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in + * addition to any environment variables set in task_environments, specifying + * the number of Tasks in the Task's parent TaskGroup, and the specific Task's + * index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). + * task_environments supports up to 200 entries. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Environment task_environments = 9; + * @param array<\Google\Cloud\Batch\V1\Environment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTaskEnvironments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\Environment::class); + $this->task_environments = $arr; + + return $this; + } + + /** + * Max number of tasks that can be run on a VM at the same time. + * If not specified, the system will decide a value based on available + * compute resources on a VM and task requirements. + * + * Generated from protobuf field int64 task_count_per_node = 10; + * @return int|string + */ + public function getTaskCountPerNode() + { + return $this->task_count_per_node; + } + + /** + * Max number of tasks that can be run on a VM at the same time. + * If not specified, the system will decide a value based on available + * compute resources on a VM and task requirements. + * + * Generated from protobuf field int64 task_count_per_node = 10; + * @param int|string $var + * @return $this + */ + public function setTaskCountPerNode($var) + { + GPBUtil::checkInt64($var); + $this->task_count_per_node = $var; + + return $this; + } + + /** + * When true, Batch will populate a file with a list of all VMs assigned to + * the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path + * of that file. Defaults to false. + * + * Generated from protobuf field bool require_hosts_file = 11; + * @return bool + */ + public function getRequireHostsFile() + { + return $this->require_hosts_file; + } + + /** + * When true, Batch will populate a file with a list of all VMs assigned to + * the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path + * of that file. Defaults to false. + * + * Generated from protobuf field bool require_hosts_file = 11; + * @param bool $var + * @return $this + */ + public function setRequireHostsFile($var) + { + GPBUtil::checkBool($var); + $this->require_hosts_file = $var; + + return $this; + } + + /** + * When true, Batch will configure SSH to allow passwordless login between + * VMs running the Batch tasks in the same TaskGroup. + * + * Generated from protobuf field bool permissive_ssh = 12; + * @return bool + */ + public function getPermissiveSsh() + { + return $this->permissive_ssh; + } + + /** + * When true, Batch will configure SSH to allow passwordless login between + * VMs running the Batch tasks in the same TaskGroup. + * + * Generated from protobuf field bool permissive_ssh = 12; + * @param bool $var + * @return $this + */ + public function setPermissiveSsh($var) + { + GPBUtil::checkBool($var); + $this->permissive_ssh = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskSpec.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskSpec.php new file mode 100644 index 000000000000..0d5eccb981c0 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskSpec.php @@ -0,0 +1,412 @@ +google.cloud.batch.v1.TaskSpec + */ +class TaskSpec extends \Google\Protobuf\Internal\Message +{ + /** + * The sequence of scripts or containers to run for this Task. Each Task using + * this TaskSpec executes its list of runnables in order. The Task succeeds if + * all of its runnables either exit with a zero status or any that exit with a + * non-zero status have the ignore_exit_status flag. + * Background runnables are killed automatically (if they have not already + * exited) a short time after all foreground runnables have completed. Even + * though this is likely to result in a non-zero exit status for the + * background runnable, these automatic kills are not treated as Task + * failures. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Runnable runnables = 8; + */ + private $runnables; + /** + * ComputeResource requirements. + * + * Generated from protobuf field .google.cloud.batch.v1.ComputeResource compute_resource = 3; + */ + protected $compute_resource = null; + /** + * Maximum duration the task should run. + * The task will be killed and marked as FAILED if over this limit. + * + * Generated from protobuf field .google.protobuf.Duration max_run_duration = 4; + */ + protected $max_run_duration = null; + /** + * Maximum number of retries on failures. + * The default, 0, which means never retry. + * The valid value range is [0, 10]. + * + * Generated from protobuf field int32 max_retry_count = 5; + */ + protected $max_retry_count = 0; + /** + * Lifecycle management schema when any task in a task group is failed. + * Currently we only support one lifecycle policy. + * When the lifecycle policy condition is met, + * the action in the policy will execute. + * If task execution result does not meet with the defined lifecycle + * policy, we consider it as the default policy. + * Default policy means if the exit code is 0, exit task. + * If task ends with non-zero exit code, retry the task with max_retry_count. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.LifecyclePolicy lifecycle_policies = 9; + */ + private $lifecycle_policies; + /** + * Deprecated: please use environment(non-plural) instead. + * + * Generated from protobuf field map environments = 6 [deprecated = true]; + * @deprecated + */ + private $environments; + /** + * Volumes to mount before running Tasks using this TaskSpec. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Volume volumes = 7; + */ + private $volumes; + /** + * Environment variables to set before running the Task. + * + * Generated from protobuf field .google.cloud.batch.v1.Environment environment = 10; + */ + protected $environment = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Batch\V1\Runnable>|\Google\Protobuf\Internal\RepeatedField $runnables + * The sequence of scripts or containers to run for this Task. Each Task using + * this TaskSpec executes its list of runnables in order. The Task succeeds if + * all of its runnables either exit with a zero status or any that exit with a + * non-zero status have the ignore_exit_status flag. + * Background runnables are killed automatically (if they have not already + * exited) a short time after all foreground runnables have completed. Even + * though this is likely to result in a non-zero exit status for the + * background runnable, these automatic kills are not treated as Task + * failures. + * @type \Google\Cloud\Batch\V1\ComputeResource $compute_resource + * ComputeResource requirements. + * @type \Google\Protobuf\Duration $max_run_duration + * Maximum duration the task should run. + * The task will be killed and marked as FAILED if over this limit. + * @type int $max_retry_count + * Maximum number of retries on failures. + * The default, 0, which means never retry. + * The valid value range is [0, 10]. + * @type array<\Google\Cloud\Batch\V1\LifecyclePolicy>|\Google\Protobuf\Internal\RepeatedField $lifecycle_policies + * Lifecycle management schema when any task in a task group is failed. + * Currently we only support one lifecycle policy. + * When the lifecycle policy condition is met, + * the action in the policy will execute. + * If task execution result does not meet with the defined lifecycle + * policy, we consider it as the default policy. + * Default policy means if the exit code is 0, exit task. + * If task ends with non-zero exit code, retry the task with max_retry_count. + * @type array|\Google\Protobuf\Internal\MapField $environments + * Deprecated: please use environment(non-plural) instead. + * @type array<\Google\Cloud\Batch\V1\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes + * Volumes to mount before running Tasks using this TaskSpec. + * @type \Google\Cloud\Batch\V1\Environment $environment + * Environment variables to set before running the Task. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * The sequence of scripts or containers to run for this Task. Each Task using + * this TaskSpec executes its list of runnables in order. The Task succeeds if + * all of its runnables either exit with a zero status or any that exit with a + * non-zero status have the ignore_exit_status flag. + * Background runnables are killed automatically (if they have not already + * exited) a short time after all foreground runnables have completed. Even + * though this is likely to result in a non-zero exit status for the + * background runnable, these automatic kills are not treated as Task + * failures. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Runnable runnables = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRunnables() + { + return $this->runnables; + } + + /** + * The sequence of scripts or containers to run for this Task. Each Task using + * this TaskSpec executes its list of runnables in order. The Task succeeds if + * all of its runnables either exit with a zero status or any that exit with a + * non-zero status have the ignore_exit_status flag. + * Background runnables are killed automatically (if they have not already + * exited) a short time after all foreground runnables have completed. Even + * though this is likely to result in a non-zero exit status for the + * background runnable, these automatic kills are not treated as Task + * failures. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Runnable runnables = 8; + * @param array<\Google\Cloud\Batch\V1\Runnable>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRunnables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\Runnable::class); + $this->runnables = $arr; + + return $this; + } + + /** + * ComputeResource requirements. + * + * Generated from protobuf field .google.cloud.batch.v1.ComputeResource compute_resource = 3; + * @return \Google\Cloud\Batch\V1\ComputeResource|null + */ + public function getComputeResource() + { + return $this->compute_resource; + } + + public function hasComputeResource() + { + return isset($this->compute_resource); + } + + public function clearComputeResource() + { + unset($this->compute_resource); + } + + /** + * ComputeResource requirements. + * + * Generated from protobuf field .google.cloud.batch.v1.ComputeResource compute_resource = 3; + * @param \Google\Cloud\Batch\V1\ComputeResource $var + * @return $this + */ + public function setComputeResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\ComputeResource::class); + $this->compute_resource = $var; + + return $this; + } + + /** + * Maximum duration the task should run. + * The task will be killed and marked as FAILED if over this limit. + * + * Generated from protobuf field .google.protobuf.Duration max_run_duration = 4; + * @return \Google\Protobuf\Duration|null + */ + public function getMaxRunDuration() + { + return $this->max_run_duration; + } + + public function hasMaxRunDuration() + { + return isset($this->max_run_duration); + } + + public function clearMaxRunDuration() + { + unset($this->max_run_duration); + } + + /** + * Maximum duration the task should run. + * The task will be killed and marked as FAILED if over this limit. + * + * Generated from protobuf field .google.protobuf.Duration max_run_duration = 4; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setMaxRunDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->max_run_duration = $var; + + return $this; + } + + /** + * Maximum number of retries on failures. + * The default, 0, which means never retry. + * The valid value range is [0, 10]. + * + * Generated from protobuf field int32 max_retry_count = 5; + * @return int + */ + public function getMaxRetryCount() + { + return $this->max_retry_count; + } + + /** + * Maximum number of retries on failures. + * The default, 0, which means never retry. + * The valid value range is [0, 10]. + * + * Generated from protobuf field int32 max_retry_count = 5; + * @param int $var + * @return $this + */ + public function setMaxRetryCount($var) + { + GPBUtil::checkInt32($var); + $this->max_retry_count = $var; + + return $this; + } + + /** + * Lifecycle management schema when any task in a task group is failed. + * Currently we only support one lifecycle policy. + * When the lifecycle policy condition is met, + * the action in the policy will execute. + * If task execution result does not meet with the defined lifecycle + * policy, we consider it as the default policy. + * Default policy means if the exit code is 0, exit task. + * If task ends with non-zero exit code, retry the task with max_retry_count. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.LifecyclePolicy lifecycle_policies = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLifecyclePolicies() + { + return $this->lifecycle_policies; + } + + /** + * Lifecycle management schema when any task in a task group is failed. + * Currently we only support one lifecycle policy. + * When the lifecycle policy condition is met, + * the action in the policy will execute. + * If task execution result does not meet with the defined lifecycle + * policy, we consider it as the default policy. + * Default policy means if the exit code is 0, exit task. + * If task ends with non-zero exit code, retry the task with max_retry_count. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.LifecyclePolicy lifecycle_policies = 9; + * @param array<\Google\Cloud\Batch\V1\LifecyclePolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLifecyclePolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\LifecyclePolicy::class); + $this->lifecycle_policies = $arr; + + return $this; + } + + /** + * Deprecated: please use environment(non-plural) instead. + * + * Generated from protobuf field map environments = 6 [deprecated = true]; + * @return \Google\Protobuf\Internal\MapField + * @deprecated + */ + public function getEnvironments() + { + @trigger_error('environments is deprecated.', E_USER_DEPRECATED); + return $this->environments; + } + + /** + * Deprecated: please use environment(non-plural) instead. + * + * Generated from protobuf field map environments = 6 [deprecated = true]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + * @deprecated + */ + public function setEnvironments($var) + { + @trigger_error('environments is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->environments = $arr; + + return $this; + } + + /** + * Volumes to mount before running Tasks using this TaskSpec. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Volume volumes = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVolumes() + { + return $this->volumes; + } + + /** + * Volumes to mount before running Tasks using this TaskSpec. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.Volume volumes = 7; + * @param array<\Google\Cloud\Batch\V1\Volume>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVolumes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\Volume::class); + $this->volumes = $arr; + + return $this; + } + + /** + * Environment variables to set before running the Task. + * + * Generated from protobuf field .google.cloud.batch.v1.Environment environment = 10; + * @return \Google\Cloud\Batch\V1\Environment|null + */ + public function getEnvironment() + { + return $this->environment; + } + + public function hasEnvironment() + { + return isset($this->environment); + } + + public function clearEnvironment() + { + unset($this->environment); + } + + /** + * Environment variables to set before running the Task. + * + * Generated from protobuf field .google.cloud.batch.v1.Environment environment = 10; + * @param \Google\Cloud\Batch\V1\Environment $var + * @return $this + */ + public function setEnvironment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Environment::class); + $this->environment = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus.php new file mode 100644 index 000000000000..d450092f3978 --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus.php @@ -0,0 +1,101 @@ +google.cloud.batch.v1.TaskStatus + */ +class TaskStatus extends \Google\Protobuf\Internal\Message +{ + /** + * Task state + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State state = 1; + */ + protected $state = 0; + /** + * Detailed info about why the state is reached. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.StatusEvent status_events = 2; + */ + private $status_events; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * Task state + * @type array<\Google\Cloud\Batch\V1\StatusEvent>|\Google\Protobuf\Internal\RepeatedField $status_events + * Detailed info about why the state is reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); + parent::__construct($data); + } + + /** + * Task state + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State state = 1; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Task state + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State state = 1; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\TaskStatus\State::class); + $this->state = $var; + + return $this; + } + + /** + * Detailed info about why the state is reached. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.StatusEvent status_events = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStatusEvents() + { + return $this->status_events; + } + + /** + * Detailed info about why the state is reached. + * + * Generated from protobuf field repeated .google.cloud.batch.v1.StatusEvent status_events = 2; + * @param array<\Google\Cloud\Batch\V1\StatusEvent>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStatusEvents($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\StatusEvent::class); + $this->status_events = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus/State.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus/State.php new file mode 100644 index 000000000000..ec4cc65716fe --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus/State.php @@ -0,0 +1,85 @@ +google.cloud.batch.v1.TaskStatus.State + */ +class State +{ + /** + * unknown state + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The Task is created and waiting for resources. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * The Task is assigned to at least one VM. + * + * Generated from protobuf enum ASSIGNED = 2; + */ + const ASSIGNED = 2; + /** + * The Task is running. + * + * Generated from protobuf enum RUNNING = 3; + */ + const RUNNING = 3; + /** + * The Task has failed. + * + * Generated from protobuf enum FAILED = 4; + */ + const FAILED = 4; + /** + * The Task has succeeded. + * + * Generated from protobuf enum SUCCEEDED = 5; + */ + const SUCCEEDED = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::ASSIGNED => 'ASSIGNED', + self::RUNNING => 'RUNNING', + self::FAILED => 'FAILED', + self::SUCCEEDED => 'SUCCEEDED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Batch\V1\TaskStatus_State::class); + diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus_State.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus_State.php new file mode 100644 index 000000000000..4c76fa84ac6b --- /dev/null +++ b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus_State.php @@ -0,0 +1,16 @@ +google.cloud.batch.v1.Volume + */ +class Volume extends \Google\Protobuf\Internal\Message +{ + /** + * The mount path for the volume, e.g. /mnt/disks/share. + * + * Generated from protobuf field string mount_path = 4; + */ + protected $mount_path = ''; + /** + * For Google Cloud Storage (GCS), mount options are the options supported by + * the gcsfuse tool (https://github.com/GoogleCloudPlatform/gcsfuse). + * For existing persistent disks, mount options provided by the + * mount command (https://man7.org/linux/man-pages/man8/mount.8.html) except + * writing are supported. This is due to restrictions of multi-writer mode + * (https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). + * For other attached disks and Network File System (NFS), mount options are + * these supported by the mount command + * (https://man7.org/linux/man-pages/man8/mount.8.html). + * + * Generated from protobuf field repeated string mount_options = 5; + */ + private $mount_options; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Batch\V1\NFS $nfs + * A Network File System (NFS) volume. For example, a + * Filestore file share. + * @type \Google\Cloud\Batch\V1\GCS $gcs + * A Google Cloud Storage (GCS) volume. + * @type string $device_name + * Device name of an attached disk volume, which should align with a + * device_name specified by + * job.allocation_policy.instances[0].policy.disks[i].device_name or + * defined by the given instance template in + * job.allocation_policy.instances[0].instance_template. + * @type string $mount_path + * The mount path for the volume, e.g. /mnt/disks/share. + * @type array|\Google\Protobuf\Internal\RepeatedField $mount_options + * For Google Cloud Storage (GCS), mount options are the options supported by + * the gcsfuse tool (https://github.com/GoogleCloudPlatform/gcsfuse). + * For existing persistent disks, mount options provided by the + * mount command (https://man7.org/linux/man-pages/man8/mount.8.html) except + * writing are supported. This is due to restrictions of multi-writer mode + * (https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). + * For other attached disks and Network File System (NFS), mount options are + * these supported by the mount command + * (https://man7.org/linux/man-pages/man8/mount.8.html). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Batch\V1\Volume::initOnce(); + parent::__construct($data); + } + + /** + * A Network File System (NFS) volume. For example, a + * Filestore file share. + * + * Generated from protobuf field .google.cloud.batch.v1.NFS nfs = 1; + * @return \Google\Cloud\Batch\V1\NFS|null + */ + public function getNfs() + { + return $this->readOneof(1); + } + + public function hasNfs() + { + return $this->hasOneof(1); + } + + /** + * A Network File System (NFS) volume. For example, a + * Filestore file share. + * + * Generated from protobuf field .google.cloud.batch.v1.NFS nfs = 1; + * @param \Google\Cloud\Batch\V1\NFS $var + * @return $this + */ + public function setNfs($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\NFS::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A Google Cloud Storage (GCS) volume. + * + * Generated from protobuf field .google.cloud.batch.v1.GCS gcs = 3; + * @return \Google\Cloud\Batch\V1\GCS|null + */ + public function getGcs() + { + return $this->readOneof(3); + } + + public function hasGcs() + { + return $this->hasOneof(3); + } + + /** + * A Google Cloud Storage (GCS) volume. + * + * Generated from protobuf field .google.cloud.batch.v1.GCS gcs = 3; + * @param \Google\Cloud\Batch\V1\GCS $var + * @return $this + */ + public function setGcs($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\GCS::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Device name of an attached disk volume, which should align with a + * device_name specified by + * job.allocation_policy.instances[0].policy.disks[i].device_name or + * defined by the given instance template in + * job.allocation_policy.instances[0].instance_template. + * + * Generated from protobuf field string device_name = 6; + * @return string + */ + public function getDeviceName() + { + return $this->readOneof(6); + } + + public function hasDeviceName() + { + return $this->hasOneof(6); + } + + /** + * Device name of an attached disk volume, which should align with a + * device_name specified by + * job.allocation_policy.instances[0].policy.disks[i].device_name or + * defined by the given instance template in + * job.allocation_policy.instances[0].instance_template. + * + * Generated from protobuf field string device_name = 6; + * @param string $var + * @return $this + */ + public function setDeviceName($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The mount path for the volume, e.g. /mnt/disks/share. + * + * Generated from protobuf field string mount_path = 4; + * @return string + */ + public function getMountPath() + { + return $this->mount_path; + } + + /** + * The mount path for the volume, e.g. /mnt/disks/share. + * + * Generated from protobuf field string mount_path = 4; + * @param string $var + * @return $this + */ + public function setMountPath($var) + { + GPBUtil::checkString($var, True); + $this->mount_path = $var; + + return $this; + } + + /** + * For Google Cloud Storage (GCS), mount options are the options supported by + * the gcsfuse tool (https://github.com/GoogleCloudPlatform/gcsfuse). + * For existing persistent disks, mount options provided by the + * mount command (https://man7.org/linux/man-pages/man8/mount.8.html) except + * writing are supported. This is due to restrictions of multi-writer mode + * (https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). + * For other attached disks and Network File System (NFS), mount options are + * these supported by the mount command + * (https://man7.org/linux/man-pages/man8/mount.8.html). + * + * Generated from protobuf field repeated string mount_options = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMountOptions() + { + return $this->mount_options; + } + + /** + * For Google Cloud Storage (GCS), mount options are the options supported by + * the gcsfuse tool (https://github.com/GoogleCloudPlatform/gcsfuse). + * For existing persistent disks, mount options provided by the + * mount command (https://man7.org/linux/man-pages/man8/mount.8.html) except + * writing are supported. This is due to restrictions of multi-writer mode + * (https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). + * For other attached disks and Network File System (NFS), mount options are + * these supported by the mount command + * (https://man7.org/linux/man-pages/man8/mount.8.html). + * + * Generated from protobuf field repeated string mount_options = 5; + * @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; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/create_job.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/create_job.php new file mode 100644 index 000000000000..d75dc497441a --- /dev/null +++ b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/create_job.php @@ -0,0 +1,77 @@ +setTaskSpec($jobTaskGroupsTaskSpec); + $jobTaskGroups = [$taskGroup,]; + $job = (new Job()) + ->setTaskGroups($jobTaskGroups); + + // Call the API and handle any network failures. + try { + /** @var Job $response */ + $response = $batchServiceClient->createJob($formattedParent, $job); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = BatchServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + create_job_sample($formattedParent); +} +// [END batch_v1_generated_BatchService_CreateJob_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/delete_job.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/delete_job.php new file mode 100644 index 000000000000..646ce369153f --- /dev/null +++ b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/delete_job.php @@ -0,0 +1,62 @@ +deleteJob(); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END batch_v1_generated_BatchService_DeleteJob_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_job.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_job.php new file mode 100644 index 000000000000..6e7eacccb7f1 --- /dev/null +++ b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_job.php @@ -0,0 +1,66 @@ +getJob($formattedName); + 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 = BatchServiceClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + + get_job_sample($formattedName); +} +// [END batch_v1_generated_BatchService_GetJob_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_location.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_location.php new file mode 100644 index 000000000000..50853941cea8 --- /dev/null +++ b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_location.php @@ -0,0 +1,53 @@ +getLocation(); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END batch_v1_generated_BatchService_GetLocation_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_task.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_task.php new file mode 100644 index 000000000000..16f4471f074d --- /dev/null +++ b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_task.php @@ -0,0 +1,72 @@ +getTask($formattedName); + 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 = BatchServiceClient::taskName( + '[PROJECT]', + '[LOCATION]', + '[JOB]', + '[TASK_GROUP]', + '[TASK]' + ); + + get_task_sample($formattedName); +} +// [END batch_v1_generated_BatchService_GetTask_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_jobs.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_jobs.php new file mode 100644 index 000000000000..6a12d4d8741e --- /dev/null +++ b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_jobs.php @@ -0,0 +1,58 @@ +listJobs(); + + /** @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()); + } +} +// [END batch_v1_generated_BatchService_ListJobs_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_locations.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_locations.php new file mode 100644 index 000000000000..2f45e2e55cbf --- /dev/null +++ b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_locations.php @@ -0,0 +1,58 @@ +listLocations(); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END batch_v1_generated_BatchService_ListLocations_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_tasks.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_tasks.php new file mode 100644 index 000000000000..bc61d857a0f6 --- /dev/null +++ b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_tasks.php @@ -0,0 +1,78 @@ +listTasks($formattedParent); + + /** @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 = BatchServiceClient::taskGroupName( + '[PROJECT]', + '[LOCATION]', + '[JOB]', + '[TASK_GROUP]' + ); + + list_tasks_sample($formattedParent); +} +// [END batch_v1_generated_BatchService_ListTasks_sync] diff --git a/owl-bot-staging/Batch/v1/src/V1/BatchServiceClient.php b/owl-bot-staging/Batch/v1/src/V1/BatchServiceClient.php new file mode 100644 index 000000000000..8ce48d079257 --- /dev/null +++ b/owl-bot-staging/Batch/v1/src/V1/BatchServiceClient.php @@ -0,0 +1,34 @@ +locationName('[PROJECT]', '[LOCATION]'); + * $job = new Job(); + * $response = $batchServiceClient->createJob($formattedParent, $job); + * } finally { + * $batchServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + */ +class BatchServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.batch.v1.BatchService'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'batch.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $jobNameTemplate; + + private static $locationNameTemplate; + + private static $taskNameTemplate; + + private static $taskGroupNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/batch_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/batch_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/batch_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/batch_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getJobNameTemplate() + { + if (self::$jobNameTemplate == null) { + self::$jobNameTemplate = new PathTemplate('projects/{project}/locations/{location}/jobs/{job}'); + } + + return self::$jobNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getTaskNameTemplate() + { + if (self::$taskNameTemplate == null) { + self::$taskNameTemplate = new PathTemplate('projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}'); + } + + return self::$taskNameTemplate; + } + + private static function getTaskGroupNameTemplate() + { + if (self::$taskGroupNameTemplate == null) { + self::$taskGroupNameTemplate = new PathTemplate('projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}'); + } + + return self::$taskGroupNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'job' => self::getJobNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'task' => self::getTaskNameTemplate(), + 'taskGroup' => self::getTaskGroupNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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($project, $location, $job) + { + return self::getJobNameTemplate()->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($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a task + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * @param string $taskGroup + * @param string $task + * + * @return string The formatted task resource. + */ + public static function taskName($project, $location, $job, $taskGroup, $task) + { + return self::getTaskNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + 'task_group' => $taskGroup, + 'task' => $task, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a task_group + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * @param string $taskGroup + * + * @return string The formatted task_group resource. + */ + public static function taskGroupName($project, $location, $job, $taskGroup) + { + return self::getTaskGroupNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + 'task_group' => $taskGroup, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - job: projects/{project}/locations/{location}/jobs/{job} + * - location: projects/{project}/locations/{location} + * - task: projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task} + * - taskGroup: projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'batch.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); + } + + /** + * Create a Job. + * + * Sample code: + * ``` + * $batchServiceClient = new BatchServiceClient(); + * try { + * $formattedParent = $batchServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * $job = new Job(); + * $response = $batchServiceClient->createJob($formattedParent, $job); + * } finally { + * $batchServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource name where the Job will be created. + * Pattern: "projects/{project}/locations/{location}" + * @param Job $job Required. The Job to create. + * @param array $optionalArgs { + * Optional. + * + * @type string $jobId + * ID used to uniquely identify the Job within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * + * The job.name field in the request will be ignored and the created resource + * name of the Job will be "{parent}/jobs/{job_id}". + * @type string $requestId + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Batch\V1\Job + * + * @throws ApiException if the remote call fails + */ + public function createJob($parent, $job, array $optionalArgs = []) + { + $request = new CreateJobRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setJob($job); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['jobId'])) { + $request->setJobId($optionalArgs['jobId']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateJob', Job::class, $optionalArgs, $request)->wait(); + } + + /** + * Delete a Job. + * + * Sample code: + * ``` + * $batchServiceClient = new BatchServiceClient(); + * try { + * $operationResponse = $batchServiceClient->deleteJob(); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $batchServiceClient->deleteJob(); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $batchServiceClient->resumeOperation($operationName, 'deleteJob'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $batchServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Job name. + * @type string $reason + * Optional. Reason for this deletion. + * @type string $requestId + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteJob(array $optionalArgs = []) + { + $request = new DeleteJobRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['reason'])) { + $request->setReason($optionalArgs['reason']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteJob', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Get a Job specified by its resource name. + * + * Sample code: + * ``` + * $batchServiceClient = new BatchServiceClient(); + * try { + * $formattedName = $batchServiceClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + * $response = $batchServiceClient->getJob($formattedName); + * } finally { + * $batchServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Job name. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Batch\V1\Job + * + * @throws ApiException if the remote call fails + */ + public function getJob($name, array $optionalArgs = []) + { + $request = new GetJobRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetJob', Job::class, $optionalArgs, $request)->wait(); + } + + /** + * Return a single Task. + * + * Sample code: + * ``` + * $batchServiceClient = new BatchServiceClient(); + * try { + * $formattedName = $batchServiceClient->taskName('[PROJECT]', '[LOCATION]', '[JOB]', '[TASK_GROUP]', '[TASK]'); + * $response = $batchServiceClient->getTask($formattedName); + * } finally { + * $batchServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Task name. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Batch\V1\Task + * + * @throws ApiException if the remote call fails + */ + public function getTask($name, array $optionalArgs = []) + { + $request = new GetTaskRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetTask', Task::class, $optionalArgs, $request)->wait(); + } + + /** + * List all Jobs for a project within a region. + * + * Sample code: + * ``` + * $batchServiceClient = new BatchServiceClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $batchServiceClient->listJobs(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $batchServiceClient->listJobs(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $batchServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $parent + * Parent path. + * @type string $filter + * List filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listJobs(array $optionalArgs = []) + { + $request = new ListJobsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['parent'])) { + $request->setParent($optionalArgs['parent']); + $requestParamHeaders['parent'] = $optionalArgs['parent']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListJobs', $optionalArgs, ListJobsResponse::class, $request); + } + + /** + * List Tasks associated with a job. + * + * Sample code: + * ``` + * $batchServiceClient = new BatchServiceClient(); + * try { + * $formattedParent = $batchServiceClient->taskGroupName('[PROJECT]', '[LOCATION]', '[JOB]', '[TASK_GROUP]'); + * // Iterate over pages of elements + * $pagedResponse = $batchServiceClient->listTasks($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $batchServiceClient->listTasks($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $batchServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listTasks($parent, array $optionalArgs = []) + { + $request = new ListTasksRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListTasks', $optionalArgs, ListTasksResponse::class, $request); + } + + /** + * Gets information about a location. + * + * Sample code: + * ``` + * $batchServiceClient = new BatchServiceClient(); + * try { + * $response = $batchServiceClient->getLocation(); + * } finally { + * $batchServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Resource name for the location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Location\Location + * + * @throws ApiException if the remote call fails + */ + public function getLocation(array $optionalArgs = []) + { + $request = new GetLocationRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * Sample code: + * ``` + * $batchServiceClient = new BatchServiceClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $batchServiceClient->listLocations(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $batchServiceClient->listLocations(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $batchServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The resource that owns the locations collection, if applicable. + * @type string $filter + * The standard list filter. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listLocations(array $optionalArgs = []) + { + $request = new ListLocationsRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + $requestParamHeaders['name'] = $optionalArgs['name']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); + } +} diff --git a/owl-bot-staging/Batch/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Batch/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..eae7f15d2f08 --- /dev/null +++ b/owl-bot-staging/Batch/v1/src/V1/gapic_metadata.json @@ -0,0 +1,58 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.batch.v1", + "libraryPackage": "Google\\Cloud\\Batch\\V1", + "services": { + "BatchService": { + "clients": { + "grpc": { + "libraryClient": "BatchServiceGapicClient", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "GetTask": { + "methods": [ + "getTask" + ] + }, + "ListJobs": { + "methods": [ + "listJobs" + ] + }, + "ListTasks": { + "methods": [ + "listTasks" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_client_config.json b/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_client_config.json new file mode 100644 index 000000000000..4fae7bea9f19 --- /dev/null +++ b/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_client_config.json @@ -0,0 +1,84 @@ +{ + "interfaces": { + "google.cloud.batch.v1.BatchService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "no_retry_1_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": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetJob": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetTask": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListJobs": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListTasks": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_descriptor_config.php b/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_descriptor_config.php new file mode 100644 index 000000000000..704e8834bed1 --- /dev/null +++ b/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_descriptor_config.php @@ -0,0 +1,48 @@ + [ + 'google.cloud.batch.v1.BatchService' => [ + 'DeleteJob' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Batch\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'ListJobs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getJobs', + ], + ], + 'ListTasks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTasks', + ], + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_rest_client_config.php b/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_rest_client_config.php new file mode 100644 index 000000000000..a72321464b81 --- /dev/null +++ b/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_rest_client_config.php @@ -0,0 +1,147 @@ + [ + 'google.cloud.batch.v1.BatchService' => [ + 'CreateJob' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/jobs', + 'body' => 'job', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteJob' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/jobs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetJob' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/jobs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetTask' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListJobs' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/jobs', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListTasks' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Batch/v1/tests/Unit/V1/BatchServiceClientTest.php b/owl-bot-staging/Batch/v1/tests/Unit/V1/BatchServiceClientTest.php new file mode 100644 index 000000000000..e679bf004c72 --- /dev/null +++ b/owl-bot-staging/Batch/v1/tests/Unit/V1/BatchServiceClientTest.php @@ -0,0 +1,628 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return BatchServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BatchServiceClient($options); + } + + /** @test */ + public function createJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $uid = 'uid115792'; + $priority = 1165461084; + $expectedResponse = new Job(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setPriority($priority); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $job = new Job(); + $jobTaskGroups = []; + $job->setTaskGroups($jobTaskGroups); + $response = $gapicClient->createJob($formattedParent, $job); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.batch.v1.BatchService/CreateJob', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getJob(); + $this->assertProtobufEquals($job, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createJobExceptionTest() + { + $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]'); + $job = new Job(); + $jobTaskGroups = []; + $job->setTaskGroups($jobTaskGroups); + try { + $gapicClient->createJob($formattedParent, $job); + // 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 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); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteJobTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + $response = $gapicClient->deleteJob(); + $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.batch.v1.BatchService/DeleteJob', $actualApiFuncCall); + $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); + $response = $gapicClient->deleteJob(); + $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 getJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $priority = 1165461084; + $expectedResponse = new Job(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setPriority($priority); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); + $response = $gapicClient->getJob($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.batch.v1.BatchService/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]'); + try { + $gapicClient->getJob($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTaskTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Task(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[JOB]', '[TASK_GROUP]', '[TASK]'); + $response = $gapicClient->getTask($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.batch.v1.BatchService/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]', '[TASK_GROUP]', '[TASK]'); + try { + $gapicClient->getTask($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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); + $response = $gapicClient->listJobs(); + $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.batch.v1.BatchService/ListJobs', $actualFuncCall); + $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); + try { + $gapicClient->listJobs(); + // 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->taskGroupName('[PROJECT]', '[LOCATION]', '[JOB]', '[TASK_GROUP]'); + $response = $gapicClient->listTasks($formattedParent); + $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.batch.v1.BatchService/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->taskGroupName('[PROJECT]', '[LOCATION]', '[JOB]', '[TASK_GROUP]'); + try { + $gapicClient->listTasks($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getLocation(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->getLocation(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listLocations(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->listLocations(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} From 92083d25cdd870ec51c3f173faf0d327f1eb8800 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 2 Mar 2023 07:18:06 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- Batch/metadata/V1/Batch.php | 5 +- Batch/metadata/V1/Task.php | Bin 3626 -> 3688 bytes Batch/src/V1/CreateJobRequest.php | 16 +- Batch/src/V1/DeleteJobRequest.php | 16 +- .../src/V1/Gapic/BatchServiceGapicClient.php | 211 +--- Batch/src/V1/Job.php | 12 +- Batch/src/V1/LifecyclePolicy.php | 16 + Batch/src/V1/Runnable/Script.php | 36 + Batch/src/V1/StatusEvent.php | 34 + Batch/src/V1/TaskSpec.php | 52 +- Batch/src/V1/gapic_metadata.json | 15 - .../batch_service_client_config.json | 15 - .../batch_service_rest_client_config.php | 37 - .../tests/Unit/V1/BatchServiceClientTest.php | 192 ---- .../Google/Cloud/Batch/V1/Batch.php | 91 -- .../GPBMetadata/Google/Cloud/Batch/V1/Job.php | Bin 5386 -> 0 bytes .../Google/Cloud/Batch/V1/Task.php | Bin 3688 -> 0 bytes .../Google/Cloud/Batch/V1/Volume.php | Bin 1026 -> 0 bytes .../Cloud/Batch/V1/AllocationPolicy.php | 262 ----- .../Batch/V1/AllocationPolicy/Accelerator.php | 147 --- .../V1/AllocationPolicy/AttachedDisk.php | 153 --- .../Cloud/Batch/V1/AllocationPolicy/Disk.php | 298 ------ .../V1/AllocationPolicy/InstancePolicy.php | 271 ------ .../InstancePolicyOrTemplate.php | 163 ---- .../V1/AllocationPolicy/LocationPolicy.php | 112 --- .../V1/AllocationPolicy/NetworkInterface.php | 202 ---- .../V1/AllocationPolicy/NetworkPolicy.php | 70 -- .../V1/AllocationPolicy/ProvisioningModel.php | 75 -- .../Batch/V1/AllocationPolicy_Accelerator.php | 16 - .../V1/AllocationPolicy_AttachedDisk.php | 16 - .../Cloud/Batch/V1/AllocationPolicy_Disk.php | 16 - .../V1/AllocationPolicy_InstancePolicy.php | 16 - ...ocationPolicy_InstancePolicyOrTemplate.php | 16 - .../V1/AllocationPolicy_LocationPolicy.php | 16 - .../V1/AllocationPolicy_NetworkInterface.php | 16 - .../V1/AllocationPolicy_NetworkPolicy.php | 16 - .../V1/AllocationPolicy_ProvisioningModel.php | 16 - .../Cloud/Batch/V1/BatchServiceGrpcClient.php | 127 --- .../Google/Cloud/Batch/V1/ComputeResource.php | 135 --- .../Cloud/Batch/V1/CreateJobRequest.php | 251 ----- .../Cloud/Batch/V1/DeleteJobRequest.php | 175 ---- .../src/Google/Cloud/Batch/V1/Environment.php | 158 --- .../Cloud/Batch/V1/Environment/KMSEnvMap.php | 102 -- .../Cloud/Batch/V1/Environment_KMSEnvMap.php | 16 - .../proto/src/Google/Cloud/Batch/V1/GCS.php | 71 -- .../Google/Cloud/Batch/V1/GetJobRequest.php | 67 -- .../Google/Cloud/Batch/V1/GetTaskRequest.php | 67 -- .../proto/src/Google/Cloud/Batch/V1/Job.php | 513 ---------- .../Google/Cloud/Batch/V1/JobNotification.php | 131 --- .../Batch/V1/JobNotification/Message.php | 140 --- .../Cloud/Batch/V1/JobNotification/Type.php | 64 -- .../Batch/V1/JobNotification_Message.php | 16 - .../Cloud/Batch/V1/JobNotification_Type.php | 16 - .../src/Google/Cloud/Batch/V1/JobStatus.php | 183 ---- .../Batch/V1/JobStatus/InstanceStatus.php | 182 ---- .../Google/Cloud/Batch/V1/JobStatus/State.php | 94 -- .../Batch/V1/JobStatus/TaskGroupStatus.php | 108 --- .../Batch/V1/JobStatus_InstanceStatus.php | 16 - .../Google/Cloud/Batch/V1/JobStatus_State.php | 16 - .../Batch/V1/JobStatus_TaskGroupStatus.php | 16 - .../Google/Cloud/Batch/V1/LifecyclePolicy.php | 128 --- .../Cloud/Batch/V1/LifecyclePolicy/Action.php | 64 -- .../V1/LifecyclePolicy/ActionCondition.php | 82 -- .../Cloud/Batch/V1/LifecyclePolicy_Action.php | 16 - .../V1/LifecyclePolicy_ActionCondition.php | 16 - .../Google/Cloud/Batch/V1/ListJobsRequest.php | 169 ---- .../Cloud/Batch/V1/ListJobsResponse.php | 135 --- .../Cloud/Batch/V1/ListTasksRequest.php | 185 ---- .../Cloud/Batch/V1/ListTasksResponse.php | 135 --- .../src/Google/Cloud/Batch/V1/LogsPolicy.php | 110 --- .../Cloud/Batch/V1/LogsPolicy/Destination.php | 64 -- .../Cloud/Batch/V1/LogsPolicy_Destination.php | 16 - .../proto/src/Google/Cloud/Batch/V1/NFS.php | 101 -- .../Cloud/Batch/V1/OperationMetadata.php | 307 ------ .../src/Google/Cloud/Batch/V1/Runnable.php | 372 ------- .../Cloud/Batch/V1/Runnable/Barrier.php | 74 -- .../Cloud/Batch/V1/Runnable/Container.php | 352 ------- .../Google/Cloud/Batch/V1/Runnable/Script.php | 147 --- .../Cloud/Batch/V1/Runnable_Barrier.php | 16 - .../Cloud/Batch/V1/Runnable_Container.php | 16 - .../Google/Cloud/Batch/V1/Runnable_Script.php | 16 - .../Google/Cloud/Batch/V1/ServiceAccount.php | 117 --- .../src/Google/Cloud/Batch/V1/StatusEvent.php | 223 ----- .../proto/src/Google/Cloud/Batch/V1/Task.php | 123 --- .../Google/Cloud/Batch/V1/TaskExecution.php | 72 -- .../src/Google/Cloud/Batch/V1/TaskGroup.php | 388 -------- .../src/Google/Cloud/Batch/V1/TaskSpec.php | 412 -------- .../src/Google/Cloud/Batch/V1/TaskStatus.php | 101 -- .../Cloud/Batch/V1/TaskStatus/State.php | 85 -- .../Cloud/Batch/V1/TaskStatus_State.php | 16 - .../src/Google/Cloud/Batch/V1/Volume.php | 256 ----- .../V1/BatchServiceClient/create_job.php | 77 -- .../V1/BatchServiceClient/delete_job.php | 62 -- .../samples/V1/BatchServiceClient/get_job.php | 66 -- .../V1/BatchServiceClient/get_location.php | 53 - .../V1/BatchServiceClient/get_task.php | 72 -- .../V1/BatchServiceClient/list_jobs.php | 58 -- .../V1/BatchServiceClient/list_locations.php | 58 -- .../V1/BatchServiceClient/list_tasks.php | 78 -- .../Batch/v1/src/V1/BatchServiceClient.php | 34 - .../src/V1/Gapic/BatchServiceGapicClient.php | 910 ------------------ .../Batch/v1/src/V1/gapic_metadata.json | 58 -- .../batch_service_client_config.json | 84 -- .../batch_service_descriptor_config.php | 48 - .../batch_service_rest_client_config.php | 147 --- .../tests/Unit/V1/BatchServiceClientTest.php | 628 ------------ 106 files changed, 141 insertions(+), 11915 deletions(-) delete mode 100644 owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Batch.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Job.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Task.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Volume.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Accelerator.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/AttachedDisk.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Disk.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicy.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicyOrTemplate.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/LocationPolicy.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkInterface.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkPolicy.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/ProvisioningModel.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_Accelerator.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_AttachedDisk.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_Disk.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_InstancePolicy.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_InstancePolicyOrTemplate.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_LocationPolicy.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_NetworkInterface.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_NetworkPolicy.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_ProvisioningModel.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/BatchServiceGrpcClient.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ComputeResource.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/CreateJobRequest.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/DeleteJobRequest.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment/KMSEnvMap.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment_KMSEnvMap.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GCS.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetJobRequest.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetTaskRequest.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Job.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Message.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Type.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification_Message.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification_Type.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/InstanceStatus.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/State.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/TaskGroupStatus.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus_InstanceStatus.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus_State.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus_TaskGroupStatus.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/Action.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/ActionCondition.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy_Action.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy_ActionCondition.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListJobsRequest.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListJobsResponse.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksRequest.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksResponse.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy/Destination.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy_Destination.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/NFS.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/OperationMetadata.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Barrier.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Container.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Script.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable_Barrier.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable_Container.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable_Script.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ServiceAccount.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/StatusEvent.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Task.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskExecution.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskGroup.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskSpec.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus/State.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus_State.php delete mode 100644 owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Volume.php delete mode 100644 owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/create_job.php delete mode 100644 owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/delete_job.php delete mode 100644 owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_job.php delete mode 100644 owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_location.php delete mode 100644 owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_task.php delete mode 100644 owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_jobs.php delete mode 100644 owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_locations.php delete mode 100644 owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_tasks.php delete mode 100644 owl-bot-staging/Batch/v1/src/V1/BatchServiceClient.php delete mode 100644 owl-bot-staging/Batch/v1/src/V1/Gapic/BatchServiceGapicClient.php delete mode 100644 owl-bot-staging/Batch/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/Batch/v1/src/V1/resources/batch_service_client_config.json delete mode 100644 owl-bot-staging/Batch/v1/src/V1/resources/batch_service_descriptor_config.php delete mode 100644 owl-bot-staging/Batch/v1/src/V1/resources/batch_service_rest_client_config.php delete mode 100644 owl-bot-staging/Batch/v1/tests/Unit/V1/BatchServiceClientTest.php diff --git a/Batch/metadata/V1/Batch.php b/Batch/metadata/V1/Batch.php index 4abdc154039c..08b6865323ca 100644 --- a/Batch/metadata/V1/Batch.php +++ b/Batch/metadata/V1/Batch.php @@ -21,11 +21,12 @@ public static function initOnce() { \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); \GPBMetadata\Google\Longrunning\Operations::initOnce(); + \GPBMetadata\Google\Protobuf\GPBEmpty::initOnce(); \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' - -!google/cloud/batch/v1/batch.protogoogle.cloud.batch.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/cloud/batch/v1/job.proto google/cloud/batch/v1/task.proto#google/longrunning/operations.protogoogle/protobuf/timestamp.proto" + +!google/cloud/batch/v1/batch.protogoogle.cloud.batch.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/cloud/batch/v1/job.proto google/cloud/batch/v1/task.proto#google/longrunning/operations.protogoogle/protobuf/empty.protogoogle/protobuf/timestamp.proto" CreateJobRequest0 parent ( B AAbatch.googleapis.com/Job job_id ( , diff --git a/Batch/metadata/V1/Task.php b/Batch/metadata/V1/Task.php index 611846841622d3e68a29fe25dd5fac1bd8cb6020..c9fc730172c399dcd31476809f2da51ccc9ed1e8 100644 GIT binary patch delta 59 zcmZ1_^Fn6BPA0}jlXo$FWV}6j4fA|)A!{zKlEmWd_~Mepl2i#+1x5`%qZswcjNFQB Ndch#E&E72cIRTRk6UhJo delta 24 gcmaDMvr1;ePA0~slXo$FWSlp74fFiXohgetIamPolicy($resource); - * } finally { - * $batchServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'GetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $batchServiceClient = new BatchServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $batchServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $batchServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'SetIamPolicy', - Policy::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $batchServiceClient = new BatchServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $batchServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $batchServiceClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions( - $resource, - $permissions, - array $optionalArgs = [] - ) { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor( - $requestParamHeaders - ); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - return $this->startCall( - 'TestIamPermissions', - TestIamPermissionsResponse::class, - $optionalArgs, - $request, - Call::UNARY_CALL, - 'google.iam.v1.IAMPolicy' - )->wait(); - } } diff --git a/Batch/src/V1/Job.php b/Batch/src/V1/Job.php index 3993ef006ff5..6a902bd6f016 100644 --- a/Batch/src/V1/Job.php +++ b/Batch/src/V1/Job.php @@ -30,7 +30,8 @@ class Job extends \Google\Protobuf\Internal\Message private $uid = ''; /** * Priority of the Job. - * The valid value range is [0, 100). + * The valid value range is [0, 100). Default value is 0. + * Higher value indicates higher priority. * A job with higher priority value is more likely to run earlier if all other * requirements are satisfied. * @@ -108,7 +109,8 @@ class Job extends \Google\Protobuf\Internal\Message * Output only. A system generated unique ID (in UUID4 format) for the Job. * @type int|string $priority * Priority of the Job. - * The valid value range is [0, 100). + * The valid value range is [0, 100). Default value is 0. + * Higher value indicates higher priority. * A job with higher priority value is more likely to run earlier if all other * requirements are satisfied. * @type array<\Google\Cloud\Batch\V1\TaskGroup>|\Google\Protobuf\Internal\RepeatedField $task_groups @@ -199,7 +201,8 @@ public function setUid($var) /** * Priority of the Job. - * The valid value range is [0, 100). + * The valid value range is [0, 100). Default value is 0. + * Higher value indicates higher priority. * A job with higher priority value is more likely to run earlier if all other * requirements are satisfied. * @@ -213,7 +216,8 @@ public function getPriority() /** * Priority of the Job. - * The valid value range is [0, 100). + * The valid value range is [0, 100). Default value is 0. + * Higher value indicates higher priority. * A job with higher priority value is more likely to run earlier if all other * requirements are satisfied. * diff --git a/Batch/src/V1/LifecyclePolicy.php b/Batch/src/V1/LifecyclePolicy.php index aac39977c9b7..a3bea43f2e16 100644 --- a/Batch/src/V1/LifecyclePolicy.php +++ b/Batch/src/V1/LifecyclePolicy.php @@ -18,6 +18,10 @@ class LifecyclePolicy extends \Google\Protobuf\Internal\Message { /** * Action to execute when ActionCondition is true. + * When RETRY_TASK is specified, we will retry failed tasks + * if we notice any exit code match and fail tasks if no match is found. + * Likewise, when FAIL_TASK is specified, we will fail tasks + * if we notice any exit code match and retry tasks if no match is found. * * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; */ @@ -37,6 +41,10 @@ class LifecyclePolicy extends \Google\Protobuf\Internal\Message * * @type int $action * Action to execute when ActionCondition is true. + * When RETRY_TASK is specified, we will retry failed tasks + * if we notice any exit code match and fail tasks if no match is found. + * Likewise, when FAIL_TASK is specified, we will fail tasks + * if we notice any exit code match and retry tasks if no match is found. * @type \Google\Cloud\Batch\V1\LifecyclePolicy\ActionCondition $action_condition * Conditions that decide why a task failure is dealt with a specific action. * } @@ -48,6 +56,10 @@ public function __construct($data = NULL) { /** * Action to execute when ActionCondition is true. + * When RETRY_TASK is specified, we will retry failed tasks + * if we notice any exit code match and fail tasks if no match is found. + * Likewise, when FAIL_TASK is specified, we will fail tasks + * if we notice any exit code match and retry tasks if no match is found. * * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; * @return int @@ -59,6 +71,10 @@ public function getAction() /** * Action to execute when ActionCondition is true. + * When RETRY_TASK is specified, we will retry failed tasks + * if we notice any exit code match and fail tasks if no match is found. + * Likewise, when FAIL_TASK is specified, we will fail tasks + * if we notice any exit code match and retry tasks if no match is found. * * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; * @param int $var diff --git a/Batch/src/V1/Runnable/Script.php b/Batch/src/V1/Runnable/Script.php index 5eeb24440ebd..e6e291925dfb 100644 --- a/Batch/src/V1/Runnable/Script.php +++ b/Batch/src/V1/Runnable/Script.php @@ -25,8 +25,20 @@ class Script extends \Google\Protobuf\Internal\Message * * @type string $path * Script file path on the host VM. + * To specify an interpreter, please add a `#!`(also known as + * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the + * first line of the file.(For example, to execute the script using bash, + * `#!/bin/bash` should be the first line of the file. To execute the + * script using`Python3`, `#!/usr/bin/env python3` should be the first + * line of the file.) Otherwise, the file will by default be excuted by + * `/bin/sh`. * @type string $text * Shell script text. + * To specify an interpreter, please add a `#!\n` at the + * beginning of the text.(For example, to execute the script using bash, + * `#!/bin/bash\n` should be added. To execute the script using`Python3`, + * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will + * by default be excuted by `/bin/sh`. * } */ public function __construct($data = NULL) { @@ -36,6 +48,13 @@ public function __construct($data = NULL) { /** * Script file path on the host VM. + * To specify an interpreter, please add a `#!`(also known as + * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the + * first line of the file.(For example, to execute the script using bash, + * `#!/bin/bash` should be the first line of the file. To execute the + * script using`Python3`, `#!/usr/bin/env python3` should be the first + * line of the file.) Otherwise, the file will by default be excuted by + * `/bin/sh`. * * Generated from protobuf field string path = 1; * @return string @@ -52,6 +71,13 @@ public function hasPath() /** * Script file path on the host VM. + * To specify an interpreter, please add a `#!`(also known as + * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the + * first line of the file.(For example, to execute the script using bash, + * `#!/bin/bash` should be the first line of the file. To execute the + * script using`Python3`, `#!/usr/bin/env python3` should be the first + * line of the file.) Otherwise, the file will by default be excuted by + * `/bin/sh`. * * Generated from protobuf field string path = 1; * @param string $var @@ -67,6 +93,11 @@ public function setPath($var) /** * Shell script text. + * To specify an interpreter, please add a `#!\n` at the + * beginning of the text.(For example, to execute the script using bash, + * `#!/bin/bash\n` should be added. To execute the script using`Python3`, + * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will + * by default be excuted by `/bin/sh`. * * Generated from protobuf field string text = 2; * @return string @@ -83,6 +114,11 @@ public function hasText() /** * Shell script text. + * To specify an interpreter, please add a `#!\n` at the + * beginning of the text.(For example, to execute the script using bash, + * `#!/bin/bash\n` should be added. To execute the script using`Python3`, + * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will + * by default be excuted by `/bin/sh`. * * Generated from protobuf field string text = 2; * @param string $var diff --git a/Batch/src/V1/StatusEvent.php b/Batch/src/V1/StatusEvent.php index bcddeac0a40a..1802f667cff9 100644 --- a/Batch/src/V1/StatusEvent.php +++ b/Batch/src/V1/StatusEvent.php @@ -39,6 +39,12 @@ class StatusEvent extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.batch.v1.TaskExecution task_execution = 4; */ private $task_execution = null; + /** + * Task State + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State task_state = 5; + */ + private $task_state = 0; /** * Constructor. @@ -54,6 +60,8 @@ class StatusEvent extends \Google\Protobuf\Internal\Message * The time this event occurred. * @type \Google\Cloud\Batch\V1\TaskExecution $task_execution * Task Execution + * @type int $task_state + * Task State * } */ public function __construct($data = NULL) { @@ -185,5 +193,31 @@ public function setTaskExecution($var) return $this; } + /** + * Task State + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State task_state = 5; + * @return int + */ + public function getTaskState() + { + return $this->task_state; + } + + /** + * Task State + * + * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State task_state = 5; + * @param int $var + * @return $this + */ + public function setTaskState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\TaskStatus\State::class); + $this->task_state = $var; + + return $this; + } + } diff --git a/Batch/src/V1/TaskSpec.php b/Batch/src/V1/TaskSpec.php index 956491e4a1ee..ddcd57645654 100644 --- a/Batch/src/V1/TaskSpec.php +++ b/Batch/src/V1/TaskSpec.php @@ -52,13 +52,12 @@ class TaskSpec extends \Google\Protobuf\Internal\Message private $max_retry_count = 0; /** * Lifecycle management schema when any task in a task group is failed. - * The valid size of lifecycle policies are [0, 10]. - * For each lifecycle policy, when the condition is met, - * the action in that policy will execute. - * If there are multiple policies that the task execution result matches, - * we use the action from the first matched policy. If task execution result - * does not meet with any of the defined lifecycle policy, we consider it as - * the default policy. Default policy means if the exit code is 0, exit task. + * Currently we only support one lifecycle policy. + * When the lifecycle policy condition is met, + * the action in the policy will execute. + * If task execution result does not meet with the defined lifecycle + * policy, we consider it as the default policy. + * Default policy means if the exit code is 0, exit task. * If task ends with non-zero exit code, retry the task with max_retry_count. * * Generated from protobuf field repeated .google.cloud.batch.v1.LifecyclePolicy lifecycle_policies = 9; @@ -111,13 +110,12 @@ class TaskSpec extends \Google\Protobuf\Internal\Message * The valid value range is [0, 10]. * @type array<\Google\Cloud\Batch\V1\LifecyclePolicy>|\Google\Protobuf\Internal\RepeatedField $lifecycle_policies * Lifecycle management schema when any task in a task group is failed. - * The valid size of lifecycle policies are [0, 10]. - * For each lifecycle policy, when the condition is met, - * the action in that policy will execute. - * If there are multiple policies that the task execution result matches, - * we use the action from the first matched policy. If task execution result - * does not meet with any of the defined lifecycle policy, we consider it as - * the default policy. Default policy means if the exit code is 0, exit task. + * Currently we only support one lifecycle policy. + * When the lifecycle policy condition is met, + * the action in the policy will execute. + * If task execution result does not meet with the defined lifecycle + * policy, we consider it as the default policy. + * Default policy means if the exit code is 0, exit task. * If task ends with non-zero exit code, retry the task with max_retry_count. * @type array|\Google\Protobuf\Internal\MapField $environments * Deprecated: please use environment(non-plural) instead. @@ -280,13 +278,12 @@ public function setMaxRetryCount($var) /** * Lifecycle management schema when any task in a task group is failed. - * The valid size of lifecycle policies are [0, 10]. - * For each lifecycle policy, when the condition is met, - * the action in that policy will execute. - * If there are multiple policies that the task execution result matches, - * we use the action from the first matched policy. If task execution result - * does not meet with any of the defined lifecycle policy, we consider it as - * the default policy. Default policy means if the exit code is 0, exit task. + * Currently we only support one lifecycle policy. + * When the lifecycle policy condition is met, + * the action in the policy will execute. + * If task execution result does not meet with the defined lifecycle + * policy, we consider it as the default policy. + * Default policy means if the exit code is 0, exit task. * If task ends with non-zero exit code, retry the task with max_retry_count. * * Generated from protobuf field repeated .google.cloud.batch.v1.LifecyclePolicy lifecycle_policies = 9; @@ -299,13 +296,12 @@ public function getLifecyclePolicies() /** * Lifecycle management schema when any task in a task group is failed. - * The valid size of lifecycle policies are [0, 10]. - * For each lifecycle policy, when the condition is met, - * the action in that policy will execute. - * If there are multiple policies that the task execution result matches, - * we use the action from the first matched policy. If task execution result - * does not meet with any of the defined lifecycle policy, we consider it as - * the default policy. Default policy means if the exit code is 0, exit task. + * Currently we only support one lifecycle policy. + * When the lifecycle policy condition is met, + * the action in the policy will execute. + * If task execution result does not meet with the defined lifecycle + * policy, we consider it as the default policy. + * Default policy means if the exit code is 0, exit task. * If task ends with non-zero exit code, retry the task with max_retry_count. * * Generated from protobuf field repeated .google.cloud.batch.v1.LifecyclePolicy lifecycle_policies = 9; diff --git a/Batch/src/V1/gapic_metadata.json b/Batch/src/V1/gapic_metadata.json index 0e283913b18d..eae7f15d2f08 100644 --- a/Batch/src/V1/gapic_metadata.json +++ b/Batch/src/V1/gapic_metadata.json @@ -49,21 +49,6 @@ "methods": [ "listLocations" ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] } } } diff --git a/Batch/src/V1/resources/batch_service_client_config.json b/Batch/src/V1/resources/batch_service_client_config.json index 40f45e675167..4fae7bea9f19 100644 --- a/Batch/src/V1/resources/batch_service_client_config.json +++ b/Batch/src/V1/resources/batch_service_client_config.json @@ -77,21 +77,6 @@ "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" - }, - "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" } } } diff --git a/Batch/src/V1/resources/batch_service_rest_client_config.php b/Batch/src/V1/resources/batch_service_rest_client_config.php index 76f3cd746fd2..a72321464b81 100644 --- a/Batch/src/V1/resources/batch_service_rest_client_config.php +++ b/Batch/src/V1/resources/batch_service_rest_client_config.php @@ -95,43 +95,6 @@ ], ], ], - 'google.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/jobs/*}:getIamPolicy', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/jobs/*}:setIamPolicy', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/jobs/*}:testIamPermissions', - 'body' => '*', - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], 'google.longrunning.Operations' => [ 'CancelOperation' => [ 'method' => 'post', diff --git a/Batch/tests/Unit/V1/BatchServiceClientTest.php b/Batch/tests/Unit/V1/BatchServiceClientTest.php index 9a4fc9a96124..6739d9ec0c48 100644 --- a/Batch/tests/Unit/V1/BatchServiceClientTest.php +++ b/Batch/tests/Unit/V1/BatchServiceClientTest.php @@ -32,8 +32,6 @@ use Google\Cloud\Batch\V1\ListJobsResponse; use Google\Cloud\Batch\V1\ListTasksResponse; use Google\Cloud\Batch\V1\Task; -use Google\Cloud\Iam\V1\Policy; -use Google\Cloud\Iam\V1\TestIamPermissionsResponse; use Google\Cloud\Location\ListLocationsResponse; use Google\Cloud\Location\Location; use Google\LongRunning\GetOperationRequest; @@ -627,194 +625,4 @@ public function listLocationsExceptionTest() $transport->popReceivedCalls(); $this->assertTrue($transport->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'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/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'; - try { - $gapicClient->getIamPolicy($resource); - // 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(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/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(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // 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 = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/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 = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // 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()); - } } diff --git a/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Batch.php b/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Batch.php deleted file mode 100644 index 08b6865323ca..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Batch.php +++ /dev/null @@ -1,91 +0,0 @@ -internalAddGeneratedFile( - ' - -!google/cloud/batch/v1/batch.protogoogle.cloud.batch.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.protogoogle/cloud/batch/v1/job.proto google/cloud/batch/v1/task.proto#google/longrunning/operations.protogoogle/protobuf/empty.protogoogle/protobuf/timestamp.proto" -CreateJobRequest0 -parent ( B AAbatch.googleapis.com/Job -job_id ( , -job ( 2.google.cloud.batch.v1.JobBA - -request_id ( BA"? - GetJobRequest. -name ( B AA -batch.googleapis.com/Job"N -DeleteJobRequest -name (  -reason ( BA - -request_id ( BA"X -ListJobsRequest -parent (  -filter (  - page_size ( - -page_token ( "j -ListJobsResponse( -jobs ( 2.google.cloud.batch.v1.Job -next_page_token (  - unreachable ( " -ListTasksRequest6 -parent ( B&AA -batch.googleapis.com/TaskGroup -filter (  - page_size ( - -page_token ( "m -ListTasksResponse* -tasks ( 2.google.cloud.batch.v1.Task -next_page_token (  - unreachable ( "A -GetTaskRequest/ -name ( B!AA -batch.googleapis.com/Task" -OperationMetadata4 - create_time ( 2.google.protobuf.TimestampBA1 -end_time ( 2.google.protobuf.TimestampBA -target ( BA -verb ( BA -status_message ( BA# -requested_cancellation (BA - api_version ( BA2 - BatchService - CreateJob\'.google.cloud.batch.v1.CreateJobRequest.google.cloud.batch.v1.Job"I/"(/v1/{parent=projects/*/locations/*}/jobs:jobAparent,job,job_id -GetJob$.google.cloud.batch.v1.GetJobRequest.google.cloud.batch.v1.Job"7*(/v1/{name=projects/*/locations/*/jobs/*}Aname - DeleteJob\'.google.cloud.batch.v1.DeleteJobRequest.google.longrunning.Operation"z**(/v1/{name=projects/*/locations/*/jobs/*}AnameA@ -google.protobuf.Empty\'google.cloud.batch.v1.OperationMetadata -ListJobs&.google.cloud.batch.v1.ListJobsRequest\'.google.cloud.batch.v1.ListJobsResponse"9*(/v1/{parent=projects/*/locations/*}/jobsAparent -GetTask%.google.cloud.batch.v1.GetTaskRequest.google.cloud.batch.v1.Task"L?=/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}Aname - ListTasks\'.google.cloud.batch.v1.ListTasksRequest(.google.cloud.batch.v1.ListTasksResponse"N?=/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasksAparentHAbatch.googleapis.comA.https://www.googleapis.com/auth/cloud-platformB -com.google.cloud.batch.v1B -BatchProtoPZ/cloud.google.com/go/batch/apiv1/batchpb;batchpbGCBGoogle.Cloud.Batch.V1Google\\Cloud\\Batch\\V1Google::Cloud::Batch::V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Job.php b/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Job.php deleted file mode 100644 index 562591488590b5ab3a61109d35752f9ca8eae616..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5386 zcmbtYTXWmS6%I*V$U}*u;7e#`#zvU5Rwgl6F^QYdaU9-6(UwR?q}*wTGbjkIC|DqX zU;#O*M>FkfpZXj6)=ppgANtgX&a}Uvj~V}lKJ@G^08z9UQ>`9E5;))4-E+Qk+pnHD z#}0fTH;F}D%_AducqV(tM0Q-;vvu2)hyKwKab?|}IEG1FMV9Lwx!vi@je4v9K0>MO zyE-Y$W7{5^q^O&=KPnD2Pd_f6ZWmwJLxt-Cu(S!Gj;0g2*{$vqPaA2THfVC#pvGW> zDuWH4Z$ARiO^s6dsXc^OAmg9o4^2atsi%4P@u5Lg!!kTWGmYQit{=-snn?-b-jqG^ zE!{J0OJ;zMrIW3XWTBJEe(2bE%ExlJkuEzp9(vHSJmOlKIj9q=yN2W0ZWl$%!k_%n%KS28ivc}UU&ed4%z6W0$ zfwL;3QRJH)?)1|iv;h(O-1j$@Yq72@P}ncU@%CVu*Bjh7n5UKscPcim4uXqgl~*; z@#!Z?$3=1&-dQezj}uZE(rh>C*tLC!=9c8dR=OlBSDsX1PHr+mravxKVN)|rTjw5B z9UH^&EVqhk)1|@vIVvgv3uvxeriA)vD>qW+^658Yi(LGvx6?{7{hCat<;n#DP(D66^KQH_x1~7G= zDx^mks)ogh!grD>J$S1f6wI$72?w$!|1vH3z1($f;}!MpWFuit7{`mIh|J#6>7 zjaqA`)u?CRLHK%YuX9*e_d3mHtKH1Tq$DhLEB)PUyztvqNJTV3Vl6XbiAc(neuR&L zR|@+e(wDH#U_MpJDX~0?n`EI>m~%{lZ7@-(aa9cdYz{Em=tVSA5fMdLbA3w<6G(2E z^X*QkC*pRPbMyaHmCqX)T0;!>Gd+NxbCzy;_D*0s51?q^&|0@O? zQJM-4wFfJ@?K7XmxKF;CqwxyU3Jpq)!-bivkTL?Jg-$NMRpDhbvk;wDIX^@bEJXAA z)R_WjUxGZDj_P#j8q^WzV~Z4C!7}?rq+77r>sR`XnGgb4`S!4Jh~X5&G?MDob{qA> zJ^UG$(y)4P*lx49O7M4wwOXT5$9GE-!geYxCbul*;AXwC*WmHlYOCFYPV=DA>t$C8 z|B1r}ntwWvF)m_nNByDd*^Z$H8SDwHV%?|OSmdyDNtti_X?4oJK;{1ygVo?W2JKQr z^GxaE1vT|CG9;Fy$xHQxJya=A7p%-Ko-Uq1hQT@i1)kO8%>2U1NG-f25>DY6Eb)!p zglzwp-C1v;6Q6dfs&Hg&x6*EM$K3|0U+F!Yc^)tPum;)Lh?RCB8K!q`{B-Hz91G1t zv6_k66;!m|bj*l4|IMPR!q5?_I&Pm#9Fy_%YuKQ~JvDTqYB~?_pcVMZ9MwG`T@k`k zE$Td0cv|>$4(!dtO|>CAuxb(SrR|;sozLfsYH16YI9C2+$jsR6j_9sll93vEK_swL z{ySJ=$xhmUWn;o3fo00n?mLnMNor{hJ+?ib{@Js&DUPQQvPy9vG#R+zHtIu>ml!&EUBnaAzGIKRWcCbx+wkXS|Ig|fu403bBc^6h3 zF+#8r<{G)?vPR_3d$7q}j%|(V1=&LMjQr(~@L>}+#2zAC{uhu9BDEDp2n(Vx==r#X zaR*qZ!e@dmcj2~WtK@reS)dw@s*OfC9|qjZ6Ij2L0;E1jfrg7<3|p2j7PWVvGTQ4k zr-8z+Ve`#KtpIniRzGj`u(8G>ukLrSjL)$zSc8Dgb+6m$V{fnl>Fz2qVoVtm+s9uJ}-(WCgxG}0_NN{@4Fl1!HE*A)})UO9rX6Y`N;dWtRhH3zXG z+a^cjWX8A5$Ncj`5i&Ey5VIzkXoeYdSs9$Jb=x7L!%bEH6oWfB5nk2js@g02Ku48^!}TZfw$N$1@sP-XtQjq|qhd zGWi32>3`@WzoO6m3w`5}$G&%_XLlvXF>wRULo6NbclKPqbI$I=$L^jB*W?DZsiy~Y zAooXdut#Ora{|Y3EV&=<>`+fOoS|!4)Kg@+wkfwZyK=qO>|RBv?}VN~Re9HOb}d>o zEGHZk`+8vP6%W>nf$r}sTp56^52^3!29+D_$_pCk13l1t4UX$o8Ln4hxZd{q0|3L) zeP8Y(9^QhCe{R^fOhfhqJ;0yqrmvZ{8JN0d{(^RI$UC~_Qv`mzb|C>!6<-a%@SPxsGo4nsz`vTeo^O>KmTv29DRprK-A1gK@x^WbJ0OEmLRi z$ZNtzRsG1w4LR^aI=Q z98&d@;p33hLSzX>@_#_PCT2g-hwjN(o`u_w%qZsN!C)NXCrG@taZp%@ZovBsa4O@- zs^Fx;IjL|?DhKQN!pT%U;6V{&&0mhzaOxr%ii61W==+uF??LRISWwu6nwnzZUT}X?)SS&wdFY+BMGGORyJUl*zCWUSmX4opW<54f@kY=xxtiriY zx7@93FI$~#bU|)mTYjiZbO+r`c%XrzHEd^|IAspHi6j`6uP( zbNnzz7D4K~tXAvw8os6rf6qZ?E3|FBZ&C6HIpf%YZeoAtQOK5V&M-5^DAgG7^bENV z^P+b}>HqpPaEEs~M5?gR*FDd~edjp~X6ACdaYd|0a2|-cYdaoAE@2Kuv^iBXjPrfn z*x&V>&>nDxahYzt)KoR9lh{#^p3alBZCnnQh;YN018R3a;o!Pz&|?SY_)#Oz0Vypii*vx>@Z85TtQ z@X^i`)*}iWmz9vuZIH-ixX`y8gB6#UDw<7$*N(TJlhDQt+b8tdxWP&Vl<=Kh9D%rI zkjpYj{tnEG^pGW(bM;_P)H%i*-vd<4lPo z(uNfQ$Gq4BJgVV9VIwYEy8Bs*us#Jk{}n6?-D452#&}HlXlH6IU3d)hkqH-ol&jt5 zW^1ZVF9B@TyIVhL-E!v{c4}gx~X z04|B6hZwxNYx)XSN|A5yBetYh)Cm0I+vw@Ah;4!&vQQR39u{9YeSF9Nhx|<4!0zdy zAYk*FwNh8eBhg{uw-jV2SU_qZ9q69PYF&hBHjgJ@%65$5JSIQDicbwZv1&)k#PGZ~ zBNmg&IvhHsvI*y@ZD2da+sA}fcC5*kZheB*XD>Rq$qU`hW7`_Pu!f3+*Nz$ zh4jH|6(^M2e-Qoto=i2Wm3PV22ER-x{J5`F*kwxDUjH+e_o7=?bj`wh)`w(HKvb1u pRF#8Nb$h)(&!^>`8{?DrEpd67xa+WLFpU%LIeewKk{rSzz`wA-aP|NI diff --git a/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Volume.php b/owl-bot-staging/Batch/v1/proto/src/GPBMetadata/Google/Cloud/Batch/V1/Volume.php deleted file mode 100644 index fa8ca8061c1c73d2e747bfcc335cfc3d120737af..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1026 zcmaiz-Hy^g6vqXW$Pm52kkq|8;wB45OIYuUXk>A5FI-66aABH|VK~4fZKs(|N!0K% zUT%C6U&O?xa6Yfp5*D99Z4go^lwcx)MZQ|0 z1SaB?M<{)O(FD#X7w~R$cJV}8Gm%S%0jz~sN7!YN$d}y(RczDU_PSdUq^r_mm!LeDyYt6rvNd_8)2mMD}7jlvOT zO!8C-In~l2Sfkosnu)YKMOl-Mub}OE41ya?4nWBquU7|BskXjC9R1ukugn_{2z?q`t&0XE-+~cvWqw>2QOPSmcSCr&MjcyC$lo4_r*7 zW^b8y4=U~2@II+J;#$v0Mb~dU)B%)Rl(yGe;}NM#jD_CrZy#}3clTj|n3g^{zV})Ych{nzou*s^Z|^c)^o#RbSr;B&mYWW8-$L$N$o*OG z$5lKm=r8cs{QoL@&JqOH69m>21hd|vYJaDfNBiABcSv0$@UQe)r2}n8c7*%}XQevv diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy.php deleted file mode 100644 index 20b0362ee475..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy.php +++ /dev/null @@ -1,262 +0,0 @@ -google.cloud.batch.v1.AllocationPolicy - */ -class AllocationPolicy extends \Google\Protobuf\Internal\Message -{ - /** - * Location where compute resources should be allocated for the Job. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; - */ - protected $location = null; - /** - * Describe instances that can be created by this AllocationPolicy. - * Only instances[0] is supported now. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; - */ - private $instances; - /** - * Service account that VMs will run as. - * - * Generated from protobuf field .google.cloud.batch.v1.ServiceAccount service_account = 9; - */ - protected $service_account = null; - /** - * Labels applied to all VM instances and other resources - * created by AllocationPolicy. - * Labels could be user provided or system generated. - * You can assign up to 64 labels. [Google Compute Engine label - * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) - * apply. - * Label names that start with "goog-" or "google-" are reserved. - * - * Generated from protobuf field map labels = 6; - */ - private $labels; - /** - * The network policy. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; - */ - protected $network = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Batch\V1\AllocationPolicy\LocationPolicy $location - * Location where compute resources should be allocated for the Job. - * @type array<\Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicyOrTemplate>|\Google\Protobuf\Internal\RepeatedField $instances - * Describe instances that can be created by this AllocationPolicy. - * Only instances[0] is supported now. - * @type \Google\Cloud\Batch\V1\ServiceAccount $service_account - * Service account that VMs will run as. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels applied to all VM instances and other resources - * created by AllocationPolicy. - * Labels could be user provided or system generated. - * You can assign up to 64 labels. [Google Compute Engine label - * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) - * apply. - * Label names that start with "goog-" or "google-" are reserved. - * @type \Google\Cloud\Batch\V1\AllocationPolicy\NetworkPolicy $network - * The network policy. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * Location where compute resources should be allocated for the Job. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; - * @return \Google\Cloud\Batch\V1\AllocationPolicy\LocationPolicy|null - */ - public function getLocation() - { - return $this->location; - } - - public function hasLocation() - { - return isset($this->location); - } - - public function clearLocation() - { - unset($this->location); - } - - /** - * Location where compute resources should be allocated for the Job. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1; - * @param \Google\Cloud\Batch\V1\AllocationPolicy\LocationPolicy $var - * @return $this - */ - public function setLocation($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\LocationPolicy::class); - $this->location = $var; - - return $this; - } - - /** - * Describe instances that can be created by this AllocationPolicy. - * Only instances[0] is supported now. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInstances() - { - return $this->instances; - } - - /** - * Describe instances that can be created by this AllocationPolicy. - * Only instances[0] is supported now. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8; - * @param array<\Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicyOrTemplate>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInstances($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicyOrTemplate::class); - $this->instances = $arr; - - return $this; - } - - /** - * Service account that VMs will run as. - * - * Generated from protobuf field .google.cloud.batch.v1.ServiceAccount service_account = 9; - * @return \Google\Cloud\Batch\V1\ServiceAccount|null - */ - public function getServiceAccount() - { - return $this->service_account; - } - - public function hasServiceAccount() - { - return isset($this->service_account); - } - - public function clearServiceAccount() - { - unset($this->service_account); - } - - /** - * Service account that VMs will run as. - * - * Generated from protobuf field .google.cloud.batch.v1.ServiceAccount service_account = 9; - * @param \Google\Cloud\Batch\V1\ServiceAccount $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\ServiceAccount::class); - $this->service_account = $var; - - return $this; - } - - /** - * Labels applied to all VM instances and other resources - * created by AllocationPolicy. - * Labels could be user provided or system generated. - * You can assign up to 64 labels. [Google Compute Engine label - * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) - * apply. - * Label names that start with "goog-" or "google-" are reserved. - * - * Generated from protobuf field map labels = 6; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels applied to all VM instances and other resources - * created by AllocationPolicy. - * Labels could be user provided or system generated. - * You can assign up to 64 labels. [Google Compute Engine label - * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) - * apply. - * Label names that start with "goog-" or "google-" are reserved. - * - * Generated from protobuf field map labels = 6; - * @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; - } - - /** - * The network policy. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; - * @return \Google\Cloud\Batch\V1\AllocationPolicy\NetworkPolicy|null - */ - public function getNetwork() - { - return $this->network; - } - - public function hasNetwork() - { - return isset($this->network); - } - - public function clearNetwork() - { - unset($this->network); - } - - /** - * The network policy. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7; - * @param \Google\Cloud\Batch\V1\AllocationPolicy\NetworkPolicy $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\NetworkPolicy::class); - $this->network = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Accelerator.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Accelerator.php deleted file mode 100644 index ce0e80128600..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Accelerator.php +++ /dev/null @@ -1,147 +0,0 @@ -google.cloud.batch.v1.AllocationPolicy.Accelerator - */ -class Accelerator extends \Google\Protobuf\Internal\Message -{ - /** - * The accelerator type. For example, "nvidia-tesla-t4". - * See `gcloud compute accelerator-types list`. - * - * Generated from protobuf field string type = 1; - */ - protected $type = ''; - /** - * The number of accelerators of this type. - * - * Generated from protobuf field int64 count = 2; - */ - protected $count = 0; - /** - * Deprecated: please use instances[0].install_gpu_drivers instead. - * - * Generated from protobuf field bool install_gpu_drivers = 3 [deprecated = true]; - * @deprecated - */ - protected $install_gpu_drivers = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $type - * The accelerator type. For example, "nvidia-tesla-t4". - * See `gcloud compute accelerator-types list`. - * @type int|string $count - * The number of accelerators of this type. - * @type bool $install_gpu_drivers - * Deprecated: please use instances[0].install_gpu_drivers instead. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * The accelerator type. For example, "nvidia-tesla-t4". - * See `gcloud compute accelerator-types list`. - * - * Generated from protobuf field string type = 1; - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * The accelerator type. For example, "nvidia-tesla-t4". - * See `gcloud compute accelerator-types list`. - * - * 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; - } - - /** - * The number of accelerators of this type. - * - * Generated from protobuf field int64 count = 2; - * @return int|string - */ - public function getCount() - { - return $this->count; - } - - /** - * The number of accelerators of this type. - * - * Generated from protobuf field int64 count = 2; - * @param int|string $var - * @return $this - */ - public function setCount($var) - { - GPBUtil::checkInt64($var); - $this->count = $var; - - return $this; - } - - /** - * Deprecated: please use instances[0].install_gpu_drivers instead. - * - * Generated from protobuf field bool install_gpu_drivers = 3 [deprecated = true]; - * @return bool - * @deprecated - */ - public function getInstallGpuDrivers() - { - @trigger_error('install_gpu_drivers is deprecated.', E_USER_DEPRECATED); - return $this->install_gpu_drivers; - } - - /** - * Deprecated: please use instances[0].install_gpu_drivers instead. - * - * Generated from protobuf field bool install_gpu_drivers = 3 [deprecated = true]; - * @param bool $var - * @return $this - * @deprecated - */ - public function setInstallGpuDrivers($var) - { - @trigger_error('install_gpu_drivers is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkBool($var); - $this->install_gpu_drivers = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Accelerator::class, \Google\Cloud\Batch\V1\AllocationPolicy_Accelerator::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/AttachedDisk.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/AttachedDisk.php deleted file mode 100644 index d57b97912d09..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/AttachedDisk.php +++ /dev/null @@ -1,153 +0,0 @@ -google.cloud.batch.v1.AllocationPolicy.AttachedDisk - */ -class AttachedDisk extends \Google\Protobuf\Internal\Message -{ - /** - * Device name that the guest operating system will see. - * It is used by Runnable.volumes field to mount disks. So please specify - * the device_name if you want Batch to help mount the disk, and it should - * match the device_name field in volumes. - * - * Generated from protobuf field string device_name = 3; - */ - protected $device_name = ''; - protected $attached; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Batch\V1\AllocationPolicy\Disk $new_disk - * @type string $existing_disk - * Name of an existing PD. - * @type string $device_name - * Device name that the guest operating system will see. - * It is used by Runnable.volumes field to mount disks. So please specify - * the device_name if you want Batch to help mount the disk, and it should - * match the device_name field in volumes. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; - * @return \Google\Cloud\Batch\V1\AllocationPolicy\Disk|null - */ - public function getNewDisk() - { - return $this->readOneof(1); - } - - public function hasNewDisk() - { - return $this->hasOneof(1); - } - - /** - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk new_disk = 1; - * @param \Google\Cloud\Batch\V1\AllocationPolicy\Disk $var - * @return $this - */ - public function setNewDisk($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\Disk::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Name of an existing PD. - * - * Generated from protobuf field string existing_disk = 2; - * @return string - */ - public function getExistingDisk() - { - return $this->readOneof(2); - } - - public function hasExistingDisk() - { - return $this->hasOneof(2); - } - - /** - * Name of an existing PD. - * - * Generated from protobuf field string existing_disk = 2; - * @param string $var - * @return $this - */ - public function setExistingDisk($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Device name that the guest operating system will see. - * It is used by Runnable.volumes field to mount disks. So please specify - * the device_name if you want Batch to help mount the disk, and it should - * match the device_name field in volumes. - * - * Generated from protobuf field string device_name = 3; - * @return string - */ - public function getDeviceName() - { - return $this->device_name; - } - - /** - * Device name that the guest operating system will see. - * It is used by Runnable.volumes field to mount disks. So please specify - * the device_name if you want Batch to help mount the disk, and it should - * match the device_name field in volumes. - * - * Generated from protobuf field string device_name = 3; - * @param string $var - * @return $this - */ - public function setDeviceName($var) - { - GPBUtil::checkString($var, True); - $this->device_name = $var; - - return $this; - } - - /** - * @return string - */ - public function getAttached() - { - return $this->whichOneof("attached"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AttachedDisk::class, \Google\Cloud\Batch\V1\AllocationPolicy_AttachedDisk::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Disk.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Disk.php deleted file mode 100644 index 72f07c40c715..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/Disk.php +++ /dev/null @@ -1,298 +0,0 @@ -google.cloud.batch.v1.AllocationPolicy.Disk - */ -class Disk extends \Google\Protobuf\Internal\Message -{ - /** - * Disk type as shown in `gcloud compute disk-types list`. - * For example, local SSD uses type "local-ssd". - * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" - * or "pd-standard". - * - * Generated from protobuf field string type = 1; - */ - protected $type = ''; - /** - * Disk size in GB. - * For persistent disk, this field is ignored if `data_source` is `image` or - * `snapshot`. - * For local SSD, size_gb should be a multiple of 375GB, - * otherwise, the final size will be the next greater multiple of 375 GB. - * For boot disk, Batch will calculate the boot disk size based on source - * image and task requirements if you do not speicify the size. - * If both this field and the boot_disk_mib field in task spec's - * compute_resource are defined, Batch will only honor this field. - * - * Generated from protobuf field int64 size_gb = 2; - */ - protected $size_gb = 0; - /** - * Local SSDs are available through both "SCSI" and "NVMe" interfaces. - * If not indicated, "NVMe" will be the default one for local ssds. - * We only support "SCSI" for persistent disks now. - * - * Generated from protobuf field string disk_interface = 6; - */ - protected $disk_interface = ''; - protected $data_source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $image - * Name of a public or custom image used as the data source. - * For example, the following are all valid URLs: - * (1) Specify the image by its family name: - * projects/{project}/global/images/family/{image_family} - * (2) Specify the image version: - * projects/{project}/global/images/{image_version} - * You can also use Batch customized image in short names. - * The following image values are supported for a boot disk: - * "batch-debian": use Batch Debian images. - * "batch-centos": use Batch CentOS images. - * "batch-cos": use Batch Container-Optimized images. - * @type string $snapshot - * Name of a snapshot used as the data source. - * @type string $type - * Disk type as shown in `gcloud compute disk-types list`. - * For example, local SSD uses type "local-ssd". - * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" - * or "pd-standard". - * @type int|string $size_gb - * Disk size in GB. - * For persistent disk, this field is ignored if `data_source` is `image` or - * `snapshot`. - * For local SSD, size_gb should be a multiple of 375GB, - * otherwise, the final size will be the next greater multiple of 375 GB. - * For boot disk, Batch will calculate the boot disk size based on source - * image and task requirements if you do not speicify the size. - * If both this field and the boot_disk_mib field in task spec's - * compute_resource are defined, Batch will only honor this field. - * @type string $disk_interface - * Local SSDs are available through both "SCSI" and "NVMe" interfaces. - * If not indicated, "NVMe" will be the default one for local ssds. - * We only support "SCSI" for persistent disks now. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * Name of a public or custom image used as the data source. - * For example, the following are all valid URLs: - * (1) Specify the image by its family name: - * projects/{project}/global/images/family/{image_family} - * (2) Specify the image version: - * projects/{project}/global/images/{image_version} - * You can also use Batch customized image in short names. - * The following image values are supported for a boot disk: - * "batch-debian": use Batch Debian images. - * "batch-centos": use Batch CentOS images. - * "batch-cos": use Batch Container-Optimized images. - * - * Generated from protobuf field string image = 4; - * @return string - */ - public function getImage() - { - return $this->readOneof(4); - } - - public function hasImage() - { - return $this->hasOneof(4); - } - - /** - * Name of a public or custom image used as the data source. - * For example, the following are all valid URLs: - * (1) Specify the image by its family name: - * projects/{project}/global/images/family/{image_family} - * (2) Specify the image version: - * projects/{project}/global/images/{image_version} - * You can also use Batch customized image in short names. - * The following image values are supported for a boot disk: - * "batch-debian": use Batch Debian images. - * "batch-centos": use Batch CentOS images. - * "batch-cos": use Batch Container-Optimized images. - * - * Generated from protobuf field string image = 4; - * @param string $var - * @return $this - */ - public function setImage($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Name of a snapshot used as the data source. - * - * Generated from protobuf field string snapshot = 5; - * @return string - */ - public function getSnapshot() - { - return $this->readOneof(5); - } - - public function hasSnapshot() - { - return $this->hasOneof(5); - } - - /** - * Name of a snapshot used as the data source. - * - * Generated from protobuf field string snapshot = 5; - * @param string $var - * @return $this - */ - public function setSnapshot($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Disk type as shown in `gcloud compute disk-types list`. - * For example, local SSD uses type "local-ssd". - * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" - * or "pd-standard". - * - * Generated from protobuf field string type = 1; - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Disk type as shown in `gcloud compute disk-types list`. - * For example, local SSD uses type "local-ssd". - * Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" - * or "pd-standard". - * - * 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; - } - - /** - * Disk size in GB. - * For persistent disk, this field is ignored if `data_source` is `image` or - * `snapshot`. - * For local SSD, size_gb should be a multiple of 375GB, - * otherwise, the final size will be the next greater multiple of 375 GB. - * For boot disk, Batch will calculate the boot disk size based on source - * image and task requirements if you do not speicify the size. - * If both this field and the boot_disk_mib field in task spec's - * compute_resource are defined, Batch will only honor this field. - * - * Generated from protobuf field int64 size_gb = 2; - * @return int|string - */ - public function getSizeGb() - { - return $this->size_gb; - } - - /** - * Disk size in GB. - * For persistent disk, this field is ignored if `data_source` is `image` or - * `snapshot`. - * For local SSD, size_gb should be a multiple of 375GB, - * otherwise, the final size will be the next greater multiple of 375 GB. - * For boot disk, Batch will calculate the boot disk size based on source - * image and task requirements if you do not speicify the size. - * If both this field and the boot_disk_mib field in task spec's - * compute_resource are defined, Batch will only honor this field. - * - * Generated from protobuf field int64 size_gb = 2; - * @param int|string $var - * @return $this - */ - public function setSizeGb($var) - { - GPBUtil::checkInt64($var); - $this->size_gb = $var; - - return $this; - } - - /** - * Local SSDs are available through both "SCSI" and "NVMe" interfaces. - * If not indicated, "NVMe" will be the default one for local ssds. - * We only support "SCSI" for persistent disks now. - * - * Generated from protobuf field string disk_interface = 6; - * @return string - */ - public function getDiskInterface() - { - return $this->disk_interface; - } - - /** - * Local SSDs are available through both "SCSI" and "NVMe" interfaces. - * If not indicated, "NVMe" will be the default one for local ssds. - * We only support "SCSI" for persistent disks now. - * - * Generated from protobuf field string disk_interface = 6; - * @param string $var - * @return $this - */ - public function setDiskInterface($var) - { - GPBUtil::checkString($var, True); - $this->disk_interface = $var; - - return $this; - } - - /** - * @return string - */ - public function getDataSource() - { - return $this->whichOneof("data_source"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Disk::class, \Google\Cloud\Batch\V1\AllocationPolicy_Disk::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicy.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicy.php deleted file mode 100644 index 5be6f1b9036a..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicy.php +++ /dev/null @@ -1,271 +0,0 @@ -google.cloud.batch.v1.AllocationPolicy.InstancePolicy - */ -class InstancePolicy extends \Google\Protobuf\Internal\Message -{ - /** - * The Compute Engine machine type. - * - * Generated from protobuf field string machine_type = 2; - */ - protected $machine_type = ''; - /** - * The minimum CPU platform. - * See - * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. - * Not yet implemented. - * - * Generated from protobuf field string min_cpu_platform = 3; - */ - protected $min_cpu_platform = ''; - /** - * The provisioning model. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 4; - */ - protected $provisioning_model = 0; - /** - * The accelerators attached to each VM instance. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; - */ - private $accelerators; - /** - * Book disk to be created and attached to each VM by this InstancePolicy. - * Boot disk will be deleted when the VM is deleted. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; - */ - protected $boot_disk = null; - /** - * Non-boot disks to be attached for each VM created by this InstancePolicy. - * New disks will be deleted when the VM is deleted. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; - */ - private $disks; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $machine_type - * The Compute Engine machine type. - * @type string $min_cpu_platform - * The minimum CPU platform. - * See - * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. - * Not yet implemented. - * @type int $provisioning_model - * The provisioning model. - * @type array<\Google\Cloud\Batch\V1\AllocationPolicy\Accelerator>|\Google\Protobuf\Internal\RepeatedField $accelerators - * The accelerators attached to each VM instance. - * @type \Google\Cloud\Batch\V1\AllocationPolicy\Disk $boot_disk - * Book disk to be created and attached to each VM by this InstancePolicy. - * Boot disk will be deleted when the VM is deleted. - * @type array<\Google\Cloud\Batch\V1\AllocationPolicy\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $disks - * Non-boot disks to be attached for each VM created by this InstancePolicy. - * New disks will be deleted when the VM is deleted. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * The Compute Engine machine type. - * - * Generated from protobuf field string machine_type = 2; - * @return string - */ - public function getMachineType() - { - return $this->machine_type; - } - - /** - * The Compute Engine machine type. - * - * Generated from protobuf field string machine_type = 2; - * @param string $var - * @return $this - */ - public function setMachineType($var) - { - GPBUtil::checkString($var, True); - $this->machine_type = $var; - - return $this; - } - - /** - * The minimum CPU platform. - * See - * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. - * Not yet implemented. - * - * Generated from protobuf field string min_cpu_platform = 3; - * @return string - */ - public function getMinCpuPlatform() - { - return $this->min_cpu_platform; - } - - /** - * The minimum CPU platform. - * See - * `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. - * Not yet implemented. - * - * Generated from protobuf field string min_cpu_platform = 3; - * @param string $var - * @return $this - */ - public function setMinCpuPlatform($var) - { - GPBUtil::checkString($var, True); - $this->min_cpu_platform = $var; - - return $this; - } - - /** - * The provisioning model. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 4; - * @return int - */ - public function getProvisioningModel() - { - return $this->provisioning_model; - } - - /** - * The provisioning model. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 4; - * @param int $var - * @return $this - */ - public function setProvisioningModel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\AllocationPolicy\ProvisioningModel::class); - $this->provisioning_model = $var; - - return $this; - } - - /** - * The accelerators attached to each VM instance. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAccelerators() - { - return $this->accelerators; - } - - /** - * The accelerators attached to each VM instance. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.Accelerator accelerators = 5; - * @param array<\Google\Cloud\Batch\V1\AllocationPolicy\Accelerator>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAccelerators($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\AllocationPolicy\Accelerator::class); - $this->accelerators = $arr; - - return $this; - } - - /** - * Book disk to be created and attached to each VM by this InstancePolicy. - * Boot disk will be deleted when the VM is deleted. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; - * @return \Google\Cloud\Batch\V1\AllocationPolicy\Disk|null - */ - public function getBootDisk() - { - return $this->boot_disk; - } - - public function hasBootDisk() - { - return isset($this->boot_disk); - } - - public function clearBootDisk() - { - unset($this->boot_disk); - } - - /** - * Book disk to be created and attached to each VM by this InstancePolicy. - * Boot disk will be deleted when the VM is deleted. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 8; - * @param \Google\Cloud\Batch\V1\AllocationPolicy\Disk $var - * @return $this - */ - public function setBootDisk($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\Disk::class); - $this->boot_disk = $var; - - return $this; - } - - /** - * Non-boot disks to be attached for each VM created by this InstancePolicy. - * New disks will be deleted when the VM is deleted. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDisks() - { - return $this->disks; - } - - /** - * Non-boot disks to be attached for each VM created by this InstancePolicy. - * New disks will be deleted when the VM is deleted. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.AttachedDisk disks = 6; - * @param array<\Google\Cloud\Batch\V1\AllocationPolicy\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDisks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\AllocationPolicy\AttachedDisk::class); - $this->disks = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(InstancePolicy::class, \Google\Cloud\Batch\V1\AllocationPolicy_InstancePolicy::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicyOrTemplate.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicyOrTemplate.php deleted file mode 100644 index daf830b8540d..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/InstancePolicyOrTemplate.php +++ /dev/null @@ -1,163 +0,0 @@ -google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - */ -class InstancePolicyOrTemplate extends \Google\Protobuf\Internal\Message -{ - /** - * Set this field true if users want Batch to help fetch drivers from a - * third party location and install them for GPUs specified in - * policy.accelerators or instance_template on their behalf. Default is - * false. - * - * Generated from protobuf field bool install_gpu_drivers = 3; - */ - protected $install_gpu_drivers = false; - protected $policy_template; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicy $policy - * InstancePolicy. - * @type string $instance_template - * Name of an instance template used to create VMs. - * Named the field as 'instance_template' instead of 'template' to avoid - * c++ keyword conflict. - * @type bool $install_gpu_drivers - * Set this field true if users want Batch to help fetch drivers from a - * third party location and install them for GPUs specified in - * policy.accelerators or instance_template on their behalf. Default is - * false. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * InstancePolicy. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; - * @return \Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicy|null - */ - public function getPolicy() - { - return $this->readOneof(1); - } - - public function hasPolicy() - { - return $this->hasOneof(1); - } - - /** - * InstancePolicy. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.InstancePolicy policy = 1; - * @param \Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicy $var - * @return $this - */ - public function setPolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\InstancePolicy::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Name of an instance template used to create VMs. - * Named the field as 'instance_template' instead of 'template' to avoid - * c++ keyword conflict. - * - * Generated from protobuf field string instance_template = 2; - * @return string - */ - public function getInstanceTemplate() - { - return $this->readOneof(2); - } - - public function hasInstanceTemplate() - { - return $this->hasOneof(2); - } - - /** - * Name of an instance template used to create VMs. - * Named the field as 'instance_template' instead of 'template' to avoid - * c++ keyword conflict. - * - * Generated from protobuf field string instance_template = 2; - * @param string $var - * @return $this - */ - public function setInstanceTemplate($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Set this field true if users want Batch to help fetch drivers from a - * third party location and install them for GPUs specified in - * policy.accelerators or instance_template on their behalf. Default is - * false. - * - * Generated from protobuf field bool install_gpu_drivers = 3; - * @return bool - */ - public function getInstallGpuDrivers() - { - return $this->install_gpu_drivers; - } - - /** - * Set this field true if users want Batch to help fetch drivers from a - * third party location and install them for GPUs specified in - * policy.accelerators or instance_template on their behalf. Default is - * false. - * - * Generated from protobuf field bool install_gpu_drivers = 3; - * @param bool $var - * @return $this - */ - public function setInstallGpuDrivers($var) - { - GPBUtil::checkBool($var); - $this->install_gpu_drivers = $var; - - return $this; - } - - /** - * @return string - */ - public function getPolicyTemplate() - { - return $this->whichOneof("policy_template"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(InstancePolicyOrTemplate::class, \Google\Cloud\Batch\V1\AllocationPolicy_InstancePolicyOrTemplate::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/LocationPolicy.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/LocationPolicy.php deleted file mode 100644 index 4a0711636785..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/LocationPolicy.php +++ /dev/null @@ -1,112 +0,0 @@ -google.cloud.batch.v1.AllocationPolicy.LocationPolicy - */ -class LocationPolicy extends \Google\Protobuf\Internal\Message -{ - /** - * A list of allowed location names represented by internal URLs. - * Each location can be a region or a zone. - * Only one region or multiple zones in one region is supported now. - * For example, - * ["regions/us-central1"] allow VMs in any zones in region us-central1. - * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs - * in zones us-central1-a and us-central1-c. - * All locations end up in different regions would cause errors. - * For example, - * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", - * "zones/us-west1-a"] contains 2 regions "us-central1" and - * "us-west1". An error is expected in this case. - * - * Generated from protobuf field repeated string allowed_locations = 1; - */ - private $allowed_locations; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_locations - * A list of allowed location names represented by internal URLs. - * Each location can be a region or a zone. - * Only one region or multiple zones in one region is supported now. - * For example, - * ["regions/us-central1"] allow VMs in any zones in region us-central1. - * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs - * in zones us-central1-a and us-central1-c. - * All locations end up in different regions would cause errors. - * For example, - * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", - * "zones/us-west1-a"] contains 2 regions "us-central1" and - * "us-west1". An error is expected in this case. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * A list of allowed location names represented by internal URLs. - * Each location can be a region or a zone. - * Only one region or multiple zones in one region is supported now. - * For example, - * ["regions/us-central1"] allow VMs in any zones in region us-central1. - * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs - * in zones us-central1-a and us-central1-c. - * All locations end up in different regions would cause errors. - * For example, - * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", - * "zones/us-west1-a"] contains 2 regions "us-central1" and - * "us-west1". An error is expected in this case. - * - * Generated from protobuf field repeated string allowed_locations = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAllowedLocations() - { - return $this->allowed_locations; - } - - /** - * A list of allowed location names represented by internal URLs. - * Each location can be a region or a zone. - * Only one region or multiple zones in one region is supported now. - * For example, - * ["regions/us-central1"] allow VMs in any zones in region us-central1. - * ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs - * in zones us-central1-a and us-central1-c. - * All locations end up in different regions would cause errors. - * For example, - * ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", - * "zones/us-west1-a"] contains 2 regions "us-central1" and - * "us-west1". An error is expected in this case. - * - * Generated from protobuf field repeated string allowed_locations = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAllowedLocations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->allowed_locations = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(LocationPolicy::class, \Google\Cloud\Batch\V1\AllocationPolicy_LocationPolicy::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkInterface.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkInterface.php deleted file mode 100644 index bf6597d781cb..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkInterface.php +++ /dev/null @@ -1,202 +0,0 @@ -google.cloud.batch.v1.AllocationPolicy.NetworkInterface - */ -class NetworkInterface extends \Google\Protobuf\Internal\Message -{ - /** - * The URL of an existing network resource. - * You can specify the network as a full or partial URL. - * For example, the following are all valid URLs: - * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} - * projects/{project}/global/networks/{network} - * global/networks/{network} - * - * Generated from protobuf field string network = 1; - */ - protected $network = ''; - /** - * The URL of an existing subnetwork resource in the network. - * You can specify the subnetwork as a full or partial URL. - * For example, the following are all valid URLs: - * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} - * projects/{project}/regions/{region}/subnetworks/{subnetwork} - * regions/{region}/subnetworks/{subnetwork} - * - * Generated from protobuf field string subnetwork = 2; - */ - protected $subnetwork = ''; - /** - * Default is false (with an external IP address). Required if - * no external public IP address is attached to the VM. If no external - * public IP address, additional configuration is required to allow the VM - * to access Google Services. See - * https://cloud.google.com/vpc/docs/configure-private-google-access and - * https://cloud.google.com/nat/docs/gce-example#create-nat for more - * information. - * - * Generated from protobuf field bool no_external_ip_address = 3; - */ - protected $no_external_ip_address = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $network - * The URL of an existing network resource. - * You can specify the network as a full or partial URL. - * For example, the following are all valid URLs: - * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} - * projects/{project}/global/networks/{network} - * global/networks/{network} - * @type string $subnetwork - * The URL of an existing subnetwork resource in the network. - * You can specify the subnetwork as a full or partial URL. - * For example, the following are all valid URLs: - * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} - * projects/{project}/regions/{region}/subnetworks/{subnetwork} - * regions/{region}/subnetworks/{subnetwork} - * @type bool $no_external_ip_address - * Default is false (with an external IP address). Required if - * no external public IP address is attached to the VM. If no external - * public IP address, additional configuration is required to allow the VM - * to access Google Services. See - * https://cloud.google.com/vpc/docs/configure-private-google-access and - * https://cloud.google.com/nat/docs/gce-example#create-nat for more - * information. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * The URL of an existing network resource. - * You can specify the network as a full or partial URL. - * For example, the following are all valid URLs: - * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} - * projects/{project}/global/networks/{network} - * global/networks/{network} - * - * Generated from protobuf field string network = 1; - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * The URL of an existing network resource. - * You can specify the network as a full or partial URL. - * For example, the following are all valid URLs: - * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} - * projects/{project}/global/networks/{network} - * global/networks/{network} - * - * Generated from protobuf field string network = 1; - * @param string $var - * @return $this - */ - public function setNetwork($var) - { - GPBUtil::checkString($var, True); - $this->network = $var; - - return $this; - } - - /** - * The URL of an existing subnetwork resource in the network. - * You can specify the subnetwork as a full or partial URL. - * For example, the following are all valid URLs: - * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} - * projects/{project}/regions/{region}/subnetworks/{subnetwork} - * regions/{region}/subnetworks/{subnetwork} - * - * Generated from protobuf field string subnetwork = 2; - * @return string - */ - public function getSubnetwork() - { - return $this->subnetwork; - } - - /** - * The URL of an existing subnetwork resource in the network. - * You can specify the subnetwork as a full or partial URL. - * For example, the following are all valid URLs: - * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} - * projects/{project}/regions/{region}/subnetworks/{subnetwork} - * regions/{region}/subnetworks/{subnetwork} - * - * Generated from protobuf field string subnetwork = 2; - * @param string $var - * @return $this - */ - public function setSubnetwork($var) - { - GPBUtil::checkString($var, True); - $this->subnetwork = $var; - - return $this; - } - - /** - * Default is false (with an external IP address). Required if - * no external public IP address is attached to the VM. If no external - * public IP address, additional configuration is required to allow the VM - * to access Google Services. See - * https://cloud.google.com/vpc/docs/configure-private-google-access and - * https://cloud.google.com/nat/docs/gce-example#create-nat for more - * information. - * - * Generated from protobuf field bool no_external_ip_address = 3; - * @return bool - */ - public function getNoExternalIpAddress() - { - return $this->no_external_ip_address; - } - - /** - * Default is false (with an external IP address). Required if - * no external public IP address is attached to the VM. If no external - * public IP address, additional configuration is required to allow the VM - * to access Google Services. See - * https://cloud.google.com/vpc/docs/configure-private-google-access and - * https://cloud.google.com/nat/docs/gce-example#create-nat for more - * information. - * - * Generated from protobuf field bool no_external_ip_address = 3; - * @param bool $var - * @return $this - */ - public function setNoExternalIpAddress($var) - { - GPBUtil::checkBool($var); - $this->no_external_ip_address = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(NetworkInterface::class, \Google\Cloud\Batch\V1\AllocationPolicy_NetworkInterface::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkPolicy.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkPolicy.php deleted file mode 100644 index f402f3e8e3d2..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/NetworkPolicy.php +++ /dev/null @@ -1,70 +0,0 @@ -google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - */ -class NetworkPolicy extends \Google\Protobuf\Internal\Message -{ - /** - * Network configurations. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; - */ - private $network_interfaces; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Batch\V1\AllocationPolicy\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $network_interfaces - * Network configurations. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * Network configurations. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNetworkInterfaces() - { - return $this->network_interfaces; - } - - /** - * Network configurations. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.AllocationPolicy.NetworkInterface network_interfaces = 1; - * @param array<\Google\Cloud\Batch\V1\AllocationPolicy\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNetworkInterfaces($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\AllocationPolicy\NetworkInterface::class); - $this->network_interfaces = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(NetworkPolicy::class, \Google\Cloud\Batch\V1\AllocationPolicy_NetworkPolicy::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/ProvisioningModel.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/ProvisioningModel.php deleted file mode 100644 index 62a6191c61cb..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy/ProvisioningModel.php +++ /dev/null @@ -1,75 +0,0 @@ -google.cloud.batch.v1.AllocationPolicy.ProvisioningModel - */ -class ProvisioningModel -{ - /** - * Unspecified. - * - * Generated from protobuf enum PROVISIONING_MODEL_UNSPECIFIED = 0; - */ - const PROVISIONING_MODEL_UNSPECIFIED = 0; - /** - * Standard VM. - * - * Generated from protobuf enum STANDARD = 1; - */ - const STANDARD = 1; - /** - * SPOT VM. - * - * Generated from protobuf enum SPOT = 2; - */ - const SPOT = 2; - /** - * Preemptible VM (PVM). - * Above SPOT VM is the preferable model for preemptible VM instances: the - * old preemptible VM model (indicated by this field) is the older model, - * and has been migrated to use the SPOT model as the underlying technology. - * This old model will still be supported. - * - * Generated from protobuf enum PREEMPTIBLE = 3; - */ - const PREEMPTIBLE = 3; - - private static $valueToName = [ - self::PROVISIONING_MODEL_UNSPECIFIED => 'PROVISIONING_MODEL_UNSPECIFIED', - self::STANDARD => 'STANDARD', - self::SPOT => 'SPOT', - self::PREEMPTIBLE => 'PREEMPTIBLE', - ]; - - 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(ProvisioningModel::class, \Google\Cloud\Batch\V1\AllocationPolicy_ProvisioningModel::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_Accelerator.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_Accelerator.php deleted file mode 100644 index 1e85fe74a884..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/AllocationPolicy_Accelerator.php +++ /dev/null @@ -1,16 +0,0 @@ -_simpleRequest('/google.cloud.batch.v1.BatchService/CreateJob', - $argument, - ['\Google\Cloud\Batch\V1\Job', 'decode'], - $metadata, $options); - } - - /** - * Get a Job specified by its resource name. - * @param \Google\Cloud\Batch\V1\GetJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetJob(\Google\Cloud\Batch\V1\GetJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.batch.v1.BatchService/GetJob', - $argument, - ['\Google\Cloud\Batch\V1\Job', 'decode'], - $metadata, $options); - } - - /** - * Delete a Job. - * @param \Google\Cloud\Batch\V1\DeleteJobRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteJob(\Google\Cloud\Batch\V1\DeleteJobRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.batch.v1.BatchService/DeleteJob', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * List all Jobs for a project within a region. - * @param \Google\Cloud\Batch\V1\ListJobsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListJobs(\Google\Cloud\Batch\V1\ListJobsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.batch.v1.BatchService/ListJobs', - $argument, - ['\Google\Cloud\Batch\V1\ListJobsResponse', 'decode'], - $metadata, $options); - } - - /** - * Return a single Task. - * @param \Google\Cloud\Batch\V1\GetTaskRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetTask(\Google\Cloud\Batch\V1\GetTaskRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.batch.v1.BatchService/GetTask', - $argument, - ['\Google\Cloud\Batch\V1\Task', 'decode'], - $metadata, $options); - } - - /** - * List Tasks associated with a job. - * @param \Google\Cloud\Batch\V1\ListTasksRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTasks(\Google\Cloud\Batch\V1\ListTasksRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.batch.v1.BatchService/ListTasks', - $argument, - ['\Google\Cloud\Batch\V1\ListTasksResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ComputeResource.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ComputeResource.php deleted file mode 100644 index 16384c01afdd..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ComputeResource.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.batch.v1.ComputeResource - */ -class ComputeResource extends \Google\Protobuf\Internal\Message -{ - /** - * The milliCPU count. - * - * Generated from protobuf field int64 cpu_milli = 1; - */ - protected $cpu_milli = 0; - /** - * Memory in MiB. - * - * Generated from protobuf field int64 memory_mib = 2; - */ - protected $memory_mib = 0; - /** - * Extra boot disk size in MiB for each task. - * - * Generated from protobuf field int64 boot_disk_mib = 4; - */ - protected $boot_disk_mib = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $cpu_milli - * The milliCPU count. - * @type int|string $memory_mib - * Memory in MiB. - * @type int|string $boot_disk_mib - * Extra boot disk size in MiB for each task. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); - parent::__construct($data); - } - - /** - * The milliCPU count. - * - * Generated from protobuf field int64 cpu_milli = 1; - * @return int|string - */ - public function getCpuMilli() - { - return $this->cpu_milli; - } - - /** - * The milliCPU count. - * - * Generated from protobuf field int64 cpu_milli = 1; - * @param int|string $var - * @return $this - */ - public function setCpuMilli($var) - { - GPBUtil::checkInt64($var); - $this->cpu_milli = $var; - - return $this; - } - - /** - * Memory in MiB. - * - * Generated from protobuf field int64 memory_mib = 2; - * @return int|string - */ - public function getMemoryMib() - { - return $this->memory_mib; - } - - /** - * Memory in MiB. - * - * Generated from protobuf field int64 memory_mib = 2; - * @param int|string $var - * @return $this - */ - public function setMemoryMib($var) - { - GPBUtil::checkInt64($var); - $this->memory_mib = $var; - - return $this; - } - - /** - * Extra boot disk size in MiB for each task. - * - * Generated from protobuf field int64 boot_disk_mib = 4; - * @return int|string - */ - public function getBootDiskMib() - { - return $this->boot_disk_mib; - } - - /** - * Extra boot disk size in MiB for each task. - * - * Generated from protobuf field int64 boot_disk_mib = 4; - * @param int|string $var - * @return $this - */ - public function setBootDiskMib($var) - { - GPBUtil::checkInt64($var); - $this->boot_disk_mib = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/CreateJobRequest.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/CreateJobRequest.php deleted file mode 100644 index 5e15edb1b9ae..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/CreateJobRequest.php +++ /dev/null @@ -1,251 +0,0 @@ -google.cloud.batch.v1.CreateJobRequest - */ -class CreateJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource name where the Job will be created. - * Pattern: "projects/{project}/locations/{location}" - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * ID used to uniquely identify the Job within its parent scope. - * This field should contain at most 63 characters and must start with - * lowercase characters. - * Only lowercase characters, numbers and '-' are accepted. - * The '-' character cannot be the first or the last one. - * A system generated ID will be used if the field is not set. - * The job.name field in the request will be ignored and the created resource - * name of the Job will be "{parent}/jobs/{job_id}". - * - * Generated from protobuf field string job_id = 2; - */ - protected $job_id = ''; - /** - * Required. The Job to create. - * - * Generated from protobuf field .google.cloud.batch.v1.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $job = null; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource name where the Job will be created. - * Pattern: "projects/{project}/locations/{location}" - * @type string $job_id - * ID used to uniquely identify the Job within its parent scope. - * This field should contain at most 63 characters and must start with - * lowercase characters. - * Only lowercase characters, numbers and '-' are accepted. - * The '-' character cannot be the first or the last one. - * A system generated ID will be used if the field is not set. - * The job.name field in the request will be ignored and the created resource - * name of the Job will be "{parent}/jobs/{job_id}". - * @type \Google\Cloud\Batch\V1\Job $job - * Required. The Job to create. - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource name where the Job will be created. - * Pattern: "projects/{project}/locations/{location}" - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource name where the Job will be created. - * Pattern: "projects/{project}/locations/{location}" - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * ID used to uniquely identify the Job within its parent scope. - * This field should contain at most 63 characters and must start with - * lowercase characters. - * Only lowercase characters, numbers and '-' are accepted. - * The '-' character cannot be the first or the last one. - * A system generated ID will be used if the field is not set. - * The job.name field in the request will be ignored and the created resource - * name of the Job will be "{parent}/jobs/{job_id}". - * - * Generated from protobuf field string job_id = 2; - * @return string - */ - public function getJobId() - { - return $this->job_id; - } - - /** - * ID used to uniquely identify the Job within its parent scope. - * This field should contain at most 63 characters and must start with - * lowercase characters. - * Only lowercase characters, numbers and '-' are accepted. - * The '-' character cannot be the first or the last one. - * A system generated ID will be used if the field is not set. - * The job.name field in the request will be ignored and the created resource - * name of the Job will be "{parent}/jobs/{job_id}". - * - * Generated from protobuf field string job_id = 2; - * @param string $var - * @return $this - */ - public function setJobId($var) - { - GPBUtil::checkString($var, True); - $this->job_id = $var; - - return $this; - } - - /** - * Required. The Job to create. - * - * Generated from protobuf field .google.cloud.batch.v1.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Batch\V1\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 create. - * - * Generated from protobuf field .google.cloud.batch.v1.Job job = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Batch\V1\Job $var - * @return $this - */ - public function setJob($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Job::class); - $this->job = $var; - - return $this; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/DeleteJobRequest.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/DeleteJobRequest.php deleted file mode 100644 index ca2d1ac3053f..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/DeleteJobRequest.php +++ /dev/null @@ -1,175 +0,0 @@ -google.cloud.batch.v1.DeleteJobRequest - */ -class DeleteJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Job name. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Optional. Reason for this deletion. - * - * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $reason = ''; - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $request_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Job name. - * @type string $reason - * Optional. Reason for this deletion. - * @type string $request_id - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); - parent::__construct($data); - } - - /** - * Job name. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Job name. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. Reason for this deletion. - * - * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getReason() - { - return $this->reason; - } - - /** - * Optional. Reason for this deletion. - * - * Generated from protobuf field string reason = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setReason($var) - { - GPBUtil::checkString($var, True); - $this->reason = $var; - - return $this; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getRequestId() - { - return $this->request_id; - } - - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * - * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setRequestId($var) - { - GPBUtil::checkString($var, True); - $this->request_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment.php deleted file mode 100644 index 058a8d4ccc90..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment.php +++ /dev/null @@ -1,158 +0,0 @@ -google.cloud.batch.v1.Environment - */ -class Environment extends \Google\Protobuf\Internal\Message -{ - /** - * A map of environment variable names to values. - * - * Generated from protobuf field map variables = 1; - */ - private $variables; - /** - * A map of environment variable names to Secret Manager secret names. - * The VM will access the named secrets to set the value of each environment - * variable. - * - * Generated from protobuf field map secret_variables = 2; - */ - private $secret_variables; - /** - * An encrypted JSON dictionary where the key/value pairs correspond to - * environment variable names and their values. - * - * Generated from protobuf field .google.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; - */ - protected $encrypted_variables = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $variables - * A map of environment variable names to values. - * @type array|\Google\Protobuf\Internal\MapField $secret_variables - * A map of environment variable names to Secret Manager secret names. - * The VM will access the named secrets to set the value of each environment - * variable. - * @type \Google\Cloud\Batch\V1\Environment\KMSEnvMap $encrypted_variables - * An encrypted JSON dictionary where the key/value pairs correspond to - * environment variable names and their values. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); - parent::__construct($data); - } - - /** - * A map of environment variable names to values. - * - * Generated from protobuf field map variables = 1; - * @return \Google\Protobuf\Internal\MapField - */ - public function getVariables() - { - return $this->variables; - } - - /** - * A map of environment variable names to values. - * - * Generated from protobuf field map variables = 1; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setVariables($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->variables = $arr; - - return $this; - } - - /** - * A map of environment variable names to Secret Manager secret names. - * The VM will access the named secrets to set the value of each environment - * variable. - * - * Generated from protobuf field map secret_variables = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getSecretVariables() - { - return $this->secret_variables; - } - - /** - * A map of environment variable names to Secret Manager secret names. - * The VM will access the named secrets to set the value of each environment - * variable. - * - * Generated from protobuf field map secret_variables = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setSecretVariables($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->secret_variables = $arr; - - return $this; - } - - /** - * An encrypted JSON dictionary where the key/value pairs correspond to - * environment variable names and their values. - * - * Generated from protobuf field .google.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; - * @return \Google\Cloud\Batch\V1\Environment\KMSEnvMap|null - */ - public function getEncryptedVariables() - { - return $this->encrypted_variables; - } - - public function hasEncryptedVariables() - { - return isset($this->encrypted_variables); - } - - public function clearEncryptedVariables() - { - unset($this->encrypted_variables); - } - - /** - * An encrypted JSON dictionary where the key/value pairs correspond to - * environment variable names and their values. - * - * Generated from protobuf field .google.cloud.batch.v1.Environment.KMSEnvMap encrypted_variables = 3; - * @param \Google\Cloud\Batch\V1\Environment\KMSEnvMap $var - * @return $this - */ - public function setEncryptedVariables($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Environment\KMSEnvMap::class); - $this->encrypted_variables = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment/KMSEnvMap.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment/KMSEnvMap.php deleted file mode 100644 index 91b995831e11..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment/KMSEnvMap.php +++ /dev/null @@ -1,102 +0,0 @@ -google.cloud.batch.v1.Environment.KMSEnvMap - */ -class KMSEnvMap extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the KMS key that will be used to decrypt the cipher text. - * - * Generated from protobuf field string key_name = 1; - */ - protected $key_name = ''; - /** - * The value of the cipherText response from the `encrypt` method. - * - * Generated from protobuf field string cipher_text = 2; - */ - protected $cipher_text = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key_name - * The name of the KMS key that will be used to decrypt the cipher text. - * @type string $cipher_text - * The value of the cipherText response from the `encrypt` method. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); - parent::__construct($data); - } - - /** - * The name of the KMS key that will be used to decrypt the cipher text. - * - * Generated from protobuf field string key_name = 1; - * @return string - */ - public function getKeyName() - { - return $this->key_name; - } - - /** - * The name of the KMS key that will be used to decrypt the cipher text. - * - * Generated from protobuf field string key_name = 1; - * @param string $var - * @return $this - */ - public function setKeyName($var) - { - GPBUtil::checkString($var, True); - $this->key_name = $var; - - return $this; - } - - /** - * The value of the cipherText response from the `encrypt` method. - * - * Generated from protobuf field string cipher_text = 2; - * @return string - */ - public function getCipherText() - { - return $this->cipher_text; - } - - /** - * The value of the cipherText response from the `encrypt` method. - * - * Generated from protobuf field string cipher_text = 2; - * @param string $var - * @return $this - */ - public function setCipherText($var) - { - GPBUtil::checkString($var, True); - $this->cipher_text = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(KMSEnvMap::class, \Google\Cloud\Batch\V1\Environment_KMSEnvMap::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment_KMSEnvMap.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment_KMSEnvMap.php deleted file mode 100644 index 75085c6ee530..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Environment_KMSEnvMap.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.batch.v1.GCS - */ -class GCS extends \Google\Protobuf\Internal\Message -{ - /** - * Remote path, either a bucket name or a subdirectory of a bucket, e.g.: - * bucket_name, bucket_name/subdirectory/ - * - * Generated from protobuf field string remote_path = 1; - */ - protected $remote_path = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $remote_path - * Remote path, either a bucket name or a subdirectory of a bucket, e.g.: - * bucket_name, bucket_name/subdirectory/ - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Volume::initOnce(); - parent::__construct($data); - } - - /** - * Remote path, either a bucket name or a subdirectory of a bucket, e.g.: - * bucket_name, bucket_name/subdirectory/ - * - * Generated from protobuf field string remote_path = 1; - * @return string - */ - public function getRemotePath() - { - return $this->remote_path; - } - - /** - * Remote path, either a bucket name or a subdirectory of a bucket, e.g.: - * bucket_name, bucket_name/subdirectory/ - * - * Generated from protobuf field string remote_path = 1; - * @param string $var - * @return $this - */ - public function setRemotePath($var) - { - GPBUtil::checkString($var, True); - $this->remote_path = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetJobRequest.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetJobRequest.php deleted file mode 100644 index ce1430ac4d74..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetJobRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.batch.v1.GetJobRequest - */ -class GetJobRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Job name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Job name. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); - parent::__construct($data); - } - - /** - * Required. Job name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Job name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetTaskRequest.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetTaskRequest.php deleted file mode 100644 index 3448bf13090a..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/GetTaskRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.batch.v1.GetTaskRequest - */ -class GetTaskRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Task name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Task name. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); - parent::__construct($data); - } - - /** - * Required. Task name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Task name. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Job.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Job.php deleted file mode 100644 index e32bd5a11b00..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Job.php +++ /dev/null @@ -1,513 +0,0 @@ -google.cloud.batch.v1.Job - */ -class Job extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Job name. - * For example: "projects/123456/locations/us-central1/jobs/job01". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Output only. A system generated unique ID (in UUID4 format) for the Job. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Priority of the Job. - * The valid value range is [0, 100). Default value is 0. - * Higher value indicates higher priority. - * A job with higher priority value is more likely to run earlier if all other - * requirements are satisfied. - * - * Generated from protobuf field int64 priority = 3; - */ - protected $priority = 0; - /** - * Required. TaskGroups in the Job. Only one TaskGroup is supported now. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - private $task_groups; - /** - * Compute resource allocation for all TaskGroups in the Job. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy allocation_policy = 7; - */ - protected $allocation_policy = null; - /** - * Labels for the Job. Labels could be user provided or system generated. - * For example, - * "labels": { - * "department": "finance", - * "environment": "test" - * } - * You can assign up to 64 labels. [Google Compute Engine label - * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) - * apply. - * Label names that start with "goog-" or "google-" are reserved. - * - * Generated from protobuf field map labels = 8; - */ - private $labels; - /** - * Output only. Job status. It is read only for users. - * - * Generated from protobuf field .google.cloud.batch.v1.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $status = null; - /** - * Output only. When the Job was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The last time the Job was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Log preservation policy for the Job. - * - * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy logs_policy = 13; - */ - protected $logs_policy = null; - /** - * Notification configurations. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.JobNotification notifications = 14; - */ - private $notifications; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. Job name. - * For example: "projects/123456/locations/us-central1/jobs/job01". - * @type string $uid - * Output only. A system generated unique ID (in UUID4 format) for the Job. - * @type int|string $priority - * Priority of the Job. - * The valid value range is [0, 100). Default value is 0. - * Higher value indicates higher priority. - * A job with higher priority value is more likely to run earlier if all other - * requirements are satisfied. - * @type array<\Google\Cloud\Batch\V1\TaskGroup>|\Google\Protobuf\Internal\RepeatedField $task_groups - * Required. TaskGroups in the Job. Only one TaskGroup is supported now. - * @type \Google\Cloud\Batch\V1\AllocationPolicy $allocation_policy - * Compute resource allocation for all TaskGroups in the Job. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels for the Job. Labels could be user provided or system generated. - * For example, - * "labels": { - * "department": "finance", - * "environment": "test" - * } - * You can assign up to 64 labels. [Google Compute Engine label - * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) - * apply. - * Label names that start with "goog-" or "google-" are reserved. - * @type \Google\Cloud\Batch\V1\JobStatus $status - * Output only. Job status. It is read only for users. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. When the Job was created. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The last time the Job was updated. - * @type \Google\Cloud\Batch\V1\LogsPolicy $logs_policy - * Log preservation policy for the Job. - * @type array<\Google\Cloud\Batch\V1\JobNotification>|\Google\Protobuf\Internal\RepeatedField $notifications - * Notification configurations. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Job name. - * For example: "projects/123456/locations/us-central1/jobs/job01". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. Job name. - * For example: "projects/123456/locations/us-central1/jobs/job01". - * - * 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. A system generated unique ID (in UUID4 format) for the Job. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. A system generated unique ID (in UUID4 format) for the Job. - * - * 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; - } - - /** - * Priority of the Job. - * The valid value range is [0, 100). Default value is 0. - * Higher value indicates higher priority. - * A job with higher priority value is more likely to run earlier if all other - * requirements are satisfied. - * - * Generated from protobuf field int64 priority = 3; - * @return int|string - */ - public function getPriority() - { - return $this->priority; - } - - /** - * Priority of the Job. - * The valid value range is [0, 100). Default value is 0. - * Higher value indicates higher priority. - * A job with higher priority value is more likely to run earlier if all other - * requirements are satisfied. - * - * Generated from protobuf field int64 priority = 3; - * @param int|string $var - * @return $this - */ - public function setPriority($var) - { - GPBUtil::checkInt64($var); - $this->priority = $var; - - return $this; - } - - /** - * Required. TaskGroups in the Job. Only one TaskGroup is supported now. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTaskGroups() - { - return $this->task_groups; - } - - /** - * Required. TaskGroups in the Job. Only one TaskGroup is supported now. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.TaskGroup task_groups = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\Batch\V1\TaskGroup>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTaskGroups($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\TaskGroup::class); - $this->task_groups = $arr; - - return $this; - } - - /** - * Compute resource allocation for all TaskGroups in the Job. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy allocation_policy = 7; - * @return \Google\Cloud\Batch\V1\AllocationPolicy|null - */ - public function getAllocationPolicy() - { - return $this->allocation_policy; - } - - public function hasAllocationPolicy() - { - return isset($this->allocation_policy); - } - - public function clearAllocationPolicy() - { - unset($this->allocation_policy); - } - - /** - * Compute resource allocation for all TaskGroups in the Job. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy allocation_policy = 7; - * @param \Google\Cloud\Batch\V1\AllocationPolicy $var - * @return $this - */ - public function setAllocationPolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy::class); - $this->allocation_policy = $var; - - return $this; - } - - /** - * Labels for the Job. Labels could be user provided or system generated. - * For example, - * "labels": { - * "department": "finance", - * "environment": "test" - * } - * You can assign up to 64 labels. [Google Compute Engine label - * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) - * apply. - * Label names that start with "goog-" or "google-" are reserved. - * - * Generated from protobuf field map labels = 8; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels for the Job. Labels could be user provided or system generated. - * For example, - * "labels": { - * "department": "finance", - * "environment": "test" - * } - * You can assign up to 64 labels. [Google Compute Engine label - * restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) - * apply. - * Label names that start with "goog-" or "google-" are reserved. - * - * Generated from protobuf field map labels = 8; - * @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. Job status. It is read only for users. - * - * Generated from protobuf field .google.cloud.batch.v1.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Batch\V1\JobStatus|null - */ - public function getStatus() - { - return $this->status; - } - - public function hasStatus() - { - return isset($this->status); - } - - public function clearStatus() - { - unset($this->status); - } - - /** - * Output only. Job status. It is read only for users. - * - * Generated from protobuf field .google.cloud.batch.v1.JobStatus status = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Batch\V1\JobStatus $var - * @return $this - */ - public function setStatus($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\JobStatus::class); - $this->status = $var; - - return $this; - } - - /** - * Output only. When the Job was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.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. When the Job was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 11 [(.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 time the Job was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 12 [(.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 time the Job was updated. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 12 [(.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; - } - - /** - * Log preservation policy for the Job. - * - * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy logs_policy = 13; - * @return \Google\Cloud\Batch\V1\LogsPolicy|null - */ - public function getLogsPolicy() - { - return $this->logs_policy; - } - - public function hasLogsPolicy() - { - return isset($this->logs_policy); - } - - public function clearLogsPolicy() - { - unset($this->logs_policy); - } - - /** - * Log preservation policy for the Job. - * - * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy logs_policy = 13; - * @param \Google\Cloud\Batch\V1\LogsPolicy $var - * @return $this - */ - public function setLogsPolicy($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\LogsPolicy::class); - $this->logs_policy = $var; - - return $this; - } - - /** - * Notification configurations. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.JobNotification notifications = 14; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNotifications() - { - return $this->notifications; - } - - /** - * Notification configurations. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.JobNotification notifications = 14; - * @param array<\Google\Cloud\Batch\V1\JobNotification>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNotifications($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\JobNotification::class); - $this->notifications = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification.php deleted file mode 100644 index 3c1fc88bdeab..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification.php +++ /dev/null @@ -1,131 +0,0 @@ -google.cloud.batch.v1.JobNotification - */ -class JobNotification extends \Google\Protobuf\Internal\Message -{ - /** - * The Pub/Sub topic where notifications like the job state changes - * will be published. This topic exist in the same project as the job - * and billings will be charged to this project. - * If not specified, no Pub/Sub messages will be sent. - * Topic format: `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string pubsub_topic = 1; - */ - protected $pubsub_topic = ''; - /** - * The attribute requirements of messages to be sent to this Pub/Sub topic. - * Without this field, no message will be sent. - * - * Generated from protobuf field .google.cloud.batch.v1.JobNotification.Message message = 2; - */ - protected $message = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $pubsub_topic - * The Pub/Sub topic where notifications like the job state changes - * will be published. This topic exist in the same project as the job - * and billings will be charged to this project. - * If not specified, no Pub/Sub messages will be sent. - * Topic format: `projects/{project}/topics/{topic}`. - * @type \Google\Cloud\Batch\V1\JobNotification\Message $message - * The attribute requirements of messages to be sent to this Pub/Sub topic. - * Without this field, no message will be sent. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * The Pub/Sub topic where notifications like the job state changes - * will be published. This topic exist in the same project as the job - * and billings will be charged to this project. - * If not specified, no Pub/Sub messages will be sent. - * Topic format: `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string pubsub_topic = 1; - * @return string - */ - public function getPubsubTopic() - { - return $this->pubsub_topic; - } - - /** - * The Pub/Sub topic where notifications like the job state changes - * will be published. This topic exist in the same project as the job - * and billings will be charged to this project. - * If not specified, no Pub/Sub messages will be sent. - * Topic format: `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string pubsub_topic = 1; - * @param string $var - * @return $this - */ - public function setPubsubTopic($var) - { - GPBUtil::checkString($var, True); - $this->pubsub_topic = $var; - - return $this; - } - - /** - * The attribute requirements of messages to be sent to this Pub/Sub topic. - * Without this field, no message will be sent. - * - * Generated from protobuf field .google.cloud.batch.v1.JobNotification.Message message = 2; - * @return \Google\Cloud\Batch\V1\JobNotification\Message|null - */ - public function getMessage() - { - return $this->message; - } - - public function hasMessage() - { - return isset($this->message); - } - - public function clearMessage() - { - unset($this->message); - } - - /** - * The attribute requirements of messages to be sent to this Pub/Sub topic. - * Without this field, no message will be sent. - * - * Generated from protobuf field .google.cloud.batch.v1.JobNotification.Message message = 2; - * @param \Google\Cloud\Batch\V1\JobNotification\Message $var - * @return $this - */ - public function setMessage($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\JobNotification\Message::class); - $this->message = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Message.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Message.php deleted file mode 100644 index af67b119fb29..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Message.php +++ /dev/null @@ -1,140 +0,0 @@ -google.cloud.batch.v1.JobNotification.Message - */ -class Message extends \Google\Protobuf\Internal\Message -{ - /** - * The message type. - * - * Generated from protobuf field .google.cloud.batch.v1.JobNotification.Type type = 1; - */ - protected $type = 0; - /** - * The new job state. - * - * Generated from protobuf field .google.cloud.batch.v1.JobStatus.State new_job_state = 2; - */ - protected $new_job_state = 0; - /** - * The new task state. - * - * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State new_task_state = 3; - */ - protected $new_task_state = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $type - * The message type. - * @type int $new_job_state - * The new job state. - * @type int $new_task_state - * The new task state. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * The message type. - * - * Generated from protobuf field .google.cloud.batch.v1.JobNotification.Type type = 1; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * The message type. - * - * Generated from protobuf field .google.cloud.batch.v1.JobNotification.Type type = 1; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\JobNotification\Type::class); - $this->type = $var; - - return $this; - } - - /** - * The new job state. - * - * Generated from protobuf field .google.cloud.batch.v1.JobStatus.State new_job_state = 2; - * @return int - */ - public function getNewJobState() - { - return $this->new_job_state; - } - - /** - * The new job state. - * - * Generated from protobuf field .google.cloud.batch.v1.JobStatus.State new_job_state = 2; - * @param int $var - * @return $this - */ - public function setNewJobState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\JobStatus\State::class); - $this->new_job_state = $var; - - return $this; - } - - /** - * The new task state. - * - * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State new_task_state = 3; - * @return int - */ - public function getNewTaskState() - { - return $this->new_task_state; - } - - /** - * The new task state. - * - * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State new_task_state = 3; - * @param int $var - * @return $this - */ - public function setNewTaskState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\TaskStatus\State::class); - $this->new_task_state = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Message::class, \Google\Cloud\Batch\V1\JobNotification_Message::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Type.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Type.php deleted file mode 100644 index 28ccf868f4c0..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification/Type.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.batch.v1.JobNotification.Type - */ -class Type -{ - /** - * Unspecified. - * - * Generated from protobuf enum TYPE_UNSPECIFIED = 0; - */ - const TYPE_UNSPECIFIED = 0; - /** - * Notify users that the job state has changed. - * - * Generated from protobuf enum JOB_STATE_CHANGED = 1; - */ - const JOB_STATE_CHANGED = 1; - /** - * Notify users that the task state has changed. - * - * Generated from protobuf enum TASK_STATE_CHANGED = 2; - */ - const TASK_STATE_CHANGED = 2; - - private static $valueToName = [ - self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', - self::JOB_STATE_CHANGED => 'JOB_STATE_CHANGED', - self::TASK_STATE_CHANGED => 'TASK_STATE_CHANGED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Type::class, \Google\Cloud\Batch\V1\JobNotification_Type::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification_Message.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification_Message.php deleted file mode 100644 index 0e84573a896a..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobNotification_Message.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.batch.v1.JobStatus - */ -class JobStatus extends \Google\Protobuf\Internal\Message -{ - /** - * Job state - * - * Generated from protobuf field .google.cloud.batch.v1.JobStatus.State state = 1; - */ - protected $state = 0; - /** - * Job status events - * - * Generated from protobuf field repeated .google.cloud.batch.v1.StatusEvent status_events = 2; - */ - private $status_events; - /** - * Aggregated task status for each TaskGroup in the Job. - * The map key is TaskGroup ID. - * - * Generated from protobuf field map task_groups = 4; - */ - private $task_groups; - /** - * The duration of time that the Job spent in status RUNNING. - * - * Generated from protobuf field .google.protobuf.Duration run_duration = 5; - */ - protected $run_duration = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $state - * Job state - * @type array<\Google\Cloud\Batch\V1\StatusEvent>|\Google\Protobuf\Internal\RepeatedField $status_events - * Job status events - * @type array|\Google\Protobuf\Internal\MapField $task_groups - * Aggregated task status for each TaskGroup in the Job. - * The map key is TaskGroup ID. - * @type \Google\Protobuf\Duration $run_duration - * The duration of time that the Job spent in status RUNNING. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * Job state - * - * Generated from protobuf field .google.cloud.batch.v1.JobStatus.State state = 1; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Job state - * - * Generated from protobuf field .google.cloud.batch.v1.JobStatus.State state = 1; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\JobStatus\State::class); - $this->state = $var; - - return $this; - } - - /** - * Job status events - * - * Generated from protobuf field repeated .google.cloud.batch.v1.StatusEvent status_events = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getStatusEvents() - { - return $this->status_events; - } - - /** - * Job status events - * - * Generated from protobuf field repeated .google.cloud.batch.v1.StatusEvent status_events = 2; - * @param array<\Google\Cloud\Batch\V1\StatusEvent>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setStatusEvents($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\StatusEvent::class); - $this->status_events = $arr; - - return $this; - } - - /** - * Aggregated task status for each TaskGroup in the Job. - * The map key is TaskGroup ID. - * - * Generated from protobuf field map task_groups = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getTaskGroups() - { - return $this->task_groups; - } - - /** - * Aggregated task status for each TaskGroup in the Job. - * The map key is TaskGroup ID. - * - * Generated from protobuf field map task_groups = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setTaskGroups($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\JobStatus\TaskGroupStatus::class); - $this->task_groups = $arr; - - return $this; - } - - /** - * The duration of time that the Job spent in status RUNNING. - * - * Generated from protobuf field .google.protobuf.Duration run_duration = 5; - * @return \Google\Protobuf\Duration|null - */ - public function getRunDuration() - { - return $this->run_duration; - } - - public function hasRunDuration() - { - return isset($this->run_duration); - } - - public function clearRunDuration() - { - unset($this->run_duration); - } - - /** - * The duration of time that the Job spent in status RUNNING. - * - * Generated from protobuf field .google.protobuf.Duration run_duration = 5; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setRunDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->run_duration = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/InstanceStatus.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/InstanceStatus.php deleted file mode 100644 index 4073a44ab3bc..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/InstanceStatus.php +++ /dev/null @@ -1,182 +0,0 @@ -google.cloud.batch.v1.JobStatus.InstanceStatus - */ -class InstanceStatus extends \Google\Protobuf\Internal\Message -{ - /** - * The Compute Engine machine type. - * - * Generated from protobuf field string machine_type = 1; - */ - protected $machine_type = ''; - /** - * The VM instance provisioning model. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 2; - */ - protected $provisioning_model = 0; - /** - * The max number of tasks can be assigned to this instance type. - * - * Generated from protobuf field int64 task_pack = 3; - */ - protected $task_pack = 0; - /** - * The VM boot disk. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; - */ - protected $boot_disk = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $machine_type - * The Compute Engine machine type. - * @type int $provisioning_model - * The VM instance provisioning model. - * @type int|string $task_pack - * The max number of tasks can be assigned to this instance type. - * @type \Google\Cloud\Batch\V1\AllocationPolicy\Disk $boot_disk - * The VM boot disk. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * The Compute Engine machine type. - * - * Generated from protobuf field string machine_type = 1; - * @return string - */ - public function getMachineType() - { - return $this->machine_type; - } - - /** - * The Compute Engine machine type. - * - * Generated from protobuf field string machine_type = 1; - * @param string $var - * @return $this - */ - public function setMachineType($var) - { - GPBUtil::checkString($var, True); - $this->machine_type = $var; - - return $this; - } - - /** - * The VM instance provisioning model. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 2; - * @return int - */ - public function getProvisioningModel() - { - return $this->provisioning_model; - } - - /** - * The VM instance provisioning model. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.ProvisioningModel provisioning_model = 2; - * @param int $var - * @return $this - */ - public function setProvisioningModel($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\AllocationPolicy\ProvisioningModel::class); - $this->provisioning_model = $var; - - return $this; - } - - /** - * The max number of tasks can be assigned to this instance type. - * - * Generated from protobuf field int64 task_pack = 3; - * @return int|string - */ - public function getTaskPack() - { - return $this->task_pack; - } - - /** - * The max number of tasks can be assigned to this instance type. - * - * Generated from protobuf field int64 task_pack = 3; - * @param int|string $var - * @return $this - */ - public function setTaskPack($var) - { - GPBUtil::checkInt64($var); - $this->task_pack = $var; - - return $this; - } - - /** - * The VM boot disk. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; - * @return \Google\Cloud\Batch\V1\AllocationPolicy\Disk|null - */ - public function getBootDisk() - { - return $this->boot_disk; - } - - public function hasBootDisk() - { - return isset($this->boot_disk); - } - - public function clearBootDisk() - { - unset($this->boot_disk); - } - - /** - * The VM boot disk. - * - * Generated from protobuf field .google.cloud.batch.v1.AllocationPolicy.Disk boot_disk = 4; - * @param \Google\Cloud\Batch\V1\AllocationPolicy\Disk $var - * @return $this - */ - public function setBootDisk($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\AllocationPolicy\Disk::class); - $this->boot_disk = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(InstanceStatus::class, \Google\Cloud\Batch\V1\JobStatus_InstanceStatus::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/State.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/State.php deleted file mode 100644 index 51436382ff04..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/State.php +++ /dev/null @@ -1,94 +0,0 @@ -google.cloud.batch.v1.JobStatus.State - */ -class State -{ - /** - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Job is admitted (validated and persisted) and waiting for resources. - * - * Generated from protobuf enum QUEUED = 1; - */ - const QUEUED = 1; - /** - * Job is scheduled to run as soon as resource allocation is ready. - * The resource allocation may happen at a later time but with a high - * chance to succeed. - * - * Generated from protobuf enum SCHEDULED = 2; - */ - const SCHEDULED = 2; - /** - * Resource allocation has been successful. At least one Task in the Job is - * RUNNING. - * - * Generated from protobuf enum RUNNING = 3; - */ - const RUNNING = 3; - /** - * All Tasks in the Job have finished successfully. - * - * Generated from protobuf enum SUCCEEDED = 4; - */ - const SUCCEEDED = 4; - /** - * At least one Task in the Job has failed. - * - * Generated from protobuf enum FAILED = 5; - */ - const FAILED = 5; - /** - * The Job will be deleted, but has not been deleted yet. Typically this is - * because resources used by the Job are still being cleaned up. - * - * Generated from protobuf enum DELETION_IN_PROGRESS = 6; - */ - const DELETION_IN_PROGRESS = 6; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::QUEUED => 'QUEUED', - self::SCHEDULED => 'SCHEDULED', - self::RUNNING => 'RUNNING', - self::SUCCEEDED => 'SUCCEEDED', - self::FAILED => 'FAILED', - self::DELETION_IN_PROGRESS => 'DELETION_IN_PROGRESS', - ]; - - 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\Batch\V1\JobStatus_State::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/TaskGroupStatus.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/TaskGroupStatus.php deleted file mode 100644 index 54e870456e18..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus/TaskGroupStatus.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.batch.v1.JobStatus.TaskGroupStatus - */ -class TaskGroupStatus extends \Google\Protobuf\Internal\Message -{ - /** - * Count of task in each state in the TaskGroup. - * The map key is task state name. - * - * Generated from protobuf field map counts = 1; - */ - private $counts; - /** - * Status of instances allocated for the TaskGroup. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; - */ - private $instances; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $counts - * Count of task in each state in the TaskGroup. - * The map key is task state name. - * @type array<\Google\Cloud\Batch\V1\JobStatus\InstanceStatus>|\Google\Protobuf\Internal\RepeatedField $instances - * Status of instances allocated for the TaskGroup. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * Count of task in each state in the TaskGroup. - * The map key is task state name. - * - * Generated from protobuf field map counts = 1; - * @return \Google\Protobuf\Internal\MapField - */ - public function getCounts() - { - return $this->counts; - } - - /** - * Count of task in each state in the TaskGroup. - * The map key is task state name. - * - * Generated from protobuf field map counts = 1; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setCounts($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::INT64); - $this->counts = $arr; - - return $this; - } - - /** - * Status of instances allocated for the TaskGroup. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInstances() - { - return $this->instances; - } - - /** - * Status of instances allocated for the TaskGroup. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.JobStatus.InstanceStatus instances = 2; - * @param array<\Google\Cloud\Batch\V1\JobStatus\InstanceStatus>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInstances($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\JobStatus\InstanceStatus::class); - $this->instances = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TaskGroupStatus::class, \Google\Cloud\Batch\V1\JobStatus_TaskGroupStatus::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus_InstanceStatus.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus_InstanceStatus.php deleted file mode 100644 index 28ee6c70c337..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/JobStatus_InstanceStatus.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.batch.v1.LifecyclePolicy - */ -class LifecyclePolicy extends \Google\Protobuf\Internal\Message -{ - /** - * Action to execute when ActionCondition is true. - * When RETRY_TASK is specified, we will retry failed tasks - * if we notice any exit code match and fail tasks if no match is found. - * Likewise, when FAIL_TASK is specified, we will fail tasks - * if we notice any exit code match and retry tasks if no match is found. - * - * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; - */ - protected $action = 0; - /** - * Conditions that decide why a task failure is dealt with a specific action. - * - * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; - */ - protected $action_condition = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $action - * Action to execute when ActionCondition is true. - * When RETRY_TASK is specified, we will retry failed tasks - * if we notice any exit code match and fail tasks if no match is found. - * Likewise, when FAIL_TASK is specified, we will fail tasks - * if we notice any exit code match and retry tasks if no match is found. - * @type \Google\Cloud\Batch\V1\LifecyclePolicy\ActionCondition $action_condition - * Conditions that decide why a task failure is dealt with a specific action. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); - parent::__construct($data); - } - - /** - * Action to execute when ActionCondition is true. - * When RETRY_TASK is specified, we will retry failed tasks - * if we notice any exit code match and fail tasks if no match is found. - * Likewise, when FAIL_TASK is specified, we will fail tasks - * if we notice any exit code match and retry tasks if no match is found. - * - * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; - * @return int - */ - public function getAction() - { - return $this->action; - } - - /** - * Action to execute when ActionCondition is true. - * When RETRY_TASK is specified, we will retry failed tasks - * if we notice any exit code match and fail tasks if no match is found. - * Likewise, when FAIL_TASK is specified, we will fail tasks - * if we notice any exit code match and retry tasks if no match is found. - * - * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.Action action = 1; - * @param int $var - * @return $this - */ - public function setAction($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\LifecyclePolicy\Action::class); - $this->action = $var; - - return $this; - } - - /** - * Conditions that decide why a task failure is dealt with a specific action. - * - * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; - * @return \Google\Cloud\Batch\V1\LifecyclePolicy\ActionCondition|null - */ - public function getActionCondition() - { - return $this->action_condition; - } - - public function hasActionCondition() - { - return isset($this->action_condition); - } - - public function clearActionCondition() - { - unset($this->action_condition); - } - - /** - * Conditions that decide why a task failure is dealt with a specific action. - * - * Generated from protobuf field .google.cloud.batch.v1.LifecyclePolicy.ActionCondition action_condition = 2; - * @param \Google\Cloud\Batch\V1\LifecyclePolicy\ActionCondition $var - * @return $this - */ - public function setActionCondition($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\LifecyclePolicy\ActionCondition::class); - $this->action_condition = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/Action.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/Action.php deleted file mode 100644 index 08419071bb67..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/Action.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.batch.v1.LifecyclePolicy.Action - */ -class Action -{ - /** - * Action unspecified. - * - * Generated from protobuf enum ACTION_UNSPECIFIED = 0; - */ - const ACTION_UNSPECIFIED = 0; - /** - * Action that tasks in the group will be scheduled to re-execute. - * - * Generated from protobuf enum RETRY_TASK = 1; - */ - const RETRY_TASK = 1; - /** - * Action that tasks in the group will be stopped immediately. - * - * Generated from protobuf enum FAIL_TASK = 2; - */ - const FAIL_TASK = 2; - - private static $valueToName = [ - self::ACTION_UNSPECIFIED => 'ACTION_UNSPECIFIED', - self::RETRY_TASK => 'RETRY_TASK', - self::FAIL_TASK => 'FAIL_TASK', - ]; - - 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(Action::class, \Google\Cloud\Batch\V1\LifecyclePolicy_Action::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/ActionCondition.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/ActionCondition.php deleted file mode 100644 index acffa97a9300..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy/ActionCondition.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.batch.v1.LifecyclePolicy.ActionCondition - */ -class ActionCondition extends \Google\Protobuf\Internal\Message -{ - /** - * Exit codes of a task execution. - * If there are more than 1 exit codes, - * when task executes with any of the exit code in the list, - * the condition is met and the action will be executed. - * - * Generated from protobuf field repeated int32 exit_codes = 1; - */ - private $exit_codes; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $exit_codes - * Exit codes of a task execution. - * If there are more than 1 exit codes, - * when task executes with any of the exit code in the list, - * the condition is met and the action will be executed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); - parent::__construct($data); - } - - /** - * Exit codes of a task execution. - * If there are more than 1 exit codes, - * when task executes with any of the exit code in the list, - * the condition is met and the action will be executed. - * - * Generated from protobuf field repeated int32 exit_codes = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExitCodes() - { - return $this->exit_codes; - } - - /** - * Exit codes of a task execution. - * If there are more than 1 exit codes, - * when task executes with any of the exit code in the list, - * the condition is met and the action will be executed. - * - * Generated from protobuf field repeated int32 exit_codes = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExitCodes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); - $this->exit_codes = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ActionCondition::class, \Google\Cloud\Batch\V1\LifecyclePolicy_ActionCondition::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy_Action.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy_Action.php deleted file mode 100644 index f63ebd057b78..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LifecyclePolicy_Action.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.batch.v1.ListJobsRequest - */ -class ListJobsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Parent path. - * - * Generated from protobuf field string parent = 1; - */ - protected $parent = ''; - /** - * List filter. - * - * Generated from protobuf field string filter = 4; - */ - protected $filter = ''; - /** - * Page size. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * Page token. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Parent path. - * @type string $filter - * List filter. - * @type int $page_size - * Page size. - * @type string $page_token - * Page token. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); - parent::__construct($data); - } - - /** - * Parent path. - * - * Generated from protobuf field string parent = 1; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Parent path. - * - * Generated from protobuf field string parent = 1; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * List filter. - * - * Generated from protobuf field string filter = 4; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * List filter. - * - * Generated from protobuf field string filter = 4; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Page size. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Page size. - * - * 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; - } - - /** - * Page token. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Page token. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListJobsResponse.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListJobsResponse.php deleted file mode 100644 index 9874dbeed530..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListJobsResponse.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.batch.v1.ListJobsResponse - */ -class ListJobsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Jobs. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.Job jobs = 1; - */ - private $jobs; - /** - * Next page token. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Batch\V1\Job>|\Google\Protobuf\Internal\RepeatedField $jobs - * Jobs. - * @type string $next_page_token - * Next page token. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); - parent::__construct($data); - } - - /** - * Jobs. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.Job jobs = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getJobs() - { - return $this->jobs; - } - - /** - * Jobs. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.Job jobs = 1; - * @param array<\Google\Cloud\Batch\V1\Job>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setJobs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\Job::class); - $this->jobs = $arr; - - return $this; - } - - /** - * Next page token. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Next page token. - * - * 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; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksRequest.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksRequest.php deleted file mode 100644 index ab6b618343d7..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksRequest.php +++ /dev/null @@ -1,185 +0,0 @@ -google.cloud.batch.v1.ListTasksRequest - */ -class ListTasksRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - * - * Generated from protobuf field string filter = 2; - */ - protected $filter = ''; - /** - * Page size. - * - * Generated from protobuf field int32 page_size = 3; - */ - protected $page_size = 0; - /** - * Page token. - * - * Generated from protobuf field string page_token = 4; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - * @type string $filter - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - * @type int $page_size - * Page size. - * @type string $page_token - * Page token. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - * - * 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. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - * - * 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; - } - - /** - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - * - * Generated from protobuf field string filter = 2; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - * - * Generated from protobuf field string filter = 2; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * Page size. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Page size. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Page token. - * - * Generated from protobuf field string page_token = 4; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Page token. - * - * Generated from protobuf field string page_token = 4; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksResponse.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksResponse.php deleted file mode 100644 index 7209c2e30a9f..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/ListTasksResponse.php +++ /dev/null @@ -1,135 +0,0 @@ -google.cloud.batch.v1.ListTasksResponse - */ -class ListTasksResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Tasks. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.Task tasks = 1; - */ - private $tasks; - /** - * Next page token. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Batch\V1\Task>|\Google\Protobuf\Internal\RepeatedField $tasks - * Tasks. - * @type string $next_page_token - * Next page token. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * Locations that could not be reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); - parent::__construct($data); - } - - /** - * Tasks. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.Task tasks = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTasks() - { - return $this->tasks; - } - - /** - * Tasks. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.Task tasks = 1; - * @param array<\Google\Cloud\Batch\V1\Task>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTasks($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\Task::class); - $this->tasks = $arr; - - return $this; - } - - /** - * Next page token. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Next page token. - * - * 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; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Locations that could not be reached. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy.php deleted file mode 100644 index 0d9e659378b6..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy.php +++ /dev/null @@ -1,110 +0,0 @@ -google.cloud.batch.v1.LogsPolicy - */ -class LogsPolicy extends \Google\Protobuf\Internal\Message -{ - /** - * Where logs should be saved. - * - * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy.Destination destination = 1; - */ - protected $destination = 0; - /** - * The path to which logs are saved when the destination = PATH. This can be a - * local file path on the VM, or under the mount point of a Persistent Disk or - * Filestore, or a Cloud Storage path. - * - * Generated from protobuf field string logs_path = 2; - */ - protected $logs_path = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $destination - * Where logs should be saved. - * @type string $logs_path - * The path to which logs are saved when the destination = PATH. This can be a - * local file path on the VM, or under the mount point of a Persistent Disk or - * Filestore, or a Cloud Storage path. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * Where logs should be saved. - * - * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy.Destination destination = 1; - * @return int - */ - public function getDestination() - { - return $this->destination; - } - - /** - * Where logs should be saved. - * - * Generated from protobuf field .google.cloud.batch.v1.LogsPolicy.Destination destination = 1; - * @param int $var - * @return $this - */ - public function setDestination($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\LogsPolicy\Destination::class); - $this->destination = $var; - - return $this; - } - - /** - * The path to which logs are saved when the destination = PATH. This can be a - * local file path on the VM, or under the mount point of a Persistent Disk or - * Filestore, or a Cloud Storage path. - * - * Generated from protobuf field string logs_path = 2; - * @return string - */ - public function getLogsPath() - { - return $this->logs_path; - } - - /** - * The path to which logs are saved when the destination = PATH. This can be a - * local file path on the VM, or under the mount point of a Persistent Disk or - * Filestore, or a Cloud Storage path. - * - * Generated from protobuf field string logs_path = 2; - * @param string $var - * @return $this - */ - public function setLogsPath($var) - { - GPBUtil::checkString($var, True); - $this->logs_path = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy/Destination.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy/Destination.php deleted file mode 100644 index 1f87d09d632d..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy/Destination.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.batch.v1.LogsPolicy.Destination - */ -class Destination -{ - /** - * Logs are not preserved. - * - * Generated from protobuf enum DESTINATION_UNSPECIFIED = 0; - */ - const DESTINATION_UNSPECIFIED = 0; - /** - * Logs are streamed to Cloud Logging. - * - * Generated from protobuf enum CLOUD_LOGGING = 1; - */ - const CLOUD_LOGGING = 1; - /** - * Logs are saved to a file path. - * - * Generated from protobuf enum PATH = 2; - */ - const PATH = 2; - - private static $valueToName = [ - self::DESTINATION_UNSPECIFIED => 'DESTINATION_UNSPECIFIED', - self::CLOUD_LOGGING => 'CLOUD_LOGGING', - self::PATH => 'PATH', - ]; - - 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(Destination::class, \Google\Cloud\Batch\V1\LogsPolicy_Destination::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy_Destination.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy_Destination.php deleted file mode 100644 index 5540f3354925..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/LogsPolicy_Destination.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.batch.v1.NFS - */ -class NFS extends \Google\Protobuf\Internal\Message -{ - /** - * The IP address of the NFS. - * - * Generated from protobuf field string server = 1; - */ - protected $server = ''; - /** - * Remote source path exported from the NFS, e.g., "/share". - * - * Generated from protobuf field string remote_path = 2; - */ - protected $remote_path = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $server - * The IP address of the NFS. - * @type string $remote_path - * Remote source path exported from the NFS, e.g., "/share". - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Volume::initOnce(); - parent::__construct($data); - } - - /** - * The IP address of the NFS. - * - * Generated from protobuf field string server = 1; - * @return string - */ - public function getServer() - { - return $this->server; - } - - /** - * The IP address of the NFS. - * - * 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; - } - - /** - * Remote source path exported from the NFS, e.g., "/share". - * - * Generated from protobuf field string remote_path = 2; - * @return string - */ - public function getRemotePath() - { - return $this->remote_path; - } - - /** - * Remote source path exported from the NFS, e.g., "/share". - * - * Generated from protobuf field string remote_path = 2; - * @param string $var - * @return $this - */ - public function setRemotePath($var) - { - GPBUtil::checkString($var, True); - $this->remote_path = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/OperationMetadata.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/OperationMetadata.php deleted file mode 100644 index 6a98d039d45c..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/OperationMetadata.php +++ /dev/null @@ -1,307 +0,0 @@ -google.cloud.batch.v1.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_time = null; - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $target = ''; - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $verb = ''; - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $status_message = ''; - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $requested_cancellation = false; - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $api_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the operation finished running. - * @type string $target - * Output only. Server-defined resource path for the target of the operation. - * @type string $verb - * Output only. Name of the verb executed by the operation. - * @type string $status_message - * Output only. Human-readable status of the operation, if any. - * @type bool $requested_cancellation - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * @type string $api_version - * Output only. API version used to start the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Batch::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.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 time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.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 time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusMessage() - { - return $this->status_message; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusMessage($var) - { - GPBUtil::checkString($var, True); - $this->status_message = $var; - - return $this; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getRequestedCancellation() - { - return $this->requested_cancellation; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setRequestedCancellation($var) - { - GPBUtil::checkBool($var); - $this->requested_cancellation = $var; - - return $this; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable.php deleted file mode 100644 index 14c8f5a01604..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable.php +++ /dev/null @@ -1,372 +0,0 @@ -google.cloud.batch.v1.Runnable - */ -class Runnable extends \Google\Protobuf\Internal\Message -{ - /** - * Normally, a non-zero exit status causes the Task to fail. This flag allows - * execution of other Runnables to continue instead. - * - * Generated from protobuf field bool ignore_exit_status = 3; - */ - protected $ignore_exit_status = false; - /** - * This flag allows a Runnable to continue running in the background while the - * Task executes subsequent Runnables. This is useful to provide services to - * other Runnables (or to provide debugging support tools like SSH servers). - * - * Generated from protobuf field bool background = 4; - */ - protected $background = false; - /** - * By default, after a Runnable fails, no further Runnable are executed. This - * flag indicates that this Runnable must be run even if the Task has already - * failed. This is useful for Runnables that copy output files off of the VM - * or for debugging. - * The always_run flag does not override the Task's overall max_run_duration. - * If the max_run_duration has expired then no further Runnables will execute, - * not even always_run Runnables. - * - * Generated from protobuf field bool always_run = 5; - */ - protected $always_run = false; - /** - * Environment variables for this Runnable (overrides variables set for the - * whole Task or TaskGroup). - * - * Generated from protobuf field .google.cloud.batch.v1.Environment environment = 7; - */ - protected $environment = null; - /** - * Timeout for this Runnable. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 8; - */ - protected $timeout = null; - protected $executable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Batch\V1\Runnable\Container $container - * Container runnable. - * @type \Google\Cloud\Batch\V1\Runnable\Script $script - * Script runnable. - * @type \Google\Cloud\Batch\V1\Runnable\Barrier $barrier - * Barrier runnable. - * @type bool $ignore_exit_status - * Normally, a non-zero exit status causes the Task to fail. This flag allows - * execution of other Runnables to continue instead. - * @type bool $background - * This flag allows a Runnable to continue running in the background while the - * Task executes subsequent Runnables. This is useful to provide services to - * other Runnables (or to provide debugging support tools like SSH servers). - * @type bool $always_run - * By default, after a Runnable fails, no further Runnable are executed. This - * flag indicates that this Runnable must be run even if the Task has already - * failed. This is useful for Runnables that copy output files off of the VM - * or for debugging. - * The always_run flag does not override the Task's overall max_run_duration. - * If the max_run_duration has expired then no further Runnables will execute, - * not even always_run Runnables. - * @type \Google\Cloud\Batch\V1\Environment $environment - * Environment variables for this Runnable (overrides variables set for the - * whole Task or TaskGroup). - * @type \Google\Protobuf\Duration $timeout - * Timeout for this Runnable. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); - parent::__construct($data); - } - - /** - * Container runnable. - * - * Generated from protobuf field .google.cloud.batch.v1.Runnable.Container container = 1; - * @return \Google\Cloud\Batch\V1\Runnable\Container|null - */ - public function getContainer() - { - return $this->readOneof(1); - } - - public function hasContainer() - { - return $this->hasOneof(1); - } - - /** - * Container runnable. - * - * Generated from protobuf field .google.cloud.batch.v1.Runnable.Container container = 1; - * @param \Google\Cloud\Batch\V1\Runnable\Container $var - * @return $this - */ - public function setContainer($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Runnable\Container::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Script runnable. - * - * Generated from protobuf field .google.cloud.batch.v1.Runnable.Script script = 2; - * @return \Google\Cloud\Batch\V1\Runnable\Script|null - */ - public function getScript() - { - return $this->readOneof(2); - } - - public function hasScript() - { - return $this->hasOneof(2); - } - - /** - * Script runnable. - * - * Generated from protobuf field .google.cloud.batch.v1.Runnable.Script script = 2; - * @param \Google\Cloud\Batch\V1\Runnable\Script $var - * @return $this - */ - public function setScript($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Runnable\Script::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Barrier runnable. - * - * Generated from protobuf field .google.cloud.batch.v1.Runnable.Barrier barrier = 6; - * @return \Google\Cloud\Batch\V1\Runnable\Barrier|null - */ - public function getBarrier() - { - return $this->readOneof(6); - } - - public function hasBarrier() - { - return $this->hasOneof(6); - } - - /** - * Barrier runnable. - * - * Generated from protobuf field .google.cloud.batch.v1.Runnable.Barrier barrier = 6; - * @param \Google\Cloud\Batch\V1\Runnable\Barrier $var - * @return $this - */ - public function setBarrier($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Runnable\Barrier::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * Normally, a non-zero exit status causes the Task to fail. This flag allows - * execution of other Runnables to continue instead. - * - * Generated from protobuf field bool ignore_exit_status = 3; - * @return bool - */ - public function getIgnoreExitStatus() - { - return $this->ignore_exit_status; - } - - /** - * Normally, a non-zero exit status causes the Task to fail. This flag allows - * execution of other Runnables to continue instead. - * - * Generated from protobuf field bool ignore_exit_status = 3; - * @param bool $var - * @return $this - */ - public function setIgnoreExitStatus($var) - { - GPBUtil::checkBool($var); - $this->ignore_exit_status = $var; - - return $this; - } - - /** - * This flag allows a Runnable to continue running in the background while the - * Task executes subsequent Runnables. This is useful to provide services to - * other Runnables (or to provide debugging support tools like SSH servers). - * - * Generated from protobuf field bool background = 4; - * @return bool - */ - public function getBackground() - { - return $this->background; - } - - /** - * This flag allows a Runnable to continue running in the background while the - * Task executes subsequent Runnables. This is useful to provide services to - * other Runnables (or to provide debugging support tools like SSH servers). - * - * Generated from protobuf field bool background = 4; - * @param bool $var - * @return $this - */ - public function setBackground($var) - { - GPBUtil::checkBool($var); - $this->background = $var; - - return $this; - } - - /** - * By default, after a Runnable fails, no further Runnable are executed. This - * flag indicates that this Runnable must be run even if the Task has already - * failed. This is useful for Runnables that copy output files off of the VM - * or for debugging. - * The always_run flag does not override the Task's overall max_run_duration. - * If the max_run_duration has expired then no further Runnables will execute, - * not even always_run Runnables. - * - * Generated from protobuf field bool always_run = 5; - * @return bool - */ - public function getAlwaysRun() - { - return $this->always_run; - } - - /** - * By default, after a Runnable fails, no further Runnable are executed. This - * flag indicates that this Runnable must be run even if the Task has already - * failed. This is useful for Runnables that copy output files off of the VM - * or for debugging. - * The always_run flag does not override the Task's overall max_run_duration. - * If the max_run_duration has expired then no further Runnables will execute, - * not even always_run Runnables. - * - * Generated from protobuf field bool always_run = 5; - * @param bool $var - * @return $this - */ - public function setAlwaysRun($var) - { - GPBUtil::checkBool($var); - $this->always_run = $var; - - return $this; - } - - /** - * Environment variables for this Runnable (overrides variables set for the - * whole Task or TaskGroup). - * - * Generated from protobuf field .google.cloud.batch.v1.Environment environment = 7; - * @return \Google\Cloud\Batch\V1\Environment|null - */ - public function getEnvironment() - { - return $this->environment; - } - - public function hasEnvironment() - { - return isset($this->environment); - } - - public function clearEnvironment() - { - unset($this->environment); - } - - /** - * Environment variables for this Runnable (overrides variables set for the - * whole Task or TaskGroup). - * - * Generated from protobuf field .google.cloud.batch.v1.Environment environment = 7; - * @param \Google\Cloud\Batch\V1\Environment $var - * @return $this - */ - public function setEnvironment($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Environment::class); - $this->environment = $var; - - return $this; - } - - /** - * Timeout for this Runnable. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 8; - * @return \Google\Protobuf\Duration|null - */ - public function getTimeout() - { - return $this->timeout; - } - - public function hasTimeout() - { - return isset($this->timeout); - } - - public function clearTimeout() - { - unset($this->timeout); - } - - /** - * Timeout for this Runnable. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 8; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setTimeout($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->timeout = $var; - - return $this; - } - - /** - * @return string - */ - public function getExecutable() - { - return $this->whichOneof("executable"); - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Barrier.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Barrier.php deleted file mode 100644 index 189d5e8cb44c..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Barrier.php +++ /dev/null @@ -1,74 +0,0 @@ -google.cloud.batch.v1.Runnable.Barrier - */ -class Barrier extends \Google\Protobuf\Internal\Message -{ - /** - * Barriers are identified by their index in runnable list. - * Names are not required, but if present should be an identifier. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Barriers are identified by their index in runnable list. - * Names are not required, but if present should be an identifier. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); - parent::__construct($data); - } - - /** - * Barriers are identified by their index in runnable list. - * Names are not required, but if present should be an identifier. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Barriers are identified by their index in runnable list. - * Names are not required, but if present should be an identifier. - * - * 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; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Barrier::class, \Google\Cloud\Batch\V1\Runnable_Barrier::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Container.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Container.php deleted file mode 100644 index c3301d6c2f2d..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Container.php +++ /dev/null @@ -1,352 +0,0 @@ -google.cloud.batch.v1.Runnable.Container - */ -class Container extends \Google\Protobuf\Internal\Message -{ - /** - * The URI to pull the container image from. - * - * Generated from protobuf field string image_uri = 1; - */ - protected $image_uri = ''; - /** - * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT - * (either in the container image or with the entrypoint field below) then - * commands are appended as arguments to the ENTRYPOINT. - * - * Generated from protobuf field repeated string commands = 2; - */ - private $commands; - /** - * Overrides the `ENTRYPOINT` specified in the container. - * - * Generated from protobuf field string entrypoint = 3; - */ - protected $entrypoint = ''; - /** - * Volumes to mount (bind mount) from the host machine files or directories - * into the container, formatted to match docker run's --volume option, - * e.g. /foo:/bar, or /foo:/bar:ro - * - * Generated from protobuf field repeated string volumes = 7; - */ - private $volumes; - /** - * Arbitrary additional options to include in the "docker run" command when - * running this container, e.g. "--network host". - * - * Generated from protobuf field string options = 8; - */ - protected $options = ''; - /** - * If set to true, external network access to and from container will be - * blocked. The container will use the default internal network - * 'goog-internal'. - * - * Generated from protobuf field bool block_external_network = 9; - */ - protected $block_external_network = false; - /** - * Optional username for logging in to a docker registry. If username - * matches `projects/*/secrets/*/versions/*` then Batch will read the - * username from the Secret Manager. - * - * Generated from protobuf field string username = 10; - */ - protected $username = ''; - /** - * Optional password for logging in to a docker registry. If password - * matches `projects/*/secrets/*/versions/*` then Batch will read the - * password from the Secret Manager; - * - * Generated from protobuf field string password = 11; - */ - protected $password = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $image_uri - * The URI to pull the container image from. - * @type array|\Google\Protobuf\Internal\RepeatedField $commands - * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT - * (either in the container image or with the entrypoint field below) then - * commands are appended as arguments to the ENTRYPOINT. - * @type string $entrypoint - * Overrides the `ENTRYPOINT` specified in the container. - * @type array|\Google\Protobuf\Internal\RepeatedField $volumes - * Volumes to mount (bind mount) from the host machine files or directories - * into the container, formatted to match docker run's --volume option, - * e.g. /foo:/bar, or /foo:/bar:ro - * @type string $options - * Arbitrary additional options to include in the "docker run" command when - * running this container, e.g. "--network host". - * @type bool $block_external_network - * If set to true, external network access to and from container will be - * blocked. The container will use the default internal network - * 'goog-internal'. - * @type string $username - * Optional username for logging in to a docker registry. If username - * matches `projects/*/secrets/*/versions/*` then Batch will read the - * username from the Secret Manager. - * @type string $password - * Optional password for logging in to a docker registry. If password - * matches `projects/*/secrets/*/versions/*` then Batch will read the - * password from the Secret Manager; - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); - parent::__construct($data); - } - - /** - * The URI to pull the container image from. - * - * Generated from protobuf field string image_uri = 1; - * @return string - */ - public function getImageUri() - { - return $this->image_uri; - } - - /** - * The URI to pull the container image from. - * - * Generated from protobuf field string image_uri = 1; - * @param string $var - * @return $this - */ - public function setImageUri($var) - { - GPBUtil::checkString($var, True); - $this->image_uri = $var; - - return $this; - } - - /** - * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT - * (either in the container image or with the entrypoint field below) then - * commands are appended as arguments to the ENTRYPOINT. - * - * Generated from protobuf field repeated string commands = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCommands() - { - return $this->commands; - } - - /** - * Overrides the `CMD` specified in the container. If there is an ENTRYPOINT - * (either in the container image or with the entrypoint field below) then - * commands are appended as arguments to the ENTRYPOINT. - * - * Generated from protobuf field repeated string commands = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCommands($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->commands = $arr; - - return $this; - } - - /** - * Overrides the `ENTRYPOINT` specified in the container. - * - * Generated from protobuf field string entrypoint = 3; - * @return string - */ - public function getEntrypoint() - { - return $this->entrypoint; - } - - /** - * Overrides the `ENTRYPOINT` specified in the container. - * - * Generated from protobuf field string entrypoint = 3; - * @param string $var - * @return $this - */ - public function setEntrypoint($var) - { - GPBUtil::checkString($var, True); - $this->entrypoint = $var; - - return $this; - } - - /** - * Volumes to mount (bind mount) from the host machine files or directories - * into the container, formatted to match docker run's --volume option, - * e.g. /foo:/bar, or /foo:/bar:ro - * - * Generated from protobuf field repeated string volumes = 7; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getVolumes() - { - return $this->volumes; - } - - /** - * Volumes to mount (bind mount) from the host machine files or directories - * into the container, formatted to match docker run's --volume option, - * e.g. /foo:/bar, or /foo:/bar:ro - * - * Generated from protobuf field repeated string volumes = 7; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setVolumes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->volumes = $arr; - - return $this; - } - - /** - * Arbitrary additional options to include in the "docker run" command when - * running this container, e.g. "--network host". - * - * Generated from protobuf field string options = 8; - * @return string - */ - public function getOptions() - { - return $this->options; - } - - /** - * Arbitrary additional options to include in the "docker run" command when - * running this container, e.g. "--network host". - * - * Generated from protobuf field string options = 8; - * @param string $var - * @return $this - */ - public function setOptions($var) - { - GPBUtil::checkString($var, True); - $this->options = $var; - - return $this; - } - - /** - * If set to true, external network access to and from container will be - * blocked. The container will use the default internal network - * 'goog-internal'. - * - * Generated from protobuf field bool block_external_network = 9; - * @return bool - */ - public function getBlockExternalNetwork() - { - return $this->block_external_network; - } - - /** - * If set to true, external network access to and from container will be - * blocked. The container will use the default internal network - * 'goog-internal'. - * - * Generated from protobuf field bool block_external_network = 9; - * @param bool $var - * @return $this - */ - public function setBlockExternalNetwork($var) - { - GPBUtil::checkBool($var); - $this->block_external_network = $var; - - return $this; - } - - /** - * Optional username for logging in to a docker registry. If username - * matches `projects/*/secrets/*/versions/*` then Batch will read the - * username from the Secret Manager. - * - * Generated from protobuf field string username = 10; - * @return string - */ - public function getUsername() - { - return $this->username; - } - - /** - * Optional username for logging in to a docker registry. If username - * matches `projects/*/secrets/*/versions/*` then Batch will read the - * username from the Secret Manager. - * - * Generated from protobuf field string username = 10; - * @param string $var - * @return $this - */ - public function setUsername($var) - { - GPBUtil::checkString($var, True); - $this->username = $var; - - return $this; - } - - /** - * Optional password for logging in to a docker registry. If password - * matches `projects/*/secrets/*/versions/*` then Batch will read the - * password from the Secret Manager; - * - * Generated from protobuf field string password = 11; - * @return string - */ - public function getPassword() - { - return $this->password; - } - - /** - * Optional password for logging in to a docker registry. If password - * matches `projects/*/secrets/*/versions/*` then Batch will read the - * password from the Secret Manager; - * - * Generated from protobuf field string password = 11; - * @param string $var - * @return $this - */ - public function setPassword($var) - { - GPBUtil::checkString($var, True); - $this->password = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Container::class, \Google\Cloud\Batch\V1\Runnable_Container::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Script.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Script.php deleted file mode 100644 index ea9a5725b610..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable/Script.php +++ /dev/null @@ -1,147 +0,0 @@ -google.cloud.batch.v1.Runnable.Script - */ -class Script extends \Google\Protobuf\Internal\Message -{ - protected $command; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $path - * Script file path on the host VM. - * To specify an interpreter, please add a `#!`(also known as - * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the - * first line of the file.(For example, to execute the script using bash, - * `#!/bin/bash` should be the first line of the file. To execute the - * script using`Python3`, `#!/usr/bin/env python3` should be the first - * line of the file.) Otherwise, the file will by default be excuted by - * `/bin/sh`. - * @type string $text - * Shell script text. - * To specify an interpreter, please add a `#!\n` at the - * beginning of the text.(For example, to execute the script using bash, - * `#!/bin/bash\n` should be added. To execute the script using`Python3`, - * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will - * by default be excuted by `/bin/sh`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); - parent::__construct($data); - } - - /** - * Script file path on the host VM. - * To specify an interpreter, please add a `#!`(also known as - * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the - * first line of the file.(For example, to execute the script using bash, - * `#!/bin/bash` should be the first line of the file. To execute the - * script using`Python3`, `#!/usr/bin/env python3` should be the first - * line of the file.) Otherwise, the file will by default be excuted by - * `/bin/sh`. - * - * Generated from protobuf field string path = 1; - * @return string - */ - public function getPath() - { - return $this->readOneof(1); - } - - public function hasPath() - { - return $this->hasOneof(1); - } - - /** - * Script file path on the host VM. - * To specify an interpreter, please add a `#!`(also known as - * [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the - * first line of the file.(For example, to execute the script using bash, - * `#!/bin/bash` should be the first line of the file. To execute the - * script using`Python3`, `#!/usr/bin/env python3` should be the first - * line of the file.) Otherwise, the file will by default be excuted by - * `/bin/sh`. - * - * Generated from protobuf field string path = 1; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Shell script text. - * To specify an interpreter, please add a `#!\n` at the - * beginning of the text.(For example, to execute the script using bash, - * `#!/bin/bash\n` should be added. To execute the script using`Python3`, - * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will - * by default be excuted by `/bin/sh`. - * - * Generated from protobuf field string text = 2; - * @return string - */ - public function getText() - { - return $this->readOneof(2); - } - - public function hasText() - { - return $this->hasOneof(2); - } - - /** - * Shell script text. - * To specify an interpreter, please add a `#!\n` at the - * beginning of the text.(For example, to execute the script using bash, - * `#!/bin/bash\n` should be added. To execute the script using`Python3`, - * `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will - * by default be excuted by `/bin/sh`. - * - * Generated from protobuf field string text = 2; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getCommand() - { - return $this->whichOneof("command"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Script::class, \Google\Cloud\Batch\V1\Runnable_Script::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable_Barrier.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable_Barrier.php deleted file mode 100644 index 795138775fad..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Runnable_Barrier.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.batch.v1.ServiceAccount - */ -class ServiceAccount extends \Google\Protobuf\Internal\Message -{ - /** - * Email address of the service account. If not specified, the default - * Compute Engine service account for the project will be used. If instance - * template is being used, the service account has to be specified in the - * instance template and it has to match the email field here. - * - * Generated from protobuf field string email = 1; - */ - protected $email = ''; - /** - * List of scopes to be enabled for this service account on the VM, in - * addition to the cloud-platform API scope that will be added by default. - * - * Generated from protobuf field repeated string scopes = 2; - */ - private $scopes; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $email - * Email address of the service account. If not specified, the default - * Compute Engine service account for the project will be used. If instance - * template is being used, the service account has to be specified in the - * instance template and it has to match the email field here. - * @type array|\Google\Protobuf\Internal\RepeatedField $scopes - * List of scopes to be enabled for this service account on the VM, in - * addition to the cloud-platform API scope that will be added by default. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * Email address of the service account. If not specified, the default - * Compute Engine service account for the project will be used. If instance - * template is being used, the service account has to be specified in the - * instance template and it has to match the email field here. - * - * Generated from protobuf field string email = 1; - * @return string - */ - public function getEmail() - { - return $this->email; - } - - /** - * Email address of the service account. If not specified, the default - * Compute Engine service account for the project will be used. If instance - * template is being used, the service account has to be specified in the - * instance template and it has to match the email field here. - * - * Generated from protobuf field string email = 1; - * @param string $var - * @return $this - */ - public function setEmail($var) - { - GPBUtil::checkString($var, True); - $this->email = $var; - - return $this; - } - - /** - * List of scopes to be enabled for this service account on the VM, in - * addition to the cloud-platform API scope that will be added by default. - * - * Generated from protobuf field repeated string scopes = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getScopes() - { - return $this->scopes; - } - - /** - * List of scopes to be enabled for this service account on the VM, in - * addition to the cloud-platform API scope that will be added by default. - * - * Generated from protobuf field repeated string scopes = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setScopes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->scopes = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/StatusEvent.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/StatusEvent.php deleted file mode 100644 index 293cb8c7bc93..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/StatusEvent.php +++ /dev/null @@ -1,223 +0,0 @@ -google.cloud.batch.v1.StatusEvent - */ -class StatusEvent extends \Google\Protobuf\Internal\Message -{ - /** - * Type of the event. - * - * Generated from protobuf field string type = 3; - */ - protected $type = ''; - /** - * Description of the event. - * - * Generated from protobuf field string description = 1; - */ - protected $description = ''; - /** - * The time this event occurred. - * - * Generated from protobuf field .google.protobuf.Timestamp event_time = 2; - */ - protected $event_time = null; - /** - * Task Execution - * - * Generated from protobuf field .google.cloud.batch.v1.TaskExecution task_execution = 4; - */ - protected $task_execution = null; - /** - * Task State - * - * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State task_state = 5; - */ - protected $task_state = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $type - * Type of the event. - * @type string $description - * Description of the event. - * @type \Google\Protobuf\Timestamp $event_time - * The time this event occurred. - * @type \Google\Cloud\Batch\V1\TaskExecution $task_execution - * Task Execution - * @type int $task_state - * Task State - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); - parent::__construct($data); - } - - /** - * Type of the event. - * - * Generated from protobuf field string type = 3; - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Type of the event. - * - * Generated from protobuf field string type = 3; - * @param string $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkString($var, True); - $this->type = $var; - - return $this; - } - - /** - * Description of the event. - * - * Generated from protobuf field string description = 1; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Description of the event. - * - * Generated from protobuf field string description = 1; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * The time this event occurred. - * - * Generated from protobuf field .google.protobuf.Timestamp event_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEventTime() - { - return $this->event_time; - } - - public function hasEventTime() - { - return isset($this->event_time); - } - - public function clearEventTime() - { - unset($this->event_time); - } - - /** - * The time this event occurred. - * - * Generated from protobuf field .google.protobuf.Timestamp event_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEventTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->event_time = $var; - - return $this; - } - - /** - * Task Execution - * - * Generated from protobuf field .google.cloud.batch.v1.TaskExecution task_execution = 4; - * @return \Google\Cloud\Batch\V1\TaskExecution|null - */ - public function getTaskExecution() - { - return $this->task_execution; - } - - public function hasTaskExecution() - { - return isset($this->task_execution); - } - - public function clearTaskExecution() - { - unset($this->task_execution); - } - - /** - * Task Execution - * - * Generated from protobuf field .google.cloud.batch.v1.TaskExecution task_execution = 4; - * @param \Google\Cloud\Batch\V1\TaskExecution $var - * @return $this - */ - public function setTaskExecution($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\TaskExecution::class); - $this->task_execution = $var; - - return $this; - } - - /** - * Task State - * - * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State task_state = 5; - * @return int - */ - public function getTaskState() - { - return $this->task_state; - } - - /** - * Task State - * - * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State task_state = 5; - * @param int $var - * @return $this - */ - public function setTaskState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\TaskStatus\State::class); - $this->task_state = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Task.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Task.php deleted file mode 100644 index c034a667462e..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/Task.php +++ /dev/null @@ -1,123 +0,0 @@ -google.cloud.batch.v1.Task - */ -class Task extends \Google\Protobuf\Internal\Message -{ - /** - * Task name. - * The name is generated from the parent TaskGroup name and 'id' field. - * For example: - * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Task Status. - * - * Generated from protobuf field .google.cloud.batch.v1.TaskStatus status = 2; - */ - protected $status = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Task name. - * The name is generated from the parent TaskGroup name and 'id' field. - * For example: - * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". - * @type \Google\Cloud\Batch\V1\TaskStatus $status - * Task Status. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); - parent::__construct($data); - } - - /** - * Task name. - * The name is generated from the parent TaskGroup name and 'id' field. - * For example: - * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Task name. - * The name is generated from the parent TaskGroup name and 'id' field. - * For example: - * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". - * - * 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; - } - - /** - * Task Status. - * - * Generated from protobuf field .google.cloud.batch.v1.TaskStatus status = 2; - * @return \Google\Cloud\Batch\V1\TaskStatus|null - */ - public function getStatus() - { - return $this->status; - } - - public function hasStatus() - { - return isset($this->status); - } - - public function clearStatus() - { - unset($this->status); - } - - /** - * Task Status. - * - * Generated from protobuf field .google.cloud.batch.v1.TaskStatus status = 2; - * @param \Google\Cloud\Batch\V1\TaskStatus $var - * @return $this - */ - public function setStatus($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\TaskStatus::class); - $this->status = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskExecution.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskExecution.php deleted file mode 100644 index f8c79be6c535..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskExecution.php +++ /dev/null @@ -1,72 +0,0 @@ -google.cloud.batch.v1.TaskExecution - */ -class TaskExecution extends \Google\Protobuf\Internal\Message -{ - /** - * When task is completed as the status of FAILED or SUCCEEDED, - * exit code is for one task execution result, default is 0 as success. - * - * Generated from protobuf field int32 exit_code = 1; - */ - protected $exit_code = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $exit_code - * When task is completed as the status of FAILED or SUCCEEDED, - * exit code is for one task execution result, default is 0 as success. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); - parent::__construct($data); - } - - /** - * When task is completed as the status of FAILED or SUCCEEDED, - * exit code is for one task execution result, default is 0 as success. - * - * Generated from protobuf field int32 exit_code = 1; - * @return int - */ - public function getExitCode() - { - return $this->exit_code; - } - - /** - * When task is completed as the status of FAILED or SUCCEEDED, - * exit code is for one task execution result, default is 0 as success. - * - * Generated from protobuf field int32 exit_code = 1; - * @param int $var - * @return $this - */ - public function setExitCode($var) - { - GPBUtil::checkInt32($var); - $this->exit_code = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskGroup.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskGroup.php deleted file mode 100644 index c1d66ac65511..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskGroup.php +++ /dev/null @@ -1,388 +0,0 @@ -google.cloud.batch.v1.TaskGroup - */ -class TaskGroup extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. TaskGroup name. - * The system generates this field based on parent Job name. - * For example: - * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Required. Tasks in the group share the same task spec. - * - * Generated from protobuf field .google.cloud.batch.v1.TaskSpec task_spec = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $task_spec = null; - /** - * Number of Tasks in the TaskGroup. - * default is 1 - * - * Generated from protobuf field int64 task_count = 4; - */ - protected $task_count = 0; - /** - * Max number of tasks that can run in parallel. - * Default to min(task_count, 1000). - * - * Generated from protobuf field int64 parallelism = 5; - */ - protected $parallelism = 0; - /** - * An array of environment variable mappings, which are passed to Tasks with - * matching indices. If task_environments is used then task_count should - * not be specified in the request (and will be ignored). Task count will be - * the length of task_environments. - * Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in - * addition to any environment variables set in task_environments, specifying - * the number of Tasks in the Task's parent TaskGroup, and the specific Task's - * index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). - * task_environments supports up to 200 entries. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.Environment task_environments = 9; - */ - private $task_environments; - /** - * Max number of tasks that can be run on a VM at the same time. - * If not specified, the system will decide a value based on available - * compute resources on a VM and task requirements. - * - * Generated from protobuf field int64 task_count_per_node = 10; - */ - protected $task_count_per_node = 0; - /** - * When true, Batch will populate a file with a list of all VMs assigned to - * the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path - * of that file. Defaults to false. - * - * Generated from protobuf field bool require_hosts_file = 11; - */ - protected $require_hosts_file = false; - /** - * When true, Batch will configure SSH to allow passwordless login between - * VMs running the Batch tasks in the same TaskGroup. - * - * Generated from protobuf field bool permissive_ssh = 12; - */ - protected $permissive_ssh = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. TaskGroup name. - * The system generates this field based on parent Job name. - * For example: - * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". - * @type \Google\Cloud\Batch\V1\TaskSpec $task_spec - * Required. Tasks in the group share the same task spec. - * @type int|string $task_count - * Number of Tasks in the TaskGroup. - * default is 1 - * @type int|string $parallelism - * Max number of tasks that can run in parallel. - * Default to min(task_count, 1000). - * @type array<\Google\Cloud\Batch\V1\Environment>|\Google\Protobuf\Internal\RepeatedField $task_environments - * An array of environment variable mappings, which are passed to Tasks with - * matching indices. If task_environments is used then task_count should - * not be specified in the request (and will be ignored). Task count will be - * the length of task_environments. - * Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in - * addition to any environment variables set in task_environments, specifying - * the number of Tasks in the Task's parent TaskGroup, and the specific Task's - * index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). - * task_environments supports up to 200 entries. - * @type int|string $task_count_per_node - * Max number of tasks that can be run on a VM at the same time. - * If not specified, the system will decide a value based on available - * compute resources on a VM and task requirements. - * @type bool $require_hosts_file - * When true, Batch will populate a file with a list of all VMs assigned to - * the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path - * of that file. Defaults to false. - * @type bool $permissive_ssh - * When true, Batch will configure SSH to allow passwordless login between - * VMs running the Batch tasks in the same TaskGroup. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce(); - parent::__construct($data); - } - - /** - * Output only. TaskGroup name. - * The system generates this field based on parent Job name. - * For example: - * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. TaskGroup name. - * The system generates this field based on parent Job name. - * For example: - * "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". - * - * 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; - } - - /** - * Required. Tasks in the group share the same task spec. - * - * Generated from protobuf field .google.cloud.batch.v1.TaskSpec task_spec = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Batch\V1\TaskSpec|null - */ - public function getTaskSpec() - { - return $this->task_spec; - } - - public function hasTaskSpec() - { - return isset($this->task_spec); - } - - public function clearTaskSpec() - { - unset($this->task_spec); - } - - /** - * Required. Tasks in the group share the same task spec. - * - * Generated from protobuf field .google.cloud.batch.v1.TaskSpec task_spec = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Batch\V1\TaskSpec $var - * @return $this - */ - public function setTaskSpec($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\TaskSpec::class); - $this->task_spec = $var; - - return $this; - } - - /** - * Number of Tasks in the TaskGroup. - * default is 1 - * - * Generated from protobuf field int64 task_count = 4; - * @return int|string - */ - public function getTaskCount() - { - return $this->task_count; - } - - /** - * Number of Tasks in the TaskGroup. - * default is 1 - * - * Generated from protobuf field int64 task_count = 4; - * @param int|string $var - * @return $this - */ - public function setTaskCount($var) - { - GPBUtil::checkInt64($var); - $this->task_count = $var; - - return $this; - } - - /** - * Max number of tasks that can run in parallel. - * Default to min(task_count, 1000). - * - * Generated from protobuf field int64 parallelism = 5; - * @return int|string - */ - public function getParallelism() - { - return $this->parallelism; - } - - /** - * Max number of tasks that can run in parallel. - * Default to min(task_count, 1000). - * - * Generated from protobuf field int64 parallelism = 5; - * @param int|string $var - * @return $this - */ - public function setParallelism($var) - { - GPBUtil::checkInt64($var); - $this->parallelism = $var; - - return $this; - } - - /** - * An array of environment variable mappings, which are passed to Tasks with - * matching indices. If task_environments is used then task_count should - * not be specified in the request (and will be ignored). Task count will be - * the length of task_environments. - * Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in - * addition to any environment variables set in task_environments, specifying - * the number of Tasks in the Task's parent TaskGroup, and the specific Task's - * index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). - * task_environments supports up to 200 entries. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.Environment task_environments = 9; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTaskEnvironments() - { - return $this->task_environments; - } - - /** - * An array of environment variable mappings, which are passed to Tasks with - * matching indices. If task_environments is used then task_count should - * not be specified in the request (and will be ignored). Task count will be - * the length of task_environments. - * Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in - * addition to any environment variables set in task_environments, specifying - * the number of Tasks in the Task's parent TaskGroup, and the specific Task's - * index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). - * task_environments supports up to 200 entries. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.Environment task_environments = 9; - * @param array<\Google\Cloud\Batch\V1\Environment>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTaskEnvironments($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\Environment::class); - $this->task_environments = $arr; - - return $this; - } - - /** - * Max number of tasks that can be run on a VM at the same time. - * If not specified, the system will decide a value based on available - * compute resources on a VM and task requirements. - * - * Generated from protobuf field int64 task_count_per_node = 10; - * @return int|string - */ - public function getTaskCountPerNode() - { - return $this->task_count_per_node; - } - - /** - * Max number of tasks that can be run on a VM at the same time. - * If not specified, the system will decide a value based on available - * compute resources on a VM and task requirements. - * - * Generated from protobuf field int64 task_count_per_node = 10; - * @param int|string $var - * @return $this - */ - public function setTaskCountPerNode($var) - { - GPBUtil::checkInt64($var); - $this->task_count_per_node = $var; - - return $this; - } - - /** - * When true, Batch will populate a file with a list of all VMs assigned to - * the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path - * of that file. Defaults to false. - * - * Generated from protobuf field bool require_hosts_file = 11; - * @return bool - */ - public function getRequireHostsFile() - { - return $this->require_hosts_file; - } - - /** - * When true, Batch will populate a file with a list of all VMs assigned to - * the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path - * of that file. Defaults to false. - * - * Generated from protobuf field bool require_hosts_file = 11; - * @param bool $var - * @return $this - */ - public function setRequireHostsFile($var) - { - GPBUtil::checkBool($var); - $this->require_hosts_file = $var; - - return $this; - } - - /** - * When true, Batch will configure SSH to allow passwordless login between - * VMs running the Batch tasks in the same TaskGroup. - * - * Generated from protobuf field bool permissive_ssh = 12; - * @return bool - */ - public function getPermissiveSsh() - { - return $this->permissive_ssh; - } - - /** - * When true, Batch will configure SSH to allow passwordless login between - * VMs running the Batch tasks in the same TaskGroup. - * - * Generated from protobuf field bool permissive_ssh = 12; - * @param bool $var - * @return $this - */ - public function setPermissiveSsh($var) - { - GPBUtil::checkBool($var); - $this->permissive_ssh = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskSpec.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskSpec.php deleted file mode 100644 index 0d5eccb981c0..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskSpec.php +++ /dev/null @@ -1,412 +0,0 @@ -google.cloud.batch.v1.TaskSpec - */ -class TaskSpec extends \Google\Protobuf\Internal\Message -{ - /** - * The sequence of scripts or containers to run for this Task. Each Task using - * this TaskSpec executes its list of runnables in order. The Task succeeds if - * all of its runnables either exit with a zero status or any that exit with a - * non-zero status have the ignore_exit_status flag. - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.Runnable runnables = 8; - */ - private $runnables; - /** - * ComputeResource requirements. - * - * Generated from protobuf field .google.cloud.batch.v1.ComputeResource compute_resource = 3; - */ - protected $compute_resource = null; - /** - * Maximum duration the task should run. - * The task will be killed and marked as FAILED if over this limit. - * - * Generated from protobuf field .google.protobuf.Duration max_run_duration = 4; - */ - protected $max_run_duration = null; - /** - * Maximum number of retries on failures. - * The default, 0, which means never retry. - * The valid value range is [0, 10]. - * - * Generated from protobuf field int32 max_retry_count = 5; - */ - protected $max_retry_count = 0; - /** - * Lifecycle management schema when any task in a task group is failed. - * Currently we only support one lifecycle policy. - * When the lifecycle policy condition is met, - * the action in the policy will execute. - * If task execution result does not meet with the defined lifecycle - * policy, we consider it as the default policy. - * Default policy means if the exit code is 0, exit task. - * If task ends with non-zero exit code, retry the task with max_retry_count. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.LifecyclePolicy lifecycle_policies = 9; - */ - private $lifecycle_policies; - /** - * Deprecated: please use environment(non-plural) instead. - * - * Generated from protobuf field map environments = 6 [deprecated = true]; - * @deprecated - */ - private $environments; - /** - * Volumes to mount before running Tasks using this TaskSpec. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.Volume volumes = 7; - */ - private $volumes; - /** - * Environment variables to set before running the Task. - * - * Generated from protobuf field .google.cloud.batch.v1.Environment environment = 10; - */ - protected $environment = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Batch\V1\Runnable>|\Google\Protobuf\Internal\RepeatedField $runnables - * The sequence of scripts or containers to run for this Task. Each Task using - * this TaskSpec executes its list of runnables in order. The Task succeeds if - * all of its runnables either exit with a zero status or any that exit with a - * non-zero status have the ignore_exit_status flag. - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. - * @type \Google\Cloud\Batch\V1\ComputeResource $compute_resource - * ComputeResource requirements. - * @type \Google\Protobuf\Duration $max_run_duration - * Maximum duration the task should run. - * The task will be killed and marked as FAILED if over this limit. - * @type int $max_retry_count - * Maximum number of retries on failures. - * The default, 0, which means never retry. - * The valid value range is [0, 10]. - * @type array<\Google\Cloud\Batch\V1\LifecyclePolicy>|\Google\Protobuf\Internal\RepeatedField $lifecycle_policies - * Lifecycle management schema when any task in a task group is failed. - * Currently we only support one lifecycle policy. - * When the lifecycle policy condition is met, - * the action in the policy will execute. - * If task execution result does not meet with the defined lifecycle - * policy, we consider it as the default policy. - * Default policy means if the exit code is 0, exit task. - * If task ends with non-zero exit code, retry the task with max_retry_count. - * @type array|\Google\Protobuf\Internal\MapField $environments - * Deprecated: please use environment(non-plural) instead. - * @type array<\Google\Cloud\Batch\V1\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes - * Volumes to mount before running Tasks using this TaskSpec. - * @type \Google\Cloud\Batch\V1\Environment $environment - * Environment variables to set before running the Task. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); - parent::__construct($data); - } - - /** - * The sequence of scripts or containers to run for this Task. Each Task using - * this TaskSpec executes its list of runnables in order. The Task succeeds if - * all of its runnables either exit with a zero status or any that exit with a - * non-zero status have the ignore_exit_status flag. - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.Runnable runnables = 8; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRunnables() - { - return $this->runnables; - } - - /** - * The sequence of scripts or containers to run for this Task. Each Task using - * this TaskSpec executes its list of runnables in order. The Task succeeds if - * all of its runnables either exit with a zero status or any that exit with a - * non-zero status have the ignore_exit_status flag. - * Background runnables are killed automatically (if they have not already - * exited) a short time after all foreground runnables have completed. Even - * though this is likely to result in a non-zero exit status for the - * background runnable, these automatic kills are not treated as Task - * failures. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.Runnable runnables = 8; - * @param array<\Google\Cloud\Batch\V1\Runnable>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRunnables($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\Runnable::class); - $this->runnables = $arr; - - return $this; - } - - /** - * ComputeResource requirements. - * - * Generated from protobuf field .google.cloud.batch.v1.ComputeResource compute_resource = 3; - * @return \Google\Cloud\Batch\V1\ComputeResource|null - */ - public function getComputeResource() - { - return $this->compute_resource; - } - - public function hasComputeResource() - { - return isset($this->compute_resource); - } - - public function clearComputeResource() - { - unset($this->compute_resource); - } - - /** - * ComputeResource requirements. - * - * Generated from protobuf field .google.cloud.batch.v1.ComputeResource compute_resource = 3; - * @param \Google\Cloud\Batch\V1\ComputeResource $var - * @return $this - */ - public function setComputeResource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\ComputeResource::class); - $this->compute_resource = $var; - - return $this; - } - - /** - * Maximum duration the task should run. - * The task will be killed and marked as FAILED if over this limit. - * - * Generated from protobuf field .google.protobuf.Duration max_run_duration = 4; - * @return \Google\Protobuf\Duration|null - */ - public function getMaxRunDuration() - { - return $this->max_run_duration; - } - - public function hasMaxRunDuration() - { - return isset($this->max_run_duration); - } - - public function clearMaxRunDuration() - { - unset($this->max_run_duration); - } - - /** - * Maximum duration the task should run. - * The task will be killed and marked as FAILED if over this limit. - * - * Generated from protobuf field .google.protobuf.Duration max_run_duration = 4; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setMaxRunDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->max_run_duration = $var; - - return $this; - } - - /** - * Maximum number of retries on failures. - * The default, 0, which means never retry. - * The valid value range is [0, 10]. - * - * Generated from protobuf field int32 max_retry_count = 5; - * @return int - */ - public function getMaxRetryCount() - { - return $this->max_retry_count; - } - - /** - * Maximum number of retries on failures. - * The default, 0, which means never retry. - * The valid value range is [0, 10]. - * - * Generated from protobuf field int32 max_retry_count = 5; - * @param int $var - * @return $this - */ - public function setMaxRetryCount($var) - { - GPBUtil::checkInt32($var); - $this->max_retry_count = $var; - - return $this; - } - - /** - * Lifecycle management schema when any task in a task group is failed. - * Currently we only support one lifecycle policy. - * When the lifecycle policy condition is met, - * the action in the policy will execute. - * If task execution result does not meet with the defined lifecycle - * policy, we consider it as the default policy. - * Default policy means if the exit code is 0, exit task. - * If task ends with non-zero exit code, retry the task with max_retry_count. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.LifecyclePolicy lifecycle_policies = 9; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLifecyclePolicies() - { - return $this->lifecycle_policies; - } - - /** - * Lifecycle management schema when any task in a task group is failed. - * Currently we only support one lifecycle policy. - * When the lifecycle policy condition is met, - * the action in the policy will execute. - * If task execution result does not meet with the defined lifecycle - * policy, we consider it as the default policy. - * Default policy means if the exit code is 0, exit task. - * If task ends with non-zero exit code, retry the task with max_retry_count. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.LifecyclePolicy lifecycle_policies = 9; - * @param array<\Google\Cloud\Batch\V1\LifecyclePolicy>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLifecyclePolicies($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\LifecyclePolicy::class); - $this->lifecycle_policies = $arr; - - return $this; - } - - /** - * Deprecated: please use environment(non-plural) instead. - * - * Generated from protobuf field map environments = 6 [deprecated = true]; - * @return \Google\Protobuf\Internal\MapField - * @deprecated - */ - public function getEnvironments() - { - @trigger_error('environments is deprecated.', E_USER_DEPRECATED); - return $this->environments; - } - - /** - * Deprecated: please use environment(non-plural) instead. - * - * Generated from protobuf field map environments = 6 [deprecated = true]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - * @deprecated - */ - public function setEnvironments($var) - { - @trigger_error('environments is deprecated.', E_USER_DEPRECATED); - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->environments = $arr; - - return $this; - } - - /** - * Volumes to mount before running Tasks using this TaskSpec. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.Volume volumes = 7; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getVolumes() - { - return $this->volumes; - } - - /** - * Volumes to mount before running Tasks using this TaskSpec. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.Volume volumes = 7; - * @param array<\Google\Cloud\Batch\V1\Volume>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setVolumes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\Volume::class); - $this->volumes = $arr; - - return $this; - } - - /** - * Environment variables to set before running the Task. - * - * Generated from protobuf field .google.cloud.batch.v1.Environment environment = 10; - * @return \Google\Cloud\Batch\V1\Environment|null - */ - public function getEnvironment() - { - return $this->environment; - } - - public function hasEnvironment() - { - return isset($this->environment); - } - - public function clearEnvironment() - { - unset($this->environment); - } - - /** - * Environment variables to set before running the Task. - * - * Generated from protobuf field .google.cloud.batch.v1.Environment environment = 10; - * @param \Google\Cloud\Batch\V1\Environment $var - * @return $this - */ - public function setEnvironment($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\Environment::class); - $this->environment = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus.php deleted file mode 100644 index d450092f3978..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.batch.v1.TaskStatus - */ -class TaskStatus extends \Google\Protobuf\Internal\Message -{ - /** - * Task state - * - * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State state = 1; - */ - protected $state = 0; - /** - * Detailed info about why the state is reached. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.StatusEvent status_events = 2; - */ - private $status_events; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $state - * Task state - * @type array<\Google\Cloud\Batch\V1\StatusEvent>|\Google\Protobuf\Internal\RepeatedField $status_events - * Detailed info about why the state is reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Task::initOnce(); - parent::__construct($data); - } - - /** - * Task state - * - * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State state = 1; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Task state - * - * Generated from protobuf field .google.cloud.batch.v1.TaskStatus.State state = 1; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\TaskStatus\State::class); - $this->state = $var; - - return $this; - } - - /** - * Detailed info about why the state is reached. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.StatusEvent status_events = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getStatusEvents() - { - return $this->status_events; - } - - /** - * Detailed info about why the state is reached. - * - * Generated from protobuf field repeated .google.cloud.batch.v1.StatusEvent status_events = 2; - * @param array<\Google\Cloud\Batch\V1\StatusEvent>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setStatusEvents($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Batch\V1\StatusEvent::class); - $this->status_events = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus/State.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus/State.php deleted file mode 100644 index ec4cc65716fe..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus/State.php +++ /dev/null @@ -1,85 +0,0 @@ -google.cloud.batch.v1.TaskStatus.State - */ -class State -{ - /** - * unknown state - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The Task is created and waiting for resources. - * - * Generated from protobuf enum PENDING = 1; - */ - const PENDING = 1; - /** - * The Task is assigned to at least one VM. - * - * Generated from protobuf enum ASSIGNED = 2; - */ - const ASSIGNED = 2; - /** - * The Task is running. - * - * Generated from protobuf enum RUNNING = 3; - */ - const RUNNING = 3; - /** - * The Task has failed. - * - * Generated from protobuf enum FAILED = 4; - */ - const FAILED = 4; - /** - * The Task has succeeded. - * - * Generated from protobuf enum SUCCEEDED = 5; - */ - const SUCCEEDED = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::PENDING => 'PENDING', - self::ASSIGNED => 'ASSIGNED', - self::RUNNING => 'RUNNING', - self::FAILED => 'FAILED', - self::SUCCEEDED => 'SUCCEEDED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Batch\V1\TaskStatus_State::class); - diff --git a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus_State.php b/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus_State.php deleted file mode 100644 index 4c76fa84ac6b..000000000000 --- a/owl-bot-staging/Batch/v1/proto/src/Google/Cloud/Batch/V1/TaskStatus_State.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.batch.v1.Volume - */ -class Volume extends \Google\Protobuf\Internal\Message -{ - /** - * The mount path for the volume, e.g. /mnt/disks/share. - * - * Generated from protobuf field string mount_path = 4; - */ - protected $mount_path = ''; - /** - * For Google Cloud Storage (GCS), mount options are the options supported by - * the gcsfuse tool (https://github.com/GoogleCloudPlatform/gcsfuse). - * For existing persistent disks, mount options provided by the - * mount command (https://man7.org/linux/man-pages/man8/mount.8.html) except - * writing are supported. This is due to restrictions of multi-writer mode - * (https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). - * For other attached disks and Network File System (NFS), mount options are - * these supported by the mount command - * (https://man7.org/linux/man-pages/man8/mount.8.html). - * - * Generated from protobuf field repeated string mount_options = 5; - */ - private $mount_options; - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Batch\V1\NFS $nfs - * A Network File System (NFS) volume. For example, a - * Filestore file share. - * @type \Google\Cloud\Batch\V1\GCS $gcs - * A Google Cloud Storage (GCS) volume. - * @type string $device_name - * Device name of an attached disk volume, which should align with a - * device_name specified by - * job.allocation_policy.instances[0].policy.disks[i].device_name or - * defined by the given instance template in - * job.allocation_policy.instances[0].instance_template. - * @type string $mount_path - * The mount path for the volume, e.g. /mnt/disks/share. - * @type array|\Google\Protobuf\Internal\RepeatedField $mount_options - * For Google Cloud Storage (GCS), mount options are the options supported by - * the gcsfuse tool (https://github.com/GoogleCloudPlatform/gcsfuse). - * For existing persistent disks, mount options provided by the - * mount command (https://man7.org/linux/man-pages/man8/mount.8.html) except - * writing are supported. This is due to restrictions of multi-writer mode - * (https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). - * For other attached disks and Network File System (NFS), mount options are - * these supported by the mount command - * (https://man7.org/linux/man-pages/man8/mount.8.html). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Batch\V1\Volume::initOnce(); - parent::__construct($data); - } - - /** - * A Network File System (NFS) volume. For example, a - * Filestore file share. - * - * Generated from protobuf field .google.cloud.batch.v1.NFS nfs = 1; - * @return \Google\Cloud\Batch\V1\NFS|null - */ - public function getNfs() - { - return $this->readOneof(1); - } - - public function hasNfs() - { - return $this->hasOneof(1); - } - - /** - * A Network File System (NFS) volume. For example, a - * Filestore file share. - * - * Generated from protobuf field .google.cloud.batch.v1.NFS nfs = 1; - * @param \Google\Cloud\Batch\V1\NFS $var - * @return $this - */ - public function setNfs($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\NFS::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * A Google Cloud Storage (GCS) volume. - * - * Generated from protobuf field .google.cloud.batch.v1.GCS gcs = 3; - * @return \Google\Cloud\Batch\V1\GCS|null - */ - public function getGcs() - { - return $this->readOneof(3); - } - - public function hasGcs() - { - return $this->hasOneof(3); - } - - /** - * A Google Cloud Storage (GCS) volume. - * - * Generated from protobuf field .google.cloud.batch.v1.GCS gcs = 3; - * @param \Google\Cloud\Batch\V1\GCS $var - * @return $this - */ - public function setGcs($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\GCS::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Device name of an attached disk volume, which should align with a - * device_name specified by - * job.allocation_policy.instances[0].policy.disks[i].device_name or - * defined by the given instance template in - * job.allocation_policy.instances[0].instance_template. - * - * Generated from protobuf field string device_name = 6; - * @return string - */ - public function getDeviceName() - { - return $this->readOneof(6); - } - - public function hasDeviceName() - { - return $this->hasOneof(6); - } - - /** - * Device name of an attached disk volume, which should align with a - * device_name specified by - * job.allocation_policy.instances[0].policy.disks[i].device_name or - * defined by the given instance template in - * job.allocation_policy.instances[0].instance_template. - * - * Generated from protobuf field string device_name = 6; - * @param string $var - * @return $this - */ - public function setDeviceName($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * The mount path for the volume, e.g. /mnt/disks/share. - * - * Generated from protobuf field string mount_path = 4; - * @return string - */ - public function getMountPath() - { - return $this->mount_path; - } - - /** - * The mount path for the volume, e.g. /mnt/disks/share. - * - * Generated from protobuf field string mount_path = 4; - * @param string $var - * @return $this - */ - public function setMountPath($var) - { - GPBUtil::checkString($var, True); - $this->mount_path = $var; - - return $this; - } - - /** - * For Google Cloud Storage (GCS), mount options are the options supported by - * the gcsfuse tool (https://github.com/GoogleCloudPlatform/gcsfuse). - * For existing persistent disks, mount options provided by the - * mount command (https://man7.org/linux/man-pages/man8/mount.8.html) except - * writing are supported. This is due to restrictions of multi-writer mode - * (https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). - * For other attached disks and Network File System (NFS), mount options are - * these supported by the mount command - * (https://man7.org/linux/man-pages/man8/mount.8.html). - * - * Generated from protobuf field repeated string mount_options = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMountOptions() - { - return $this->mount_options; - } - - /** - * For Google Cloud Storage (GCS), mount options are the options supported by - * the gcsfuse tool (https://github.com/GoogleCloudPlatform/gcsfuse). - * For existing persistent disks, mount options provided by the - * mount command (https://man7.org/linux/man-pages/man8/mount.8.html) except - * writing are supported. This is due to restrictions of multi-writer mode - * (https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). - * For other attached disks and Network File System (NFS), mount options are - * these supported by the mount command - * (https://man7.org/linux/man-pages/man8/mount.8.html). - * - * Generated from protobuf field repeated string mount_options = 5; - * @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; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/create_job.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/create_job.php deleted file mode 100644 index d75dc497441a..000000000000 --- a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/create_job.php +++ /dev/null @@ -1,77 +0,0 @@ -setTaskSpec($jobTaskGroupsTaskSpec); - $jobTaskGroups = [$taskGroup,]; - $job = (new Job()) - ->setTaskGroups($jobTaskGroups); - - // Call the API and handle any network failures. - try { - /** @var Job $response */ - $response = $batchServiceClient->createJob($formattedParent, $job); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = BatchServiceClient::locationName('[PROJECT]', '[LOCATION]'); - - create_job_sample($formattedParent); -} -// [END batch_v1_generated_BatchService_CreateJob_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/delete_job.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/delete_job.php deleted file mode 100644 index 646ce369153f..000000000000 --- a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/delete_job.php +++ /dev/null @@ -1,62 +0,0 @@ -deleteJob(); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END batch_v1_generated_BatchService_DeleteJob_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_job.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_job.php deleted file mode 100644 index 6e7eacccb7f1..000000000000 --- a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_job.php +++ /dev/null @@ -1,66 +0,0 @@ -getJob($formattedName); - 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 = BatchServiceClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - - get_job_sample($formattedName); -} -// [END batch_v1_generated_BatchService_GetJob_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_location.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_location.php deleted file mode 100644 index 50853941cea8..000000000000 --- a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_location.php +++ /dev/null @@ -1,53 +0,0 @@ -getLocation(); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END batch_v1_generated_BatchService_GetLocation_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_task.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_task.php deleted file mode 100644 index 16f4471f074d..000000000000 --- a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/get_task.php +++ /dev/null @@ -1,72 +0,0 @@ -getTask($formattedName); - 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 = BatchServiceClient::taskName( - '[PROJECT]', - '[LOCATION]', - '[JOB]', - '[TASK_GROUP]', - '[TASK]' - ); - - get_task_sample($formattedName); -} -// [END batch_v1_generated_BatchService_GetTask_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_jobs.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_jobs.php deleted file mode 100644 index 6a12d4d8741e..000000000000 --- a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_jobs.php +++ /dev/null @@ -1,58 +0,0 @@ -listJobs(); - - /** @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()); - } -} -// [END batch_v1_generated_BatchService_ListJobs_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_locations.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_locations.php deleted file mode 100644 index 2f45e2e55cbf..000000000000 --- a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_locations.php +++ /dev/null @@ -1,58 +0,0 @@ -listLocations(); - - /** @var Location $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END batch_v1_generated_BatchService_ListLocations_sync] diff --git a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_tasks.php b/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_tasks.php deleted file mode 100644 index bc61d857a0f6..000000000000 --- a/owl-bot-staging/Batch/v1/samples/V1/BatchServiceClient/list_tasks.php +++ /dev/null @@ -1,78 +0,0 @@ -listTasks($formattedParent); - - /** @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 = BatchServiceClient::taskGroupName( - '[PROJECT]', - '[LOCATION]', - '[JOB]', - '[TASK_GROUP]' - ); - - list_tasks_sample($formattedParent); -} -// [END batch_v1_generated_BatchService_ListTasks_sync] diff --git a/owl-bot-staging/Batch/v1/src/V1/BatchServiceClient.php b/owl-bot-staging/Batch/v1/src/V1/BatchServiceClient.php deleted file mode 100644 index 8ce48d079257..000000000000 --- a/owl-bot-staging/Batch/v1/src/V1/BatchServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $job = new Job(); - * $response = $batchServiceClient->createJob($formattedParent, $job); - * } finally { - * $batchServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - */ -class BatchServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.batch.v1.BatchService'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'batch.googleapis.com'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $jobNameTemplate; - - private static $locationNameTemplate; - - private static $taskNameTemplate; - - private static $taskGroupNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/batch_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/batch_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/batch_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/batch_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getJobNameTemplate() - { - if (self::$jobNameTemplate == null) { - self::$jobNameTemplate = new PathTemplate('projects/{project}/locations/{location}/jobs/{job}'); - } - - return self::$jobNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getTaskNameTemplate() - { - if (self::$taskNameTemplate == null) { - self::$taskNameTemplate = new PathTemplate('projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}'); - } - - return self::$taskNameTemplate; - } - - private static function getTaskGroupNameTemplate() - { - if (self::$taskGroupNameTemplate == null) { - self::$taskGroupNameTemplate = new PathTemplate('projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}'); - } - - return self::$taskGroupNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'job' => self::getJobNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'task' => self::getTaskNameTemplate(), - 'taskGroup' => self::getTaskGroupNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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($project, $location, $job) - { - return self::getJobNameTemplate()->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($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a task - * resource. - * - * @param string $project - * @param string $location - * @param string $job - * @param string $taskGroup - * @param string $task - * - * @return string The formatted task resource. - */ - public static function taskName($project, $location, $job, $taskGroup, $task) - { - return self::getTaskNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'job' => $job, - 'task_group' => $taskGroup, - 'task' => $task, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a task_group - * resource. - * - * @param string $project - * @param string $location - * @param string $job - * @param string $taskGroup - * - * @return string The formatted task_group resource. - */ - public static function taskGroupName($project, $location, $job, $taskGroup) - { - return self::getTaskGroupNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'job' => $job, - 'task_group' => $taskGroup, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - job: projects/{project}/locations/{location}/jobs/{job} - * - location: projects/{project}/locations/{location} - * - task: projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task} - * - taskGroup: projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'batch.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); - } - - /** - * Create a Job. - * - * Sample code: - * ``` - * $batchServiceClient = new BatchServiceClient(); - * try { - * $formattedParent = $batchServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $job = new Job(); - * $response = $batchServiceClient->createJob($formattedParent, $job); - * } finally { - * $batchServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource name where the Job will be created. - * Pattern: "projects/{project}/locations/{location}" - * @param Job $job Required. The Job to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $jobId - * ID used to uniquely identify the Job within its parent scope. - * This field should contain at most 63 characters and must start with - * lowercase characters. - * Only lowercase characters, numbers and '-' are accepted. - * The '-' character cannot be the first or the last one. - * A system generated ID will be used if the field is not set. - * - * The job.name field in the request will be ignored and the created resource - * name of the Job will be "{parent}/jobs/{job_id}". - * @type string $requestId - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Batch\V1\Job - * - * @throws ApiException if the remote call fails - */ - public function createJob($parent, $job, array $optionalArgs = []) - { - $request = new CreateJobRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setJob($job); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['jobId'])) { - $request->setJobId($optionalArgs['jobId']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateJob', Job::class, $optionalArgs, $request)->wait(); - } - - /** - * Delete a Job. - * - * Sample code: - * ``` - * $batchServiceClient = new BatchServiceClient(); - * try { - * $operationResponse = $batchServiceClient->deleteJob(); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $batchServiceClient->deleteJob(); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $batchServiceClient->resumeOperation($operationName, 'deleteJob'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $batchServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Job name. - * @type string $reason - * Optional. Reason for this deletion. - * @type string $requestId - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteJob(array $optionalArgs = []) - { - $request = new DeleteJobRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['reason'])) { - $request->setReason($optionalArgs['reason']); - } - - if (isset($optionalArgs['requestId'])) { - $request->setRequestId($optionalArgs['requestId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteJob', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Get a Job specified by its resource name. - * - * Sample code: - * ``` - * $batchServiceClient = new BatchServiceClient(); - * try { - * $formattedName = $batchServiceClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - * $response = $batchServiceClient->getJob($formattedName); - * } finally { - * $batchServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Job name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Batch\V1\Job - * - * @throws ApiException if the remote call fails - */ - public function getJob($name, array $optionalArgs = []) - { - $request = new GetJobRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetJob', Job::class, $optionalArgs, $request)->wait(); - } - - /** - * Return a single Task. - * - * Sample code: - * ``` - * $batchServiceClient = new BatchServiceClient(); - * try { - * $formattedName = $batchServiceClient->taskName('[PROJECT]', '[LOCATION]', '[JOB]', '[TASK_GROUP]', '[TASK]'); - * $response = $batchServiceClient->getTask($formattedName); - * } finally { - * $batchServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Task name. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Batch\V1\Task - * - * @throws ApiException if the remote call fails - */ - public function getTask($name, array $optionalArgs = []) - { - $request = new GetTaskRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetTask', Task::class, $optionalArgs, $request)->wait(); - } - - /** - * List all Jobs for a project within a region. - * - * Sample code: - * ``` - * $batchServiceClient = new BatchServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $batchServiceClient->listJobs(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $batchServiceClient->listJobs(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $batchServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * Parent path. - * @type string $filter - * List filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listJobs(array $optionalArgs = []) - { - $request = new ListJobsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['parent'] = $optionalArgs['parent']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListJobs', $optionalArgs, ListJobsResponse::class, $request); - } - - /** - * List Tasks associated with a job. - * - * Sample code: - * ``` - * $batchServiceClient = new BatchServiceClient(); - * try { - * $formattedParent = $batchServiceClient->taskGroupName('[PROJECT]', '[LOCATION]', '[JOB]', '[TASK_GROUP]'); - * // Iterate over pages of elements - * $pagedResponse = $batchServiceClient->listTasks($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $batchServiceClient->listTasks($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $batchServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listTasks($parent, array $optionalArgs = []) - { - $request = new ListTasksRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListTasks', $optionalArgs, ListTasksResponse::class, $request); - } - - /** - * Gets information about a location. - * - * Sample code: - * ``` - * $batchServiceClient = new BatchServiceClient(); - * try { - * $response = $batchServiceClient->getLocation(); - * } finally { - * $batchServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * Resource name for the location. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Location\Location - * - * @throws ApiException if the remote call fails - */ - public function getLocation(array $optionalArgs = []) - { - $request = new GetLocationRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetLocation', Location::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.cloud.location.Locations')->wait(); - } - - /** - * Lists information about the supported locations for this service. - * - * Sample code: - * ``` - * $batchServiceClient = new BatchServiceClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $batchServiceClient->listLocations(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $batchServiceClient->listLocations(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $batchServiceClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The resource that owns the locations collection, if applicable. - * @type string $filter - * The standard list filter. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listLocations(array $optionalArgs = []) - { - $request = new ListLocationsRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations'); - } -} diff --git a/owl-bot-staging/Batch/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Batch/v1/src/V1/gapic_metadata.json deleted file mode 100644 index eae7f15d2f08..000000000000 --- a/owl-bot-staging/Batch/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.batch.v1", - "libraryPackage": "Google\\Cloud\\Batch\\V1", - "services": { - "BatchService": { - "clients": { - "grpc": { - "libraryClient": "BatchServiceGapicClient", - "rpcs": { - "CreateJob": { - "methods": [ - "createJob" - ] - }, - "DeleteJob": { - "methods": [ - "deleteJob" - ] - }, - "GetJob": { - "methods": [ - "getJob" - ] - }, - "GetTask": { - "methods": [ - "getTask" - ] - }, - "ListJobs": { - "methods": [ - "listJobs" - ] - }, - "ListTasks": { - "methods": [ - "listTasks" - ] - }, - "GetLocation": { - "methods": [ - "getLocation" - ] - }, - "ListLocations": { - "methods": [ - "listLocations" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_client_config.json b/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_client_config.json deleted file mode 100644 index 4fae7bea9f19..000000000000 --- a/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_client_config.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "interfaces": { - "google.cloud.batch.v1.BatchService": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE" - ], - "no_retry_1_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": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateJob": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteJob": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetJob": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetTask": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListJobs": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListTasks": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetLocation": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListLocations": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_descriptor_config.php b/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_descriptor_config.php deleted file mode 100644 index 704e8834bed1..000000000000 --- a/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_descriptor_config.php +++ /dev/null @@ -1,48 +0,0 @@ - [ - 'google.cloud.batch.v1.BatchService' => [ - 'DeleteJob' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Batch\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListJobs' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getJobs', - ], - ], - 'ListTasks' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTasks', - ], - ], - 'ListLocations' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getLocations', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_rest_client_config.php b/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_rest_client_config.php deleted file mode 100644 index a72321464b81..000000000000 --- a/owl-bot-staging/Batch/v1/src/V1/resources/batch_service_rest_client_config.php +++ /dev/null @@ -1,147 +0,0 @@ - [ - 'google.cloud.batch.v1.BatchService' => [ - 'CreateJob' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/jobs', - 'body' => 'job', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteJob' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/jobs/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetJob' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/jobs/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetTask' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListJobs' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/jobs', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListTasks' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - ], - 'google.cloud.location.Locations' => [ - 'GetLocation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListLocations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*}/locations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Batch/v1/tests/Unit/V1/BatchServiceClientTest.php b/owl-bot-staging/Batch/v1/tests/Unit/V1/BatchServiceClientTest.php deleted file mode 100644 index e679bf004c72..000000000000 --- a/owl-bot-staging/Batch/v1/tests/Unit/V1/BatchServiceClientTest.php +++ /dev/null @@ -1,628 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return BatchServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new BatchServiceClient($options); - } - - /** @test */ - public function createJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $uid = 'uid115792'; - $priority = 1165461084; - $expectedResponse = new Job(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setPriority($priority); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $job = new Job(); - $jobTaskGroups = []; - $job->setTaskGroups($jobTaskGroups); - $response = $gapicClient->createJob($formattedParent, $job); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.batch.v1.BatchService/CreateJob', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getJob(); - $this->assertProtobufEquals($job, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createJobExceptionTest() - { - $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]'); - $job = new Job(); - $jobTaskGroups = []; - $job->setTaskGroups($jobTaskGroups); - try { - $gapicClient->createJob($formattedParent, $job); - // 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 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); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteJobTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - $response = $gapicClient->deleteJob(); - $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.batch.v1.BatchService/DeleteJob', $actualApiFuncCall); - $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); - $response = $gapicClient->deleteJob(); - $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 getJobTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $priority = 1165461084; - $expectedResponse = new Job(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setPriority($priority); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->jobName('[PROJECT]', '[LOCATION]', '[JOB]'); - $response = $gapicClient->getJob($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.batch.v1.BatchService/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]'); - try { - $gapicClient->getJob($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getTaskTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Task(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->taskName('[PROJECT]', '[LOCATION]', '[JOB]', '[TASK_GROUP]', '[TASK]'); - $response = $gapicClient->getTask($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.batch.v1.BatchService/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]', '[TASK_GROUP]', '[TASK]'); - try { - $gapicClient->getTask($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function 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); - $response = $gapicClient->listJobs(); - $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.batch.v1.BatchService/ListJobs', $actualFuncCall); - $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); - try { - $gapicClient->listJobs(); - // 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->taskGroupName('[PROJECT]', '[LOCATION]', '[JOB]', '[TASK_GROUP]'); - $response = $gapicClient->listTasks($formattedParent); - $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.batch.v1.BatchService/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->taskGroupName('[PROJECT]', '[LOCATION]', '[JOB]', '[TASK_GROUP]'); - try { - $gapicClient->listTasks($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $locationId = 'locationId552319461'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Location(); - $expectedResponse->setName($name2); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setDisplayName($displayName); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getLocation(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getLocationExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->getLocation(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; - $expectedResponse = new ListLocationsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setLocations($locations); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listLocations(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listLocationsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->listLocations(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -}